Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Headersunistd(3HEAD)


NAME

 unistd - standard symbolic constants and types

SYNOPSIS

 
#include <unistd.h>

DESCRIPTION

 

The <unistd.h> header defines the symbolic constants and structures which are not already defined or declared in some other header. The contents of this header are shown below.

Version Test Macros

 

The following symbolic constants are defined (with fixed values):

_POSIX_VERSION
Integer value indicating version of the POSIX standard (C language binding). See standards(5).
_POSIX2_VERSION
Integer value indicating version of the POSIX.2 standard (Commands). _POSIX2_C_VERSION Integer value indicating version of the POSIX.2 standard (C language binding).
_XOPEN_VERSION
Integer value indicating version of the XPG to which system conforms.
_XOPEN_XCU_VERSION
Integer value indicating the version of the XCU specification to which the implementation conforms. If this constant is not defined, use the sysconf(3C) function to determine which features are supported.

Mandatory Symbolic Constants

 

The following symbolic constants are either undefined or defined with a value other than -1. If a constant is undefined, an application should use the sysconf(3C), pathconf(2), or fpathconf(2) functions to determine which features are present on the system at that time or for the particular pathname in question.

_POSIX_JOB_CONTROL
Implementation supports job control.
_POSIX_SAVED_IDS
The exec functions (see exec(2)) save the effective user and group.
_POSIX_THREADS
The implementation supports the threads option.
_POSIX_THREAD_ATTR_STACKADDR
The implementation supports the thread stack address attribute option.
_POSIX_THREAD_ATTR_STACKSIZE
The implementation supports the thread stack size attribute option.
_POSIX_THREAD_PROCESS_SHARED
The implementation supports the process-shared synchronization option.
_POSIX_THREAD_SAFE_FUNCTIONS
The implementation supports the thread-safe functions option.
_XOPEN_XPG3
X/Open Specification, February 1992, System Interfaces and Headers, Issue 3 (ISBN: 1-872630-37-5, C212); this specification was formerly X/Open Portability Guide, Issue 3, Volume 2, January 1989, XSI System Interface and Headers (ISBN: 0-13-685843-0, XO/XPG/89/003).
_XOPEN_XPG4
X/Open CAE Specification, July 1992, System Interfaces and Headers, Issue 4 (ISBN: 1-872630-47-2, C202).
_XOPEN_UNIX
X/Open CAE Specification, January 1997, System Interfaces and Headers, Issue 5 (ISBN: 1-85912-181-0, C606).

Constants for Options and Feature Groups

 

The following symbolic constants are defined to have the value -1 if the implementation will never provide the feature, and to have a value other than -1 if the implementation always provides the feature. If these are undefined, the sysconf() function can be used to determine whether the feature is provided for a particular invocation of the application.

_POSIX2_C_BIND
Implementation supports the C Language Binding option.
_POSIX2_C_DEV
Implementation supports the C Language Development Utilities option.
_POSIX2_CHAR_TERM
Implementation supports at least one terminal type.
_POSIX2_LOCALEDEF
Implementation supports the creation of locales by the localedef(1) utility.
_POSIX2_SW_DEV
Implementation supports the Software Development Utilities option.
_POSIX2_UPE
The implementation supports the User Portability Utilities option.
_XOPEN_ENH_I18N
The implementation supports the Issue 4, Version 2 Enhanced Internationalization Feature Group.
_XOPEN_LEGACY
The implementation supports the Legacy Feature Group.
_XOPEN_REALTIME
The implementation supports the X/Open Realtime Feature Group.
_XOPEN_SHM
The implementation supports the Issue 4, Version 2 Shared Memory Feature Group.
_XBS5_ILP32_OFF32
Implementation provides a C-language compilation environment with 32-bit int, long, pointer and off_t types.
_XBS5_ILP32_OFFBIG
Implementation provides a C-language compilation environment with 32-bit int, long and pointer types and an off_t type using at least 64 bits.
_XBS5_LP64_OFF64
Implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer and off_t types.
_XBS5_LPBIG_OFFBIG
Implementation provides a C-language compilation environment with an int type using at least 32 bits and long, pointer and off_t types using at least 64 bits.

If _XOPEN_REALTIME is defined to have a value other than -1 then the following symbolic constants will be defined to an unspecified value to indicate that the features are supported.

