FCNTL: # Include Int FCNTL (Int FD, Int CMD, Int Arg) Here We Wil Check

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 8

fcntl

 # include<fcntl.h>
int fcntl(int fd,int cmd,int arg);

Here we wil check


F_GETOWN
F_SETOWN
F_GETTFL
F_SETFL
F_GETOWN :- return the value of process id or process group id
that is set to receive SIGIO & SIGURG signals.

F_SETOWN:- set the process id or process group id to receive


SIGIO & SIGURG signals.

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

You might also like