Professional Documents
Culture Documents
FCNTL: # Include Int FCNTL (Int FD, Int CMD, Int Arg) Here We Wil Check
FCNTL: # Include Int FCNTL (Int FD, Int CMD, Int Arg) Here We Wil Check
FCNTL: # Include Int FCNTL (Int FD, Int CMD, Int Arg) Here We Wil Check
# include<fcntl.h>
int fcntl(int fd,int cmd,int arg);
F_GETTFL & F_SETFL – The arg values that can be used are are
FAPPEND
FASYNC
FCREAT
FEXCL
FNDELAY
FTRUNC
• FNDELAY-
FNDELAY designates the socket as “non
blocking”.
-affects accept, connect……
• FASYNC – allows the receipt of asynchoronous i/o
signal
-SIGIO signal sent to process group
IOCTL ()
• Affects open file referenced by the fd arg
• # include<sys/ioctl.h>
int ioctl(int fd,unsigned long request, char *arg);
• FIOCLEX- Sets the close-on -exec flag for fd.
- F_SETFD CMD
• FIONCLEX - clears the close-on -exec flag for the fd.
- F_SETFD
• FIONBIO – set or clear the non blocking i/o flag for the file.
-FNDELAY
• FIOASYNC- set or clear the flag that allows receipt of asyn i/o signals
-FASYNC
• FIONREAD- no of bytes available to read from fd.
• FIOSETOWN-set pid or pgid to receive the SIGIO and SIGURG signals
-works only for????
- F_SETOWN.
• FIOGETOWN
• SIOCSHIWAT
• SIOCGHIWAT
• SIOCSLOWAT
• SIOCGLOWAT
• SIOCATMARK-return a zero or non zero value depending on whether
the specified sockets read pointer is currently at out-of band mark.
• SIOCSPGRP- FIOSETOWN
• SIOCGPGRP-FIOGETOWN
• SIOCADDRT
• SIOCDELRT
• SIOCSIFADDR
• SIOCGIFADDR
• SIOCSIFFLAGS
• SIOGIFCONF
• SIOCSIFDSTADDR- set p-to-p interface address
• SIOCGIFDSTADDR
• SIOCSIFBRDADDR-set broadcast adddr for the interface
• SIOCGIFBRDADDR-get broadcast adddr for the interface
• SIOCSIFNETMASK- set the mask for the n/w portion of the
interface addr
• SIOCGIFNETMASK- get the interface n/w mask for internet
addr
• SIOCGIFMETRIC-get the interface routing metric.
- stored in kernel of each interface.
• SIOCSARP- set an entry in internet ARP
• SIOCGARP- get an entry from the internet ARP entry
• SIOCDARP-delete an entry from the internet ARP table