Chapter 18. Additional Behaviors

18.1. Mandatory Optional Behaviors

This section specifies behaviors in which there is optional behavior in one of the standards on which the LSB relies, and where the LSB requires a specific behavior.

Note: The LSB does not require the kernel to be Linux; the set of mandated options reflects current existing practice, but may be modified in future releases.

LSB conforming implementations shall support the following options defined within the ISO POSIX (2003):

_POSIX_FSYNC
_POSIX_MAPPED_FILES
_POSIX_MEMLOCK
_POSIX_MEMLOCK_RANGE
_POSIX_MEMORY_PROTECTION
_POSIX_PRIORITY_SCHEDULING
_POSIX_REALTIME_SIGNALS
_POSIX_THREAD_ATTR_STACKADDR
_POSIX_THREAD_ATTR_STACKSIZE
_POSIX_THREAD_PROCESS_SHARED
_POSIX_THREAD_SAFE_FUNCTIONS
_POSIX_THREADS

The opendir() function shall consume a file descriptor in the same fashion as open(), and therefore may fail with EMFILE or ENFILE.

The START and STOP termios characters shall be changeable, as described as optional behavior in the "General Terminal Interface" section of the ISO POSIX (2003).

The access() function function shall fail with errno set to EINVAL if the amode argument contains bits other than those set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK.

The link() function shall require access to the existing file in order to succeed, as described as optional behavior in the ISO POSIX (2003).

Calling unlink() on a directory shall fail. Calling link() specifying a directory as the first argument shall fail. See also unlink.

Note: Linux allows rename() on a directory without having write access, but the LSB does not require this.

18.1.1. Special Requirements

LSB conforming systems shall enforce certain special additional restrictions above and beyond those required by ISO POSIX (2003).

Note: These additional restrictions are required in order to support the testing and certification programs associated with the LSB. In each case, these are values that defined macros must not have; conforming applications that use these values shall trigger a failure in the interface that is otherwise described as a "may fail".

The fcntl() function shall treat the "cmd" value -1 as invalid.

The whence value -1 shall be an invalid value for the lseek(), fseek() and fcntl() functions.

The value -5 shall be an invalid signal number.

If the sigaddset() or sigdelset() functions are passed an invalid signal number, they shall return with EINVAL. Implementations are only required to enforce this requirement for signal numbers which are specified to be invalid by this specification (such as the -5 mentioned above).

The mode value -1 to the access() function shall be treated as invalid.

A value of -1 shall be an invalid "_PC_..." value for pathconf().

A value of -1 shall be an invalid "_SC..." value for sysconf().

The nl_item value -1 shall be invalid for nl_langinfo().

The value -1 shall be an invalid "_CS_..." value for confstr().

The value "a" shall be an invalid mode argument to popen().

The fcntl() function shall fail and set errno to EDEADLK if the cmd argument is F_SETLKW, and the lock is blocked by a lock from another process already blocked by the current process.

The opendir() function shall consume a file descriptor; the readdir() function shall fail and set errno to EBADF if the underlying file descriptor is closed.

The link() function shall not work across file systems, and shall fail and set errno to EXDEV as described as optional behavior in ISO POSIX (2003).