Re: fcntl v/s ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On 3/29/07, Rick Brown <rick.brown.3@xxxxxxxxx> wrote:

Could some one please explain me the differences and similarities
between fcntl and ioctl?
Is one built upon the other?

AFAIK, both are used for handling of very
device specific commands by the driver.

not both,
this goes well with ioctl

as ioctl is customizable, there is an ioctl method in the
struct file_operations.
so a driver writer can define some device specific tasks
& hook her own method to execute them via an ioctl

fcntl is not customizable by a driver
there are some fixed task which it performs

setting the close on exec flag
duplicate fd
set/get owner
have a look at


& its worker

we can say that fcntl dosen't bother if its a regular file
or a device specific file

where as ioctl changes its color in these case

Milind Arun Choudhary
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at

[Site Home]     [Audio]     [Hams]     [Kernel Newbies]     [Memory]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linux Resources]     [Fedora Users]

  Powered by Linux