Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fcntl(5) — NEWS-os 5.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

creat(2)

exec(2)

fcntl(2)

open(2)



fcntl(5)               MISC. FILE FORMATS                fcntl(5)



NAME
     fcntl - file control options

SYNOPSIS
     #include <fcntl.h>

DESCRIPTION
     The <fcntl.h> header  defines  the  following  requests  and
     arguments  for use by the functions fcntl [see fcntl(2)] and
     open [see open(2)].
        Values for cmd used by fcntl (the following values are unique):
             FDUPFD        Duplicate file descriptor
             FGETFD        Get file descriptor flags
             FSETFD        Set file descriptor flags
             FGETFL        Get file status flags
             FSETFL        Set file status flags
             FGETLK        Get record locking information
             FSETLK        Set record locking information
             FSETLKW       Set record locking information;
                            wait if blocked

        File descriptor flags used for fcntl:
             FDCLOEXEC     Close the file descriptor upon
                            execution of an exec function [see exec(2)]

        Values for ltype used for record locking with fcntl
        (the following values are unique):
             FRDLCK        Shared or read lock
             FUNLCK        Unlock
             FWRLCK        Exclusive or write lock

        The following three sets of values are bitwise distinct:
        Values for oflag used by open:
             OCREAT        Create file if it does not exist
             OEXCL         Exclusive use flag
             ONOCTTY       Do not assign controlling tty
             OTRUNC        Truncate flag

        File status flags used for open and fcntl:
             OAPPEND       Set append mode
             ONDELAY       Non-blocking mode
             ONONBLOCK     Non-blocking mode (POSIX)
             OSYNC         Synchronous writes

        Mask for use with file access modes:
             OACCMODE      Mask for file access modes









                                                                1





fcntl(5)               MISC. FILE FORMATS                fcntl(5)




        File access modes used for open and fcntl:
             ORDONLY       Open for reading only
             ORDWR         Open for reading and writing
             OWRONLY       Open for writing only
     The structure flock describes a file lock.  It includes  the
     following members:
        short   ltype;     /* Type of lock */
        short   lwhence;   /* Flag for starting offset */
        offt   lstart;    /* Relative offset in bytes */
        offt   llen;      /* Size; if 0 then until EOF */
        long    lsysid;    /* Returned with FGETLK */
        pidt   lpid;      /* Returned with FGETLK */

SEE ALSO
     creat(2), exec(2), fcntl(2), open(2).







































                                                                2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026