UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2006-01-31 11:12 AM

usha
Member
Registered: 2005-11-16
Posts: 32

Re: use of fcntl()

hi
  i want to know about the sys call fcntl().
  i have seen the man page, but unable to understand.
 
  Where can we use this call, and what r its uses.
                                                   thanking u sir
                                                    usha


[i]usha[/i]

Offline

#2 2006-01-31 02:28 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: use of fcntl()

fcntl() has a wide variety of uses...  It can be used to implement dup(); it can be used
to change misc. FD flags (eg: set non-blocking I/O mode); it can be used to place
advisory locks on portions of files; it can be used to setup signal-based async I/O
on an FD; and, probably a great many other misc. things...  It's sort of a catch-all
"misc. file descriptor tweaking" function...  Basically, a slightly more sane and
restricted version of ioctl()...  (And, in fact, some of the stuff you can do with fcntl()
can also be done diferently via ioctl()...)

Offline

Board footer

Powered by FluxBB