_POSIX_ASYNCHRONOUS_IO
Implementation supports the Asynchronous Input and Output option.
_POSIX_MEMLOCK
Implementation supports the Process Memory Locking option.
_POSIX_MEMLOCK_RANGE
Implementation supports the Range Memory Locking option.
_POSIX_MESSAGE_PASSING
Implementation supports the Message Passing option.
_POSIX_PRIORITY_SCHEDULING
Implementation supports the Process Scheduling option.
_POSIX_REALTIME_SIGNALS
Implementation supports the Realtime Signals Extension option.
_POSIX_SEMAPHORES
Implementation supports the Semaphores option.
_POSIX_SHARED_MEMORY_OBJECTS
Implementation supports the Shared Memory Objects option.
_POSIX_SYNCHRONIZED_IO
Implementation supports the Synchronized Input and Output option.
_POSIX_TIMERS
Implementation supports the Timers option.

The following symbolic constants are always defined to unspecified values to indicate that the functionality is always present on XSI-conformant systems.

_POSIX_FSYNC
Implementation supports the File Synchronisation option.
_POSIX_MAPPED_FILES
Implementation supports the Memory Mapped Files option.
_POSIX_MEMORY_PROTECTION
Implementation supports the Memory Protection option.

Execution-time Symbolic Constants

 

If any of the following constants are not defined in the header <unistd.h>, the value varies depending on the file to which it is applied.

If any of the following constants are defined to have value -1 in the header <unistd.h>, the implementation will not provide the option on any file; if any are defined to have a value other than -1 in the header <unistd.h>, the implementation will provide the option on all applicable files.

All of the following constants, whether defined in <unistd.h> or not, may be queried with respect to a specific file using the pathconf() or fpathconf() functions.

_POSIX_ASYNC_IO
Asynchronous input or output operations may be performed for the associated file.
_POSIX_PRIO_IO
Prioritized input or output operations may be performed for the associated file.
_POSIX_SYNC_IO
Synchronized input or output operations may be performed for the associated file.

Constants for Functions

 

The following constant is defined:

NULL
Null pointer.

The following symbolic constants are defined for the access(2) function:

R_OK
Test for read permission.
W_OK
Test for write permission.
X_OK
Test for execute (search) permission.
F_OK
Test for existence of file. The constants F_OK, R_OK, W_OK, and X_OK, and the expressions R_OK|W_OK, R_OK|X_OK, and R_OK|W_OK|X_OK all have distinct values.

The following symbolic constants are defined for the lockf(3C) function:

F_ULOCK
Unlock a previously locked region.
F_LOCK
Lock a region for exclusive use.
F_TLOCK
Test and lock a region for exclusive use.
F_TEST
Test a region for other processes locks.

The following symbolic constants are defined for the lseek(2) and fcntl(2) functions (they have distinct values):

SEEK_SET
Set file offset to offset.
SEEK_CUR
Set file offset to current plus offset.
SEEK_END
Set file offset to EOF plus offset.

The following symbolic constants are defined for the confstr(3C) function for both SPARC and IA:

_CS_LFS64_CFLAGS_CS_LFS64_LDFLAGS
_CS_LFS64_LIBS_CS_LFS64_LINTFLAGS
_CS_LFS_CFLAGS_CS_LFS_LDFLAGS
_CS_LFS_LIBS_CS_LFS_LINTFLAGS
_CS_PATH_CS_XBS5_ILP32_OFF32_CFLAGS
_CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS
_CS_XBS5_ILP32_OFF32_LINTFLAGS_CS_XBS5_ILP32_OFFBIG_CFLAGS
_CS_XBS5_ILP32_OFFBIG_LDFLAGS_CS_XBS5_ILP32_OFFBIG_LIBS
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS 

The followwing symbolic constants are defined for the confstr() function for SPARC only:

_CS_XBS5_LP64_OFF64_CFLAGS_CS_XBS5_LP64_OFF64_LDFLAGS
_CS_XBS5_LP64_OFF64_LIBS_CS_XBS5_LP64_OFF64_LINTFLAGS
_CS_XBS5_LPBIG_OFFBIG_CFLAGS_CS_XBS5_LPBIG_OFFBIG_LDFLAGS
_CS_XBS5_LPBIG_OFFBIG_LIBS_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS

The following symbolic constants are defined for the sysconf(3C) function:

