Top "Fcntl" questions

fcntl refers to a function that provides control over the open file referenced by a file descriptor

Python fcntl does not lock as expected

On a Debian-based OS (Ubuntu, Debian Squeeze), I'm using Python (2.7, 3.2) fcntl to lock a file. As I understand from what …

python fcntl
How to get hard disk serial number using Python

How can I get the serial number of a hard disk drive using Python on Linux? I would like to …

python linux hard-drive serial-number fcntl
Is it possible (and safe) to make an accepting socket non-blocking?

I'm looking for a way to interrupt an accept() call on a blocking socket. Using signals is not an option, …

c sockets posix fcntl
Is O_NONBLOCK being set a property of the file descriptor or underlying file?

From what I have been reading on The Open Group website on fcntl, open, read, and write, I get the …

c nonblocking file-descriptor fcntl posix-api
How can I read and write from files using the headers fcntl.h and unistd.h?

I'm trying to learn how to use the header files <fcntl.h> and <unistd.h>. I …

c++ c file-io fcntl
c - Usage of F_GETFL and F_SETFL

While trying to use fcntl() with command F_GETFL and F_SETFL, I got some questions: Why the flag returned …

c file-io fcntl
What is the purpose of calling fcntl() be called with the file descriptor as -1 and cmd as F_GETFL?

I am trying to understand what this line of code means: flags = fcntl(-1,F_GETFL,0);

c sockets unix freebsd fcntl
python lockf and flock behaviour

I have read enough posts on stackoverflow regarding the difference b/w flock/lockf/fcntl but I am unable to …

python file-locking flock fcntl
How to properly convert a C ioctl call to a python fcntl.ioctl call?

Following an example on resetting a serial port in Linux I wanted to translate the following snippet fd = open(filename, …

python python-2.7 ioctl fcntl
Why fcntl(fd, F_SETFL, 0) use in serial port programming

I am starting serial port programming in Linux. After reading several examples on the web, I don't understand exact effect …

c linux serial-port fcntl