The following flags are used by the POSIX functions and structures:
The fcntl function uses the following flags in the cmd parameter. They are defined in the fcntl.h file and are described in the following table. The locking flags are for advisory locks, which can only be used by threads within a single virtual machine and cannot be shared with another virtual machine.
Constant |
Value |
Description |
---|---|---|
F_GETFL |
1 |
Gets the file status flags (O_APPEND, O_DSYNC, O_NONBLOCK, O_RSYNC, and O_SYNC) and the file access modes (O_RDONLY, O_WRONLY, and O_RDWR). The third parameter is not used. |
F_SETFL |
2 |
Sets the file status flags (O_APPEND, O_DSYNC, O_NONBLOCK, O_RSYNC, and O_SYNC). The third parameter of fcntl must be one of these flags or FNDELAY (0x0004), which specifies non blocking I/O. |
F_DUPFD |
3 |
Duplicates the file descriptor. The third parameter of fcntl must be an integer, specifying a value that the duplicate file descriptor must equal or be greater than. |
F_GETFD |
4 |
Gets the file descriptor flags (FD_CLOEXEC). The third parameter is not used. |
F_SETFD |
5 |
Sets the file descriptor flags. The third parameter must be an integer and must be set to either FD_CLOEXEC or 0. |
F_SETLK |
6 |
Sets or clears the record lock, specified by the third parameter of fcntl, which is a pointer to an flock structure. If the lock cannot be set, the fcntl function returns immediately with a return value of -1. |
F_GETLK |
7 |
Gets the first record lock specified by the third parameter of the fcntl function, which is a pointer to an flock structure. The information retrieved overwrites the information passed in the flock structure. If no lock is found that would prevent this lock from being created, the structure is left unchanged except for the lock type, which is set to F_UNLCK. |
F_SETLKW |
8 |
Sets or clears the record lock, specified by the third parameter of fcntl, which is a pointer to an flock structure. This is the same as F_SETLK except that it waits if lock cannot be currently granted. |
F_SETLK64 |
16 |
Sets or clears the record lock (64-bit), specified by the third parameter of fcntl, which is a pointer to an flock64 structure. If the lock cannot be set, the fcntl function returns immediately with a return value of -1. |
F_GETLK64 |
17 |
Gets the first record lock (64-bit) specified by the third parameter of the fcntl function, which is a pointer to an flock64 structure. The information retrieved overwrites the information passed in the flock64 structure. If no lock is found that would prevent this lock from being created, the structure is left unchanged except for the lock type, which is set to F_UNLCK. |
F_SETLKW64 |
18 |
Sets or clears the record lock(64-bit), specified by the third parameter of fcntl, which is a pointer to an flock64 structure. This is the same as F_SETLK64 except that it waits if lock cannot be currently granted. |
The following flags have been defined for the d_type field of the DIR structure. The DT_ flags are defined in the dirent.h file, and the S_IF flags in the sys/mode.h file.
The various access mode constants are defined in the sys/mode.h header file. These constants are resolved using a bitwise OR, and they set the mode parameter in the chmod, creat, fchmod, mkdir, mkfifo, and open (when oflag is set to O_CREAT) functions. The stat and fstat functions return the current value of mode.
On NetWare file systems, you cannot use the mode parameter to set file system permissions or rights. The file or directory inherits its rights from the user creating it, its path, and NetWare trustee assignments. You can use the mode parameter to set file and directory attributes with either POSIX permission modes or with NetWare attribute flags.
The permission modes have the following meanings on the NetWare file systems:
The following constants can be OR'd together to create the permission mode.
User Constants |
Group Constants |
Other Constants |
Permission Mode |
---|---|---|---|
S_IRWXU |
S_IRWXG |
S_IRWXO |
rwx |
S_IRUSR S_IREAD |
S_IRGRP |
S_IROTH |
r |
S_IWUSR S_IWRITE |
S_IWGRP |
S_IWOTH |
w |
S_IXUSR S_IEXEC |
S_IXGRP |
S_IXOTH |
x |
The permission modes are OR'd, not within a type (such as user), but with all types (user, group, and other). For example the OR of the following flags (S_IRUSR | S_IWGRP | S_IXOTH) has the same effect as any one of the following flags: S_IRWXU, S_IRWXG, or S_IRWXO.
If the permission mode equates to 0 and the M_A_BITS_SIGNIFICANT bit is not set, the read only attribute is set.
The M_A_BITS_SIGNIFICANT bit signals LibC that you are using the mode parameter to set NetWare attributes:
If the M_A_BITS_SIGNIFICANT bit is set, the NetWare attribute bits are used to set attributes in addition to the permission modes. If the permission mode equates to 0, the NetWare attribute bits can be used to both clear and set attributes because any attribute not included in the bit mask is cleared.
If the M_A_BITS_SIGNIFICANT bit is not set, the NetWare specific flags are not examined and only the permission modes are used to set attributes.
The following constants are used to set attributes:
The open mode is established as a combination of the bits defined in the fcntl.h header file. Of the following first three values, only one can be set. The other flags can be ORed to one of these first three values.
The following flags can be passed in the request parameter of the ioctl function. The flags are defined in the sys/ioctl.h file
The following flags can be passed in the request parameter of the ioctl function. The FIO flags are defined in the sys/filio.h file and SIO flags in the sys/sockio.h file.
The fgetstat_with_namespace, getstat_with_namespace, set_pathname_format, and other functions use the name space flags to set the format for returning path and file names. They are defined in the fsio.h file.
The fpathconf and pathconf functions use these path configuration variables to return information about file system limits for such items as pathnames and filenames. These values are defined in sys/unistd.h file.
The following flags are used by the processle and processve functions to specify how a process is to be started. The flags can be OR's together.
The following flags are used by the fgetstat and getstat functions to specify which fields in the stat structure are filled in. The flags can be OR's together.
Flag |
Value |
Description |
---|---|---|
ST_FLAGS_BIT |
0x00000001 |
Specifies the open flags for the entry (st_flags field) and returns O_RDONLY, O_WRONLY, or O_RDWR. |
ST_MODE_BIT |
0x00000002 |
Specifies the file mode (st_mode field). For a list of possible modes, see File Access Modes and NetWare Attributes. |
ST_GEN_BIT |
0x00000004 |
Specifies the generation number of the inode (st_gen field). This number is not used in NetWare file systems. |
ST_INO_BIT |
0x00000008 |
Specifies the directory entry number (st_ino field). |
ST_DEV_BIT |
0x00000010 |
Specifies the volume number (st_dev field). |
ST_RDEV_BIT |
0x00000020 |
Specifies the device type (st_rdev field). This is always 0 on NetWare file systems. |
ST_SIZE_BIT |
0x00000040 |
Specifies the total file size in bytes (st_size). Only valid for files. |
ST_BLOCKS_BIT |
0x00000080 |
Specifies the number of blocks allocated to the file (st_blocks field). |
ST_BLKSIZE_BIT |
0x00000100 |
Specifies the block allocation size (st_blksize field). Valid only for files. |
ST_NLINK_BIT |
0x00000200 |
Specifies the count of hard links (st_nlink field). Always 1 on NetWare file systems. |
ST_UID_BIT |
0x00000400 |
Specifies the object ID of the owner (st_uid field). |
ST_GID_BIT |
0x00000800 |
Specifies the group ID (st_gid field). Always 0 on NetWare file systems. |
ST_BID_BIT |
0x00001000 |
Specifies the ID of the object that last archived the entry (st_bid field). |
ST_MID_BIT |
0x00002000 |
Specifies the ID of the object that last modified the entry (st_mid field). |
ST_ATIME_BIT |
0x00004000 |
Specifies the last time the file was accessed (st_atime field). Not used for directories. |
ST_MTIME_BIT |
0x00008000 |
Specifies the last time the entry was modified (st_mtime field). |
ST_CTIME_BIT |
0x00010000 |
Specifies when the attributes of the file last changed (st_ctime field). |
ST_BTIME_BIT |
0x00020000 |
Specifies when the entry was last archived (st_btime field). |
ST_STAT_BITS |
0x0003FFFF |
Specifies that all normal stat structure fields should be returned, which includes all fields except the st_name and the st_rights fields. |
ST_RIGHTS_BIT |
0x00040000 |
Specifies the effective rights of the caller to the entry (st_rights field). |
ST_NAME_BIT |
0x00080000 |
Specifies the name of the entry (st_name field). |
ST_NS_BIT |
0x00100000 |
Specifies that name be returned in the requested name space. Used by the fgetstat_with_namespace and getstat_with_namespace functions. |
The sysconf function uses the following values to return the current numeric value of configurable system limits. These values are defined in the sys/unistd.h file. Only the values that currently return configuration information are listed below. The others return -1.
The confstr function uses the following flags to return system configuration strings. These flags are defined in the sys/unistd.h file.