_SC_2_C_BIND_SC_2_C_DEV
_SC_2_C_VERSION_SC_2_FORT_DEV
_SC_2_FORT_RUN_SC_2_LOCALEDEF
_SC_2_SW_DEV_SC_2_UPE
_SC_2_VERSION_SC_AIO_LISTIO_MAX
_SC_AIO_MAX_SC_AIO_PRIO_DELTA_MAX
_SC_ARG_MAX_SC_ASYNCHRONOUS_IO
_SC_ATEXIT_MAX_SC_AVPHYS_PAGES
_SC_BC_BASE_MAX_SC_BC_DIM_MAX
_SC_BC_SCALE_MAX_SC_BC_STRING_MAX
_SC_CHILD_MAX_SC_CLK_TCK
_SC_COLL_WEIGHTS_MAX_SC_DELAYTIMER_MAX
_SC_EXPR_NEST_MAX_SC_FSYNC
_SC_GETGR_R_SIZE_MAX_SC_GETPW_R_SIZE_MAX
_SC_IOV_MAX_SC_JOB_CONTROL
_SC_LINE_MAX_SC_LOGIN_NAME_MAX
_SC_LOGNAME_MAX_SC_MAPPED_FILES
_SC_MEMLOCK_SC_MEMLOCK_RANGE
_SC_MEMORY_PROTECTION_SC_MESSAGE_PASSING
_SC_MQ_OPEN_MAX_SC_MQ_PRIO_MAX
_SC_NGROUPS_MAX_SC_NPROCESSORS_CONF
_SC_NPROCESSORS_ONLN_SC_OPEN_MAX
_SC_PAGESIZE_SC_PAGE_SIZE
_SC_PASS_MAX_SC_PHYS_PAGES
_SC_PRIORITIZED_IO_SC_PRIORITY_SCHEDULING
_SC_REALTIME_SIGNALS_SC_RE_DUP_MAX
_SC_RTSIG_MAX_SC_SAVED_IDS
_SC_SEMAPHORES_SC_SEM_NSEMS_MAX
_SC_SEM_VALUE_MAX_SC_SHARED_MEMORY_OBJECTS
_SC_SIGQUEUE_MAX_SC_STREAM_MAX
_SC_SYNCHRONIZED_IO_SC_THREAD_ATTR_STACKADDR
_SC_THREAD_ATTR_STACKSIZE_SC_THREAD_DESTRUCTOR_ITERATIONS
_SC_THREAD_KEYS_MAX_SC_THREAD_PRIO_INHERIT
_SC_THREAD_PRIO_PROTECT_SC_THREAD_PRIORITY_SCHEDULING
_SC_THREAD_PROCESS_SHARED _SC_THREADS
_SC_THREAD_SAFE_FUNCTIONS_SC_THREAD_STACK_MIN
_SC_THREAD_THREADS_MAX_SC_TIMER_MAX
_SC_TIMERS_SC_TTY_NAME_MAX
_SC_TZNAME_MAX_SC_VERSION
_SC_XBS5_ILP32_OFF32_SC_XBS5_ILP32_OFFBIG
_SC_XBS5_LP64_OFF64_SC_XBS5_LPBIG_OFFBIG
_SC_XOPEN_CRYPT_SC_XOPEN_ENH_I18N
_SC_XOPEN_SHM_SC_XOPEN_UNIX
_SC_XOPEN_VERSION_SC_XOPEN_XCU_VERSION

The two constants _SC_PAGESIZE and _SC_PAGE_SIZE may be defined to have the same value.

The following symbolic constants are defined for the fpathconf(2) function:

_PC_ASYNC_IO_PC_CHOWN_RESTRICTED
_PC_FILESIZEBITS_PC_LINK_MAX
_PC_MAX_CANON_PC_MAX_INPUT
_PC_NAME_MAX_PC_NO_TRUNC
_PC_PATH_MAX_PC_PIPE_BUF
_PC_PRIO_IO_PC_SYNC_IO
_PC_VDISABLE_PC_XATTR_ENABLED
_PC_XATTR_EXISTS 

The following symbolic constants are defined for file streams:

STDIN_FILENO
File number (0) of stdin.
STDOUT_FILENO
File number (1) of stout.
STDERR_FILENO
File number (2) of stderr. The following pathnames are defined:
GF_PATH
Pathname of the group file.
PF_PATH
Pathname of the passwd file.

SEE ALSO

 

access(2), exec(2), fcntl(2), fpathconf(2), lseek(2), confstr(3C), lockf(3C), sysconf(3C), termios(3C), group(4), passwd(4), standards(5), termio(7I)


SunOS 5.9Go To TopLast Changed 1 Aug 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.