next up previous contents index
Next: Fork Up: Functions and procedures Previous: Fcntl

Fcntl

   

Declaration:

Procedure Fcntl (Fd : text, Cmd : Integer; Arg : longint) ;

Description:

Read or Set a file's attributes. Fd is an assigned file. Cmd speciefies what to do, and is one of the following:

F_SetFd
Set the close_on_exec flag of Fd. (only the least siginificant bit is used).
F_GetLk
Return the flock record that prevents this process from obtaining the lock, or set the l_type field of the lock of there is no obstruction. Arg is a pointer to a flock record.
F_SetLk
Set the lock or clear it (depending on l_type in the flock structure). if the lock is held by another process, an error occurs.
F_GetLkw
Same as for F_Setlk, but wait until the lock is released.
F_SetOwn
Set the Process or process group that owns a socket.

Errors:

LinuxError is used to report errors.

sys_ebadf
Fd has a bad file descriptor.
sys_eagain or sys_eaccess
For F_SetLk, if the lock is held by another process.

See also:

Fcntl, Fcntl (2)



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998