Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

fcntl(5)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fcntl — file control options

SYNOPSIS

#include <sys/types.h>

#include <fcntl.h>

DESCRIPTION

The fcntl() function provides for control over open files. The <fcntl.h> include file describes requests and arguments to fcntl() and open(). See fcntl(2) and open(2).

The access modes set by open() and accessed by fcntl() are:

O_RDONLY

O_WRONLY

O_RDWR

The mask for file access modes is:

O_ACCMODE

The file status flags set by open() or fcntl() and accessed by fcntl() are:

O_NDELAY

Nonblocking I/O.

O_NONBLOCK

POSIX-style nonblocking I/O.

O_APPEND

Append (writes guaranteed at the end).

O_DSYNC

Write through cache for data.

O_SYNC

Write through cache for data and attributes.

O_RSYNC|O_DSYNC

Write through cache for data on reads and writes.

O_RSYNC|O_SYNC

Write through cache for data and attributes on reads and writes.

O_LARGEFILE

When the filesystem is mounted as large files enabled, the O_LARGEFILE option allows the file to grow over 2 GB.

The flag O_SYNCIO is a synonym for O_SYNC and is defined for backward compatibility in <fcntl.h>.

The flag values accessible only to open() are:

O_CREAT

Open with file create (uses third open arg).

O_TRUNC

Open with truncation.

O_EXCL

Exclusive open.

O_NOCTTY

Do not assign a controlling terminal.

O_NOFOLLOW

Do not traverse a symbolic link if it is the last component in the path.

The requests for fcntl() are:

F_DUPFD

Duplicate file descriptor.

F_GETFD

Get file descriptor flags.

F_SETFD

Set file descriptor flags.

F_GETFL

Get file flags.

F_SETFL

Set file flags.

F_GETLK

Get blocking file lock.

F_SETLK

Set or clear file locks and fail on busy.

F_SETLKW

Set or clear file locks and wait on busy.

F_ADVISE

Fadvise service request (see fadvise(2)).

The file descriptor flag for F_GETFD, F_SETFD is:

FD_CLOEXEC

The file segment locking control structure struct flock, includes the following members:

short l_type; /* F_RDLCK, F_WRLCK or F_UNLCK */ short l_whence; /* Flag - see lseek(2) */ off_t l_start; /* Relative offset in bytes */ off_t l_len; /* Size; if 0 then until EOF */ pid_t l_pid; /* By F_GETLK - process holding lock */

The file segment locking types are:

F_RDLCK Read lock. F_WRLCK Write lock. F_UNLCK Remove locks.

STANDARDS CONFORMANCE

<fcntl.h>: AES, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.