[+]Misprints
- dirfd.02
- lsb.sched_setscheduler.22.01
Summary:( Total:18238 / Covered:7186 / Failed:130)
- [+]!other (628 / 177 / 0)
- [+]FD_CLR (5 / 0 / 0)
- FD_CLR.01
File descriptor masks of type fd_set can be initialized and tested with FD_CLR(), FD_ISSET(), FD_SET(), and FD_ZERO().
- FD_CLR.02
It is unspecified whether each of these is a macro or a function.
- FD_CLR.03
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with any of these names, the behavior is undefined.
- FD_CLR.04
FD_CLR(fd, fdsetp) shall remove the file descriptor fd from the set pointed to by fdsetp.
- FD_CLR.05
If fd is not a member of this set, there shall be no effect on the set, nor will an error be returned.
- app.FD_CLR.06
The behavior of these macros is undefined if the fd argument is less than 0 or greater than or equal to FD_SETSIZE, or if fd is not a valid file descriptor, or if any of the arguments are expressions with side effects.
- [+]FD_ISSET (6 / 0 / 0)
- FD_ISSET.01
File descriptor masks of type fd_set can be initialized and tested with FD_CLR(), FD_ISSET(), FD_SET(), and FD_ZERO().
- FD_ISSET.02
It is unspecified whether each of these is a macro or a function.
- FD_ISSET.03
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with any of these names, the behavior is undefined.
- FD_ISSET.04
FD_ISSET(fd, fdsetp) shall evaluate to non-zero if the file descriptor fd is a member of the set pointed to by fdsetp, and shall evaluate to zero otherwise.
- app.FD_ISSET.06
The behavior of these macros is undefined if the fd argument is less than 0 or greater than or equal to FD_SETSIZE, or if fd is not a valid file descriptor, or if any of the arguments are expressions with side effects.
- FD_ISSET.06.01
FD_ISSET() shall return a non-zero value if the bit for the file descriptor fd is set in the file descriptor set pointed to by fdset,
- FD_ISSET.06.02
and 0 otherwise.
- [+]FD_SET (5 / 0 / 0)
- FD_SET.01
File descriptor masks of type fd_set can be initialized and tested with FD_CLR(), FD_ISSET(), FD_SET(), and FD_ZERO().
- FD_SET.02
It is unspecified whether each of these is a macro or a function.
- FD_SET.03
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with any of these names, the behavior is undefined.
- FD_SET.04
FD_SET(fd, fdsetp) shall add the file descriptor fd to the set pointed to by fdsetp.
- FD_SET.05
If the file descriptor fd is already in this set, there shall be no effect on the set, nor will an error be returned.
- app.FD_SET.06
The behavior of these macros is undefined if the fd argument is less than 0 or greater than or equal to FD_SETSIZE, or if fd is not a valid file descriptor, or if any of the arguments are expressions with side effects.
- [+]FD_ZERO (5 / 0 / 0)
- FD_ZERO.01
File descriptor masks of type fd_set can be initialized and tested with FD_CLR(), FD_ISSET(), FD_SET(), and FD_ZERO().
- FD_ZERO.02
It is unspecified whether each of these is a macro or a function.
- FD_ZERO.03
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with any of these names, the behavior is undefined.
- FD_ZERO.04
FD_ZERO(fdsetp) shall initialize the descriptor set pointed to by fdsetp to the null set.
- FD_ZERO.05
No error is returned if the set is not empty at the time FD_ZERO() is invoked.
- app.FD_ZERO.06
The behavior of these macros is undefined if the fd argument is less than 0 or greater than or equal to FD_SETSIZE, or if fd is not a valid file descriptor, or if any of the arguments are expressions with side effects.
- [+]__assertion_fail (0 / 0 / 0)
- app.__assertion_fail.04
assertion, file, and line shall be non-NULL
- [+]__pthread_cleanup_pop (1 / 0 / 0)
- __pthread_cleanup_pop.30
The _pthread_cleanup_pop() function provides an implementation of the pthread_cleanup_pop() macro described in ISO POSIX (2003).
- [+]__pthread_cleanup_push (1 / 0 / 0)
- __pthread_cleanup_push.30
The _pthread_cleanup_push() function provides an implementation of the pthread_cleanup_push() macro described in ISO POSIX (2003).
- [+]delay_mode (5 / 0 / 0)
- delay_mode.01
Two mutually-exclusive delay modes specify how quickly certain Curses functions return to the application when there is no terminal input waiting when the function is called:
- delay_mode.01.01
No Delay
- delay_mode.01.01.01
The function fails.
- delay_mode.01.02
Delay
- delay_mode.01.02.01
The application waits until the implementation passes text through to the application.
- delay_mode.01.02.02
If cbreak or Raw Mode is set, this is after one character.
- delay_mode.01.02.03
Otherwise, this is after the first <newline> character, end-of-line character, or end-of-file character.
- delay_mode.03
The effect of No Delay Mode on function key processing is unspecified.
- [+]echo_processing (9 / 0 / 0)
- echo_processing.01
Echo mode determines whether Curses echoes typed characters to the screen.
- echo_processing.02
The effect of Echo mode is analogous to the effect of the ECHO flag in the local mode field of the termios structure associated with the terminal device connected to the window.
- echo_processing.03
However, Curses always clears the ECHO flag when invoked, to inhibit the operating system from performing echoing.
- echo_processing.04
The method of echoing characters is not identical to the operating system's method of echoing characters, because Curses performs additional processing of terminal input.
- echo_processing.05
If in Echo mode, Curses performs its own echoing: Any visible input character is stored in the current or specified window by the input function that the application called, at that window's cursor position, as though addch() were called, with all consequent effects such as cursor movement and wrapping.
- echo_processing.06
If not in Echo mode, any echoing of input must be performed by the application.
- echo_processing.07
Applications often perform their own echoing in a controlled area of the screen, or do not echo at all, so they disable Echo mode.
- echo_processing.08
It may not be possible to turn off echo processing for synchronous and networked asynchronous terminals because echo processing is done directly by the terminals.
- echo_processing.09
Applications running on such terminals should be aware that any characters typed will appear on the screen at wherever the cursor is positioned.
- [+]erasewchar (2 / 0 / 0)
- erasewchar.01
The erasewchar() function stores the current erase character in the object pointed to by ch.
- erasewchar.02
If no erase character has been defined, the function will fail and the object pointed to by ch will not be changed.
- [+]exp2l (15 / 8 / 0)
- exp2l.01
These functions shall compute the base-2 exponential of x.
- exp2l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- exp2l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- exp2l.04
Upon successful completion, these functions shall return 2x.
- exp2l.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- exp2l.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- exp2l.07
[MX] If x is NaN, a NaN shall be returned.
- exp2l.08
If x is ?0, 1 shall be returned.
- exp2l.09
If x is -Inf, +0 shall be returned.
- exp2l.10
If x is +Inf, x shall be returned.
- exp2l.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- exp2l.12
These functions shall fail if:
- exp2l.12.01
Range Error The result overflows.
- exp2l.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2l.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- exp2l.13
These functions may fail if:
- exp2l.13.01
Range Error The result underflows.
- exp2l.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2l.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]general_signal (33 / 0 / 0)
- general_signal.01
Signals which are generated by some action attributable to a particular thread, such as a hardware fault, shall be generated for the thread that caused the signal to be generated
- general_signal.02
Signals that are generated in association with a process ID or process group ID or an asynchronous event, such as terminal activity, shall be generated for the process
- general_signal.03
When SIGCONT is generated for a process that is stopped, the process shall be continued, even if the SIGCONT signal is blocked or ignored.
- general_signal.04
If SIGCONT is blocked and not ignored, it shall remain pending until it is either unblocked or a stop signal is generated for the process.
- general_signal.05
SIG_DFL
- general_signal.05.01
The default actions for the signals defined in this volume of IEEE Std 1003.1-2001 are specified under <signal.h>. [RTS]
- general_signal.05.02
If the Realtime Signals Extension option is supported, the default actions for the realtime signals in the range SIGRTMIN to SIGRTMAX shall be to terminate the process abnormally.
- general_signal.06
If the default action is to stop the process, the execution of that process is temporarily suspended.
- general_signal.07
When a process stops, a SIGCHLD signal shall be generated for its parent process, unless the parent process has set the SA_NOCLDSTOP flag.
- general_signal.08
While a process is stopped
- general_signal.08.01
any additional signals that are sent to the process shall not be delivered until the process is continued
- general_signal.08.02
except SIGKILL which always terminates the receiving process
- general_signal.09
A process that is a member of an orphaned process group
- general_signal.09.01
shall not be allowed to stop in response to the SIGTSTP, SIGTTIN, or SIGTTOU signals
- general_signal.09.02
In cases where delivery of one of these signals would stop such a process, the signal shall be discarded.
- general_signal.10
The default action for SIGCONT is to resume execution at the point where the process was stopped, after first handling any pending unblocked signals
- general_signal.11
When a stopped process is continued, a SIGCHLD signal may be generated for its parent process, unless the parent process has set the SA_NOCLDSTOP flag
- general_signal.12
SIG_IGN
- general_signal.12.01
Delivery of the signal shall have no effect on the process.
- general_signal.12.02
The behavior of a process is undefined after it ignores a SIGFPE, SIGILL, SIGSEGV, [RTS] or SIGBUS signal that was not generated by kill(), [RTS] sigqueue(), or raise().
- general_signal.13
Setting a signal action to SIG_IGN
- general_signal.13.01
for a signal that is pending shall cause the pending signal to be discarded, whether or not it is blocked.
- general_signal.13.02
If the Realtime Signals Extension option is supported, any queued values pending shall be discarded and the resources used to queue them shall be released and made available to queue other signals.
- general_signal.14
If a process sets the action for the SIGCHLD signal to SIG_IGN, the behavior is unspecified, [XSI] except as specified below.
- general_signal.14.01
If the action for the SIGCHLD signal is set to SIG_IGN, child processes of the calling processes shall not be transformed into zombie processes when they terminate. If the calling process subsequently waits for its children, and the process has no unwaited-for children that were transformed into zombie processes, it shall block until all of its children terminate, and wait(), waitid(), and waitpid() shall fail and set errno to [ECHILD].
- general_signal.15
pointer to a function
- general_signal.15.01
On delivery of the signal, the receiving process is to execute the signal-catching function at the specified address. After returning from the signal-catching function, the receiving process shall resume execution at the point at which it was interrupted.
- general_signal.16
The si_code member shall contain a code identifying the cause of the signal.
- general_signal.16.01
SI_USER
- general_signal.16.01.01
The signal was sent by the kill() function
- general_signal.16.01.02
The implementation may set si_code to SI_USER if the signal was sent by the raise() or abort() functions or any similar functions provided as implementation extensions
- general_signal.16.02
SI_QUEUE [RTS] The signal was sent by the sigqueue() function.
- general_signal.16.03
SI_TIMER [RTS] The signal was generated by the expiration of a timer set by timer_settime().
- general_signal.16.04
SI_ASYNCIO [RTS] The signal was generated by the completion of an asynchronous I/O request.
- general_signal.16.05
SI_MESGQ [RTS] The signal was generated by the arrival of a message on an empty message queue.
- general_signal.16.06
If the signal was not generated by one of the functions or events listed above, the si_code shall be set to an implementation-defined value that is not equal to any of the values defined above.
- general_signal.17
If the Realtime Signals Extension is supported, and si_code is one of SI_QUEUE, SI_TIMER, SI_ASYNCIO, or SI_MESGQ
- general_signal.17.01
then si_value shall contain the application-specified signal value
- general_signal.17.02
Otherwise, the contents of si_value are undefined
- general_signal.18
The behavior of a process is undefined after it returns normally from a signal-catching function for a [XSI] SIGBUS, SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(), [RTS] sigqueue(), or raise().
- general_signal.19
If a process establishes a signal-catching function for the SIGCHLD signal while it has a terminated child process for which it has not waited, it is unspecified whether a SIGCHLD signal is generated to indicate that child process.
- general_signal.20
When a signal is delivered to a thread, if the action of that signal specifies termination, stop, or continue, the entire process shall be terminated, stopped, or continued, respectively.
- general_signal.21
Signals affect the behavior of certain functions defined by this volume of IEEE Std 1003.1-2001 if delivered to a process while it is executing such a function.
- general_signal.21.01
If the action of the signal is to terminate the process, the process shall be terminated and the function shall not return
- [+]getwc_unlocked (18 / 0 / 0)
- getwc_unlocked.fgetwc.01.01
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream,
- getwc_unlocked.fgetwc.01.02
convert that to the corresponding wide-character code,
- getwc_unlocked.fgetwc.01.03
and advance the associated file position indicator for the stream (if defined).
- getwc_unlocked.fgetwc.02
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- getwc_unlocked.fgetwc.03
The fgetwc() function may mark the st_atime field of the file associated with stream for update.
- getwc_unlocked.fgetwc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getwc_unlocked.fgetwc.05
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t.
- getwc_unlocked.fgetwc.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF.
- getwc_unlocked.fgetwc.07
If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, [CX] and shall set errno to indicate the error.
- getwc_unlocked.fgetwc.08
If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
- getwc_unlocked.fgetwc.09
The fgetwc() function shall fail if data needs to be read and:
- getwc_unlocked.fgetwc.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- getwc_unlocked.fgetwc.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getwc_unlocked.fgetwc.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- getwc_unlocked.fgetwc.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getwc_unlocked.fgetwc.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getwc_unlocked.fgetwc.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getwc_unlocked.fgetwc.10
The fgetwc() function may fail if:
- getwc_unlocked.fgetwc.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- getwc_unlocked.fgetwc.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]input_mode (9 / 0 / 0)
- input_mode.01
The XBD specification (Special Characters) defines flow-control characters, the interrupt character, the erase character, and the kill character.
- input_mode.02
Four mutually-exclusive Curses modes let the application control the effect of these input characters:
- input_mode.02.01.01
Cooked Mode This achieves normal line-at-a-time processing with all special characters handled outside the application. This achieves the same effect as canonical-mode input processing as specified in the XBD specification. The state of the ISIG and IXON flags are not changed upon entering this mode by calling and are set upon entering this mode by calling
- input_mode.02.01.02
The implementation supports erase and kill characters from any supported locale, no matter what the width of the character is.
- input_mode.02.02
cbreak Mode Characters typed by the user are immediately available to the application and Curses does not perform special processing on either the erase character or the kill character. An application can select cbreak mode to do its own line editing but to let the abort character be used to abort the task. This mode achieves the same effect as non-canonical-mode, Case B input processing (with MIN set to 1 and ICRNL cleared) as specified in the XBD specification. The state of the ISIG and IXON flags are not changed upon entering this mode.
- input_mode.02.03
Half-Delay Mode The effect is the same as cbreak, except that input functions wait until a character is available or an interval defined by the application elapses, whichever comes first. This mode achieves the same effect as non-canonical-mode, Case C input processing (with TIME set to the value specified by the application) as specified in the XBD specification. The state of the ISIG and IXON flags are not changed upon entering this mode.
- input_mode.02.04
Raw Mode Raw mode gives the application maximum control over terminal input. The application sees each character as it is typed. This achieves the same effect as non-canonical mode, Case D input processing as specified in the XBD specification. The ISIG and IXON flags are cleared upon entering this mode.
- input_mode.03
The terminal interface settings are recorded when the process calls initscr() or newterm() to initialise Curses and restores these settings when endwin() is called.
- input_mode.04
The initial input mode for Curses operations is unspecified unless the implementation supports Enhanced Curses compliance, in which the initial input mode is cbreak mode.
- input_mode.05
The behaviour of the BREAK key depends on other bits in the display driver that are not set by Curses.
- [+]io (1 / 1 / 0)
- io.term.01
The default on the opening of a terminal file is that neither its input nor its output are suspended.
- app.io.term.01
Conforming applications shall ensure that they call unlockpt() before opening the slave side of a pseudo-terminal device.
- [+]key_name (6 / 0 / 0)
- key_name.01
The keyname() and key_name() functions generate a character string whose value describes the key c.
- key_name.02
The c argument of key_name() must be a wide character.
- key_name.03
The string has a format according to the first applicable row in the following table: Input Format of Returned String Visible character The same character Control character ^X Meta-character (keyname() only) M-X Key value defined in <curses.h> (keyname() only) KEY_name None of the above UNKNOWN KEY
- key_name.04
The meta-character notation shown above is used only if meta-characters are enabled.
- key_name.05.01
Upon successful completion, keyname() returns a pointer to a string as described above.
- key_name.05.02
Otherwise, it returns a null pointer.
- [+]keypad_processing (18 / 0 / 0)
- keypad_processing.01
The application can enable or disable keypad translation by calling keypad().
- keypad_processing.02
When translation is enabled, Curses attempts to translate a sequence of terminal input that represents the pressing of a function key into a single key code.
- keypad_processing.03
When translation is disabled, Curses passes terminal input to the application without such translation, and any interpretation of the input as representing the pressing of a keypad key must be done by the application.
- keypad_processing.04
The complete set of key codes for keypad keys that Curses can process is specified by the constants defined in <curses.h> whose names begin with "KEY_".
- keypad_processing.05
Each terminal type described in the terminfo database may support some or all of these key codes.
- keypad_processing.06
The terminfo database specifies the sequence of input characters from the terminal type that correspond to each key code (see ).
- keypad_processing.07
The Curses implementation cannot translate keypad keys on terminals where pressing the keys does not transmit a unique sequence.
- keypad_processing.08
When translation is enabled and a character that could be the beginning of a function key (such as escape) is received, Curses notes the time and begins accumulating characters.
- keypad_processing.09
If Curses receives additional characters that represent the pressing of a keypad key, within an unspecified interval from the time the first character was received, then Curses converts this input to a key code for presentation to the application.
- keypad_processing.10
If such characters are not received during this interval, translation of this input does not occur and the individual characters are presented to the application separately. (Because Curses waits for this interval to accumulate a key code, many terminals experience a delay between the time a user presses the escape key and the time the escape is returned to the application.)
- keypad_processing.11
In addition, No Timeout Mode provides that in any case where Curses has received part of a function key sequence, it waits indefinitely for the complete key sequence.
- keypad_processing.12
The "unspecified interval" in the previous paragraph becomes infinite in No Timeout Mode.
- keypad_processing.13
No Timeout Mode allows the use of function keys over slow communication lines.
- keypad_processing.14
No Timeout Mode lets the user type the individual characters of a function key sequence, but also delays application response when the user types a character (not a function key) that begins a function key sequence.
- keypad_processing.15
For this reason, in No Timeout Mode many terminals will appear to hang between the time a user presses the escape key and the time another key is pressed.
- keypad_processing.16
No Timeout Mode is switchable by calling notimeout().
- keypad_processing.17
If any special characters (see Special Characters ) are defined or redefined to be characters that are members of a function key sequence, then Curses will be unable to recognise and translate those function keys.
- keypad_processing.18
Several of the modes discussed below are described in terms of availability of input. If keypad translation is enabled, then input is not available once Curses has begun receiving a keypad sequence until the sequence is completely received or the interval has elapsed.
- [+]killwchar (2 / 0 / 0)
- killwchar.01
The killwchar() function stores the current line kill character in the object pointed to by ch.
- killwchar.02
If no line kill character has been defined, the function will fail and the object pointed to by ch will not be changed.
- [+]limits (137 / 65 / 0)
- limits.1
{AIO_LISTIO_MAX} [AIO]
Maximum number of I/O operations in a single list I/O call supported by the implementation.
Minimum Acceptable Value: {_POSIX_AIO_LISTIO_MAX}
- limits.10
{LOGIN_NAME_MAX} Maximum length of a login name.
Minimum Acceptable Value: {_POSIX_LOGIN_NAME_MAX}
- limits.100
{_POSIX2_BC_SCALE_MAX} Maximum scale value allowed by the bc utility.
Value: 99
- limits.101
{_POSIX2_BC_STRING_MAX} Maximum length of a string constant accepted by the bc utility.
Value: 1 000
- limits.102
{_POSIX2_CHARCLASS_NAME_MAX} Maximum number of bytes in a character class name.
Value: 14
- limits.103
{_POSIX2_COLL_WEIGHTS_MAX} Maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in the locale definition file; see Locale.
Value: 2
- limits.104
{_POSIX2_EXPR_NEST_MAX} Maximum number of expressions that can be nested within parentheses by the expr utility.
Value: 32
- limits.105
{_POSIX2_LINE_MAX} Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>.
Value: 2 048
- limits.106
{_POSIX2_RE_DUP_MAX] Maximum number of repeated occurrences of a regular expression permitted when using the interval notation \{m,n\}; see Regular Expressions.
Value: 255
- limits.107
{_XOPEN_IOV_MAX} [XSI]
Maximum number of iovec structures that one process has available for use with readv() or writev().
Value: 16
- limits.108
{_XOPEN_NAME_MAX} [XSI]
Maximum number of bytes in a filename (not including the terminating null).
Value: 255
- limits.109
{_XOPEN_PATH_MAX} [XSI]
Maximum number of bytes in a pathname.
Value: 1024
- limits.11
{MQ_OPEN_MAX} [MSG]
The maximum number of open message queue descriptors a process may hold.
Minimum Acceptable Value: {_POSIX_MQ_OPEN_MAX}
- limits.110
{CHAR_BIT} Number of bits in a type char.
[CX] Value: 8
- limits.111
{CHAR_MAX} Maximum value of type char.
Value: {UCHAR_MAX} or {SCHAR_MAX}
- limits.112
{CHAR_MIN} Minimum value of type char.
Value: {SCHAR_MIN} or 0
- limits.113
{INT_MAX} Maximum value of an int.
[CX] Minimum Acceptable Value: 2 147 483 647
- limits.114
{LONG_BIT} [XSI]
Number of bits in a long.
Minimum Acceptable Value: 32
- limits.115
{LONG_MAX} Maximum value of a long.
Minimum Acceptable Value: +2 147 483 647
- limits.116
{MB_LEN_MAX} Maximum number of bytes in a character, for any supported locale.
Minimum Acceptable Value: 1
- limits.117
{SCHAR_MAX} Maximum value of type signed char.
[CX] Value: +127
- limits.118
{SHRT_MAX} Maximum value of type short.
Minimum Acceptable Value: +32 767
- limits.119
{SSIZE_MAX} Maximum value of an object of type ssize_t.
Minimum Acceptable Value: {_POSIX_SSIZE_MAX}
- limits.12
{MQ_PRIO_MAX} [MSG]
The maximum number of message priorities supported by the implementation.
Minimum Acceptable Value: {_POSIX_MQ_PRIO_MAX}
- limits.120
{UCHAR_MAX} Maximum value of type unsigned char.
[CX] Value: 255
- limits.121
{UINT_MAX} Maximum value of type unsigned.
[CX] Minimum Acceptable Value: 4 294 967 295
- limits.122
{ULONG_MAX} Maximum value of type unsigned long.
Minimum Acceptable Value: 4 294 967 295
- limits.123
{USHRT_MAX} Maximum value for a type unsigned short.
Minimum Acceptable Value: 65 535
- limits.124
{WORD_BIT} [XSI]
Number of bits in a type int.
Minimum Acceptable Value: 32
- limits.125
{INT_MIN} Minimum value of type int.
[CX] Maximum Acceptable Value: -2 147 483 647
- limits.126
{LONG_MIN} Minimum value of type long.
Maximum Acceptable Value: -2 147 483 647
- limits.127
{SCHAR_MIN} Minimum value of type signed char.
[CX] Value: -128
- limits.128
{SHRT_MIN} Minimum value of type short.
Maximum Acceptable Value: -32 767
- limits.129
{LLONG_MIN} Minimum value of type long long.
Maximum Acceptable Value: -9223372036854775807
- limits.13
{OPEN_MAX} Maximum number of files that one process can have open at any one time.
Minimum Acceptable Value: {_POSIX_OPEN_MAX}
- limits.130
{LLONG_MAX} Maximum value of type long long.
Minimum Acceptable Value: +9223372036854775807
- limits.131
{ULLONG_MAX} Maximum value of type unsigned long long.
Minimum Acceptable Value: 18446744073709551615
- limits.132
{NL_ARGMAX} [XSI]
Maximum value of digit in calls to the printf() and scanf() functions.
Minimum Acceptable Value: 9
- limits.133
{NL_LANGMAX} [XSI]
Maximum number of bytes in a LANG name.
Minimum Acceptable Value: 14
- limits.134
{NL_MSGMAX} [XSI]
Maximum message number.
Minimum Acceptable Value: 32 767
- limits.135
{NL_NMAX} [XSI]
Maximum number of bytes in an N-to-1 collation mapping.
Minimum Acceptable Value: No guaranteed value across all conforming implementations.
- limits.136
{NL_SETMAX} [XSI]
Maximum set number.
Minimum Acceptable Value: 255
- limits.137
{NL_TEXTMAX} [XSI]
Maximum number of bytes in a message string.
Minimum Acceptable Value: {_POSIX2_LINE_MAX}
- limits.138
{NZERO} [XSI]
Default process priority.
Minimum Acceptable Value: 20
- limits.14
{PAGESIZE} Size in bytes of a page.
Minimum Acceptable Value: 1
- limits.15
{PAGE_SIZE} [XSI]
Equivalent to {PAGESIZE}. If either {PAGESIZE} or {PAGE_SIZE} is defined, the other is defined with the same value.
- limits.16
{PTHREAD_DESTRUCTOR_ITERATIONS} [THR]
Maximum number of attempts made to destroy a thread's thread-specific data values on thread exit.
Minimum Acceptable Value: {_POSIX_THREAD_DESTRUCTOR_ITERATIONS}
- limits.17
{PTHREAD_KEYS_MAX} [THR]
Maximum number of data keys that can be created by a process.
Minimum Acceptable Value: {_POSIX_THREAD_KEYS_MAX}
- limits.18
{PTHREAD_STACK_MIN} [THR]
Minimum size in bytes of thread stack storage.
Minimum Acceptable Value: 0
- limits.19
{PTHREAD_THREADS_MAX} [THR]
Maximum number of threads that can be created per process.
Minimum Acceptable Value: {_POSIX_THREAD_THREADS_MAX}
- limits.2
{AIO_MAX} [AIO]
Maximum number of outstanding asynchronous I/O operations supported by the implementation.
Minimum Acceptable Value: {_POSIX_AIO_MAX}
- limits.20
{RE_DUP_MAX} The number of repeated occurrences of a BRE permitted by the regexec() and regcomp() functions when using the interval notation {\(m,n\}; see BREs Matching Multiple Characters.
Minimum Acceptable Value: {_POSIX2_RE_DUP_MAX}
- limits.21
{RTSIG_MAX} [RTS]
Maximum number of realtime signals reserved for application use in this implementation.
Minimum Acceptable Value: {_POSIX_RTSIG_MAX}
- limits.22
{SEM_NSEMS_MAX} [SEM]
Maximum number of semaphores that a process may have.
Minimum Acceptable Value: {_POSIX_SEM_NSEMS_MAX}
- limits.23
{SEM_VALUE_MAX} [SEM]
The maximum value a semaphore may have.
Minimum Acceptable Value: {_POSIX_SEM_VALUE_MAX}
- limits.24
{SIGQUEUE_MAX} [RTS]
Maximum number of queued signals that a process may send and have pending at the receiver(s) at any time.
Minimum Acceptable Value: {_POSIX_SIGQUEUE_MAX}
- limits.25
{SS_REPL_MAX} [SS|TSP]
The maximum number of replenishment operations that may be simultaneously pending for a particular sporadic server scheduler.
Minimum Acceptable Value: {_POSIX_SS_REPL_MAX}
- limits.26
{STREAM_MAX} The number of streams that one process can have open at one time. If defined, it has the same value as {FOPEN_MAX} (see <stdio.h>).
Minimum Acceptable Value: {_POSIX_STREAM_MAX}
- limits.27
{SYMLOOP_MAX} Maximum number of symbolic links that can be reliably traversed in the resolution of a pathname in the absence of a loop.
Minimum Acceptable Value: {_POSIX_SYMLOOP_MAX}
- limits.28
{TIMER_MAX} [TMR]
Maximum number of timers per process supported by the implementation.
Minimum Acceptable Value: {_POSIX_TIMER_MAX}
- limits.29
{TRACE_EVENT_NAME_MAX} [TRC]
Maximum length of the trace event name.
Minimum Acceptable Value: {_POSIX_TRACE_EVENT_NAME_MAX}
- limits.3
{AIO_PRIO_DELTA_MAX} [AIO]
The maximum amount by which a process can decrease its asynchronous I/O priority level from its own scheduling priority.
Minimum Acceptable Value: 0
- limits.30
{TRACE_NAME_MAX} [TRC]
Maximum length of the trace generation version string or of the trace stream name.
Minimum Acceptable Value: {_POSIX_TRACE_NAME_MAX}
- limits.31
{TRACE_SYS_MAX} [TRC]
Maximum number of trace streams that may simultaneously exist in the system.
Minimum Acceptable Value: {_POSIX_TRACE_SYS_MAX}
- limits.32
{TRACE_USER_EVENT_MAX} [TRC]
Maximum number of user trace event type identifiers that may simultaneously exist in a traced process, including the predefined user trace event POSIX_TRACE_UNNAMED_USER_EVENT.
Minimum Acceptable Value: {_POSIX_TRACE_USER_EVENT_MAX}
- limits.33
{TTY_NAME_MAX} Maximum length of terminal device name.
Minimum Acceptable Value: {_POSIX_TTY_NAME_MAX}
- limits.34
{TZNAME_MAX} Maximum number of bytes supported for the name of a timezone (not of the TZ variable).
Minimum Acceptable Value: {_POSIX_TZNAME_MAX}
- limits.35
Note: The length given by {TZNAME_MAX} does not include the quoting characters mentioned in Other Environment Variables.
- limits.36
{FILESIZEBITS} Minimum number of bits needed to represent, as a signed integer value, the maximum size of a regular file allowed in the specified directory.
Minimum Acceptable Value: 32
- limits.37
{LINK_MAX} Maximum number of links to a single file.
Minimum Acceptable Value: {_POSIX_LINK_MAX}
- limits.38
{MAX_CANON} Maximum number of bytes in a terminal canonical input line.
Minimum Acceptable Value: {_POSIX_MAX_CANON}
- limits.39
{MAX_INPUT} Minimum number of bytes for which space is available in a terminal input queue; therefore, the maximum number of bytes a conforming application may require to be typed as input before reading them.
Minimum Acceptable Value: {_POSIX_MAX_INPUT}
- limits.4
{ARG_MAX} Maximum length of argument to the exec functions including environment data.
Minimum Acceptable Value: {_POSIX_ARG_MAX}
- limits.40
{NAME_MAX} Maximum number of bytes in a filename (not including terminating null).
Minimum Acceptable Value: {_POSIX_NAME_MAX}
[XSI] Minimum Acceptable Value: {_XOPEN_NAME_MAX}
- limits.41
{PATH_MAX} Maximum number of bytes in a pathname, including the terminating null character.
Minimum Acceptable Value: {_POSIX_PATH_MAX}
[XSI] Minimum Acceptable Value: {_XOPEN_PATH_MAX}
- limits.42
{PIPE_BUF} Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.
Minimum Acceptable Value: {_POSIX_PIPE_BUF}
- limits.43
{POSIX_ALLOC_SIZE_MIN} [ADV]
Minimum number of bytes of storage actually allocated for any portion of a file.
Minimum Acceptable Value: Not specified.
- limits.44
{POSIX_REC_INCR_XFER_SIZE} [ADV]
Recommended increment for file transfer sizes between the {POSIX_REC_MIN_XFER_SIZE} and {POSIX_REC_MAX_XFER_SIZE} values.
Minimum Acceptable Value: Not specified.
- limits.45
{POSIX_REC_MAX_XFER_SIZE} [ADV]
Maximum recommended file transfer size.
Minimum Acceptable Value: Not specified.
- limits.46
{POSIX_REC_MIN_XFER_SIZE} [ADV]
Minimum recommended file transfer size.
Minimum Acceptable Value: Not specified.
- limits.47
{POSIX_REC_XFER_ALIGN} [ADV]
Recommended file transfer buffer alignment.
Minimum Acceptable Value: Not specified.
- limits.48
{SYMLINK_MAX} Maximum number of bytes in a symbolic link.
Minimum Acceptable Value: {_POSIX_SYMLINK_MAX}
- limits.49
{BC_BASE_MAX} Maximum obase values allowed by the bc utility.
Minimum Acceptable Value: {_POSIX2_BC_BASE_MAX}
- limits.5
{ATEXIT_MAX} [XSI]
Maximum number of functions that may be registered with atexit().
Minimum Acceptable Value: 32
- limits.50
{BC_DIM_MAX} Maximum number of elements permitted in an array by the bc utility.
Minimum Acceptable Value: {_POSIX2_BC_DIM_MAX}
- limits.51
{BC_SCALE_MAX} Maximum scale value allowed by the bc utility.
Minimum Acceptable Value: {_POSIX2_BC_SCALE_MAX}
- limits.52
{BC_STRING_MAX} Maximum length of a string constant accepted by the bc utility.
Minimum Acceptable Value: {_POSIX2_BC_STRING_MAX}
- limits.53
{CHARCLASS_NAME_MAX} Maximum number of bytes in a character class name.
Minimum Acceptable Value: {_POSIX2_CHARCLASS_NAME_MAX}
- limits.54
{COLL_WEIGHTS_MAX} Maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in the locale definition file; see Locale.
Minimum Acceptable Value: {_POSIX2_COLL_WEIGHTS_MAX}
- limits.55
{EXPR_NEST_MAX} Maximum number of expressions that can be nested within parentheses by the expr utility.
Minimum Acceptable Value: {_POSIX2_EXPR_NEST_MAX}
- limits.56
{LINE_MAX} Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>.
Minimum Acceptable Value: {_POSIX2_LINE_MAX}
- limits.57
{NGROUPS_MAX} Maximum number of simultaneous supplementary group IDs per process.
Minimum Acceptable Value: {_POSIX_NGROUPS_MAX}
- limits.58
{RE_DUP_MAX} Maximum number of repeated occurrences of a regular expression permitted when using the interval notation \{m,n\}; see Regular Expressions.
Minimum Acceptable Value: {_POSIX2_RE_DUP_MAX}
- limits.59
{_POSIX_CLOCKRES_MIN} [TMR]
The resolution of the CLOCK_REALTIME clock, in nanoseconds.
Value: 20 000 000 [MON] If the Monotonic Clock option is supported, the resolution of the CLOCK_MONOTONIC clock, in nanoseconds, is represented by {_POSIX_CLOCKRES_MIN}.
- limits.6
{CHILD_MAX} Maximum number of simultaneous processes per real user ID.
Minimum Acceptable Value: {_POSIX_CHILD_MAX}
- limits.60
{_POSIX_AIO_LISTIO_MAX} [AIO]
The number of I/O operations that can be specified in a list I/O call.
Value: 2
- limits.61
{_POSIX_AIO_MAX} [AIO]
The number of outstanding asynchronous I/O operations.
Value: 1
- limits.62
{_POSIX_ARG_MAX} Maximum length of argument to the exec functions including environment data.
Value: 4 096
- limits.63
{_POSIX_CHILD_MAX} Maximum number of simultaneous processes per real user ID.
Value: 25
- limits.64
{_POSIX_DELAYTIMER_MAX} [TMR]
The number of timer expiration overruns.
Value: 32
- limits.65
{_POSIX_HOST_NAME_MAX} Maximum length of a host name (not including the terminating null) as returned from the gethostname() function.
Value: 255
- limits.66
{_POSIX_LINK_MAX} Maximum number of links to a single file.
Value: 8
- limits.67
{_POSIX_LOGIN_NAME_MAX} The size of the storage required for a login name, in bytes, including the terminating null.
Value: 9
- limits.68
{_POSIX_MAX_CANON} Maximum number of bytes in a terminal canonical input queue.
Value: 255
- limits.69
{_POSIX_MAX_INPUT} Maximum number of bytes allowed in a terminal input queue.
Value: 255
- limits.7
{DELAYTIMER_MAX} [TMR]
Maximum number of timer expiration overruns.
Minimum Acceptable Value: {_POSIX_DELAYTIMER_MAX}
- limits.70
{_POSIX_MQ_OPEN_MAX} [MSG]
The number of message queues that can be open for a single process.
Value: 8
- limits.71
{_POSIX_MQ_PRIO_MAX} [MSG]
The maximum number of message priorities supported by the implementation.
Value: 32
- limits.72
{_POSIX_NAME_MAX} Maximum number of bytes in a filename (not including terminating null).
Value: 14
- limits.73
{_POSIX_NGROUPS_MAX} Maximum number of simultaneous supplementary group IDs per process.
Value: 8
- limits.74
{_POSIX_OPEN_MAX} Maximum number of files that one process can have open at any one time.
Value: 20
- limits.75
{_POSIX_PATH_MAX} Maximum number of bytes in a pathname.
Value: 256
- limits.76
{_POSIX_PIPE_BUF} Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.
Value: 512
- limits.77
{_POSIX_RE_DUP_MAX} The number of repeated occurrences of a BRE permitted by the regexec() and regcomp() functions when using the interval notation {\(m,n\}; see BREs Matching Multiple Characters.
Value: 255
- limits.78
{_POSIX_RTSIG_MAX} [RTS]
The number of realtime signal numbers reserved for application use.
Value: 8
- limits.79
{_POSIX_SEM_NSEMS_MAX} [SEM]
The number of semaphores that a process may have.
Value: 256
- limits.8
{HOST_NAME_MAX} Maximum length of a host name (not including the terminating null) as returned from the gethostname() function.
Minimum Acceptable Value: {_POSIX_HOST_NAME_MAX}
- limits.80
{_POSIX_SEM_VALUE_MAX} [SEM]
The maximum value a semaphore may have.
Value: 32 767
- limits.81
{_POSIX_SIGQUEUE_MAX} [RTS]
The number of queued signals that a process may send and have pending at the receiver(s) at any time.
Value: 32
- limits.82
{_POSIX_SSIZE_MAX} The value that can be stored in an object of type ssize_t.
Value: 32 767
- limits.83
{_POSIX_STREAM_MAX} The number of streams that one process can have open at one time.
Value: 8
- limits.84
{_POSIX_SS_REPL_MAX} [SS|TSP]
The number of replenishment operations that may be simultaneously pending for a particular sporadic server scheduler.
Value: 4
- limits.85
{_POSIX_SYMLINK_MAX} The number of bytes in a symbolic link.
Value: 255
- limits.86
{_POSIX_SYMLOOP_MAX} The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop.
Value: 8
- limits.87
{_POSIX_THREAD_DESTRUCTOR_ITERATIONS} [THR]
The number of attempts made to destroy a thread's thread-specific data values on thread exit.
Value: 4
- limits.88
{_POSIX_THREAD_KEYS_MAX} [THR]
The number of data keys per process.
Value: 128
- limits.89
{_POSIX_THREAD_THREADS_MAX} [THR]
The number of threads per process.
Value: 64
- limits.9
{IOV_MAX} [XSI]
Maximum number of iovec structures that one process has available for use with readv() or writev().
Minimum Acceptable Value: {_XOPEN_IOV_MAX}
- limits.90
{_POSIX_TIMER_MAX} [TMR]
The per-process number of timers.
Value: 32
- limits.91
{_POSIX_TRACE_EVENT_NAME_MAX} [TRC]
The length in bytes of a trace event name.
Value: 30
- limits.92
{_POSIX_TRACE_NAME_MAX} [TRC]
The length in bytes of a trace generation version string or a trace stream name.
Value: 8
- limits.93
{_POSIX_TRACE_SYS_MAX} [TRC]
The number of trace streams that may simultaneously exist in the system.
Value: 8
- limits.94
{_POSIX_TRACE_USER_EVENT_MAX} [TRC]
The number of user trace event type identifiers that may simultaneously exist in a traced process, including the predefined user trace event POSIX_TRACE_UNNAMED_USER_EVENT.
Value: 32
- limits.95
{_POSIX_TTY_NAME_MAX} The size of the storage required for a terminal device name, in bytes, including the terminating null.
Value: 9
- limits.96
{_POSIX_TZNAME_MAX} Maximum number of bytes supported for the name of a timezone (not of the TZ variable).
Value: 6 Note: The length given by {_POSIX_TZNAME_MAX} does not include the quoting characters mentioned in Other Environment Variables.
- limits.98
{_POSIX2_BC_BASE_MAX} Maximum obase values allowed by the bc utility.
Value: 99
- limits.99
{_POSIX2_BC_DIM_MAX} Maximum number of elements permitted in an array by the bc utility.
Value: 2 048
- [+]locale (1 / 0 / 0)
- app.locale.bind_textdomain_codeset.08.01
shall not be changed or freed by the user.
- app.locale.bindtextdomain.11
Note: Applications that wish to use chdir() should always use absolute pathnames to avoid misadvertently selecting the wrong or non-existant directory.
- app.locale.bindtextdomain.12
The string
- app.locale.bindtextdomain.12.01
shall not be changed or freed by the user.
- app.locale.dcgettext.09
The resulting NULL-terminated string
- app.locale.dcgettext.09.01
must not be modified or freed.
- app.locale.dcngettext.11
The resulting NULL-terminated string
- app.locale.dcngettext.11.01
must not be modified or freed.
- app.locale.dgettext.08
The length of the string returned is undetermined until dgettext() is called.
- app.locale.dngettext.11
The resulting NULL-terminated string
- app.locale.dngettext.11.01
must not be modified or freed.
- app.locale.gettext.06
Applications shall not modify the string returned by gettext().
- app.locale.ngettext.09
Applications shall not modify the string returned by ngettext().
- locale.textdomain.01
Subsequent calls to gettext() and ngettext() use the default message domain.
- [+]lsb (3 / 0 / 0)
- lsb.strerror_r.01
The strerror_r() shall behave as specified in ISO POSIX (2003), except as described below.
- lsb.strerror_r.02
The strerror_r() function shall return a pointer to the string corresponding to errno.
On success, strerror_r() shall return a pointer to the generated message string (determined by the setting of the LC_MESSAGES category in the current locale).
- lsb.strerror_r.03 (struct)
The returned pointer may point within the buffer buf (at most buflen bytes).
- lsb.strerror_r.04
Otherwise, strerror_r() shall return the string corresponding to "Unknown error".
- [+]ncurses (4 / 0 / 0)
- ncurses.slk.01
The Curses interface manipulates the set of soft function-key labels that exist on many terminals.
- ncurses.slk.02
For those terminals that do not have soft labels, Curses takes over the bottom line of stdscr, reducing the size of stdscr and the value of the LINES external variable.
- ncurses.slk.03.count
There can be up to eight labels of up to eight display columns each.
- ncurses.slk.03.width
There can be up to eight labels of up to eight display columns each.
- [+]nlspath (1 / 0 / 0)
- nlspath.01
This variable shall contain a sequence of templates that the catopen() function uses when attempting to locate message catalogs.
- [+]pecho_wchar (5 / 0 / 0)
- pecho_wchar.01
The pechochar() and pecho_wchar() functions output one character to a pad and immediately refresh the pad.
- pecho_wchar.02
They are equivalent to a call to waddch() or wadd_wch(), respectively, followed by a call to prefresh().
- pecho_wchar.03
The last location of the pad on the screen is reused for the arguments to prefresh().
- pecho_wchar.04.01
Upon successful completion, these functions return OK.
- pecho_wchar.04.02
Otherwise, they return ERR.
- [+]process (3 / 0 / 0)
- process.context.01
The ucontext_t type that ucp points to defines the user context and includes the contents of the calling thread's machine registers, the signal mask, and the current execution stack.
- process.meta.nice.01
The default nice value is {NZERO}
- process.meta.nice.02
lower nice values shall cause more favorable scheduling
- [+]pselect (39 / 0 / 0)
- pselect.01
The pselect() function shall examine the file descriptor sets whose addresses are passed in the readfds, writefds, and errorfds parameters to see whether some of their descriptors are ready for reading, are ready for writing, or have an exceptional condition pending, respectively.
- app.pselect.02
The pselect() and select() functions shall support regular files, terminal and pseudo-terminal devices, [XSR] STREAMS-based files, FIFOs, pipes, and sockets. The behavior of pselect() and select() on file descriptors that refer to other types of file is unspecified.
- pselect.03 (struct)
The nfds argument specifies the range of descriptors to be tested.
- pselect.04
The first nfds descriptors shall be checked in each set; that is, the descriptors from zero through nfds-1 in the descriptor sets shall be examined.
- pselect.05
If the readfds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for being ready to read, and on output indicates which file descriptors are ready to read.
- pselect.06
If the writefds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for being ready to write, and on output indicates which file descriptors are ready to write.
- pselect.07
If the errorfds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for error conditions pending, and on output indicates which file descriptors have error conditions pending.
- pselect.08
Upon successful completion, the pselect() or select() function shall modify the objects pointed to by the readfds, writefds, and errorfds arguments to indicate which file descriptors are ready for reading, ready for writing, or have an error condition pending, respectively, and shall return the total number of ready descriptors in all the output sets.
- pselect.09
For each file descriptor less than nfds, the corresponding bit shall be set on successful completion if it was set on input and the associated condition is true for that file descriptor.
- pselect.10
If none of the selected descriptors are ready for the requested operation, the pselect() or select() function shall block until at least one of the requested operations becomes ready, until the timeout occurs, or until interrupted by a signal.
- pselect.11
The timeout parameter controls how long the pselect() or select() function shall take before timing out.
- pselect.12
If the timeout parameter is not a null pointer, it specifies a maximum interval to wait for the selection to complete.
- pselect.13
If the specified time interval expires without any requested operation becoming ready, the function shall return.
- pselect.14
If the timeout parameter is a null pointer, then the call to pselect() or select() shall block indefinitely until at least one descriptor meets the specified criteria.
- pselect.15 (struct)
To effect a poll, the timeout parameter should not be a null pointer, and should point to a zero-valued timespec structure.
- pselect.16
The use of a timeout does not affect any pending timers set up by alarm(), ualarm(), or setitimer().
- pselect.17 (struct)
Implementations may place limitations on the maximum timeout interval supported.
- pselect.20 (struct)
Implementations may also place limitations on the granularity of timeout intervals.
- pselect.22
If sigmask is not a null pointer, then the pselect() function shall replace the signal mask of the caller by the set of signals pointed to by sigmask before examining the descriptors, and shall restore the signal mask of the calling thread before returning.
- pselect.23 (struct)
A descriptor shall be considered ready for reading when a call to an input function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully.
- pselect.24 (struct)
The function might return data, an end-of-file indication, or an error other than one indicating that it is blocked, and in each of these cases the descriptor shall be considered ready for reading.
- pselect.25 (struct)
A descriptor shall be considered ready for writing when a call to an output function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully.
- pselect.26
If a socket has a pending error, it shall be considered to have an exceptional condition pending.
- pselect.27
Otherwise, what constitutes an exceptional condition is file type-specific.
- pselect.28
For a file descriptor for use with a socket, it is protocol-specific except as noted below. For other file types it is implementation-defined.
- pselect.29
If the operation is meaningless for a particular file type, pselect() or select() shall indicate that the descriptor is ready for read or write operations, and shall indicate that the descriptor has no exceptional condition pending.
- pselect.30
If a descriptor refers to a socket, the implied input function is the recvmsg() function with parameters requesting normal and ancillary data, such that the presence of either type shall cause the socket to be marked as readable.
- pselect.31
The presence of out-of-band data shall be checked if the socket option SO_OOBINLINE has been enabled, as out-of-band data is enqueued with normal data.
- pselect.32
If the socket is currently listening, then it shall be marked as readable if an incoming connection request has been received, and a call to the accept() function shall complete without blocking.
- pselect.33
If a descriptor refers to a socket, the implied output function is the sendmsg() function supplying an amount of normal data equal to the current value of the SO_SNDLOWAT option for the socket.
- pselect.34
If a non-blocking call to the connect() function has been made for a socket, and the connection attempt has either succeeded or failed leaving a pending error, the socket shall be marked as writable.
- pselect.35
A socket shall be considered to have an exceptional condition pending if a receive operation with O_NONBLOCK clear for the open file description and with the MSG_OOB flag set would return out-of-band data without blocking.
- pselect.36
It is protocol-specific whether the MSG_OOB flag would be used to read out-of-band data.
- pselect.37
A socket shall also be considered to have an exceptional condition pending if an out-of-band data mark is present in the receive queue.
- pselect.38
Other circumstances under which a socket may be considered to have an exceptional condition pending are protocol-specific and implementation-defined.
- pselect.39
If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is not a null pointer, the pselect() or select() function shall block for the time specified, or until interrupted by a signal.
- pselect.40
If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is a null pointer, the pselect() or select() function shall block until interrupted by a signal.
- pselect.41
File descriptors associated with regular files shall always select true for ready to read, ready to write, and error conditions.
- pselect.42
On failure, the objects pointed to by the readfds, writefds, and errorfds arguments shall not be modified.
- pselect.43
If the timeout interval expires without the specified condition being true for any of the specified file descriptors, the objects pointed to by the readfds, writefds, and errorfds arguments shall have all bits set to 0.
- pselect.44.01
Upon successful completion, the pselect() and select() functions shall return the total number of bits set in the bit masks.
- pselect.44.02
Otherwise, -1 shall be returned, and errno shall be set to indicate the error.
- pselect.45
Under the following conditions, pselect() and select() shall fail and set errno to:
- pselect.45.01
[EBADF] One or more of the file descriptor sets specified a file descriptor that is not a valid open file descriptor.
- pselect.45.02
[EINTR] The function was interrupted before any of the selected events occurred and before the timeout interval expired. [XSI] If SA_RESTART has been set for the interrupting signal, it is implementation-defined whether the function restarts or returns with [EINTR].
- pselect.45.03
[EINVAL] An invalid timeout interval was specified.
- pselect.45.04
[EINVAL] The nfds argument is less than 0 or greater than FD_SETSIZE.
- pselect.45.05
[EINVAL] [XSR] One of the specified file descriptors refers to a STREAM or multiplexer that is linked (directly or indirectly) downstream from a multiplexer.
- [+]pthread (2 / 0 / 0)
- pthread.cond.01
After a condition variable attributes object has been used to initialize one or more condition variables, any function affecting the attributes object (including destruction) shall not affect any previously initialized condition variables.
- app.pthread.cond.condattr.01
A destroyed attr attributes object can be reinitialized using pthread_condattr_init();
- app.pthread.cond.condattr.02
the results of otherwise referencing the object after it has been destroyed are undefined.
- pthread.rwlock.01
After a read-write lock attributes object has been used to initialize one or more read-write locks, any function affecting the attributes object (including destruction) shall not affect any previously initialized read-write locks.
- app.pthread.rwlock.rwlock.01.rdlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.timedrdlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.timedwrlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.tryrdlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.trywrlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.unlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.01.wrlock
The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init().
- app.pthread.rwlock.rwlock.02.01.rdlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.timedrdlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.timedwrlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.tryrdlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.trywrlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.unlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.01.wrlock
Results are undefined if a read-write lock is used without first being initialized.
- app.pthread.rwlock.rwlock.02.rdlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.timedrdlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.timedwrlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.tryrdlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.trywrlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.unlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.02.wrlock
Once initialized, the lock can be used any number of times without being reinitialized.
- app.pthread.rwlock.rwlock.03.rdlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.timedrdlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.timedwrlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.tryrdlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.trywrlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.unlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlock.03.wrlock
Only the object referenced by rwlock may be used for performing synchronization. The result of referring to copies of that object in calls to pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), or pthread_rwlock_wrlock() is undefined.
- app.pthread.rwlock.rwlockattr.01
A destroyed attr attributes object can be reinitialized using pthread_rwlockattr_init();
- app.pthread.rwlock.rwlockattr.02
the results of otherwise referencing the object after it has been destroyed are undefined.
- [+]pthread_cleanup (3 / 1 / 0)
- pthread_cleanup.01
The cancellation cleanup handler shall be popped from the cancellation cleanup stack and invoked with the argument arg when:
- pthread_cleanup.01.01
The thread exits (that is, calls pthread_exit()).
- pthread_cleanup.01.02
The thread acts upon a cancellation request.
- pthread_cleanup.01.03
The thread calls pthread_cleanup_pop() with a non-zero execute argument.
- [+]pthread_mutex (1 / 0 / 0)
- app.pthread_mutex.01
Only mutex itself may be used for performing synchronization. The result of referring to copies of mutex in calls to pthread_mutex_lock(), pthread_mutex_trylock(), pthread_mutex_unlock(), and pthread_mutex_destroy() is undefined.
- pthread_mutex.02
An implementation may map this mutex to one of the other mutex types.
- [+]pthread_mutex_static_init (1 / 1 / 0)
- pthread_mutex_static_init.01
In cases where default mutex attributes are appropriate, the macro PTHREAD_MUTEX_INITIALIZER can be used to initialize mutexes that are statically allocated. The effect shall be equivalent to dynamic initialization by a call to pthread_mutex_init() with parameter attr specified as NULL, except that no error checks are performed.
- [+]pthread_mutexattr (6 / 1 / 0)
- pthread_mutexattr.01
After a mutex attributes object has been used to initialize one or more mutexes, any function affecting the attributes object (including destruction) shall not affect any previously initialized mutexes.
- pthread_mutexattr.02
The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex to be operated upon by any thread that has access to the memory where the mutex is allocated, even if the mutex is allocated in memory that is shared by multiple processes.
- pthread_mutexattr.03.01
If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the mutex shall only be operated upon by threads created within the same process as the thread that initialized the mutex;
- pthread_mutexattr.03.02
if threads of differing processes attempt to operate on such a mutex, the behavior is undefined.
- pthread_mutexattr.04
The default value of the attribute shall be PTHREAD_PROCESS_PRIVATE.
- pthread_mutexattr.05
The default value of the type attribute is PTHREAD_MUTEX_DEFAULT.
- [+]rendition (6 / 0 / 0)
- rendition.01
When the application adds or inserts characters into a window, the effect is as follows:
- rendition.01.01
If the character is not the space character, then the window receives:
- rendition.01.01.01
the character that the application specifies
- rendition.01.01.02
the colour that the application specifies; or the window colour, if the application does not specify a colour
- rendition.01.01.03
the attributes specified, OR-ed with the window attributes.
- rendition.01.02
If the character is the space character, then the window receives:
- rendition.01.02.01
the background character
- rendition.01.02.02
the colour that the application specifies; or the window colour, if the application does not specify a colour
- rendition.01.02.03
the attributes specified, OR-ed with the window attributes.
- [+]return_from_main (25 / 3 / 0)
- return_from_main.01
The exit() function shall first call all functions registered by atexit(), in the reverse order of their registration, except that a function is called after any previously registered functions that had already been called at the time it was registered. Each function is called as many times as it was registered.
- return_from_main.02
If a function registered by a call to atexit() fails to return, the remaining registered functions shall not be called and the rest of the exit() processing shall not be completed.
- return_from_main.03
The exit() function shall then flush all open streams with unwritten buffered data, close all open streams, and remove all files created by tmpfile().
- return_from_main.04
These functions shall terminate the calling process [CX] with the following consequences:
- return_from_main.04.01
All of the file descriptors, directory streams, [XSI] conversion descriptors, and message catalog descriptors open in the calling process shall be closed.
- return_from_main.04.02
If the parent process of the calling process is executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, it shall be notified of the calling process' termination and the low-order eight bits (that is, bits 0377) of status shall be made available to it. If the parent is not waiting, the child's status shall be made available to it when the parent subsequently executes wait() or waitpid().
- return_from_main.04.03
If the parent process of the calling process is not executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, the calling process shall be transformed into a zombie process. A zombie process is an inactive process and it shall be deleted at some later time when its parent process executes wait() or waitpid().
- return_from_main.04.04
Termination of a process does not directly terminate its children. The sending of a SIGHUP signal as described below indirectly terminates children in some circumstances.
- return_from_main.04.05
The parent process ID of all of the calling process' existing child processes and zombie processes shall be set to the process ID of an implementation-defined system process. That is, these processes shall be inherited by a special system process.
- return_from_main.04.06
[XSI] Each attached shared-memory segment is detached and the value of shm_nattch (see shmget()) in the data structure associated with its shared memory ID shall be decremented by 1.
- return_from_main.04.07
[XSI] For each semaphore for which the calling process has set a semadj value (see semop() ), that value shall be added to the semval of the specified semaphore.
- return_from_main.04.08
If the process is a controlling process, the SIGHUP signal shall be sent to each process in the foreground process group of the controlling terminal belonging to the calling process.
- return_from_main.04.09
If the process is a controlling process, the controlling terminal associated with the session shall be disassociated from the session, allowing it to be acquired by a new controlling process.
- return_from_main.04.10
If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal shall be sent to each process in the newly-orphaned process group.
- return_from_main.04.11
[SEM] All open named semaphores in the calling process shall be closed as if by appropriate calls to sem_close().
- return_from_main.04.12
[ML] Any memory locks established by the process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to _Exit() or _exit().
- return_from_main.04.13
[MF|SHM] Memory mappings that were created in the process shall be unmapped before the process is destroyed.
- return_from_main.04.14
[TYM] Any blocks of typed memory that were mapped in the calling process shall be unmapped, as if munmap() was implicitly called to unmap them.
- return_from_main.04.15
[MSG] All open message queue descriptors in the calling process shall be closed as if by appropriate calls to mq_close().
- return_from_main.04.16
[AIO] Any outstanding cancelable asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the _Exit() or _exit() operation had not yet occurred, but any associated signal notifications shall be suppressed. The _Exit() or _exit() operation may block awaiting such I/O completion. Whether any I/O is canceled, and which I/O may be canceled upon _Exit() or _exit(), is implementation-defined.
- return_from_main.04.18
[TRC] If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described by the posix_trace_shutdown() function, and any process' mapping of trace event names to trace event type identifiers built for these trace streams may be deallocated.
- return_from_main.04.19.01
If the implementation supports the SIGCHLD signal, a SIGCHLD shall be sent to the parent process.
- return_from_main.04.19.02
If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status shall be discarded, and the lifetime of the calling process shall end immediately.
- return_from_main.04.19.03
If SA_NOCLDWAIT is set, it is implementation-defined whether a SIGCHLD signal is sent to the parent process.
- return_from_main.05
These functions do not return.
- return_from_main.06
The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process.
- [+]scrolling (11 / 0 / 0)
- scrolling.01
If the application specifies a character or a string of characters such that writing them to a window would extend beyond the end of the line (for example, if the application tries to deposit any multi-column character at the last column in a line), the behaviour depends on whether the function supports line wrapping:
- scrolling.01.01
If the function does not wrap, it fails.
- scrolling.01.02
If the function wraps, then it places one or more characters in the window at the start of the next line, beginning with the first character that would not completely fit on the original line.
- scrolling.01.03
If the final character on the line is a multi-column character that does not completely fit on the line, the entire character wraps to the next line and columns at the end of the original line may be orphaned.
- scrolling.01.04
If the original line was the last line in the window, the wrap may cause a scroll to occur:
- scrolling.01.04.01
If scrolling is enabled, a scroll occurs.
- scrolling.01.04.02
The contents of the first line of the window are lost.
- scrolling.01.04.03
The contents of each remaining line in the window move to the previous line.
- scrolling.01.04.04
The last line of the window is filled with any characters that wrapped.
- scrolling.01.04.05
Any remaining space on the last line is filled with the background character and rendition.
- scrolling.01.04.06
If scrolling is disabled, any characters that would extend beyond the last column of the last line are truncated.
- scrolling.02
Some add functions move the cursor just beyond the end of the last character added.
- scrolling.03
If this position is beyond the end of a line, it causes wrapping and scrolling under the conditions specified in the second bullet above.
- [+]setjmp (3 / 0 / 0)
- app.setjmp.01
If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with the name setjmp, the behavior is undefined.
- setjmp.01
A call to setjmp() shall save the calling environment in its env argument for later use by longjmp().
- app.setjmp.02
An application shall ensure that an invocation of setjmp() appears in one of the following contexts only:
- app.setjmp.02.01
The entire controlling expression of a selection or iteration statement
- app.setjmp.02.02
One operand of a relational or equality operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- app.setjmp.02.03
The operand of a unary '!' operator with the resulting expression being the entire controlling expression of a selection or iteration
- app.setjmp.02.04
The entire expression of an expression statement (possibly cast to void)
- setjmp.02
It is unspecified whether setjmp() is a macro or a function.
- setjmp.04
If the return is from a direct invocation, setjmp() shall return 0. If the return is from a call to longjmp(), setjmp() shall return a non-zero value.
- [+]sh (59 / 15 / 0)
- sh.pattern.filename.01
The rules described so far in Patterns Matching a Single Character and Patterns Matching Multiple Characters are qualified by the following rules that apply when pattern matching notation is used for filename expansion:
- sh.pattern.filename.01.01.01
The slash character in a pathname shall be explicitly matched by using one or more slashes in the pattern; it shall neither be matched by the asterisk or question-mark special characters nor by a bracket expression.
- sh.pattern.filename.01.01.02
Slashes in the pattern shall be identified before bracket expressions; thus, a slash cannot be included in a pattern bracket expression used for filename expansion.
- sh.pattern.filename.01.01.03
If a slash character is found following an unescaped open square bracket character before a corresponding closing square bracket is found, the open bracket shall be treated as an ordinary character.
- sh.pattern.filename.01.02.01
If a filename begins with a period ( '.' ), the period shall be explicitly matched by using a period as the first character of the pattern or immediately following a slash character.
- sh.pattern.filename.01.02.02
The leading period shall not be matched by:
- sh.pattern.filename.01.02.02.01
The asterisk or question-mark special characters
- sh.pattern.filename.01.02.02.02
A bracket expression containing a non-matching list, such as "[!a]", a range expression, such as "[%-0]", or a character class expression, such as "[[:punct:]]"
- sh.pattern.filename.01.02.03
It is unspecified whether an explicit period in a bracket expression matching list, such as "[.abc]", can match a leading period in a filename.
- sh.pattern.filename.01.03.01
Specified patterns shall be matched against existing filenames and pathnames, as appropriate.
- sh.pattern.filename.01.03.02
Each component that contains a pattern character shall require read permission in the directory containing that component.
In order to have access to a pathname, glob() requires search permission on every component of a path except the last, and read permission on each directory of any filename component of pattern that contains any of the following special characters: '*', '?', and '['.
- sh.pattern.filename.01.03.03
Any component, except the last, that does not contain a pattern character shall require search permission.
In order to have access to a pathname, glob() requires search permission on every component of a path except the last, and read permission on each directory of any filename component of pattern that contains any of the following special characters: '*', '?', and '['.
- sh.pattern.multiple.01
The following rules are used to construct patterns matching multiple characters from patterns matching a single character:
- sh.pattern.multiple.01.01
The asterisk ( '*' ) is a pattern that shall match any string, including the null string.
* An asterisk is a pattern that shall match multiple characters, as described in Patterns Matching Multiple Characters.
- sh.pattern.multiple.01.02
The concatenation of patterns matching a single character is a valid pattern that shall match the concatenation of the single characters or collating elements matched by each of the concatenated patterns.
- sh.pattern.multiple.01.03
The concatenation of one or more patterns matching a single character with one or more asterisks is a valid pattern. In such patterns, each asterisk shall match a string of zero or more characters, matching the greatest possible number of characters that still allows the remainder of the pattern to match the string.
- sh.pattern.single.01
A backslash character shall escape the following character.
- sh.pattern.single.02
The escaping backslash shall be discarded.
- sh.pattern.single.03
An ordinary character is a pattern that shall match itself.
- sh.pattern.single.04
Matching shall be based on the bit pattern used for encoding the character, not on the graphic representation of the character.
- sh.pattern.single.05
If any character (ordinary, shell special, or pattern special) is quoted, that pattern shall match the character itself.
- sh.pattern.single.06
The shell special characters always require quoting.
- sh.pattern.single.07
When unquoted and outside a bracket expression, the following three characters shall have special meaning in the specification of patterns:
- sh.pattern.single.07.01
? A question-mark is a pattern that shall match any character.
- sh.pattern.single.07.02
[ The open bracket shall introduce a pattern bracket expression.
- app.sh.wordexp.command.01
a conforming application shall separate the "$(" and '(' into two tokens (that is, separate them with white space). This is required to avoid any ambiguities with arithmetic expansion.
- app.sh.wordexp.parameter.01
If parameter is '*' or '@', the result of the expansion is unspecified.
Only variables, not positional parameters or special parameters, can be assigned in this way.
- app.sh.wordexp.tilde.01
If HOME is unset, the results are unspecified.
- app.sh.wordexp.tilde.02
If the system does not recognize the login name, the results are undefined.
- sh.wordexp.arithmetic.01
The shell shall expand all tokens in the expression for parameter expansion, command substitution, and quote removal.
- sh.wordexp.arithmetic.02
Next, the shell shall treat this as an arithmetic expression and substitute the value of the expression.
- sh.wordexp.arithmetic.03
All changes to variables in an arithmetic expression shall be in effect after the arithmetic expansion, as in the parameter expansion "${x=value}".
- sh.wordexp.command.01
The shell shall expand the command substitution by executing command in a subshell environment (see Shell Execution Environment) and replacing the command substitution (the text of command plus the enclosing "$()" or backquotes) with the standard output of the command, removing sequences of one or more <newline>s at the end of the substitution.
- sh.wordexp.command.02
Embedded <newline>s before the end of the output shall not be removed;
- sh.wordexp.command.03
The results of command substitution shall not be processed for further tilde expansion, parameter expansion, command substitution, or arithmetic expansion.
- sh.wordexp.command.04
If a command substitution occurs inside double-quotes, field splitting and pathname expansion shall not be performed on the results of the substitution.
- sh.wordexp.field.01
If the value of IFS is a <space>, <tab>, and <newline>, or if it is unset, any sequence of <space>s, <tab>s, or <newline>s at the beginning or end of the input shall be ignored and any sequence of those characters within the input shall delimit a field.
- sh.wordexp.field.02
If the value of IFS is null, no field splitting shall be performed.
- sh.wordexp.field.03
Otherwise, the following rules shall be applied in sequence. The term " IFS white space" is used to mean any sequence (zero or more instances) of white space characters that are in the IFS value (for example, if IFS contains <space>/ <comma>/ <tab>, any sequence of <space>s and <tab>s is considered IFS white space).
- sh.wordexp.field.03.01
IFS white space shall be ignored at the beginning and end of the input.
- sh.wordexp.field.03.02
Each occurrence in the input of an IFS character that is not IFS white space, along with any adjacent IFS white space, shall delimit a field, as described previously.
- sh.wordexp.field.03.03
Non-zero-length IFS white space shall delimit a field.
- sh.wordexp.parameter.01
The value, if any, of parameter shall be substituted.
- sh.wordexp.parameter.02.01
${parameter:-word}substitute parametersubstitute wordsubstitute word
If parameter is unset or null, the expansion of word shall be substituted;
- sh.wordexp.parameter.02.02
${parameter:-word}substitute parametersubstitute wordsubstitute word
otherwise, the value of parameter shall be substituted.
- sh.wordexp.parameter.03.01
${parameter:=word}substitute parameterassign wordassign word
If parameter is unset or null, the expansion of word shall be assigned to parameter.
In all cases, the final value of parameter shall be substituted.
- sh.wordexp.parameter.03.02
${parameter:=word}substitute parameterassign wordassign word
- sh.wordexp.parameter.04.01
${parameter:?word}substitute parametererror, exiterror, exit
If parameter is unset or null, the expansion of word (or a message indicating it is unset if word is omitted) shall be written to standard error and the shell exits with a non-zero exit status.
- sh.wordexp.parameter.04.02
${parameter:?word}substitute parametererror, exiterror, exit
Otherwise, the value of parameter shall be substituted. An interactive shell need not exit.
- sh.wordexp.parameter.05.01
${parameter:+word}substitute wordsubstitute nullsubstitute null
If parameter is unset or null, null shall be substituted;
otherwise, the expansion of word shall be substituted.
- sh.wordexp.parameter.05.02
${parameter:+word}substitute wordsubstitute nullsubstitute null
- sh.wordexp.parameter.06.01
${parameter-word}substitute parametersubstitute nullsubstitute word
- sh.wordexp.parameter.06.02
${parameter-word}substitute parametersubstitute nullsubstitute word
- sh.wordexp.parameter.07.01
${parameter=word}substitute parametersubstitute nullassign word
- sh.wordexp.parameter.07.02
${parameter=word}substitute parametersubstitute nullassign word
- sh.wordexp.parameter.08.01
${parameter?word}substitute parametersubstitute nullerror, exit
- sh.wordexp.parameter.08.02
${parameter?word}substitute parametersubstitute nullerror, exit
- sh.wordexp.parameter.09.01
${parameter+word}substitute wordsubstitute wordsubstitute null
- sh.wordexp.parameter.09.02
${parameter+word}substitute wordsubstitute wordsubstitute null
- sh.wordexp.parameter.10
The length in characters of the value of parameter shall be substituted.
- sh.wordexp.parameter.11
${parameter%word} Remove Smallest Suffix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the smallest portion of the suffix matched by the pattern deleted.
- sh.wordexp.parameter.12
${parameter%%word} Remove Largest Suffix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the largest portion of the suffix matched by the pattern deleted.
- sh.wordexp.parameter.13
${parameter#word} Remove Smallest Prefix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the smallest portion of the prefix matched by the pattern deleted.
- sh.wordexp.parameter.14
${parameter##word} Remove Largest Prefix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the largest portion of the prefix matched by the pattern deleted.
- sh.wordexp.pathname.01
After field splitting, if set -f is not in effect, each field in the resulting command line shall be expanded using the algorithm described in Pattern Matching Notation , qualified by the rules in Patterns Used for Filename Expansion.
- sh.wordexp.quote.01
The quote characters: '\', '", and '' (backslash, single-quote, double-quote) that were present in the original word shall be removed unless they have themselves been quoted.
- sh.wordexp.tilde.01
If the login name is null (that is, the tilde-prefix contains only the tilde), the tilde-prefix is replaced by the value of the variable HOME .
- sh.wordexp.tilde.02
Otherwise, the tilde-prefix shall be replaced by a pathname of the initial working directory associated with the login name obtained using the getpwnam() function as defined in the System Interfaces volume of IEEE Std 1003.1-2001.
- [+]sigsetjmp (3 / 0 / 0)
- sigsetjmp.01
A call to setjmp() shall save the calling environment in its env argument for later use by longjmp().
References to setjmp() are equivalent to sigsetjmp().References to longjmp() are equivalent to siglongjmp().
- app.sigsetjmp.02
An application shall ensure that an invocation of setjmp() appears in one of the following contexts only:
- app.sigsetjmp.02.01
The entire controlling expression of a selection or iteration statement
- app.sigsetjmp.02.02
One operand of a relational or equality operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- app.sigsetjmp.02.03
The operand of a unary '!' operator with the resulting expression being the entire controlling expression of a selection or iteration
- app.sigsetjmp.02.04
The entire expression of an expression statement (possibly cast to void)
- sigsetjmp.04
If the return is from a successful direct invocation, sigsetjmp() shall return 0. If the return is from a call to siglongjmp(), sigsetjmp() shall return a non-zero value.
- sigsetjmp.07
The sigsetjmp() function shall be equivalent to the setjmp() function, except as follows:
- sigsetjmp.07.01
If the value of the savemask argument is not 0, sigsetjmp() shall also save the current signal mask of the calling thread as part of the calling environment.
- [+]socket_netdb (1 / 0 / 0)
- socket_netdb.01
This information is considered to be stored in a database that can be accessed sequentially or randomly. The implementation of this database is unspecified.
This information is considered to be stored in a database that can be accessed sequentially or randomly. Implementation of this database is unspecified.
- [+]sockio (39 / 3 / 0)
- sockio.01
Socket ioctl() commands are a subset of the ioctl() calls, which can perform a variety of functions on sockets.
Generalizes:
- sockio.02
- sockio.03
- sockio.04.01.01
- sockio.04.01.02
- sockio.04.01.03
- sockio.04.01.04
- sockio.04.01.05
- sockio.04.01.06
- sockio.04.02.01
- sockio.04.02.02
- sockio.04.02.03
- sockio.04.02.04
- sockio.04.03.01
- sockio.04.03.02
- sockio.04.03.03
- sockio.04.03.04
- sockio.04.04.01
- sockio.04.04.02
- sockio.04.04.03
- sockio.04.04.04
- sockio.04.05.01
- sockio.04.05.02
- sockio.04.05.03
- sockio.04.05.04
- sockio.04.06.01
- sockio.04.06.02
- sockio.04.06.03
- sockio.04.06.04
- sockio.04.07.01
- sockio.04.07.02
- sockio.05.01
- sockio.05.02
- sockio.05.03
- sockio.06.01
- sockio.06.02
- sockio.06.03
- sockio.06.04
- sockio.06.05
- sockio.02
sockfd shall be an open file descriptor referring to a socket
- sockio.03
Socket ioctl() commands apply to the underlying network interfaces, and affect the entire system, not just the file descriptor used to issue the ioctl().
- sockio.04
The following values for request are accepted:
- sockio.04.01
SIOCGIFCONF (Deprecated)
- sockio.04.01.01
Get the interface configuration list for the system.
- sockio.04.01.02
argp shall point to a ifconf structure, as described in <net/if.h>.
- sockio.04.01.03
Before calling, the caller shall set the ifc_ifcu.ifcu_req field to point to an array of ifreq structures, and set ifc_len to the size in bytes of this allocated array.
- sockio.04.01.04
Upon return, ifc_len will contain the size in bytes of the array which was actually used.
- sockio.04.01.05
If it is the same as the length upon calling, the caller should assume that the array was too small and try again with a larger array.
- sockio.04.01.06
On success, SIOCGIFCONF shall return a nonnegative value.
- sockio.04.02
SIOCGIFFLAGS
- sockio.04.02.01
Get the interface flags for the indicated interface.
- sockio.04.02.02
argp shall point to a ifreq structure.
- sockio.04.02.03
Before calling, the caller should fill in the ifr_name field with the interface name,
- sockio.04.02.04
and upon return, the ifr_ifru.ifru_flags field is set with the interface flags.
- sockio.04.03
SIOCGIFADDR
- sockio.04.03.01
Get the interface address for the given interface.
- sockio.04.03.02
argp shall point to a ifreq structure.
- sockio.04.03.03
Before calling, the caller should fill in the ifr_name field with the interface name,
- sockio.04.03.04
and upon return, the ifr_ifru.ifru_addr field is set with the interface address.
- sockio.04.04
SIOCGIFBRDADDR
- sockio.04.04.01
Get the interface broadcast address for the given interface.
- sockio.04.04.02
argp shall point to a ifreq structure.
- sockio.04.04.03
Before calling, the caller should fill in the ifr_name field with the interface name,
- sockio.04.04.04
and upon return, the ifr_ifru.ifru_broadcast field is set with the interface broadcast address.
- sockio.04.05
SIOCGIFNETMASK
- sockio.04.05.01
Get the network mask for the given interface.
- sockio.04.05.02
argp shall point to a ifreq structure.
- sockio.04.05.03
Before calling, the caller should fill in the ifr_name field with the interface name,
- sockio.04.05.04
and upon return, the ifr_ifru.ifru_netmask field is set with the network mask.
- sockio.04.06
SIOCGIFMTU
- sockio.04.06.01
Get the Maximum Transmission Unit (MTU) size for the given interface.
- sockio.04.06.02
argp shall point to a ifreq structure.
- sockio.04.06.03
Before calling, the caller should fill in the ifr_name field with the interface name,
- sockio.04.06.04
and upon return, the ifr_ifru.ifru_mtu field is set with the MTU.
- sockio.04.07
FIONREAD
- sockio.04.07.01
Get the amount of queued unread data in the receive buffer.
- sockio.04.07.02
argp shall point to an integer where the result is to be placed.
- sockio.05.01
On success, if request is SIOCGIFCONF, a non-negative integer shall be returned.
- sockio.05.02
If request is not SIOCGIFCONF, on success 0 is returned.
- sockio.05.03
On error, -1 is returned and the global variable errno is set appropriately.
- sockio.06.01
[EBADF] sockfd is not a valid descriptor.
- sockio.06.02
[EFAULT] argp references an inaccessible memory area.
- sockio.06.03
[ENOTTY] The specified request does not apply to the kind of object that the descriptor sockfd references.
- sockio.06.04
[EINVAL] Either request or argp is invalid.
- sockio.06.05
[ENOTCONN] The operation is only defined on a connected socket, but the socket wasn't connected.
- [+]special (14 / 0 / 0)
- special.01
In functions that do not move the cursor based on the information placed in the window, these special characters would only be used within a string in order to affect the placement of subsequent characters; the cursor movement specified below does not persist in the visible cursor beyond the end of the operation.
- special.02
In functions that do move the cursor, these special characters can be used to affect the placement of subsequent characters and to achieve movement of the visible cursor.
- special.03
<backspace>
- special.03.01
Unless the cursor was already in column 0, <backspace> moves the cursor one column toward the start of the current line and any characters after the <backspace> are added or inserted starting there.
- special.04
<carriage return>
- special.04.01
Unless the cursor was already in column 0, <carriage return> moves the cursor to the start of the current line. Any characters after the <carriage return> are added or inserted starting there.
- special.05
<newline>
- special.05.01
In an add operation, Curses adds the background character into successive columns until reaching the end of the line.
- special.05.02
Scrolling occurs as described in Truncation, Wrapping and Scrolling .
- special.05.03
Any characters after the <newline> character are added, starting at the start of the new line.
- special.05.04
In an insert operation, <newline> erases the remainder of the current line with the background character, effectively a wclrtoeol(), and moves the cursor to the start of a new line.
- special.05.05
When scrolling is enabled, advancing the cursor to a new line may cause scrolling as described in Truncation, Wrapping and Scrolling .
- special.05.06
Any characters after the <newline> character are inserted at the start of the new line.
- special.06
<tab>
- special.06.01
Tab characters in text move subsequent characters to the next horizontal tab stop.
- special.06.02
By default, tab stops are in column 0, 8, 16, and so on.
- special.06.03
In an insert or add operation, Curses inserts or adds, respectively, the background character into successive columns until reaching the next tab stop
- special.06.04
If there are no more tab stops in the current line, wrapping and scrolling occur as described in Truncation, Wrapping and Scrolling .
- [+]sys_siglist (1 / 0 / 0)
- sys_siglist.01
The array sys_siglist holds the signal description strings indexed by signal number
The array sys_siglist holds the signal description strings indexed by signal number.
- app.sys_siglist.02
This array should not be accessed directly by applications
- [+]term_attrs (2 / 0 / 0)
- term_attrs.01
The term_attrs() function extracts information for the video attributes of the current terminal which is supported for a cchar_t
- term_attrs.02
The term_attrs() function returns a logical OR of WA_ values of all video attributes supported by the terminal.
- [+]ttyio_TIOCGWINSZ (6 / 3 / 0)
- ttyio_TIOCGWINSZ.01
Get the size attributes of the terminal or pseudo-terminal identified by fd.
- ttyio_TIOCGWINSZ.01.01
On return, the structure will have ws_row set to the number of rows of text (i.e. lines of text) that can be viewed on the device,
- ttyio_TIOCGWINSZ.01.02
and ws_col set to the number of columns (i.e. text width).
- app.ttyio_TIOCGWINSZ.01
On entry, argp shall reference a winsize structure.
- ttyio_TIOCGWINSZ.02
On success, 0 is returned.
- ttyio_TIOCGWINSZ.03
On error, -1 is returned and the global variable errno is set appropriately.
- ttyio_TIOCGWINSZ.03.01
[EBADF] fd is not a valid descriptor.
- ttyio_TIOCGWINSZ.03.02
[EFAULT] argp references an inaccessible memory area.
- ttyio_TIOCGWINSZ.03.03
[EINVAL] request and argp are not valid.
- [+]unget_wch (3 / 0 / 0)
- unget_wch.01
The unget_wch() function pushes the wide character wch onto the head of the input queue.
- app.unget_wch.02
One character of push-back is guaranteed. The result of successive calls without an intervening call to getch() or get_wch() are unspecified.
- unget_wch.03.01
Upon successful completion, these functions return OK.
- unget_wch.03.02
Otherwise, they return ERR.
- [+]unistd (85 / 75 / 0)
- unistd.01
_POSIX_ADVISORY_INFO [ADV]
The implementation supports the Advisory Information option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.02
_POSIX_ASYNCHRONOUS_IO [AIO]
The implementation supports the Asynchronous Input and Output option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.03
_POSIX_BARRIERS [BAR]
The implementation supports the Barriers option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.04
_POSIX_CHOWN_RESTRICTED The use of chown() and fchown() is restricted to a process with appropriate privileges, and to changing the group ID of a file only to the effective group ID of the process or to one of its supplementary group IDs. This symbol shall either be undefined or defined with a value other than -1.
- unistd.05
_POSIX_CLOCK_SELECTION [CS]
The implementation supports the Clock Selection option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.06
_POSIX_CPUTIME [CPT]
The implementation supports the Process CPU-Time Clocks option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.07
_POSIX_FSYNC [FSC]
The implementation supports the File Synchronization option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.08
_POSIX_IPV6 The implementation supports the IPv6 option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.09
_POSIX_JOB_CONTROL The implementation supports job control. This symbol shall always be set to a value greater than zero.
- unistd.10
_POSIX_MAPPED_FILES [MF]
The implementation supports the Memory Mapped Files option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.11
_POSIX_MEMLOCK [ML]
The implementation supports the Process Memory Locking option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.12
_POSIX_MEMLOCK_RANGE [MR]
The implementation supports the Range Memory Locking option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.13
_POSIX_MEMORY_PROTECTION [MPR]
The implementation supports the Memory Protection option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.14
_POSIX_MESSAGE_PASSING [MSG]
The implementation supports the Message Passing option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.15
_POSIX_MONOTONIC_CLOCK [MON]
The implementation supports the Monotonic Clock option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.16
_POSIX_NO_TRUNC Pathname components longer than {NAME_MAX} generate an error. This symbol shall either be undefined or defined with a value other than -1.
- unistd.17
_POSIX_PRIORITIZED_IO [PIO]
The implementation supports the Prioritized Input and Output option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.18
_POSIX_PRIORITY_SCHEDULING [PS]
The implementation supports the Process Scheduling option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.19
_POSIX_RAW_SOCKETS [RS]
The implementation supports the Raw Sockets option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.20
_POSIX_READER_WRITER_LOCKS [THR]
The implementation supports the Read-Write Locks option. This is always set to a value greater than zero if the Threads option is supported. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.21
_POSIX_REALTIME_SIGNALS [RTS]
The implementation supports the Realtime Signals Extension option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.22
_POSIX_REGEXP The implementation supports the Regular Expression Handling option. This symbol shall always be set to a value greater than zero.
- unistd.23
_POSIX_SAVED_IDS Each process has a saved set-user-ID and a saved set-group-ID. This symbol shall always be set to a value greater than zero.
- unistd.24
_POSIX_SEMAPHORES [SEM]
The implementation supports the Semaphores option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.25
_POSIX_SHARED_MEMORY_OBJECTS [SHM]
The implementation supports the Shared Memory Objects option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.26
_POSIX_SHELL The implementation supports the POSIX shell. This symbol shall always be set to a value greater than zero.
- unistd.27
_POSIX_SPAWN [SPN]
The implementation supports the Spawn option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.28
_POSIX_SPIN_LOCKS [SPI]
The implementation supports the Spin Locks option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.29
_POSIX_SPORADIC_SERVER [SS]
The implementation supports the Process Sporadic Server option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.30
_POSIX_SYNCHRONIZED_IO [SIO]
The implementation supports the Synchronized Input and Output option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.31
_POSIX_THREAD_ATTR_STACKADDR [TSA]
The implementation supports the Thread Stack Address Attribute option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.32
_POSIX_THREAD_ATTR_STACKSIZE [TSS]
The implementation supports the Thread Stack Size Attribute option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.33
_POSIX_THREAD_CPUTIME [TCT]
The implementation supports the Thread CPU-Time Clocks option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.34
_POSIX_THREAD_PRIO_INHERIT [TPI]
The implementation supports the Thread Priority Inheritance option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.35
_POSIX_THREAD_PRIO_PROTECT [TPP]
The implementation supports the Thread Priority Protection option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.36
_POSIX_THREAD_PRIORITY_SCHEDULING [TPS]
The implementation supports the Thread Execution Scheduling option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.37
_POSIX_THREAD_PROCESS_SHARED [TSH]
The implementation supports the Thread Process-Shared Synchronization option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.38
_POSIX_THREAD_SAFE_FUNCTIONS [TSF]
The implementation supports the Thread-Safe Functions option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.39
_POSIX_THREAD_SPORADIC_SERVER [TSP]
The implementation supports the Thread Sporadic Server option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.40
_POSIX_THREADS [THR]
The implementation supports the Threads option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.41
_POSIX_TIMEOUTS [TMO]
The implementation supports the Timeouts option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.42
_POSIX_TIMERS [TMR]
The implementation supports the Timers option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.43
_POSIX_TRACE [TRC]
The implementation supports the Trace option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.44
_POSIX_TRACE_EVENT_FILTER [TEF]
The implementation supports the Trace Event Filter option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.45
_POSIX_TRACE_INHERIT [TRI]
The implementation supports the Trace Inherit option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.46
_POSIX_TRACE_LOG [TRL]
The implementation supports the Trace Log option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.47
_POSIX_TYPED_MEMORY_OBJECTS [TYM]
The implementation supports the Typed Memory Objects option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.48
_POSIX_VDISABLE This symbol shall be defined to be the value of a character that shall disable terminal special character handling as described in <termios.h>. This symbol shall always be set to a value other than -1.
- unistd.49
_POSIX2_C_BIND The implementation supports the C-Language Binding option. This symbol shall always have the value 200112L.
- unistd.50
_POSIX2_C_DEV [CD]
The implementation supports the C-Language Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.51
_POSIX2_CHAR_TERM The implementation supports at least one terminal type.
- unistd.52
_POSIX2_FORT_DEV [FD]
The implementation supports the FORTRAN Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.53
_POSIX2_FORT_RUN [FR]
The implementation supports the FORTRAN Runtime Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.54
_POSIX2_LOCALEDEF The implementation supports the creation of locales by the localedef utility. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.55
_POSIX2_PBS [BE]
The implementation supports the Batch Environment Services and Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.56
_POSIX2_PBS_ACCOUNTING [BE]
The implementation supports the Batch Accounting option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.57
_POSIX2_PBS_CHECKPOINT [BE]
The implementation supports the Batch Checkpoint/Restart option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.58
_POSIX2_PBS_LOCATE [BE]
The implementation supports the Locate Batch Job Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.59
_POSIX2_PBS_MESSAGE [BE]
The implementation supports the Batch Job Message Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.60
_POSIX2_PBS_TRACK [BE]
The implementation supports the Track Batch Job Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.61
_POSIX2_SW_DEV [SD]
The implementation supports the Software Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.62
_POSIX2_UPE [UP]
The implementation supports the User Portability Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L.
- unistd.63
_POSIX_V6_ILP32_OFF32 The implementation provides a C-language compilation environment with 32-bit int, long, pointer, and off_t types.
- unistd.64
_POSIX_V6_ILP32_OFFBIG The 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.
- unistd.65
_POSIX_V6_LP64_OFF64 The implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer, and off_t types.
- unistd.66
_POSIX_V6_LPBIG_OFFBIG The 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.
- unistd.67
_XBS5_ILP32_OFF32 (LEGACY) [XSI]
The implementation provides a C-language compilation environment with 32-bit int, long, pointer, and off_t types.
- unistd.68
_XBS5_ILP32_OFFBIG (LEGACY) [XSI]
The 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.
- unistd.69
_XBS5_LP64_OFF64 (LEGACY) [XSI]
The implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer, and off_t types.
- unistd.70
_XBS5_LPBIG_OFFBIG (LEGACY) [XSI]
The 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.
- unistd.71
_XOPEN_CRYPT [XSI]
The implementation supports the X/Open Encryption Option Group.
- unistd.72
_XOPEN_ENH_I18N The implementation supports the Issue 4, Version 2 Enhanced Internationalization Option Group. This symbol shall always be set to a value other than -1.
- unistd.73
_XOPEN_LEGACY The implementation supports the Legacy Option Group.
- unistd.74
_XOPEN_REALTIME The implementation supports the X/Open Realtime Option Group.
- unistd.75
_XOPEN_REALTIME_THREADS The implementation supports the X/Open Realtime Threads Option Group.
- unistd.76
_XOPEN_SHM The implementation supports the Issue 4, Version 2 Shared Memory Option Group. This symbol shall always be set to a value other than -1.
- unistd.77
_XOPEN_STREAMS The implementation supports the XSI STREAMS Option Group.
- unistd.78
_XOPEN_UNIX [XSI]
The implementation supports the XSI extension.
- unistd.79
_POSIX_ASYNC_IO Asynchronous input or output operations may be performed for the associated file.
- unistd.80
_POSIX_PRIO_IO Prioritized input or output operations may be performed for the associated file.
- unistd.81
_POSIX_SYNC_IO Synchronized input or output operations may be performed for the associated file.
- unistd.82
_XOPEN_VERSION [XSI]
Integer value indicating version of the X/Open Portability Guide to which the implementation conforms. The value shall be 600.
- unistd.83
_POSIX_VERSION Integer value indicating version of IEEE Std 1003.1 (C-language binding) to which the implementation conforms. For implementations conforming to IEEE Std 1003.1-2001, the value shall be 200112L.
- unistd.84
_POSIX2_VERSION Integer value indicating version of the Shell and Utilities volume of IEEE Std 1003.1 to which the implementation conforms. For implementations conforming to IEEE Std 1003.1-2001, the value shall be 200112L.
- unistd.85
The two constants _SC_PAGESIZE and _SC_PAGE_SIZE may be defined to have the same value.
- [+]unlocked (3 / 0 / 0)
- unlocked.01
Versions of the functions getc(), getchar(), putc(), and putchar() respectively named getc_unlocked(), getchar_unlocked(), putc_unlocked(), and putchar_unlocked() shall be provided which are functionally equivalent to the original versions, with the exception that they are not required to be implemented in a thread-safe manner.
- unlocked.02
They may only safely be used within a scope protected by flockfile() (or ftrylockfile()) and funlockfile().
- unlocked.03
These functions may safely be used in a multi-threaded program if and only if they are called while the invoking thread owns the ( FILE *) object, as is the case after a successful call to the flockfile() or ftrylockfile() functions.
- [+]usernames (1 / 1 / 0)
- usernames.01
21.2. User & Group NamesTable 21-1 describes required mnemonic user and group names. This specification makes no attempt to numerically assign user or group identity numbers, with the exception that both the User ID and Group ID for the user root shall be equal to 0.Table 21-1. Required User & Group NamesUserGroupCommentsrootrootAdministrative user with all appropriate privilegesbinbinLegacy User ID/Group ID[a]daemondaemonLegacy User ID/Group ID[b]Notes:
a. The bin User ID/Group ID is included for compatibility with legacy applications. New applications should no longer use the bin User ID/Group ID.
b. The daemon User ID/Group ID was used as an unprivileged User ID/Group ID for daemons to execute under in order to limit their access to the system. Generally daemons should now run under individual User ID/Group IDs in order to further partition daemons from one another.
- [+]utmpx (9 / 0 / 0)
- utmpx.01
For all entries that match a request, the ut_type member indicates the type of the entry.
- utmpx.02
Other members of the entry shall contain meaningful data based on the value of the ut_type member as follows:
- utmpx.02.01
No others
- utmpx.02.02
ut_tv
- utmpx.02.03
ut_tv
- utmpx.02.04
ut_tv
- utmpx.02.05
ut_id, ut_user (login name of the user), ut_line, ut_pid, ut_tv
- utmpx.02.06
ut_id, ut_pid, ut_tv
- utmpx.02.07
ut_id, ut_user (implementation-defined name of the login process), ut_pid, ut_tv
- utmpx.02.08
ut_id, ut_pid, ut_tv
- [+]vid_attr (5 / 0 / 0)
- vid_attr.01
These functions output commands to the terminal that change the terminal's attributes.
Generalizes:
- vid_attr.02
- vid_attr.03
- vid_attr.06.01
- vid_attr.06.02
- vid_attr.02
The vid_attr() and vid_puts() functions correspond to vidattr() and vidputs() respectively, but take a set of arguments, one of type attr_t for the attributes, short for the colour pair number and a void *, and thus support the attribute constants with the WA_ prefix.
- vid_attr.03
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- vid_attr.06.01
Upon successful completion, these functions return OK.
- vid_attr.06.02
Otherwise, they return ERR.
- [+]vid_puts (5 / 0 / 0)
- vid_puts.01
These functions output commands to the terminal that change the terminal's attributes.
Generalizes:
- vid_puts.02
- vid_puts.03
- vid_puts.04
- vid_puts.05
- vid_puts.06.01
- vid_puts.06.02
- vid_puts.02
The vid_attr() and vid_puts() functions correspond to vidattr() and vidputs() respectively, but take a set of arguments, one of type attr_t for the attributes, short for the colour pair number and a void *, and thus support the attribute constants with the WA_ prefix.
- vid_puts.03
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- vid_puts.04 (struct)
The user-supplied function putfunc (which can be specified as an argument to either vidputs() or vid_puts()) is either putchar() or some other function with the same prototype.
- vid_puts.05 (struct)
Both the vidputs() and the vid_puts() function ignore the return value of putfunc.
- vid_puts.06.01
Upon successful completion, these functions return OK.
- vid_puts.06.02
Otherwise, they return ERR.
- [+]fs.dir (107 / 40 / 0)
- [+]closedir (6 / 3 / 0)
- closedir.01
The closedir() function shall close the directory stream referred to by the argument dirp. Upon return, the value of dirp may no longer point to an accessible object of the type DIR.
- closedir.03
If a file descriptor is used to implement type DIR, that file descriptor shall be closed.
- closedir.04
Upon successful completion, closedir() shall return 0;
- closedir.05
otherwise, -1 shall be returned and errno set to indicate the error.
- closedir.90
The closedir() function may fail if:
- closedir.90.01
[EBADF] The dirp argument does not refer to an open directory stream.
- closedir.90.02
[EINTR] The closedir() function was interrupted by a signal.
- [+]mkdir (22 / 10 / 0)
- mkdir.01
The mkdir() function shall create a new directory with name path.
- mkdir.02
The file permission bits of the new directory shall be initialized from mode.
- mkdir.03
These file permission bits of the mode argument shall be modified by the process' file creation mask
- mkdir.04
The directory's user ID shall be set to the process' effective user ID
- mkdir.05
The directory's group ID shall be set to the group ID of the parent directory or to the effective group ID of the process. Implementations shall provide a way to initialize the directory's group ID to the group ID of the parent directory. Implementations may, but need not, provide an implementation-defined way to initialize the directory's group ID to the effective group ID of the calling process.
- mkdir.06
The newly created directory shall be an empty directory.
- mkdir.07
If path names a symbolic link, mkdir() shall fail and set errno to [EEXIST].
- mkdir.08
Upon successful completion, mkdir() shall mark for update the st_atime, st_ctime, and st_mtime fields of the directory.
- mkdir.09
Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update.
- mkdir.10
Upon successful completion, mkdir() shall return 0.
- mkdir.11
Otherwise, -1 shall be returned, no directory shall be created, and errno shall be set to indicate the error
- mkdir.12
The mkdir() function shall fail if:
- mkdir.12.01
[EACCES] Search permission is denied on a component of the path prefix, or write permission is denied on the parent directory of the directory to be created.
- mkdir.12.02
[EEXIST] The named file exists.
- mkdir.12.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- mkdir.12.04
[EMLINK] The link count of the parent directory would exceed {LINK_MAX}.
- mkdir.12.05
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- mkdir.12.06
[ENOENT] A component of the path prefix specified by path does not name an existing directory or path is an empty string.
- mkdir.12.07
[ENOSPC] The file system does not contain enough space to hold the contents of the new directory or to extend the parent directory of the new directory.
- mkdir.12.08
[ENOTDIR] A component of the path prefix is not a directory.
- mkdir.12.09
[EROFS] The parent directory resides on a read-only file system.
- mkdir.13
The mkdir() function may fail if:
- mkdir.13.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- mkdir.13.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]opendir (13 / 4 / 0)
- app.opendir.01
The opendir() function shall open a directory stream corresponding to the directory named by the dirname argument.
- opendir.02
The directory stream is positioned at the first entry.
- opendir.03
If the type DIR is implemented using a file descriptor, applications shall only be able to open up to a total of {OPEN_MAX} files and directories.
- opendir.04
Upon successful completion, opendir() shall return a pointer to an object of type DIR.
- opendir.05
Otherwise, a null pointer shall be returned and errno set to indicate the error.
- opendir.06
The opendir() function shall fail if:
- opendir.06.01
[EACCES] Search permission is denied for the component of the path prefix of dirname or read permission is denied for dirname.
- opendir.06.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the dirname argument.
- opendir.06.03
[ENAMETOOLONG] The length of the dirname argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- opendir.06.04
[ENOENT] A component of dirname does not name an existing directory or dirname is an empty string.
- opendir.06.05
[ENOTDIR] A component of dirname is not a directory.
- opendir.07
The opendir() function may fail if:
- opendir.07.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the dirname argument.
- opendir.07.02
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- opendir.07.03
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the dirname argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- opendir.07.04
[ENFILE] Too many files are currently open in the system.
- [+]readdir (12 / 6 / 0)
- readdir.01
The readdir() function shall return a pointer to a structure representing the directory entry at the current position in the directory stream specified by the argument dirp, and position the directory stream at the next entry.
- readdir.01.01
Upon successful completion, readdir() shall return a pointer to an object of type struct dirent
- readdir.02
It shall return a null pointer upon reaching the end of the directory stream.
- readdir.02.01
When the end of the directory is encountered, a null pointer shall be returned and errno is not changed
- readdir.03
The readdir() function shall not return directory entries containing empty names
- readdir.04
If entries for dot or dot-dot exist, one entry shall be returned for dot and one entry shall be returned for dot-dot; otherwise, they shall not be returned
- app.readdir.05
The pointer returned by readdir() points to data which may be overwritten by another call to readdir() on the same directory stream.
- app.readdir.06
This data is not overwritten by another call to readdir() on a different directory stream.
- readdir.07
If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified.
- readdir.08
The readdir() function may buffer several directory entries per actual read operation;
- readdir.09
readdir() shall mark for update the st_atime field of the directory each time the directory is actually read.
- app.readdir.10
After a call to fork(), either the parent or child (but not both) may continue processing the directory stream using readdir(), rewinddir(), [XSI] or seekdir().
- app.readdir.11
If both the parent and child processes use these functions, the result is undefined.
- readdir.12
If the entry names a symbolic link, the value of the d_ino member is unspecified
- app.readdir.13
The readdir() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- readdir.16
Applications wishing to check for error situations should set errno to 0 before calling readdir(). If errno is set to non-zero on return, an error occurred.
- readdir.16.01
When an error is encountered, a null pointer shall be returned and errno shall be set to indicate the error.
- readdir.90
The readdir() function shall fail if:
- readdir.90.01
[EOVERFLOW] One of the values in the structure to be returned cannot be represented correctly.
- readdir.91
The readdir() function may fail if:
- readdir.91.01
[EBADF] The dirp argument does not refer to an open directory stream.
- readdir.91.02
[ENOENT] The current position of the directory stream is invalid.
- [+]readdir64 (17 / 5 / 0)
- readdir64.readdir.01
The readdir() function shall return a pointer to a structure representing the directory entry at the current position in the directory stream specified by the argument dirp, and position the directory stream at the next entry.
- readdir64.readdir.01.01
Upon successful completion, readdir() shall return a pointer to an object of type struct dirent
- readdir64.readdir.02
It shall return a null pointer upon reaching the end of the directory stream.
- readdir64.readdir.02.01
When the end of the directory is encountered, a null pointer shall be returned and errno is not changed
- readdir64.readdir.03
The readdir() function shall not return directory entries containing empty names
- readdir64.readdir.04
If entries for dot or dot-dot exist, one entry shall be returned for dot and one entry shall be returned for dot-dot; otherwise, they shall not be returned
- readdir64.readdir.05
The pointer returned by readdir() points to data which may be overwritten by another call to readdir() on the same directory stream.
- readdir64.readdir.06
This data is not overwritten by another call to readdir() on a different directory stream.
- readdir64.readdir.07
If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified.
- readdir64.readdir.08
The readdir() function may buffer several directory entries per actual read operation;
- readdir64.readdir.09
readdir() shall mark for update the st_atime field of the directory each time the directory is actually read.
- readdir64.readdir.10
After a call to fork(), either the parent or child (but not both) may continue processing the directory stream using readdir(), rewinddir(), [XSI] or seekdir().
- readdir64.readdir.11
If both the parent and child processes use these functions, the result is undefined.
- readdir64.readdir.12
If the entry names a symbolic link, the value of the d_ino member is unspecified
- readdir64.readdir.13
The readdir() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- readdir64.readdir.16
Applications wishing to check for error situations should set errno to 0 before calling readdir(). If errno is set to non-zero on return, an error occurred.
- readdir64.readdir.16.01
When an error is encountered, a null pointer shall be returned and errno shall be set to indicate the error.
- readdir64.readdir.90
The readdir() function shall fail if:
- readdir64.readdir.90.01
[EOVERFLOW] One of the values in the structure to be returned cannot be represented correctly.
- readdir64.readdir.91
The readdir() function may fail if:
- readdir64.readdir.91.01
[EBADF] The dirp argument does not refer to an open directory stream.
- readdir64.readdir.91.02
[ENOENT] The current position of the directory stream is invalid.
- [+]readdir_r (9 / 5 / 0)
- readdir_r.01
The readdir_r() function shall initialize the dirent structure referenced by entry to represent the directory entry at the current position in the directory stream referred to by dirp, store a pointer to this structure at the location referenced by result, and position the directory stream at the next entry.
- readdir_r.02
The storage pointed to by entry shall be large enough for a dirent with an array of char d_name members containing at least {NAME_MAX}+1 elements.
- readdir_r.03
Upon successful return, the pointer returned at *result shall have the same value as the argument entry.
- readdir_r.04
Upon reaching the end of the directory stream, this pointer shall have the value NULL.
- readdir_r.05
The readdir_r() function shall not return directory entries containing empty names
- readdir_r.06
If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir_r() returns an entry for that file is unspecified.
- readdir_r.07
The readdir_r() function may buffer several directory entries per actual read operation; the readdir_r() function shall mark for update the st_atime field of the directory each time the directory is actually read
- readdir_r.09
If successful, the readdir_r() function shall return zero; otherwise, an error number shall be returned to indicate the error.
- readdir_r.91
The readdir_r() function may fail if:
- readdir_r.91.01
[EBADF] The dirp argument does not refer to an open directory stream.
- [+]rewinddir (2 / 1 / 0)
- rewinddir.01
The rewinddir() function shall reset the position of the directory stream to which dirp refers to the beginning of the directory.
- rewinddir.02
It shall also cause the directory stream to refer to the current state of the corresponding directory, as a call to opendir() would have done.
- app.rewinddir.03
If dirp does not refer to a directory stream, the effect is undefined
- app.rewinddir.04
After a call to the fork() function, either the parent or child (but not both) may continue processing the directory stream using readdir(), rewinddir(), or [XSI] seekdir().
- app.rewinddir.05
If both the parent and child processes use these functions, the result is undefined.
- [+]rmdir (23 / 5 / 0)
- rmdir.01
The rmdir() function shall remove a directory whose name is given by path. The directory shall be removed only if it is an empty directory.
- rmdir.02
If path names a symbolic link, then rmdir() shall fail and set errno to [ENOTDIR].
- rmdir.03
If the path argument refers to a path whose final component is either dot or dot-dot, rmdir() shall fail.
- rmdir.04
If the directory's link count becomes 0 and no process has the directory open, the space occupied by the directory shall be freed and the directory shall no longer be accessible.
- rmdir.05
If one or more processes have the directory open when the last link is removed, the dot and dot-dot entries, if present, shall be removed before rmdir() returns and no new entries may be created in the directory, but the directory shall not be removed until all references to the directory are closed
- rmdir.06
Upon successful completion, the rmdir() function shall mark for update the st_ctime and st_mtime fields of the parent directory.
- rmdir.07
Upon successful completion, the function rmdir() shall return 0.
- rmdir.08
Otherwise, -1 shall be returned, and errno set to indicate the error. If -1 is returned, the named directory shall not be changed.
- rmdir.10
If the directory is the root directory or the current working directory of any process, it is unspecified whether the function succeeds, or whether it shall fail and set errno to [EBUSY].
- rmdir.11
If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY].
- rmdir.90
The rmdir() function shall fail if
- rmdir.90.01
[EACCES] Search permission is denied on a component of the path prefix, or write permission is denied on the parent directory of the directory to be removed.
- rmdir.90.02
[EBUSY] The directory to be removed is currently in use by the system or some process and the implementation considers this to be an error.
- rmdir.90.03
[EEXIST] or [ENOTEMPTY] The path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.
- rmdir.90.04
[EINVAL] The path argument contains a last component that is dot.
- rmdir.90.05
[EIO] A physical I/O error has occurred.
- rmdir.90.06
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- rmdir.90.07
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- rmdir.90.08
[ENOENT] A component of path does not name an existing file, or the path argument names a nonexistent directory or points to an empty string.
- rmdir.90.10
[ENOTDIR] A component of path is not a directory.
- rmdir.90.11
[EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the parent directory of the directory to be removed and the caller is not the owner of the directory to be removed, nor is the caller the owner of the parent directory, nor does the caller have the appropriate privileges.
- rmdir.90.12
[EROFS] The directory entry to be removed resides on a read-only file system.
- rmdir.91
The rmdir() function may fail if:
- rmdir.91.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- rmdir.91.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]seekdir (2 / 1 / 0)
- seekdir.01
The seekdir() function shall set the position of the next readdir() operation on the directory stream specified by dirp to the position specified by loc
- seekdir.02
The value of loc should have been returned from an earlier call to telldir()
- seekdir.02.01
If the value of loc was not obtained from an earlier call to telldir(), or if a call to rewinddir() occurred between the call to telldir() and the call to seekdir(), the results of subsequent calls to readdir() are unspecified
- [+]telldir (1 / 0 / 0)
- telldir.01
The telldir() function shall obtain the current location associated with the directory stream specified by dirp.
- telldir.01.01
Upon successful completion, telldir() shall return the current location of the specified directory stream.
- app.telldir.02
If the most recent operation on the directory stream was a seekdir(), the directory position returned from the telldir() shall be the same as that supplied as a loc argument for seekdir().
- [+]fs.fifo (20 / 7 / 0)
- [+]mkfifo (20 / 7 / 0)
- mkfifo.01
The mkfifo() function shall create a new FIFO special file named by the pathname pointed to by path.
Generalizes:
- mkfifo.02
- mkfifo.04
- mkfifo.05
- mkfifo.06
- mkfifo.07
- mkfifo.08
- mkfifo.09
- mkfifo.10
- mkfifo.11
- mkfifo.12.01
- mkfifo.12.02
- mkfifo.12.03
- mkfifo.12.04
- mkfifo.12.05
- mkfifo.12.06
- mkfifo.12.07
- mkfifo.12.08
- mkfifo.13.01
- mkfifo.13.02
- mkfifo.02
The file permission bits of the new FIFO shall be initialized from mode. The file permission bits of the mode argument shall be modified by the process' file creation mask.
- app.mkfifo.03 (struct)
When bits in mode other than the file permission bits are set, the effect is implementation-defined.
- mkfifo.04
If path names a symbolic link, mkfifo() shall fail and set errno to [EEXIST].
- mkfifo.05
The FIFO's user ID shall be set to the process' effective user ID.
- mkfifo.06
The FIFO's group ID shall be set to the group ID of the parent directory or to the effective group ID of the process.
- mkfifo.07
Implementations shall provide a way to initialize the FIFO's group ID to the group ID of the parent directory. Implementations may, but need not, provide an implementation-defined way to initialize the FIFO's group ID to the effective group ID of the calling process.
- mkfifo.08
Upon successful completion, mkfifo() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file.
- mkfifo.09
Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update.
- mkfifo.10
Upon successful completion, 0 shall be returned.
- mkfifo.11
Otherwise, -1 shall be returned, no FIFO shall be created, and errno shall be set to indicate the error.
- mkfifo.12
The mkfifo() function shall fail if:
- mkfifo.12.01
[EACCES] A component of the path prefix denies search permission, or write permission is denied on the parent directory of the FIFO to be created.
- mkfifo.12.02
[EEXIST] The named file already exists.
- mkfifo.12.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- mkfifo.12.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- mkfifo.12.05
[ENOENT] A component of the path prefix specified by path does not name an existing directory or path is an empty string.
- mkfifo.12.06
[ENOSPC] The directory that would contain the new file cannot be extended or the file system is out of file-allocation resources.
- mkfifo.12.07
[ENOTDIR] A component of the path prefix is not a directory.
- mkfifo.12.08
[EROFS] The named file resides on a read-only file system.
- mkfifo.13
The mkfifo() function may fail if:
- mkfifo.13.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- mkfifo.13.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]fs.fs (164 / 40 / 0)
- [+]__xmknod (23 / 7 / 0)
- __xmknod.01
The mknod() function shall create a new file named by the pathname to which the argument path points
The value of ver shall be 1 or the behavior of __xmknod() is undefined
- app.__xmknod.02
The file type for path is OR'ed into the mode argument, and the application shall select one of the following symbolic constants
- app.__xmknod.03
The only portable use of mknod() is to create a FIFO-special file. If mode is not S_IFIFO or dev is not 0, the behavior of mknod() is unspecified
- app.__xmknod.04
The permissions for the new file are OR'ed into the mode argument, and may be selected from any combination of the following symbolic constants
- __xmknod.05
The user ID of the file shall be initialized to the effective user ID of the process
- __xmknod.06
The group ID of the file shall be initialized to either the effective group ID of the process or the group ID of the parent directory. Implementations shall provide a way to initialize the file's group ID to the group ID of the parent directory. Implementations may, but need not, provide an implementation-defined way to initialize the file's group ID to the effective group ID of the calling process.
- __xmknod.07
The owner, group, and other permission bits of mode shall be modified by the file mode creation mask of the process. The mknod() function shall clear each bit whose corresponding bit in the file mode creation mask of the process is set.
- __xmknod.08
If path names a symbolic link, mknod() shall fail and set errno to [EEXIST]
- __xmknod.09
Upon successful completion, mknod() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file
- __xmknod.10
Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update
- __xmknod.11
Only a process with appropriate privileges may invoke mknod() for file types other than FIFO-special
- __xmknod.12
Upon successful completion, mknod() shall return 0
- __xmknod.13
Otherwise, it shall return -1, the new file shall not be created, and errno shall be set to indicate the error
- __xmknod.90
The mknod() function shall fail if:
- __xmknod.90.01
[EACCES] A component of the path prefix denies search permission, or write permission is denied on the parent directory.
- __xmknod.90.02
[EEXIST] The named file exists.
- __xmknod.90.03
[EINVAL] An invalid argument exists.
- __xmknod.90.04
[EIO] An I/O error occurred while accessing the file system.
- __xmknod.90.05
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- __xmknod.90.06
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- __xmknod.90.07
[ENOENT] A component of the path prefix specified by path does not name an existing directory or path is an empty string.
- __xmknod.90.08
[ENOSPC] The directory that would contain the new file cannot be extended or the file system is out of file allocation resources.
- __xmknod.90.09
[ENOTDIR] A component of the path prefix is not a directory.
- __xmknod.90.10
[EPERM] The invoking process does not have appropriate privileges and the file type is not FIFO-special.
- __xmknod.90.11
[EROFS] The directory in which the file is to be created is located on a read-only file system.
- __xmknod.91
The mknod() function may fail if:
- __xmknod.91.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- __xmknod.91.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- [+]link (24 / 8 / 0)
- link.01
The link() function shall create a new link (directory entry) for the existing file, path1.
- link.02
The link() function shall atomically create a new link for the existing file and the link count of the file shall be incremented by one
- link.03
If path1 names a directory, link() shall fail unless the process has appropriate privileges and the implementation supports using link() on directories
- link.04
Upon successful completion, link() shall mark for update the st_ctime field of the file
- link.05
Also, the st_ctime and st_mtime fields of the directory that contains the new entry shall be marked for update.
- link.06
If link() fails, no link shall be created and the link count of the file shall remain unchanged
- link.07
The implementation may require that the calling process has permission to access the existing file.
- link.08
Upon successful completion, 0 shall be returned.
- link.09
Otherwise, -1 shall be returned and errno set to indicate the error
- link.30
ISO POSIX (2003) specifies that pathname resolution shall follow symbolic links during pathname resolution unless the function is required to act on the symbolic link itself, or certain arguments direct that the function act on the symbolic link itself. The link() function in ISO POSIX (2003) contains no such requirement to operate on a symbolic link. However, a conforming LSB implementation need not follow a symbolic link for the path1 argument.
- link.90
The link() function shall fail if:
- link.90.01
[EACCES] A component of either path prefix denies search permission, or the requested link requires writing in a directory that denies write permission, or the calling process does not have permission to access the existing file and this is required by the implementation.
- link.90.02
[EEXIST] The path2 argument resolves to an existing file or refers to a symbolic link.
- link.90.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path1 or path2 argument.
- link.90.04
[EMLINK] The number of links to the file named by path1 would exceed {LINK_MAX}.
- link.90.05
[ENAMETOOLONG] The length of the path1 or path2 argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- link.90.06
[ENOENT] A component of either path prefix does not exist; the file named by path1 does not exist; or path1 or path2 points to an empty string.
- link.90.07
[ENOSPC] The directory to contain the link cannot be extended.
- link.90.08
[ENOTDIR] A component of either path prefix is not a directory.
- link.90.09
[EPERM] The file named by path1 is a directory and either the calling process does not have appropriate privileges or the implementation prohibits using link() on directories.
- link.90.10
[EROFS] The requested link requires writing in a directory on a read-only file system.
- link.90.11
[EXDEV] The link named by path2 and the file named by path1 are on different file systems and the implementation does not support links between file systems.
- link.90.12
[EXDEV] [XSR] path1 refers to a named STREAM.
- link.92
The link() function may fail if:
- link.92.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path1 or path2 argument.
- link.92.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path1 or path2 argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]remove (49 / 10 / 0)
- remove.01
The remove() function shall cause the file named by the pathname pointed to by path to be no longer accessible by that name
- remove.02
A subsequent attempt to open that file using that name shall fail, unless it is created anew
- remove.05
The unlink() function shall remove a link to a file
- remove.06
If path names a symbolic link, unlink() shall remove the symbolic link named by path and shall not affect any file or directory named by the contents of the symbolic link
- remove.07
Otherwise, unlink() shall remove the link named by the pathname pointed to by path and shall decrement the link count of the file referenced by the link
- remove.08
When the file's link count becomes 0 and no process has the file open, the space occupied by the file shall be freed and the file shall no longer be accessible
- remove.09
If one or more processes have the file open when the last link is removed, the link shall be removed before unlink() returns, but the removal of the file contents shall be postponed until all references to the file are closed.
- remove.10
The path argument shall not name a directory unless the process has appropriate privileges and the implementation supports using unlink() on directories
- remove.11
Upon successful completion, unlink() shall mark for update the st_ctime and st_mtime fields of the parent directory
- remove.12
Also, if the file's link count is not 0, the st_ctime field of the file shall be marked for update
- remove.13
Upon successful completion, 0 shall be returned
- remove.14
Otherwise, -1 shall be returned and errno set to indicate the error
- remove.15
If -1 is returned, the named file shall not be changed
- remove.31
The rmdir() function shall remove a directory whose name is given by path. The directory shall be removed only if it is an empty directory.
- remove.32
If path names a symbolic link, then rmdir() shall fail and set errno to [ENOTDIR].
- remove.33
If the path argument refers to a path whose final component is either dot or dot-dot, rmdir() shall fail.
- remove.34
If the directory's link count becomes 0 and no process has the directory open, the space occupied by the directory shall be freed and the directory shall no longer be accessible.
- remove.35
If one or more processes have the directory open when the last link is removed, the dot and dot-dot entries, if present, shall be removed before rmdir() returns and no new entries may be created in the directory, but the directory shall not be removed until all references to the directory are closed
- remove.36
Upon successful completion, the rmdir() function shall mark for update the st_ctime and st_mtime fields of the parent directory.
- remove.37
Upon successful completion, the function rmdir() shall return 0.
- remove.38
Otherwise, -1 shall be returned, and errno set to indicate the error. If -1 is returned, the named directory shall not be changed.
- remove.40
If the directory is the root directory or the current working directory of any process, it is unspecified whether the function succeeds, or whether it shall fail and set errno to [EBUSY].
- remove.41
If the directory is not an empty directory, rmdir() shall fail and set errno to [EEXIST] or [ENOTEMPTY].
- remove.80
The rmdir() function shall fail if
- remove.80.01
[EACCES] Search permission is denied on a component of the path prefix, or write permission is denied on the parent directory of the directory to be removed.
- remove.80.02
[EBUSY] The directory to be removed is currently in use by the system or some process and the implementation considers this to be an error.
- remove.80.03
[EEXIST] or [ENOTEMPTY] The path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.
- remove.80.04
[EINVAL] The path argument contains a last component that is dot.
- remove.80.05
[EIO] A physical I/O error has occurred.
- remove.80.06
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- remove.80.07
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- remove.80.08
[ENOENT] A component of path does not name an existing file, or the path argument names a nonexistent directory or points to an empty string.
- remove.80.10
[ENOTDIR] A component of path is not a directory.
- remove.80.11
[EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the parent directory of the directory to be removed and the caller is not the owner of the directory to be removed, nor is the caller the owner of the parent directory, nor does the caller have the appropriate privileges.
- remove.80.12
[EROFS] The directory entry to be removed resides on a read-only file system.
- remove.81
The rmdir() function may fail if:
- remove.81.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- remove.81.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- remove.90
The unlink() function shall fail and shall not unlink the file if:
- remove.90.01
[EACCES] Search permission is denied for a component of the path prefix, or write permission is denied on the directory containing the directory entry to be removed.
- remove.90.02
[EBUSY] The file named by the path argument cannot be unlinked because it is being used by the system or another process and the implementation considers this an error.
- remove.90.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- remove.90.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- remove.90.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- remove.90.06
[ENOTDIR] A component of the path prefix is not a directory.
- remove.90.07
[EPERM] The file named by path is a directory, and either the calling process does not have appropriate privileges, or the implementation prohibits using unlink() on directories.
- remove.90.08
[EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the directory containing the file referred to by the path argument and the caller is not the file owner, nor is the caller the directory owner, nor does the caller have appropriate privileges.
- remove.90.09
[EROFS] The directory entry to be unlinked is part of a read-only file system.
- remove.92
The unlink() function may fail and not unlink the file if:
- remove.92.01
[EBUSY] [XSI] The file named by path is a named STREAM.
- remove.92.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- remove.92.03
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- remove.92.04
[ETXTBSY] The entry to be unlinked is the last directory entry to a pure procedure (shared text) file that is being executed.
- [+]rename (43 / 6 / 0)
- rename.01
The rename() function shall change the name of a file
- rename.02
If either the old or new argument names a symbolic link, rename() shall operate on the symbolic link itself, and shall not resolve the last component of the argument.
- rename.03
If the old argument and the new argument resolve to the same existing file, rename() shall return successfully and perform no other action
- rename.04
If the old argument points to the pathname of a file that is not a directory, the new argument shall not point to the pathname of a directory
- rename.05
If the link named by the new argument exists, it shall be removed and old renamed to new
- rename.06
In this case, a link named new shall remain visible to other processes throughout the renaming operation and refer either to the file referred to by new or old before the operation began
- rename.07
Write access permission is required for both the directory containing old and the directory containing new
- rename.08
If the old argument points to the pathname of a directory, the new argument shall not point to the pathname of a file that is not a directory
- rename.09
If the directory named by the new argument exists, it shall be removed and old renamed to new.
- rename.10
If new names an existing directory, it shall be required to be an empty directory.
- rename.11
If the old argument points to a pathname of a symbolic link, the symbolic link shall be renamed
- rename.12
If the new argument points to a pathname of a symbolic link, the symbolic link shall be removed
- rename.13
The new pathname shall not contain a path prefix that names old
- rename.14
Write access permission is required for the directory containing old and the directory containing new
- rename.15
If the old argument points to the pathname of a directory, write access permission may be required for the directory named by old
- rename.16
and, if it exists, the directory named by new.
- rename.17
If the link named by the new argument exists and the file's link count becomes 0 when it is removed and no process has the file open, the space occupied by the file shall be freed and the file shall no longer be accessible
- rename.18
If one or more processes have the file open when the last link is removed, the link shall be removed before rename() returns, but the removal of the file contents shall be postponed until all references to the file are closed
- rename.19
Upon successful completion, rename() shall mark for update the st_ctime and st_mtime fields of the parent directory of each file
- rename.20
If the rename() function fails for any reason other than [EIO], any file named by new shall be unaffected
- rename.21
Upon successful completion, rename() shall return 0;
- rename.22
otherwise, -1 shall be returned, [CX] errno shall be set to indicate the error,
- rename.23
In this case, a link named new shall exist throughout the renaming operation and shall refer either to the directory referred to by new or old before the operation began
- rename.24
and neither the file named by old nor the file named by new shall be changed or created
- rename.90
The rename() function shall fail if:
- rename.90.01
[EACCES] [CX] A component of either path prefix denies search permission; or one of the directories containing old or new denies write permissions; or, write permission is required and is denied for a directory pointed to by the old or new arguments.
- rename.90.02
[EBUSY] [CX] The directory named by old or new is currently in use by the system or another process, and the implementation considers this an error.
- rename.90.03
[EEXIST] or [ENOTEMPTY] [CX]
The link named by new is a directory that is not an empty directory.
- rename.90.04
[EINVAL] [CX] The new directory pathname contains a path prefix that names the old directory.
- rename.90.05
[EIO] [CX] A physical I/O error has occurred.
- rename.90.06
[EISDIR] [CX] The new argument points to a directory and the old argument points to a file that is not a directory.
- rename.90.07
[ELOOP] [CX] A loop exists in symbolic links encountered during resolution of the path argument.
- rename.90.08
[EMLINK] [CX] The file named by old is a directory, and the link count of the parent directory of new would exceed {LINK_MAX}.
- rename.90.09
[ENAMETOOLONG] [CX]
The length of the old or new argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- rename.90.10
[ENOENT] [CX] The link named by old does not name an existing file, or either old or new points to an empty string.
- rename.90.11
[ENOSPC] [CX] The directory that would contain new cannot be extended.
- rename.90.12
[ENOTDIR] [CX] A component of either path prefix is not a directory; or the old argument names a directory and new argument names a non-directory file.
- rename.90.13
[EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the directory containing the file referred to by old and the caller is not the file owner, nor is the caller the directory owner, nor does the caller have appropriate privileges; or new refers to an existing file, the S_ISVTX flag is set on the directory containing this file, and the caller is not the file owner, nor is the caller the directory owner, nor does the caller have appropriate privileges.
- rename.90.14
[EROFS] [CX] The requested operation requires writing in a directory on a read-only file system.
- rename.90.15
[EXDEV] [CX] The links named by new and old are on different file systems and the implementation does not support links between file systems.
- rename.91
The rename() function may fail if:
- rename.91.01
[EBUSY] [XSI] The file named by the old or new arguments is a named STREAM.
- rename.91.02
[ELOOP] [CX] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- rename.91.03
[ENAMETOOLONG] [CX]
As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- rename.91.04
[ETXTBSY] [CX] The file to be renamed is a pure procedure (shared text) file that is being executed.
- [+]unlink (25 / 9 / 0)
- unlink.05
The unlink() function shall remove a link to a file
- unlink.06
If path names a symbolic link, unlink() shall remove the symbolic link named by path and shall not affect any file or directory named by the contents of the symbolic link
- unlink.07
Otherwise, unlink() shall remove the link named by the pathname pointed to by path and shall decrement the link count of the file referenced by the link
- unlink.08
When the file's link count becomes 0 and no process has the file open, the space occupied by the file shall be freed and the file shall no longer be accessible
- unlink.09
If one or more processes have the file open when the last link is removed, the link shall be removed before unlink() returns, but the removal of the file contents shall be postponed until all references to the file are closed.
- unlink.10
The path argument shall not name a directory unless the process has appropriate privileges and the implementation supports using unlink() on directories
- unlink.11
Upon successful completion, unlink() shall mark for update the st_ctime and st_mtime fields of the parent directory
- unlink.12
Also, if the file's link count is not 0, the st_ctime field of the file shall be marked for update
- unlink.13
Upon successful completion, 0 shall be returned
- unlink.14
Otherwise, -1 shall be returned and errno set to indicate the error
- unlink.15
If -1 is returned, the named file shall not be changed
- unlink.90
The unlink() function shall fail and shall not unlink the file if:
- unlink.90.01
[EACCES] Search permission is denied for a component of the path prefix, or write permission is denied on the directory containing the directory entry to be removed.
- unlink.90.02
[EBUSY] The file named by the path argument cannot be unlinked because it is being used by the system or another process and the implementation considers this an error.
- unlink.90.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- unlink.90.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- unlink.90.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- unlink.90.06
[ENOTDIR] A component of the path prefix is not a directory.
- unlink.90.07
[EPERM] The file named by path is a directory, and either the calling process does not have appropriate privileges, or the implementation prohibits using unlink() on directories.
- unlink.90.08
[EPERM] or [EACCES] [XSI]
The S_ISVTX flag is set on the directory containing the file referred to by the path argument and the caller is not the file owner, nor is the caller the directory owner, nor does the caller have appropriate privileges.
- unlink.90.09
[EROFS] The directory entry to be unlinked is part of a read-only file system.
- unlink.90.30
If path specifies a directory, the implementation may return EISDIR instead of EPERM as specified by ISO POSIX (2003).
- unlink.92
The unlink() function may fail and not unlink the file if:
- unlink.92.01
[EBUSY] [XSI] The file named by path is a named STREAM.
- unlink.92.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- unlink.92.03
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- unlink.92.04
[ETXTBSY] The entry to be unlinked is the last directory entry to a pure procedure (shared text) file that is being executed.
- [+]fs.ftw (132 / 54 / 0)
- [+]ftw (29 / 8 / 0)
- app.ftw.01
The argument ndirs should be in the range [1, {OPEN_MAX}].
- ftw.01
The ftw() function shall recursively descend the directory hierarchy rooted in path.
- ftw.02
For each object in the hierarchy, ftw() shall call the function pointed to by fn, passing it a pointer to a null-terminated character string containing the name of the object, a pointer to a stat structure containing information about the object, and an integer.
- app.ftw.02
The results are unspecified if the application-supplied fn function does not preserve the current working directory.
- ftw.03
Possible values of the integer, defined in the <ftw.h> header, are:
- ftw.03.01
FTW_D For a directory.
- ftw.03.02
FTW_DNR For a directory that cannot be read.
- ftw.03.03
FTW_F For a file.
- ftw.03.04
FTW_SL For a symbolic link (but see also FTW_NS below).
- ftw.03.05
FTW_NS
- ftw.03.05.01
For an object other than a symbolic link on which stat() could not successfully be executed.
- ftw.03.05.02
If the object is a symbolic link and stat() failed, it is unspecified whether ftw() passes FTW_SL or FTW_NS to the user-supplied function.
- ftw.04
If the integer is FTW_DNR, descendants of that directory shall not be processed.
- ftw.05
If the integer is FTW_NS, the stat structure contains undefined values.
- ftw.06
The ftw() function shall visit a directory before visiting any of its descendants.
- ftw.07
The ftw() function shall use at most one file descriptor for each level in the tree.
- ftw.08
The tree traversal shall continue until either the tree is exhausted, an invocation of fn returns a non-zero value, or some error, other than [EACCES], is detected within ftw().
- ftw.08.01
If the tree is exhausted, ftw() shall return 0.
- ftw.08.02
If the function pointed to by fn returns a non-zero value, ftw() shall stop its tree traversal and return whatever value was returned by the function pointed to by fn.
- ftw.08.03
If ftw() detects an error, it shall return -1 and set errno to indicate the error.
- ftw.08.04
If ftw() encounters an error other than [EACCES] (see FTW_DNR and FTW_NS above), it shall return -1 and set errno to indicate the error.
- ftw.09
The ndirs argument shall specify the maximum number of directory streams or file descriptors or both available for use by ftw() while traversing the tree.
- ftw.10
When ftw() returns it shall close any directory streams and file descriptors it uses not counting any opened by the application-supplied fn function.
- ftw.11
The external variable errno may contain any error value that is possible when a directory is opened or when one of the stat functions is executed on a directory or file.
- ftw.12
The ftw() function shall fail if:
- ftw.12.01
[EACCES] Search permission is denied for any component of path or read permission is denied for path.
- ftw.12.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- ftw.12.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- ftw.12.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- ftw.12.05
[ENOTDIR] A component of path is not a directory.
- ftw.12.06
[EOVERFLOW] A field in the stat structure cannot be represented correctly in the current programming environment for one or more files found in the file hierarchy.
- ftw.13
The ftw() function may fail if:
- ftw.13.01
[EINVAL] The value of the ndirs argument is invalid.
- ftw.13.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- ftw.13.03
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- ftw.14
In addition, if the function pointed to by fn encounters system errors, errno may be set accordingly.
- [+]ftw64 (29 / 8 / 0)
- app.ftw64.01
The argument ndirs should be in the range [1, {OPEN_MAX}].
- ftw64.01
The ftw() function shall recursively descend the directory hierarchy rooted in path.
- app.ftw64.02
The results are unspecified if the application-supplied fn function does not preserve the current working directory.
- ftw64.02
For each object in the hierarchy, ftw() shall call the function pointed to by fn, passing it a pointer to a null-terminated character string containing the name of the object, a pointer to a stat structure containing information about the object, and an integer.
- ftw64.03
Possible values of the integer, defined in the <ftw.h> header, are:
- ftw64.03.01
FTW_D For a directory.
- ftw64.03.02
FTW_DNR For a directory that cannot be read.
- ftw64.03.03
FTW_F For a file.
- ftw64.03.04
FTW_SL For a symbolic link (but see also FTW_NS below).
- ftw64.03.05
FTW_NS
- ftw64.03.05.01
For an object other than a symbolic link on which stat() could not successfully be executed.
- ftw64.03.05.02
If the object is a symbolic link and stat() failed, it is unspecified whether ftw() passes FTW_SL or FTW_NS to the user-supplied function.
- ftw64.04
If the integer is FTW_DNR, descendants of that directory shall not be processed.
- ftw64.05
If the integer is FTW_NS, the stat structure contains undefined values.
- ftw64.06
The ftw() function shall visit a directory before visiting any of its descendants.
- ftw64.07
The ftw() function shall use at most one file descriptor for each level in the tree.
- ftw64.08
The tree traversal shall continue until either the tree is exhausted, an invocation of fn returns a non-zero value, or some error, other than [EACCES], is detected within ftw().
- ftw64.08.01
If the tree is exhausted, ftw() shall return 0.
- ftw64.08.02
If the function pointed to by fn returns a non-zero value, ftw() shall stop its tree traversal and return whatever value was returned by the function pointed to by fn.
- ftw64.08.03
If ftw() detects an error, it shall return -1 and set errno to indicate the error.
- ftw64.08.04
If ftw() encounters an error other than [EACCES] (see FTW_DNR and FTW_NS above), it shall return -1 and set errno to indicate the error.
- ftw64.09
The ndirs argument shall specify the maximum number of directory streams or file descriptors or both available for use by ftw() while traversing the tree.
- ftw64.10
When ftw() returns it shall close any directory streams and file descriptors it uses not counting any opened by the application-supplied fn function.
- ftw64.11
The external variable errno may contain any error value that is possible when a directory is opened or when one of the stat functions is executed on a directory or file.
- ftw64.12
The ftw() function shall fail if:
- ftw64.12.01
[EACCES] Search permission is denied for any component of path or read permission is denied for path.
- ftw64.12.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- ftw64.12.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- ftw64.12.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- ftw64.12.05
[ENOTDIR] A component of path is not a directory.
- ftw64.12.06
[EOVERFLOW] A field in the stat structure cannot be represented correctly in the current programming environment for one or more files found in the file hierarchy.
- ftw64.13
The ftw() function may fail if:
- ftw64.13.01
[EINVAL] The value of the ndirs argument is invalid.
- ftw64.13.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- ftw64.13.03
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- ftw64.14
In addition, if the function pointed to by fn encounters system errors, errno may be set accordingly.
- [+]nftw (37 / 19 / 0)
- app.nftw.01
The results are unspecified if the application-supplied fn function does not preserve the current working directory.
- nftw.01
The nftw() function shall recursively descend the directory hierarchy rooted in path.
- nftw.02
The nftw() function has a similar effect to ftw() except that it takes an additional argument flags, which is a bitwise-inclusive OR of zero or more of the following flags:
- nftw.02.01
FTW_CHDIR
- nftw.02.01.01
If set, nftw() shall change the current working directory to each directory as it reports files in that directory.
- nftw.02.01.02
If clear, nftw() shall not change the current working directory.
- nftw.02.02
FTW_DEPTH
- nftw.02.02.01
If set, nftw() shall report all files in a directory before reporting the directory itself.
- nftw.02.02.02
If clear, nftw() shall report any directory before reporting the files in that directory.
- nftw.02.03
FTW_MOUNT
- nftw.02.03.01
If set, nftw() shall only report files in the same file system as path.
- nftw.02.03.02
If clear, nftw() shall report all files encountered during the walk.
- nftw.02.04
FTW_PHYS If set, nftw() shall perform a physical walk and shall not follow symbolic links.
- nftw.02.05
If FTW_PHYS is clear and FTW_DEPTH is set, nftw() shall follow links instead of reporting them, but shall not report any directory that would be a descendant of itself.
- nftw.02.06
If FTW_PHYS is clear and FTW_DEPTH is clear, nftw() shall follow links instead of reporting them, but shall not report the contents of any directory that would be a descendant of itself.
- nftw.03
At each file it encounters, nftw() shall call the user-supplied function fn with four arguments:
- nftw.03.01
The first argument is the pathname of the object.
- nftw.03.02
The second argument is a pointer to the stat buffer containing information on the object.
- nftw.03.03
The third argument is an integer giving additional information. Its value is one of the following:
- nftw.03.03.01
FTW_F The object is a file.
- nftw.03.03.02
FTW_D The object is a directory.
- nftw.03.03.03
FTW_DP The object is a directory and subdirectories have been visited. (This condition shall only occur if the FTW_DEPTH flag is included in flags.)
- nftw.03.03.04
FTW_SL The object is a symbolic link. (This condition shall only occur if the FTW_PHYS flag is included in flags.)
- nftw.03.03.05
FTW_SLN The object is a symbolic link that does not name an existing file. (This condition shall only occur if the FTW_PHYS flag is not included in flags.)
- nftw.03.03.06
FTW_DNR
- nftw.03.03.06.01
The object is a directory that cannot be read.
- nftw.03.03.06.02
The fn function shall not be called for any of its descendants.
- nftw.03.03.07
FTW_NS The stat() function failed on the object because of lack of appropriate permission. The stat buffer passed to fn is undefined. Failure of stat() for any other reason is considered an error and nftw() shall return -1.
- nftw.03.04
The fourth argument is a pointer to an FTW structure. The value of base is the offset of the object's filename in the pathname passed as the first argument to fn. The value of level indicates depth relative to the root of the walk, where the root level is 0.
- nftw.04
The argument fd_limit sets the maximum number of file descriptors that shall be used by nftw() while traversing the file tree.
- nftw.05
At most one file descriptor shall be used for each directory level.
- nftw.06
The nftw() function shall continue until the first of the following conditions occurs:
- nftw.06.01
An invocation of fn shall return a non-zero value, in which case nftw() shall return that value.
- nftw.06.02
The nftw() function detects an error other than [EACCES] (see FTW_DNR and FTW_NS above), in which case nftw() shall return -1 and set errno to indicate the error.
- nftw.06.03
The tree is exhausted, in which case nftw() shall return 0.
- nftw.07
The nftw() function shall fail if:
- nftw.07.01
[EACCES] Search permission is denied for any component of path or read permission is denied for path, or fn returns -1 and does not reset errno.
- nftw.07.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- nftw.07.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- nftw.07.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- nftw.07.05
[ENOTDIR] A component of path is not a directory.
- nftw.07.06
[EOVERFLOW] A field in the stat structure cannot be represented correctly in the current programming environment for one or more files found in the file hierarchy.
- nftw.08
The nftw() function may fail if:
- nftw.08.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- nftw.08.02
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- nftw.08.03
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- nftw.08.04
[ENFILE] Too many files are currently open in the system.
- nftw.09
In addition, errno may be set if the function pointed to by fn causes errno to be set.
- [+]nftw64 (37 / 19 / 0)
- nftw64.01
The nftw() function shall recursively descend the directory hierarchy rooted in path.
- app.nftw64.01
The results are unspecified if the application-supplied fn function does not preserve the current working directory.
- nftw64.02
The nftw() function has a similar effect to ftw() except that it takes an additional argument flags, which is a bitwise-inclusive OR of zero or more of the following flags:
- nftw64.02.01
FTW_CHDIR
- nftw64.02.01.01
If set, nftw() shall change the current working directory to each directory as it reports files in that directory.
- nftw64.02.01.02
If clear, nftw() shall not change the current working directory.
- nftw64.02.02
FTW_DEPTH
- nftw64.02.02.01
If set, nftw() shall report all files in a directory before reporting the directory itself.
- nftw64.02.02.02
If clear, nftw() shall report any directory before reporting the files in that directory.
- nftw64.02.03
FTW_MOUNT
- nftw64.02.03.01
If set, nftw() shall only report files in the same file system as path.
- nftw64.02.03.02
If clear, nftw() shall report all files encountered during the walk.
- nftw64.02.04
FTW_PHYS If set, nftw() shall perform a physical walk and shall not follow symbolic links.
- nftw64.02.05
If FTW_PHYS is clear and FTW_DEPTH is set, nftw() shall follow links instead of reporting them, but shall not report any directory that would be a descendant of itself.
- nftw64.02.06
If FTW_PHYS is clear and FTW_DEPTH is clear, nftw() shall follow links instead of reporting them, but shall not report the contents of any directory that would be a descendant of itself.
- nftw64.03
At each file it encounters, nftw() shall call the user-supplied function fn with four arguments:
- nftw64.03.01
The first argument is the pathname of the object.
- nftw64.03.02
The second argument is a pointer to the stat buffer containing information on the object.
- nftw64.03.03
The third argument is an integer giving additional information. Its value is one of the following:
- nftw64.03.03.01
FTW_F The object is a file.
- nftw64.03.03.02
FTW_D The object is a directory.
- nftw64.03.03.03
FTW_DP The object is a directory and subdirectories have been visited. (This condition shall only occur if the FTW_DEPTH flag is included in flags.)
- nftw64.03.03.04
FTW_SL The object is a symbolic link. (This condition shall only occur if the FTW_PHYS flag is included in flags.)
- nftw64.03.03.05
FTW_SLN The object is a symbolic link that does not name an existing file. (This condition shall only occur if the FTW_PHYS flag is not included in flags.)
- nftw64.03.03.06
FTW_DNR
- nftw64.03.03.06.01
The object is a directory that cannot be read.
- nftw64.03.03.06.02
The fn function shall not be called for any of its descendants.
- nftw64.03.03.07
FTW_NS The stat() function failed on the object because of lack of appropriate permission. The stat buffer passed to fn is undefined. Failure of stat() for any other reason is considered an error and nftw() shall return -1.
- nftw64.03.04
The fourth argument is a pointer to an FTW structure. The value of base is the offset of the object's filename in the pathname passed as the first argument to fn. The value of level indicates depth relative to the root of the walk, where the root level is 0.
- nftw64.04
The argument fd_limit sets the maximum number of file descriptors that shall be used by nftw() while traversing the file tree.
- nftw64.05
At most one file descriptor shall be used for each directory level.
- nftw64.06
The nftw() function shall continue until the first of the following conditions occurs:
- nftw64.06.01
An invocation of fn shall return a non-zero value, in which case nftw() shall return that value.
- nftw64.06.02
The nftw() function detects an error other than [EACCES] (see FTW_DNR and FTW_NS above), in which case nftw() shall return -1 and set errno to indicate the error.
- nftw64.06.03
The tree is exhausted, in which case nftw() shall return 0.
- nftw64.07
The nftw() function shall fail if:
- nftw64.07.01
[EACCES] Search permission is denied for any component of path or read permission is denied for path, or fn returns -1 and does not reset errno.
- nftw64.07.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- nftw64.07.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- nftw64.07.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- nftw64.07.05
[ENOTDIR] A component of path is not a directory.
- nftw64.07.06
[EOVERFLOW] A field in the stat structure cannot be represented correctly in the current programming environment for one or more files found in the file hierarchy.
- nftw64.08
The nftw() function may fail if:
- nftw64.08.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- nftw64.08.02
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- nftw64.08.03
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- nftw64.08.04
[ENFILE] Too many files are currently open in the system.
- nftw64.09
In addition, errno may be set if the function pointed to by fn causes errno to be set.
- [+]fs.glob (64 / 35 / 0)
- [+]glob (31 / 18 / 0)
- app.glob.00
It is the caller's responsibility to create the structure pointed to by pglob.
- glob.01
The argument pattern is a pointer to a pathname pattern to be expanded. The glob() function shall match all accessible pathnames against this pattern and develop a list of all pathnames that match.
- glob.02
The glob() function shall store the number of matched pathnames into pglob->gl_pathc and a pointer to a list of pointers to pathnames into pglob->gl_pathv.
- glob.03
The pathnames shall be in sort order as defined by the current setting of the LC_COLLATE category;
- glob.04
The first pointer after the last pathname shall be a null pointer.
- glob.05
If the pattern does not match any pathnames, the returned number of matched paths is set to 0, and the contents of pglob->gl_pathv are implementation-defined.
- glob.06
The glob() function shall allocate other space as needed, including the memory pointed to by gl_pathv.
- glob.07
The flags argument is used to control the behavior of glob(). The value of flags is a bitwise-inclusive OR of zero or more of the following constants, which are defined in <glob.h>:
- glob.07.01
GLOB_APPEND Append pathnames generated to the ones from a previous call to glob().
- glob.07.02
GLOB_DOOFFS Make use of pglob->gl_offs. If this flag is set, pglob->gl_offs is used to specify how many null pointers to add to the beginning of pglob->gl_pathv. In other words, pglob->gl_pathv shall point to pglob->gl_offs null pointers, followed by pglob->gl_pathc pathname pointers, followed by a null pointer.
- glob.07.03
GLOB_ERR Cause glob() to return when it encounters a directory that it cannot open or read. Ordinarily, glob() continues to find matches.
- glob.07.03.01
If (*errfunc()) is called and returns non-zero, or if the GLOB_ERR flag is set in flags, glob() shall stop the scan and return GLOB_ABORTED after setting gl_pathc and gl_pathv in pglob to reflect the paths already scanned.
- glob.07.03.02
If GLOB_ERR is not set and either errfunc is a null pointer or (*errfunc()) returns 0, the error shall be ignored.
- glob.07.04
GLOB_MARK Each pathname that is a directory that matches pattern shall have a slash appended.
- glob.07.05
GLOB_NOCHECK Supports rule 3 in the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.13.3, Patterns Used for Filename Expansion. If pattern does not match any pathname, then glob() shall return a list consisting of only pattern, and the number of matched pathnames is 1.
- glob.07.06
GLOB_NOESCAPE Disable backslash escaping.
- glob.07.07
GLOB_NOSORT Ordinarily, glob() sorts the matching pathnames according to the current setting of the LC_COLLATE category; see the Base Definitions volume of IEEE Std 1003.1-2001, Section 7.3.2, LC_COLLATE. When this flag is used, the order of pathnames returned is unspecified.
- glob.07.08
The GLOB_APPEND flag can be used to append a new set of pathnames to those found in a previous call to glob().
- app.glob.08.01
The first such call shall not set GLOB_APPEND. All subsequent calls shall set it.
- app.glob.08.02
All the calls shall set GLOB_DOOFFS, or all shall not set it.
- glob.08
The following rules apply to applications when two or more calls to glob() are made with the same value of pglob and without intervening calls to globfree():
- glob.08.03
After the second call, pglob->gl_pathv points to a list containing the following:
- glob.08.03.01
Zero or more null pointers, as specified by GLOB_DOOFFS and pglob->gl_offs.
- glob.08.03.02
Pointers to the pathnames that were in the pglob->gl_pathv list before the call, in the same order as before.
- glob.08.03.03
Pointers to the new pathnames generated by the second call, in the specified order.
- glob.08.04
The count returned in pglob->gl_pathc shall be the total number of pathnames from the two calls.
- glob.08.05
The application can change any of the fields after a call to glob(). If it does, the application shall reset them to the original value before a subsequent call, using the same pglob value, to globfree() or glob() with the GLOB_APPEND flag.
- glob.09
If, during the search, a directory is encountered that cannot be opened or read and errfunc is not a null pointer, glob() calls (*errfunc()) with two arguments:The epath argument is a pointer to the path that failed.The eerrno argument is the value of errno from the failure, as set by opendir(), readdir(), or stat(). (Other values may be used to report other errors not explicitly documented for those functions.)
- glob.10
The glob() function shall not fail because of large files.
- glob.11
No tilde expansion or parameter substitution is done; see wordexp().
- glob.20.01
Upon successful completion, glob() shall return 0.
- glob.20.02.01
The glob() function shall fail and return the corresponding value if:
- glob.20.02.01.01
GLOB_ABORTED The scan was stopped because GLOB_ERR was set or (*errfunc()) returned non-zero.
- glob.20.02.01.02
GLOB_NOMATCH The pattern does not match any existing pathname, and GLOB_NOCHECK was not set in flags.
- glob.20.02.01.03
GLOB_NOSPACE An attempt to allocate memory failed.
- glob.22
The argument pglob->gl_pathc shall return the number of matched pathnames and the argument pglob->gl_pathv shall contain a pointer to a null-terminated list of matched and sorted pathnames.
- glob.23
However, if pglob->gl_pathc is 0, the content of pglob->gl_pathv is undefined.
- glob.24.02.01
If glob() terminates due to an error, it shall return one of the non-zero constants defined in <glob.h>.
- glob.24.02.02
The arguments pglob->gl_pathc and pglob->gl_pathv are still set as defined above.
- [+]glob64 (31 / 15 / 0)
- app.glob64.00
It is the caller's responsibility to create the structure pointed to by pglob.
- glob64.01
The argument pattern is a pointer to a pathname pattern to be expanded. The glob() function shall match all accessible pathnames against this pattern and develop a list of all pathnames that match.
It shall search for pathnames matching pattern according to the rules used by the shell, /bin/sh.
- glob64.02
The glob() function shall store the number of matched pathnames into pglob->gl_pathc and a pointer to a list of pointers to pathnames into pglob->gl_pathv.
The results of a glob64() call are stored in the structure pointed to by pglob
- glob64.03
The pathnames shall be in sort order as defined by the current setting of the LC_COLLATE category;
- glob64.04
The first pointer after the last pathname shall be a null pointer.
- glob64.04.02
Other possible returns are:
- glob64.05
If the pattern does not match any pathnames, the returned number of matched paths is set to 0, and the contents of pglob->gl_pathv are implementation-defined.
- glob64.06
The glob() function shall allocate other space as needed, including the memory pointed to by gl_pathv.
- glob64.07
The flags argument is used to control the behavior of glob(). The value of flags is a bitwise-inclusive OR of zero or more of the following constants, which are defined in <glob.h>:
- glob64.07.01
GLOB_APPEND Append pathnames generated to the ones from a previous call to glob().
- glob64.07.02
GLOB_DOOFFS Make use of pglob->gl_offs. If this flag is set, pglob->gl_offs is used to specify how many null pointers to add to the beginning of pglob->gl_pathv. In other words, pglob->gl_pathv shall point to pglob->gl_offs null pointers, followed by pglob->gl_pathc pathname pointers, followed by a null pointer.
- glob64.07.03
GLOB_ERR Cause glob() to return when it encounters a directory that it cannot open or read. Ordinarily, glob() continues to find matches.
- glob64.07.03.01
If (*errfunc()) is called and returns non-zero, or if the GLOB_ERR flag is set in flags, glob() shall stop the scan and return GLOB_ABORTED after setting gl_pathc and gl_pathv in pglob to reflect the paths already scanned.
- glob64.07.03.02
If GLOB_ERR is not set and either errfunc is a null pointer or (*errfunc()) returns 0, the error shall be ignored.
- glob64.07.04
GLOB_MARK Each pathname that is a directory that matches pattern shall have a slash appended.
- glob64.07.05
GLOB_NOCHECK Supports rule 3 in the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.13.3, Patterns Used for Filename Expansion. If pattern does not match any pathname, then glob() shall return a list consisting of only pattern, and the number of matched pathnames is 1.
- glob64.07.06
GLOB_NOESCAPE Disable backslash escaping.
- glob64.07.07
GLOB_NOSORT Ordinarily, glob() sorts the matching pathnames according to the current setting of the LC_COLLATE category; see the Base Definitions volume of IEEE Std 1003.1-2001, Section 7.3.2, LC_COLLATE. When this flag is used, the order of pathnames returned is unspecified.
- glob64.07.08
The GLOB_APPEND flag can be used to append a new set of pathnames to those found in a previous call to glob().
- app.glob64.08.01
The first such call shall not set GLOB_APPEND. All subsequent calls shall set it.
- app.glob64.08.02
All the calls shall set GLOB_DOOFFS, or all shall not set it.
- glob64.08
The following rules apply to applications when two or more calls to glob() are made with the same value of pglob and without intervening calls to globfree():
- glob64.08.03
After the second call, pglob->gl_pathv points to a list containing the following:
- glob64.08.03.01
Zero or more null pointers, as specified by GLOB_DOOFFS and pglob->gl_offs.
- glob64.08.03.02
Pointers to the pathnames that were in the pglob->gl_pathv list before the call, in the same order as before.
- glob64.08.03.03
Pointers to the new pathnames generated by the second call, in the specified order.
- glob64.08.04
The count returned in pglob->gl_pathc shall be the total number of pathnames from the two calls.
- glob64.08.05
The application can change any of the fields after a call to glob(). If it does, the application shall reset them to the original value before a subsequent call, using the same pglob value, to globfree() or glob() with the GLOB_APPEND flag.
- glob64.09
If, during the search, a directory is encountered that cannot be opened or read and errfunc is not a null pointer, glob() calls (*errfunc()) with two arguments:The epath argument is a pointer to the path that failed.The eerrno argument is the value of errno from the failure, as set by opendir(), readdir(), or stat(). (Other values may be used to report other errors not explicitly documented for those functions.)
- glob64.10
The glob() function shall not fail because of large files.
- glob64.11
No tilde expansion or parameter substitution is done; see wordexp().
- glob64.20.01
Upon successful completion, glob() shall return 0.
On success, 0 is returned.
- glob64.20.02.01
The glob() function shall fail and return the corresponding value if:
- glob64.20.02.01.01
GLOB_ABORTED The scan was stopped because GLOB_ERR was set or (*errfunc()) returned non-zero.
GLOB_ABORTED read error
- glob64.20.02.01.02
GLOB_NOMATCH The pattern does not match any existing pathname, and GLOB_NOCHECK was not set in flags.
GLOB_NOMATCH no match found
- glob64.20.02.01.03
GLOB_NOSPACE An attempt to allocate memory failed.
GLOB_NOSPACE out of memory
- glob64.22
The argument pglob->gl_pathc shall return the number of matched pathnames and the argument pglob->gl_pathv shall contain a pointer to a null-terminated list of matched and sorted pathnames.
- glob64.23
However, if pglob->gl_pathc is 0, the content of pglob->gl_pathv is undefined.
- glob64.24.02.01
If glob() terminates due to an error, it shall return one of the non-zero constants defined in <glob.h>.
- glob64.24.02.02
The arguments pglob->gl_pathc and pglob->gl_pathv are still set as defined above.
- [+]globfree (1 / 1 / 0)
- globfree.01
The globfree() function shall free any space associated with pglob from a previous call to glob().
- [+]globfree64 (1 / 1 / 0)
- globfree64.01
The globfree() function shall free any space associated with pglob from a previous call to glob().
globfree64() frees the dynamically allocated storage from an earlier call to glob64().
- [+]fs.meta.access (123 / 53 / 0)
- [+]access (15 / 5 / 0)
- access.01
The access() function shall check the file named by the pathname pointed to by the path argument for accessibility according to the bit pattern contained in amode, using the real user ID in place of the effective user ID and the real group ID in place of the effective group ID.
- access.02
If the requested access is permitted, access() succeeds and shall return 0;
- access.03
otherwise, -1 shall be returned and errno shall be set to indicate the error.
- access.04
The access() function shall fail if:
- access.04.01
[EACCES] Permission bits of the file mode do not permit the requested access, or search permission is denied on a component of the path prefix.
- access.04.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- access.04.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- access.04.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- access.04.05
[ENOTDIR] A component of the path prefix is not a directory.
- access.04.06
[EROFS] Write access is requested for a file on a read-only file system.
- access.05
The access() function may fail if:
- access.05.01
[EINVAL] The value of the amode argument is invalid.
- access.05.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- access.05.03
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- access.05.04
[ETXTBSY] Write access is requested for a pure procedure (shared text) file that is being executed.
- app.access.06
The value of amode is either the bitwise-inclusive OR of the access permissions to be checked (R_OK, W_OK, X_OK) or the existence test (F_OK).
- access.07
If any access permissions are checked, each shall be checked individually, as described in the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 3, Definitions.
- access.08
If the process has appropriate privileges, an implementation may indicate success for X_OK even if none of the execute file permission bits are set.
- [+]chmod (18 / 7 / 0)
- chmod.01
The chmod() function shall change S_ISUID, S_ISGID, [XSI] S_ISVTX, and the file permission bits of the file named by the pathname pointed to by the path argument to the corresponding bits in the mode argument. The application shall ensure that the effective user ID of the process matches the owner of the file or the process has appropriate privileges in order to do this.
- chmod.02
If the calling process does not have appropriate privileges, and if the group ID of the file does not match the effective group ID or one of the supplementary group IDs and if the file is a regular file, bit S_ISGID (set-group-ID on execution) in the file's mode shall be cleared upon successful return from chmod().
- chmod.03
Upon successful completion, chmod() shall mark for update the st_ctime field of the file.
- chmod.04
Upon successful completion, 0 shall be returned;
- chmod.05
otherwise, -1 shall be returned and errno set to indicate the error. If -1 is returned, no change to the file mode occurs.
- chmod.06
The chmod() function shall fail if:
- chmod.06.01
[EACCES] Search permission is denied on a component of the path prefix.
- chmod.06.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- chmod.06.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- chmod.06.04
[ENOTDIR] A component of the path prefix is not a directory.
- chmod.06.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- chmod.06.06
[EPERM] The effective user ID does not match the owner of the file and the process does not have appropriate privileges.
- chmod.06.07
[EROFS] The named file resides on a read-only file system.
- chmod.07
The chmod() function may fail if:
- chmod.07.01
[EINTR] A signal was caught during execution of the function.
- chmod.07.02
[EINVAL] The value of the mode argument is invalid.
- chmod.07.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- chmod.07.04
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname strings exceeded {PATH_MAX}.
- chmod.08
Additional implementation-defined restrictions may cause the S_ISUID and S_ISGID bits in mode to be ignored.
- chmod.09
The effect on file descriptors for files open at the time of a call to chmod() is implementation-defined.
- [+]chown (26 / 11 / 0)
- chown.01
The chown() function shall change the user and group ownership of a file.
- chown.02
Only processes with an effective user ID equal to the user ID of the file or with appropriate privileges may change the ownership of a file.
- chown.03
If _POSIX_CHOWN_RESTRICTED is in effect for path:
- chown.03.01
Changing the user ID is restricted to processes with appropriate privileges.
- chown.03.02
Changing the group ID is permitted to a process with an effective user ID equal to the user ID of the file, but without appropriate privileges, if and only if owner is equal to the file's user ID or ( uid_t)-1 and group is equal either to the calling process' effective group ID or to one of its supplementary group IDs.
- chown.04
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process does not have appropriate privileges, the set-user-ID (S_ISUID) and set-group-ID (S_ISGID) bits of the file mode shall be cleared upon successful return from chown().
- chown.05
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process has appropriate privileges, it is implementation-defined whether the set-user-ID and set-group-ID bits are altered.
- chown.06
If the chown() function is successfully invoked on a file that is not a regular file and one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, the set-user-ID and set-group-ID bits may be cleared.
- chown.07.01
If owner or group is specified as ( uid_t)-1 or ( gid_t)-1, respectively, the corresponding ID of the file shall not be changed.
- chown.07.02
If both owner and group are -1, the times need not be updated.
- chown.08
Upon successful completion, chown() shall mark for update the st_ctime field of the file.
- chown.09
Upon successful completion, 0 shall be returned;
- chown.10
otherwise, -1 shall be returned and errno set to indicate the error.
- chown.11
If -1 is returned, no changes are made in the user ID and group ID of the file.
- chown.12
The chown() function shall fail if:
- chown.12.01
[EACCES] Search permission is denied on a component of the path prefix.
- chown.12.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- chown.12.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- chown.12.04
[ENOTDIR] A component of the path prefix is not a directory.
- chown.12.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- chown.12.06
[EPERM] The effective user ID does not match the owner of the file, or the calling process does not have appropriate privileges and _POSIX_CHOWN_RESTRICTED indicates that such privilege is required.
- chown.12.07
[EROFS] The named file resides on a read-only file system.
- chown.13
The chown() function may fail if:
- chown.13.01
[EIO] An I/O error occurred while reading or writing to the file system.
- chown.13.02
[EINTR] The chown() function was interrupted by a signal which was caught.
- chown.13.03
[EINVAL] The owner or group ID supplied is not a value supported by the implementation.
- chown.13.04
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- chown.13.05
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- chown.14
The path argument points to a pathname naming a file. The user ID and group ID of the named file shall be set to the numeric values contained in owner and group, respectively.
- [+]fchmod (16 / 8 / 0)
- fchmod.01
The fchmod() function shall be equivalent to chmod() except that the file whose permissions are changed is specified by the file descriptor fildes.
- fchmod.02
[SHM] If fildes references a shared memory object, the fchmod() function need only affect the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits.
- fchmod.03
[TYM] If fildes references a typed memory object, the behavior of fchmod() is unspecified.
- fchmod.04
If fildes refers to a socket, the behavior of fchmod() is unspecified.
- fchmod.05
[XSR] If fildes refers to a STREAM (which is fattach()-ed into the file system name space) the call returns successfully, doing nothing.
- fchmod.06
Upon successful completion, fchmod() shall return 0.
- fchmod.07
Otherwise, it shall return -1 and set errno to indicate the error.
- fchmod.08
The fchmod() function shall fail if:
- fchmod.08.01
[EBADF] The fildes argument is not an open file descriptor.
- fchmod.08.02
[EPERM] The effective user ID does not match the owner of the file and the process does not have appropriate privilege.
- fchmod.08.03
[EROFS] The file referred to by fildes resides on a read-only file system.
- fchmod.09
The fchmod() function may fail if:
- fchmod.09.01
[EINTR] [XSI] The fchmod() function was interrupted by a signal.
- fchmod.09.02
[EINVAL] [XSI] The value of the mode argument is invalid.
- fchmod.09.03
[EINVAL] The fildes argument refers to a pipe and the implementation disallows execution of fchmod() on a pipe.
- fchmod.chmod.02
If the calling process does not have appropriate privileges, and if the group ID of the file does not match the effective group ID or one of the supplementary group IDs and if the file is a regular file, bit S_ISGID (set-group-ID on execution) in the file's mode shall be cleared upon successful return from chmod().
- fchmod.chmod.03
Upon successful completion, chmod() shall mark for update the st_ctime field of the file.
- fchmod.chmod.08
Additional implementation-defined restrictions may cause the S_ISUID and S_ISGID bits in mode to be ignored.
- [+]fchown (20 / 10 / 0)
- fchown.01
The fchown() function shall be equivalent to chown() except that the file whose owner and group are changed is specified by the file descriptor fildes.
- fchown.02
Upon successful completion, fchown() shall return 0.
- fchown.03
Otherwise, it shall return -1 and set errno to indicate the error.
- fchown.04
The fchown() function shall fail if:
- fchown.04.01
[EBADF] The fildes argument is not an open file descriptor.
- fchown.04.02
[EPERM] The effective user ID does not match the owner of the file or the process does not have appropriate privilege and _POSIX_CHOWN_RESTRICTED indicates that such privilege is required.
- fchown.04.03
[EROFS] The file referred to by fildes resides on a read-only file system.
- fchown.05
The fchown() function may fail if:
- fchown.05.01
[EINVAL] The owner or group ID is not a value supported by the implementation. The fildes argument refers to a pipe or socket [XSR] or an fattach()-ed STREAM and the implementation disallows execution of fchown() on a pipe.
- fchown.05.02
[EIO] A physical I/O error has occurred.
- fchown.05.03
[EINTR] The fchown() function was interrupted by a signal which was caught.
- fchown.chown.02
Only processes with an effective user ID equal to the user ID of the file or with appropriate privileges may change the ownership of a file.
- fchown.chown.03.01
Changing the user ID is restricted to processes with appropriate privileges.
- fchown.chown.03.02
Changing the group ID is permitted to a process with an effective user ID equal to the user ID of the file, but without appropriate privileges, if and only if owner is equal to the file's user ID or ( uid_t)-1 and group is equal either to the calling process' effective group ID or to one of its supplementary group IDs.
- fchown.chown.04
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process does not have appropriate privileges, the set-user-ID (S_ISUID) and set-group-ID (S_ISGID) bits of the file mode shall be cleared upon successful return from chown().
- fchown.chown.05
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process has appropriate privileges, it is implementation-defined whether the set-user-ID and set-group-ID bits are altered.
- fchown.chown.06
If the chown() function is successfully invoked on a file that is not a regular file and one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, the set-user-ID and set-group-ID bits may be cleared.
- fchown.chown.07.01
If owner or group is specified as ( uid_t)-1 or ( gid_t)-1, respectively, the corresponding ID of the file shall not be changed.
- fchown.chown.07.02
If both owner and group are -1, the times need not be updated.
- fchown.chown.08
Upon successful completion, chown() shall mark for update the st_ctime field of the file.
- fchown.chown.11
If -1 is returned, no changes are made in the user ID and group ID of the file.
- fchown.chown.14
The path argument points to a pathname naming a file. The user ID and group ID of the named file shall be set to the numeric values contained in owner and group, respectively.
- [+]lchown (28 / 12 / 0)
- lchown.01
The lchown() function shall be equivalent to chown(), except in the case where the named file is a symbolic link.
- lchown.02
In this case, lchown() shall change the ownership of the symbolic link file itself, while chown() changes the ownership of the file or directory to which the symbolic link refers.
- lchown.03
Upon successful completion, lchown() shall return 0.
- lchown.04
Otherwise, it shall return -1 and set errno to indicate an error.
- lchown.05
The lchown() function shall fail if:
- lchown.05.01
[EACCES] Search permission is denied on a component of the path prefix of path.
- lchown.05.02
[EINVAL] The owner or group ID is not a value supported by the implementation.
- lchown.05.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- lchown.05.04
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- lchown.05.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- lchown.05.06
[ENOTDIR] A component of the path prefix of path is not a directory.
- lchown.05.07
[EOPNOTSUPP] The path argument names a symbolic link and the implementation does not support setting the owner or group of a symbolic link.
- lchown.05.08
[EPERM] The effective user ID does not match the owner of the file and the process does not have appropriate privileges.
- lchown.05.09
[EROFS] The file resides on a read-only file system.
- lchown.06
The lchown() function may fail if:
- lchown.06.01
[EIO] An I/O error occurred while reading or writing to the file system.
- lchown.06.02
[EINTR] A signal was caught during execution of the function.
- lchown.06.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- lchown.06.04
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- lchown.chown.02
Only processes with an effective user ID equal to the user ID of the file or with appropriate privileges may change the ownership of a file.
- lchown.chown.03.01
Changing the user ID is restricted to processes with appropriate privileges.
- lchown.chown.03.02
Changing the group ID is permitted to a process with an effective user ID equal to the user ID of the file, but without appropriate privileges, if and only if owner is equal to the file's user ID or ( uid_t)-1 and group is equal either to the calling process' effective group ID or to one of its supplementary group IDs.
- lchown.chown.04
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process does not have appropriate privileges, the set-user-ID (S_ISUID) and set-group-ID (S_ISGID) bits of the file mode shall be cleared upon successful return from chown().
- lchown.chown.05
If the specified file is a regular file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, and the process has appropriate privileges, it is implementation-defined whether the set-user-ID and set-group-ID bits are altered.
- lchown.chown.06
If the chown() function is successfully invoked on a file that is not a regular file and one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set, the set-user-ID and set-group-ID bits may be cleared.
- lchown.chown.07.01
If owner or group is specified as ( uid_t)-1 or ( gid_t)-1, respectively, the corresponding ID of the file shall not be changed.
- lchown.chown.07.02
If both owner and group are -1, the times need not be updated.
- lchown.chown.08
Upon successful completion, chown() shall mark for update the st_ctime field of the file.
- lchown.chown.11
If -1 is returned, no changes are made in the user ID and group ID of the file.
- lchown.chown.14
The path argument points to a pathname naming a file. The user ID and group ID of the named file shall be set to the numeric values contained in owner and group, respectively.
- [+]fs.meta.meta (114 / 38 / 0)
- [+]__fxstat (10 / 5 / 0)
- app.__fxstat.30
The functions __xstat(), __lxstat(), and __fxstat() shall implement the ISO POSIX (2003) functions stat(), lstat(), and fstat() respectively.ver shall be 3 or the behavior of these functions is undefined.
- __fxstat.30
__fxstat(3, fildes, stat_buf) shall implement fstat(fildes, stat_buf) as specified by ISO POSIX (2003).
Generalizes:
- __fxstat.fstat.01
- __fxstat.fstat.02
- __fxstat.fstat.03
- __fxstat.fstat.04
- __fxstat.fstat.05
- __fxstat.fstat.06.01
- __fxstat.fstat.06.02
- __fxstat.fstat.06.03
- __fxstat.fstat.07.01
- __fxstat.fstat.01
The fstat() function shall obtain information about an open file associated with the file descriptor fildes, and shall write it to the area pointed to by buf.
- __fxstat.fstat.02
[SHM] If fildes references a shared memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags.
- __fxstat.fstat.03
[TYM] If fildes references a typed memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags.
- __fxstat.fstat.04
Upon successful completion, 0 shall be returned.
- __fxstat.fstat.05
Otherwise, -1 shall be returned and errno set to indicate the error.
- __fxstat.fstat.06
The fstat() function shall fail if:
- __fxstat.fstat.06.01
[EBADF] The fildes argument is not a valid file descriptor.
- __fxstat.fstat.06.02
[EIO] An I/O error occurred while reading from the file system.
- __fxstat.fstat.06.03
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __fxstat.fstat.07
The fstat() function may fail if:
- __fxstat.fstat.07.01
[EOVERFLOW] One of the values is too large to store into the structure pointed to by the buf argument.
- [+]__fxstat64 (11 / 5 / 0)
- __fxstat64.08
The functions __xstat64(), __lxstat64(), and __fxstat64() shall implement the Large File Support functions stat64(), lstat64(), and fstat64() respectively.
Generalizes:
- __fxstat64.fstat.01
- __fxstat64.fstat.02
- __fxstat64.fstat.03
- __fxstat64.fstat.04
- __fxstat64.fstat.05
- __fxstat64.fstat.06.01
- __fxstat64.fstat.06.02
- __fxstat64.fstat.06.03
- __fxstat64.fstat.07.01
- app.__fxstat64.09
ver shall be 3 or the behavior of these functions is undefined.
- __fxstat64.10
__fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, stat_buf) as specified by Large File Support.
Generalizes:
- __fxstat64.fstat.01
- __fxstat64.fstat.02
- __fxstat64.fstat.03
- __fxstat64.fstat.04
- __fxstat64.fstat.05
- __fxstat64.fstat.06.01
- __fxstat64.fstat.06.02
- __fxstat64.fstat.06.03
- __fxstat64.fstat.07.01
- __fxstat64.fstat.01
The fstat() function shall obtain information about an open file associated with the file descriptor fildes, and shall write it to the area pointed to by buf.
- __fxstat64.fstat.02
[SHM] If fildes references a shared memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags.
- __fxstat64.fstat.03
[TYM] If fildes references a typed memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags.
- __fxstat64.fstat.04
Upon successful completion, 0 shall be returned.
- __fxstat64.fstat.05
Otherwise, -1 shall be returned and errno set to indicate the error.
- __fxstat64.fstat.06
The fstat() function shall fail if:
- __fxstat64.fstat.06.01
[EBADF] The fildes argument is not a valid file descriptor.
- __fxstat64.fstat.06.02
[EIO] An I/O error occurred while reading from the file system.
- __fxstat64.fstat.06.03
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __fxstat64.fstat.07
The fstat() function may fail if:
- __fxstat64.fstat.07.01
[EOVERFLOW] One of the values is too large to store into the structure pointed to by the buf argument.
- [+]__lxstat (15 / 4 / 0)
- __lxstat.30
__lxstat(3, path, stat_buf) shall implement lstat(path, stat_buf) as specified by ISO POSIX (2003).
Generalizes:
- __lxstat.lstat.01
- __lxstat.lstat.02
- __lxstat.lstat.03.01
- __lxstat.lstat.03.02
- __lxstat.lstat.03.03
- __lxstat.lstat.03.04
- __lxstat.lstat.03.05
- __lxstat.lstat.03.06
- __lxstat.lstat.03.07
- __lxstat.lstat.04.01
- __lxstat.lstat.04.02
- __lxstat.lstat.04.03
- __lxstat.lstat.05
- __lxstat.lstat.06
- app.__lxstat.30
The functions __xstat(), __lxstat(), and __fxstat() shall implement the ISO POSIX (2003) functions stat(), lstat(), and fstat() respectively.ver shall be 3 or the behavior of these functions is undefined.
- __lxstat.lstat.01
The lstat() function shall be equivalent to stat(), except when path refers to a symbolic link. In that case lstat() shall return information about the link, while stat() shall return information about the file the link references.
- __lxstat.lstat.02
For symbolic links, the st_mode member shall contain meaningful information when used with the file type macros, and the st_size member shall contain the length of the pathname contained in the symbolic link.
- __lxstat.lstat.03
The lstat() function shall fail if:
- __lxstat.lstat.03.01
[EACCES] A component of the path prefix denies search permission.
- __lxstat.lstat.03.02
[EIO] An error occurred while reading from the file system.
- __lxstat.lstat.03.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- __lxstat.lstat.03.04
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- __lxstat.lstat.03.05
[ENOTDIR] A component of the path prefix is not a directory.
- __lxstat.lstat.03.06
[ENOENT] A component of path does not name an existing file or path is an empty string.
- __lxstat.lstat.03.07
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __lxstat.lstat.04
The lstat() function may fail if:
- __lxstat.lstat.04.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- __lxstat.lstat.04.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- __lxstat.lstat.04.03
[EOVERFLOW] One of the members is too large to store into the structure pointed to by the buf argument.
- __lxstat.lstat.05
Upon successful completion, lstat() shall return 0.
- __lxstat.lstat.06
Otherwise, it shall return -1 and set errno to indicate the error.
- [+]__lxstat64 (16 / 4 / 0)
- __lxstat64.07
The functions __xstat64(), __lxstat64(), and __fxstat64() shall implement the Large File Support functions stat64(), lstat64(), and fstat64() respectively.
Generalizes:
- __lxstat64.lstat.01
- __lxstat64.lstat.02
- __lxstat64.lstat.03.01
- __lxstat64.lstat.03.02
- __lxstat64.lstat.03.03
- __lxstat64.lstat.03.04
- __lxstat64.lstat.03.05
- __lxstat64.lstat.03.06
- __lxstat64.lstat.03.07
- __lxstat64.lstat.04.01
- __lxstat64.lstat.04.02
- __lxstat64.lstat.04.03
- __lxstat64.lstat.05
- __lxstat64.lstat.06
- app.__lxstat64.08
ver shall be 3 or the behavior of these functions is undefined.
- __lxstat64.09
__lxstat64(3, path, stat_buf) shall behave as lstat(path, stat_buf) as specified by Large File Support.
- __lxstat64.lstat.01
The lstat() function shall be equivalent to stat(), except when path refers to a symbolic link. In that case lstat() shall return information about the link, while stat() shall return information about the file the link references.
- __lxstat64.lstat.02
For symbolic links, the st_mode member shall contain meaningful information when used with the file type macros, and the st_size member shall contain the length of the pathname contained in the symbolic link.
- __lxstat64.lstat.03
The lstat() function shall fail if:
- __lxstat64.lstat.03.01
[EACCES] A component of the path prefix denies search permission.
- __lxstat64.lstat.03.02
[EIO] An error occurred while reading from the file system.
- __lxstat64.lstat.03.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- __lxstat64.lstat.03.04
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- __lxstat64.lstat.03.05
[ENOTDIR] A component of the path prefix is not a directory.
- __lxstat64.lstat.03.06
[ENOENT] A component of path does not name an existing file or path is an empty string.
- __lxstat64.lstat.03.07
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __lxstat64.lstat.04
The lstat() function may fail if:
- __lxstat64.lstat.04.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- __lxstat64.lstat.04.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- __lxstat64.lstat.04.03
[EOVERFLOW] One of the members is too large to store into the structure pointed to by the buf argument.
- __lxstat64.lstat.05
Upon successful completion, lstat() shall return 0.
- __lxstat64.lstat.06
Otherwise, it shall return -1 and set errno to indicate the error.
- [+]__xstat (16 / 5 / 0)
- app.__xstat.30
The functions __xstat(), __lxstat(), and __fxstat() shall implement the ISO POSIX (2003) functions stat(), lstat(), and fstat() respectively.ver shall be 3 or the behavior of these functions is undefined.
- __xstat.30
__xstat(3, path, stat_buf) shall implement stat(path, stat_buf) as specified by ISO POSIX (2003).
Generalizes:
- __xstat.stat.01
- __xstat.stat.02
- __xstat.stat.03
- __xstat.stat.04
- __xstat.stat.05
- __xstat.stat.09.01
- __xstat.stat.09.02
- __xstat.stat.09.03
- __xstat.stat.09.04
- __xstat.stat.09.05
- __xstat.stat.09.06
- __xstat.stat.09.07
- __xstat.stat.10.01
- __xstat.stat.10.02
- __xstat.stat.10.03
- __xstat.stat.01
If the named file is a symbolic link, the stat() function shall continue pathname resolution using the contents of the symbolic link, and shall return information pertaining to the resulting file if the file exists.
- __xstat.stat.02
The stat() function shall update any time-related fields (as described in the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.7, File Times Update), before writing into the stat structure.
- __xstat.stat.03
Upon successful completion, 0 shall be returned.
- __xstat.stat.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- __xstat.stat.05
The stat() function shall obtain information about the named file and write it to the area pointed to by the buf argument.
- __xstat.stat.09
The stat() function shall fail if:
- __xstat.stat.09.01
[EACCES] Search permission is denied for a component of the path prefix.
- __xstat.stat.09.02
[EIO] An error occurred while reading from the file system.
- __xstat.stat.09.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- __xstat.stat.09.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- __xstat.stat.09.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- __xstat.stat.09.06
[ENOTDIR] A component of the path prefix is not a directory.
- __xstat.stat.09.07
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __xstat.stat.10
The stat() function may fail if:
- __xstat.stat.10.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- __xstat.stat.10.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- __xstat.stat.10.03
[EOVERFLOW] A value to be stored would overflow one of the members of the stat structure.
- [+]__xstat64 (17 / 4 / 0)
- __xstat64.11
The functions __xstat64(), __lxstat64(), and __fxstat64() shall implement the Large File Support functions stat64(), lstat64(), and fstat64() respectively.
Generalizes:
- __xstat64.stat.01
- __xstat64.stat.02
- __xstat64.stat.03
- __xstat64.stat.04
- __xstat64.stat.05
- __xstat64.stat.09.01
- __xstat64.stat.09.02
- __xstat64.stat.09.03
- __xstat64.stat.09.04
- __xstat64.stat.09.05
- __xstat64.stat.09.06
- __xstat64.stat.09.07
- __xstat64.stat.10.01
- __xstat64.stat.10.02
- __xstat64.stat.10.03
- app.__xstat64.12
ver shall be 3 or the behavior of these functions is undefined.
- __xstat64.13
__xstat64(3, path, stat_buf) shall behave as stat(path, stat_buf) as specified by Large File Support.
Generalizes:
- __xstat64.stat.01
- __xstat64.stat.02
- __xstat64.stat.03
- __xstat64.stat.04
- __xstat64.stat.05
- __xstat64.stat.09.01
- __xstat64.stat.09.02
- __xstat64.stat.09.03
- __xstat64.stat.09.04
- __xstat64.stat.09.05
- __xstat64.stat.09.06
- __xstat64.stat.09.07
- __xstat64.stat.10.01
- __xstat64.stat.10.02
- __xstat64.stat.10.03
- __xstat64.stat.01
If the named file is a symbolic link, the stat() function shall continue pathname resolution using the contents of the symbolic link, and shall return information pertaining to the resulting file if the file exists.
- __xstat64.stat.02
The stat() function shall update any time-related fields (as described in the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.7, File Times Update), before writing into the stat structure.
- __xstat64.stat.03
Upon successful completion, 0 shall be returned.
- __xstat64.stat.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- __xstat64.stat.05
The stat() function shall obtain information about the named file and write it to the area pointed to by the buf argument.
- __xstat64.stat.09
The stat() function shall fail if:
- __xstat64.stat.09.01
[EACCES] Search permission is denied for a component of the path prefix.
- __xstat64.stat.09.02
[EIO] An error occurred while reading from the file system.
- __xstat64.stat.09.03
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- __xstat64.stat.09.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- __xstat64.stat.09.05
[ENOENT] A component of path does not name an existing file or path is an empty string.
- __xstat64.stat.09.06
[ENOTDIR] A component of the path prefix is not a directory.
- __xstat64.stat.09.07
[EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.
- __xstat64.stat.10
The stat() function may fail if:
- __xstat64.stat.10.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- __xstat64.stat.10.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- __xstat64.stat.10.03
[EOVERFLOW] A value to be stored would overflow one of the members of the stat structure.
- [+]utime (14 / 5 / 0)
- utime.01
The utime() function shall set the access and modification times of the file named by the path argument.
- utime.02
If times is a null pointer, the access and modification times of the file shall be set to the current time. The effective user ID of the process shall match the owner of the file, or the process has write permission to the file or has appropriate privileges, to use utime() in this manner.
- utime.03
If times is not a null pointer, times shall be interpreted as a pointer to a utimbuf structure and the access and modification times shall be set to the values contained in the designated structure. Only a process with the effective user ID equal to the user ID of the file or a process with appropriate privileges may use utime() this way.
- utime.04
Upon successful completion, 0 shall be returned.
- utime.05
Otherwise, -1 shall be returned and errno shall be set to indicate the error, and the file times shall not be affected.
- utime.06
The utime() function shall fail if:
- utime.06.01
[EACCES] Search permission is denied by a component of the path prefix; or the times argument is a null pointer and the effective user ID of the process does not match the owner of the file, the process does not have write permission for the file, and the process does not have appropriate privileges.
- utime.06.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- utime.06.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- utime.06.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- utime.06.05
[ENOTDIR] A component of the path prefix is not a directory.
- utime.06.06
[EPERM] The times argument is not a null pointer and the calling process' effective user ID does not match the owner of the file and the calling process does not have the appropriate privileges.
- utime.06.07
[EROFS] The file system containing the file is read-only.
- utime.07
The utime() function may fail if:
- utime.07.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- utime.07.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]utimes (15 / 6 / 0)
- utimes.01
The utimes() function shall set the access and modification times of the file pointed to by the path argument to the value of the times argument. The utimes() function allows time specifications accurate to the microsecond.
- utimes.02
The times in the timeval structure are measured in seconds and microseconds since the Epoch, although rounding toward the nearest second may occur.
- utimes.03
If the times argument is a null pointer, the access and modification times of the file shall be set to the current time.The effective user ID of the process shall match the owner of the file, or has write access to the file or appropriate privileges to use this call in this manner.
- utimes.04
Upon completion, utimes() shall mark the time of the last file status change, st_ctime, for update.
- utimes.05
The utimes() function shall fail if:
- utimes.05.01
[EACCES] Search permission is denied by a component of the path prefix; or the times argument is a null pointer and the effective user ID of the process does not match the owner of the file and write access is denied.
- utimes.05.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- utimes.05.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- utimes.05.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- utimes.05.05
[ENOTDIR] A component of the path prefix is not a directory.
- utimes.05.06
[EPERM] The times argument is not a null pointer and the calling process' effective user ID has write access to the file but does not match the owner of the file and the calling process does not have the appropriate privileges.
- utimes.05.07
[EROFS] The file system containing the file is read-only.
- utimes.06
The utimes() function may fail if:
- utimes.06.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- utimes.06.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- utimes.07
Upon successful completion, 0 shall be returned.
- utimes.08
Otherwise, -1 shall be returned and errno shall be set to indicate the error, and the file times shall not be affected.
- [+]fs.meta.statvfs (48 / 8 / 0)
- [+]fstatvfs (9 / 2 / 0)
- fstatvfs.01
The fstatvfs() function shall obtain information about the file system containing the file referenced by fildes.
Generalizes:
- fstatvfs.03
- fstatvfs.04
- fstatvfs.05.01
- fstatvfs.05.02
- fstatvfs.05.03
- fstatvfs.06.01
- fstatvfs.09
- fstatvfs.10
- fstatvfs.03
Upon successful completion, statvfs() shall return 0.
- fstatvfs.04
Otherwise, it shall return -1 and set errno to indicate the error.
- fstatvfs.05
The fstatvfs() and statvfs() functions shall fail if:
- fstatvfs.05.01
[EIO] An I/O error occurred while reading the file system.
- fstatvfs.05.02
[EINTR] A signal was caught during execution of the function.
- fstatvfs.05.03
[EOVERFLOW] One of the values to be returned cannot be represented correctly in the structure pointed to by buf.
- fstatvfs.06
The fstatvfs() function shall fail if:
- fstatvfs.06.01
[EBADF] The fildes argument is not an open file descriptor.
- app.fstatvfs.08
For both functions, the buf argument is a pointer to a statvfs structure
- fstatvfs.09
Read, write, or execute permission of the named file is not required.
- fstatvfs.10
that shall be filled.
- [+]fstatvfs64 (9 / 2 / 0)
- fstatvfs64.fstatvfs.01
The fstatvfs() function shall obtain information about the file system containing the file referenced by fildes.
Generalizes:
- fstatvfs64.fstatvfs.03
- fstatvfs64.fstatvfs.04
- fstatvfs64.fstatvfs.05.01
- fstatvfs64.fstatvfs.05.02
- fstatvfs64.fstatvfs.05.03
- fstatvfs64.fstatvfs.06.01
- fstatvfs64.fstatvfs.09
- fstatvfs64.fstatvfs.10
- fstatvfs64.fstatvfs.03
Upon successful completion, statvfs() shall return 0.
- fstatvfs64.fstatvfs.04
Otherwise, it shall return -1 and set errno to indicate the error.
- fstatvfs64.fstatvfs.05
The fstatvfs() and statvfs() functions shall fail if:
- fstatvfs64.fstatvfs.05.01
[EIO] An I/O error occurred while reading the file system.
- fstatvfs64.fstatvfs.05.02
[EINTR] A signal was caught during execution of the function.
- fstatvfs64.fstatvfs.05.03
[EOVERFLOW] One of the values to be returned cannot be represented correctly in the structure pointed to by buf.
- fstatvfs64.fstatvfs.06
The fstatvfs() function shall fail if:
- fstatvfs64.fstatvfs.06.01
[EBADF] The fildes argument is not an open file descriptor.
- fstatvfs64.fstatvfs.09
Read, write, or execute permission of the named file is not required.
- fstatvfs64.fstatvfs.10
that shall be filled.
- app.fstatvfs64.fstatvfs.08
For both functions, the buf argument is a pointer to a statvfs structure
- [+]statvfs (15 / 2 / 0)
- statvfs.01
The statvfs() function shall obtain information about the file system containing the file named by path.
Generalizes:
- statvfs.03
- statvfs.04
- statvfs.05.01
- statvfs.05.02
- statvfs.05.03
- statvfs.06.01
- statvfs.06.02
- statvfs.06.03
- statvfs.06.04
- statvfs.06.05
- statvfs.07.01
- statvfs.07.02
- statvfs.09
- statvfs.10
- statvfs.03
Upon successful completion, statvfs() shall return 0.
- statvfs.04
Otherwise, it shall return -1 and set errno to indicate the error.
- statvfs.05
The fstatvfs() and statvfs() functions shall fail if:
- statvfs.05.01
[EIO] An I/O error occurred while reading the file system.
- statvfs.05.02
[EINTR] A signal was caught during execution of the function.
- statvfs.05.03
[EOVERFLOW] One of the values to be returned cannot be represented correctly in the structure pointed to by buf.
- statvfs.06
The statvfs() function shall fail if:
- statvfs.06.01
[EACCES] Search permission is denied on a component of the path prefix.
- statvfs.06.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- statvfs.06.03
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- statvfs.06.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- statvfs.06.05
[ENOTDIR] A component of the path prefix of path is not a directory.
- statvfs.07
The statvfs() function may fail if:
- statvfs.07.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- statvfs.07.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- app.statvfs.08
For both functions, the buf argument is a pointer to a statvfs structure
- statvfs.09
Read, write, or execute permission of the named file is not required.
- statvfs.10
that shall be filled.
- [+]statvfs64 (15 / 2 / 0)
- app.statvfs64.statvfs.08
For both functions, the buf argument is a pointer to a statvfs structure
- statvfs64.statvfs.01
The statvfs() function shall obtain information about the file system containing the file named by path.
Generalizes:
- statvfs64.statvfs.03
- statvfs64.statvfs.04
- statvfs64.statvfs.05.01
- statvfs64.statvfs.05.02
- statvfs64.statvfs.05.03
- statvfs64.statvfs.06.01
- statvfs64.statvfs.06.02
- statvfs64.statvfs.06.03
- statvfs64.statvfs.06.04
- statvfs64.statvfs.06.05
- statvfs64.statvfs.07.01
- statvfs64.statvfs.07.02
- statvfs64.statvfs.09
- statvfs64.statvfs.10
- statvfs64.statvfs.03
Upon successful completion, statvfs() shall return 0.
- statvfs64.statvfs.04
Otherwise, it shall return -1 and set errno to indicate the error.
- statvfs64.statvfs.05
The fstatvfs() and statvfs() functions shall fail if:
- statvfs64.statvfs.05.01
[EIO] An I/O error occurred while reading the file system.
- statvfs64.statvfs.05.02
[EINTR] A signal was caught during execution of the function.
- statvfs64.statvfs.05.03
[EOVERFLOW] One of the values to be returned cannot be represented correctly in the structure pointed to by buf.
- statvfs64.statvfs.06
The statvfs() function shall fail if:
- statvfs64.statvfs.06.01
[EACCES] Search permission is denied on a component of the path prefix.
- statvfs64.statvfs.06.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- statvfs64.statvfs.06.03
[ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- statvfs64.statvfs.06.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- statvfs64.statvfs.06.05
[ENOTDIR] A component of the path prefix of path is not a directory.
- statvfs64.statvfs.07
The statvfs() function may fail if:
- statvfs64.statvfs.07.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- statvfs64.statvfs.07.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- statvfs64.statvfs.09
Read, write, or execute permission of the named file is not required.
- statvfs64.statvfs.10
that shall be filled.
- [+]fs.name (24 / 11 / 0)
- [+]basename (4 / 4 / 0)
- basename.01
The basename() function shall return a pointer to the final component of path.
- basename.01.01
The basename() function shall take the pathname pointed to by path and return a pointer to the final component of the pathname, deleting any trailing '/' characters.
- basename.02
If the string pointed to by path consists entirely of the '/' character, basename() shall return a pointer to the string "/".
- basename.03
If the string pointed to by path is exactly "//", it is implementation-defined whether '/' or "//" is returned
- basename.04
If path is a null pointer or points to an empty string, basename() shall return a pointer to the string ".".
- app.basename.05
The basename() function may modify the string pointed to by path, and may return a pointer to static storage that may then be overwritten by a subsequent call to basename().
- app.basename.06
The basename() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]dirname (5 / 2 / 0)
- dirname.01
The dirname() function shall return a pointer to a string that is the parent directory of path.
- dirname.01.01
The dirname() function shall take a pointer to a character string that contains a pathname, and return a pointer to a string that is a pathname of the parent directory of that file.
- dirname.02
Trailing '/' characters in the path are not counted as part of the path.
- dirname.03
If path does not contain a '/', then dirname() shall return a pointer to the string ".".
- dirname.04
If path is a null pointer or points to an empty string, dirname() shall return a pointer to the string "." .
- app.dirname.05
The dirname() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- app.dirname.06
The dirname() function may modify the string pointed to by path, and may return a pointer to static storage that may then be overwritten by subsequent calls to dirname().
- dirname.07
If path is a null pointer or points to an empty string, a pointer to a string "." is returned.
- [+]realpath (15 / 5 / 0)
- realpath.01
The realpath() function shall derive, from the pathname pointed to by file_name, an absolute pathname that names the same file, whose resolution does not involve '.', '..', or symbolic links.
- realpath.02
The generated pathname shall be stored as a null-terminated string, up to a maximum of {PATH_MAX} bytes, in the buffer pointed to by resolved_name.
- realpath.03
If resolved_name is a null pointer, the behavior of realpath() is implementation-defined.
- realpath.04
Upon successful completion, realpath() shall return a pointer to the resolved name.
- realpath.05
Otherwise, realpath() shall return a null pointer and set errno to indicate the error, and the contents of the buffer pointed to by resolved_name are undefined.
- realpath.06
The realpath() function shall fail if:
- realpath.06.01
[EACCES] Read or search permission was denied for a component of file_name.
- realpath.06.02
[EINVAL] The file_name argument is a null pointer.
- realpath.06.03
[EIO] An error occurred while reading from the file system.
- realpath.06.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the file_name argument.
- realpath.06.05
[ENAMETOOLONG] The length of the file_name argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- realpath.06.06
[ENOENT] A component of file_name does not name an existing file or file_name points to an empty string.
- realpath.06.07
[ENOTDIR] A component of the path prefix is not a directory.
- realpath.07
The realpath() function may fail if:
- realpath.07.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the file_name argument.
- realpath.07.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- realpath.07.03
[ENOMEM] Insufficient storage space is available.
- [+]fs.symlink (33 / 14 / 0)
- [+]readlink (17 / 8 / 0)
- readlink.01
The readlink() function shall place the contents of the symbolic link referred to by path in the buffer buf which has size bufsize.
- readlink.02
If the number of bytes in the symbolic link is less than bufsize, the contents of the remainder of buf are unspecified.
- readlink.03
If the buf argument is not large enough to contain the link content, the first bufsize bytes shall be placed in buf.
- readlink.04
Upon successful completion, readlink() shall return the count of bytes placed in the buffer.
- readlink.05.01
Otherwise, it shall return a value of -1,
- readlink.05.02
leave the buffer unchanged,
- readlink.05.03
and set errno to indicate the error
- readlink.06
The readlink() function shall fail if:
- readlink.06.01
[EACCES] Search permission is denied for a component of the path prefix of path.
- readlink.06.02
[EINVAL] The path argument names a file that is not a symbolic link.
- readlink.06.03
[EIO] An I/O error occurred while reading from the file system.
- readlink.06.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- readlink.06.05
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- readlink.06.06
[ENOENT] A component of path does not name an existing file or path is an empty string.
- readlink.06.07
[ENOTDIR] A component of the path prefix is not a directory.
- readlink.07
The readlink() function may fail if:
- readlink.07.01
[EACCES] Read permission is denied for the directory.
- readlink.07.02
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- readlink.07.03
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]symlink (16 / 6 / 0)
- symlink.01
The symlink() function shall create a symbolic link called path2 that contains the string pointed to by path1
- symlink.02
The string pointed to by path1 shall be treated only as a character string and shall not be validated as a pathname.
- symlink.03
If the symlink() function fails for any reason other than [EIO], any file named by path2 shall be unaffected.
- symlink.04.01
Upon successful completion, symlink() shall return 0;
- symlink.04.02
otherwise, it shall return -1 and set errno to indicate the error.
- symlink.05
The symlink() function shall fail if:
- symlink.05.01
[EACCES] Write permission is denied in the directory where the symbolic link is being created, or search permission is denied for a component of the path prefix of path2.
- symlink.05.02
[EEXIST] The path2 argument names an existing file or symbolic link.
- symlink.05.03
[EIO] An I/O error occurs while reading from or writing to the file system.
- symlink.05.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path2 argument.
- symlink.05.05
[ENAMETOOLONG] The length of the path2 argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX} or the length of the path1 argument is longer than {SYMLINK_MAX}.
- symlink.05.06
[ENOENT] A component of path2 does not name an existing file or path2 is an empty string.
- symlink.05.07
[ENOSPC] The directory in which the entry for the new symbolic link is being placed cannot be extended because no space is left on the file system containing the directory, or the new symbolic link cannot be created because no space is left on the file system which shall contain the link, or the file system is out of file-allocation resources.
- symlink.05.08
[ENOTDIR] A component of the path prefix of path2 is not a directory.
- symlink.05.09
[EROFS] The new symbolic link would reside on a read-only file system.
- symlink.06
The symlink() function may fail if:
- symlink.06.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path2 argument.
- symlink.06.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path2 argument, the length of the substituted pathname string exceeded {PATH_MAX} bytes (including the terminating null byte), or the length of the string pointed to by path1 exceeded {SYMLINK_MAX}.
- [+]fs.tmpfile (69 / 14 / 0)
- [+]mkstemp (7 / 3 / 0)
- mkstemp.01.01
The mkstemp() function shall replace the contents of the string pointed to by template by a unique filename,
Generalizes:
- mkstemp.01.02
- mkstemp.02
- mkstemp.04
- mkstemp.05
- mkstemp.06.01
- mkstemp.06.02
- mkstemp.01.02
and return a file descriptor for the file open for reading and writing.
- mkstemp.02
The function thus prevents any possible race condition between testing whether the file exists and opening it for use.
- app.mkstemp.03
The string in template should look like a filename
- app.mkstemp.03.01
- app.mkstemp.03.02
with six trailing 'X' s;
- mkstemp.04
mkstemp() replaces each 'X' with a character from the portable filename character set.
- mkstemp.05
The characters are chosen such that the resulting name does not duplicate the name of an existing file at the time of a call to mkstemp().
- mkstemp.06.01
Upon successful completion, mkstemp() shall return an open file descriptor.
- mkstemp.06.02
Otherwise, -1 shall be returned if no suitable file could be created.
- [+]mkstemp64 (7 / 0 / 0)
- app.mkstemp64.mkstemp.03
The string in template should look like a filename
- app.mkstemp64.mkstemp.03.01
- app.mkstemp64.mkstemp.03.02
with six trailing 'X' s;
- mkstemp64.mkstemp.01.01
The mkstemp() function shall replace the contents of the string pointed to by template by a unique filename,
Generalizes:
- mkstemp64.mkstemp.01.02
- mkstemp64.mkstemp.02
- mkstemp64.mkstemp.04
- mkstemp64.mkstemp.05
- mkstemp64.mkstemp.06.01
- mkstemp64.mkstemp.06.02
- mkstemp64.mkstemp.01.02
and return a file descriptor for the file open for reading and writing.
- mkstemp64.mkstemp.02
The function thus prevents any possible race condition between testing whether the file exists and opening it for use.
- mkstemp64.mkstemp.04
mkstemp() replaces each 'X' with a character from the portable filename character set.
- mkstemp64.mkstemp.05
The characters are chosen such that the resulting name does not duplicate the name of an existing file at the time of a call to mkstemp().
- mkstemp64.mkstemp.06.01
Upon successful completion, mkstemp() shall return an open file descriptor.
- mkstemp64.mkstemp.06.02
Otherwise, -1 shall be returned if no suitable file could be created.
- [+]mktemp (5 / 3 / 0)
- mktemp.01.01
The mktemp() function shall replace the contents of the string pointed to by template by a unique filename
- mktemp.01.02
and return template.
- app.mktemp.02
The application shall initialize template to be a filename
- app.mktemp.02.01
- app.mktemp.02.02
with six trailing 'X' s;
- mktemp.03
mktemp() shall replace each 'X' with a single byte character from the portable filename character set.
- mktemp.04.01
The mktemp() function shall return the pointer template.
- mktemp.04.02
If a unique name cannot be created, template shall point to a null string.
- [+]tempnam (12 / 3 / 0)
- tempnam.01
The tempnam() function shall generate a pathname that may be used for a temporary file.
Generalizes:
- tempnam.02
- tempnam.03
- tempnam.04
- tempnam.05
- tempnam.06.01
- tempnam.06.02
- tempnam.07.01.01
- tempnam.07.01.02
- tempnam.07.02
- tempnam.08.01
- tempnam.09
- tempnam.02
The tempnam() function allows the user to control the choice of a directory.
- tempnam.03
The dir argument points to the name of the directory in which the file is to be created.
- tempnam.04
If dir is a null pointer or points to a string which is not a name for an appropriate directory, the path prefix defined as P_tmpdir in the <stdio.h> header shall be used.
- tempnam.05
If that directory is not accessible, an implementation-defined directory may be used.
- tempnam.06
The pfx argument should be used for this.
- tempnam.06.01
This argument may be a null pointer
- tempnam.06.02
a string of up to five bytes to be used as the beginning of the filename
- tempnam.07.01.01
Upon successful completion, tempnam() shall allocate space for a string, put the generated pathname in that space, and return a pointer to it.
- tempnam.07.01.02
The pointer shall be suitable for use in a subsequent call to free().
- tempnam.07.02
Otherwise, it shall return a null pointer and set errno to indicate the error.
- tempnam.08
The tempnam() function shall fail if:
- tempnam.08.01
[ENOMEM] Insufficient storage space is available.
- tempnam.09
Some implementations of tempnam() may use tmpnam() internally. On such implementations, if called more than {TMP_MAX} times in a single process, the behavior is implementation-defined.
- [+]tmpfile (14 / 3 / 0)
- tmpfile.01
The tmpfile() function shall create a temporary file and open a corresponding stream.
Generalizes:
- tmpfile.02
- tmpfile.03
- tmpfile.04
- tmpfile.05
- tmpfile.06.01
- tmpfile.06.02
- tmpfile.07.01
- tmpfile.07.02
- tmpfile.07.03
- tmpfile.07.04
- tmpfile.07.05
- tmpfile.08.01
- tmpfile.08.02
- tmpfile.02
The file shall be automatically deleted when all references to the file are closed.
- tmpfile.03
The file is opened as in fopen() for update (w+).
- tmpfile.04
In some implementations, a permanent file may be left behind if the process calling tmpfile() is killed while it is processing a call to tmpfile().
- tmpfile.05
An error message may be written to standard error if the stream cannot be opened.
- tmpfile.06.01
Upon successful completion, tmpfile() shall return a pointer to the stream of the file that is created.
- tmpfile.06.02
Otherwise, it shall return a null pointer [CX] and set errno to indicate the error.
- tmpfile.07
The tmpfile() function shall fail if:
- tmpfile.07.01
[EINTR] [CX] A signal was caught during tmpfile().
- tmpfile.07.02
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- tmpfile.07.03
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- tmpfile.07.04
[ENOSPC] [CX] The directory or file system which would contain the new file cannot be expanded.
- tmpfile.07.05
[EOVERFLOW] [CX] The file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- tmpfile.08
The tmpfile() function may fail if:
- tmpfile.08.01
[EMFILE] [CX] {FOPEN_MAX} streams are currently open in the calling process.
- tmpfile.08.02
[ENOMEM] [CX] Insufficient storage space is available.
- [+]tmpfile64 (14 / 0 / 0)
- tmpfile64.tmpfile.01
The tmpfile() function shall create a temporary file and open a corresponding stream.
Generalizes:
- tmpfile64.tmpfile.02
- tmpfile64.tmpfile.03
- tmpfile64.tmpfile.04
- tmpfile64.tmpfile.05
- tmpfile64.tmpfile.06.01
- tmpfile64.tmpfile.06.02
- tmpfile64.tmpfile.07.01
- tmpfile64.tmpfile.07.02
- tmpfile64.tmpfile.07.03
- tmpfile64.tmpfile.07.04
- tmpfile64.tmpfile.07.05
- tmpfile64.tmpfile.08.01
- tmpfile64.tmpfile.08.02
- tmpfile64.tmpfile.02
The file shall be automatically deleted when all references to the file are closed.
- tmpfile64.tmpfile.03
The file is opened as in fopen() for update (w+).
- tmpfile64.tmpfile.04
In some implementations, a permanent file may be left behind if the process calling tmpfile() is killed while it is processing a call to tmpfile().
- tmpfile64.tmpfile.05
An error message may be written to standard error if the stream cannot be opened.
- tmpfile64.tmpfile.06.01
Upon successful completion, tmpfile() shall return a pointer to the stream of the file that is created.
- tmpfile64.tmpfile.06.02
Otherwise, it shall return a null pointer [CX] and set errno to indicate the error.
- tmpfile64.tmpfile.07
The tmpfile() function shall fail if:
- tmpfile64.tmpfile.07.01
[EINTR] [CX] A signal was caught during tmpfile().
- tmpfile64.tmpfile.07.02
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- tmpfile64.tmpfile.07.03
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- tmpfile64.tmpfile.07.04
[ENOSPC] [CX] The directory or file system which would contain the new file cannot be expanded.
- tmpfile64.tmpfile.07.05
[EOVERFLOW] [CX] The file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- tmpfile64.tmpfile.08
The tmpfile() function may fail if:
- tmpfile64.tmpfile.08.01
[EMFILE] [CX] {FOPEN_MAX} streams are currently open in the calling process.
- tmpfile64.tmpfile.08.02
[ENOMEM] [CX] Insufficient storage space is available.
- [+]tmpnam (10 / 2 / 0)
- tmpnam.01
The tmpnam() function shall generate a string that is a valid filename and that is not the same as the name of an existing file.
Generalizes:
- tmpnam.02
- tmpnam.03.01
- tmpnam.03.02
- tmpnam.04
- tmpnam.06
- tmpnam.07
- tmpnam.08
- tmpnam.09
- tmpnam.10.02
- tmpnam.02
The function is potentially capable of generating {TMP_MAX} different strings, but any or all of them may already be in use by existing files and thus not be suitable return values.
- tmpnam.03.01
The tmpnam() function generates a different string each time it is called from the same process, up to {TMP_MAX} times.
- tmpnam.03.02
If it is called more than {TMP_MAX} times, the behavior is implementation-defined.
- tmpnam.04
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001, except tempnam(), calls tmpnam().
- app.tmpnam.05
If the application uses any of the functions guaranteed to be available if either _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS is defined, the application shall ensure that the tmpnam() function is called with a non-NULL parameter.
- tmpnam.06
Upon successful completion, tmpnam() shall return a pointer to a string
- tmpnam.07
If no suitable string can be generated, the tmpnam() function shall return a null pointer.
- tmpnam.08
If the argument s is a null pointer, tmpnam() shall leave its result in an internal static object and return a pointer to that object.
- tmpnam.09
Subsequent calls to tmpnam() may modify the same object.
- tmpnam.10.02
tmpnam() shall write its result in that array and shall return the argument as its value.
- app.tmpnam.10.01
If the argument s is not a null pointer, it is presumed to point to an array of at least L_tmpnam chars;
- [+]io.file (1144 / 309 / 0)
- [+]close (31 / 10 / 0)
- close.01
The close() function shall deallocate the file descriptor indicated by fildes. To deallocate means to make the file descriptor available for return by subsequent calls to open() or other functions that allocate file descriptors.
- close.02
All outstanding record locks owned by the process on the file associated with the file descriptor shall be removed (that is, unlocked).
- close.03
When all file descriptors associated with a pipe or FIFO special file are closed, any data remaining in the pipe or FIFO shall be discarded.
- close.04
When all file descriptors associated with an open file description have been closed, the open file description shall be freed.
- close.05
If the link count of the file is 0, when all file descriptors associated with the file are closed, the space occupied by the file shall be freed and the file shall no longer be accessible.
- close.06.01
If a STREAMS-based fildes is closed and the calling process was previously registered to receive a SIGPOLL signal for events associated with that STREAM, the calling process shall be unregistered for events associated with the STREAM.
- close.06.02
The last close() for a STREAM shall cause the STREAM associated with fildes to be dismantled.
- close.06.03
If O_NONBLOCK is not set and there have been no signals posted for the STREAM, and if there is data on the module's write queue, close() shall wait for an unspecified time (for each module and driver) for any output to drain before dismantling the STREAM.
- close.06.04
If the O_NONBLOCK flag is set, or if there are any pending signals, close() shall not wait for output to drain, and shall dismantle the STREAM immediately.
- close.07.01
If the implementation supports STREAMS-based pipes, and fildes is associated with one end of a pipe, the last close() shall cause a hangup to occur on the other end of the pipe.
- close.07.02
In addition, if the other end of the pipe has been named by fattach(), then the last close() shall force the named end to be detached by fdetach().
- close.07.03
If the named end has no open file descriptors associated with it and gets detached, the STREAM associated with that end shall also be dismantled.
- close.08
If fildes refers to the master side of a pseudo-terminal, and this is the last close, a SIGHUP signal shall be sent to the controlling process, if any, for which the slave side of the pseudo-terminal is the controlling terminal.
- close.09
If fildes refers to the slave side of a STREAMS-based pseudo-terminal, a zero-length message may be sent to the master.
- close.10.01
When there is an outstanding cancelable asynchronous I/O operation against fildes when close() is called, that I/O operation may be canceled.
- close.10.02
An I/O operation that is not canceled completes as if the close() operation had not yet occurred.
- close.10.03
All operations that are not canceled shall complete as if the close() blocked until the operations completed.
- close.10.04
The close() operation itself need not block awaiting such I/O completion.
- close.11.01
If a shared memory object or a memory mapped file remains referenced at the last close (that is, a process has it mapped), then the entire contents of the memory object shall persist until the memory object becomes unreferenced.
- close.11.02
If this is the last close of a shared memory object or a memory mapped file and the close results in the memory object becoming unreferenced, and the memory object has been unlinked, then the memory object shall be removed.
- close.12.01
If fildes refers to a socket, close() shall cause the socket to be destroyed.
- close.12.02
If the socket is in connection-mode, and the SO_LINGER option is set for the socket with non-zero linger time, and the socket has untransmitted data, then close() shall block for up to the current linger interval until all data is transmitted.
- close.13.01
Upon successful completion, 0 shall be returned;
- close.13.02
otherwise, -1 shall be returned and errno set to indicate the error.
- close.14
The close() function shall fail if:
- close.14.01
[EBADF] The fildes argument is not a valid file descriptor.
- close.14.02
[EINTR] The close() function was interrupted by a signal.
- close.15
The close() function may fail if:
- close.15.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- close.16.01
If close() is interrupted by a signal that is to be caught, it shall return -1 with errno set to [EINTR] and the state of fildes is unspecified.
- close.16.02
If an I/O error occurred while reading from or writing to the file system during close(), it may return -1 with errno set to [EIO]; if this error is returned, the state of fildes is unspecified.
- close.20
The last process to close a terminal device file shall cause any output to be sent to the device and any input to be discarded. If HUPCL is set in the control modes and the communications port supports a disconnect function, the terminal device shall perform a disconnect.
- close.21
If a modem disconnect is detected by the terminal interface for a controlling terminal, and if CLOCAL is not set in the c_cflag field for the terminal (see Control Modes), the SIGHUP signal shall be sent to the controlling process for which the terminal is the controlling terminal.
- [+]creat (41 / 0 / 0)
- creat.01
The function call:creat(path, mode)shall be equivalent to:open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)
- app.creat.open.06.06
When bits other than the file permission bits are set, the effect is unspecified.
- creat.open.01
The open() function shall establish the connection between a file and a file descriptor. It shall create an open file description that refers to a file and a file descriptor that refers to that open file description.
- creat.open.02.01
The open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open for that process.
- creat.open.02.02
The open file description is new, and therefore the file descriptor shall not share it with any other process in the system.
- creat.open.02.03
The FD_CLOEXEC file descriptor flag associated with the new file descriptor shall be cleared.
- creat.open.03
The file offset used to mark the current position within the file shall be set to the beginning of the file.
- creat.open.04
The file status flags and file access modes of the open file description shall be set according to the value of oflag.
- creat.open.06.02
Otherwise, the file shall be created;
- creat.open.06.03
the user ID of the file shall be set to the effective user ID of the process;
- creat.open.06.04
the group ID of the file shall be set to the group ID of the file's parent directory or to the effective group ID of the process;
- creat.open.06.05
and the access permission bits (see <sys/stat.h>) of the file mode shall be set to the value of the third argument taken as type mode_t modified as follows: a bitwise AND is performed on the file-mode bits and the corresponding bits in the complement of the process' file mode creation mask. Thus, all bits in the file mode whose corresponding bit in the file mode creation mask is set are cleared.
- creat.open.13.01
If the file exists and is a regular file, and the file is successfully opened O_RDWR or O_WRONLY, its length shall be truncated to 0, and the mode and owner shall be unchanged.
- creat.open.14
If O_CREAT is set and the file did not previously exist, upon successful completion, open() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- creat.open.15
If O_TRUNC is set and the file did previously exist, upon successful completion, open() shall mark for update the st_ctime and st_mtime fields of the file.
- creat.open.30.01
Upon successful completion, the function shall open the file and return a non-negative integer representing the lowest numbered unused file descriptor.
- creat.open.30.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- creat.open.30.03
No files shall be created or modified if the function returns -1.
- creat.open.31
The open() function shall fail if:
- creat.open.31.01
[EACCES] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by oflag are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created, or O_TRUNC is specified and write permission is denied.
- creat.open.31.02
[EEXIST] O_CREAT and O_EXCL are set, and the named file exists.
- creat.open.31.03
[EINTR] A signal was caught during open().
- creat.open.31.04
[EINVAL] [SIO] The implementation does not support synchronized I/O for this file.
- creat.open.31.05
[EIO] [XSR] The path argument names a STREAMS file and a hangup or error occurred during the open().
- creat.open.31.06
[EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR.
- creat.open.31.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- creat.open.31.08
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- creat.open.31.09
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- creat.open.31.10
[ENFILE] The maximum allowable number of files is currently open in the system.
- creat.open.31.11
[ENOENT] O_CREAT is not set and the named file does not exist; or O_CREAT is set and either the path prefix does not exist or the path argument points to an empty string.
- creat.open.31.12
[ENOSR] [XSR] The path argument names a STREAMS-based file and the system is unable to allocate a STREAM.
- creat.open.31.13
[ENOSPC] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and O_CREAT is specified.
- creat.open.31.14
[ENOTDIR] A component of the path prefix is not a directory.
- creat.open.31.15
[ENXIO] O_NONBLOCK is set, the named file is a FIFO, O_WRONLY is set, and no process has the file open for reading.
- creat.open.31.16
[ENXIO] The named file is a character special or block special file, and the device associated with this special file does not exist.
- creat.open.31.17
[EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- creat.open.31.18
[EROFS] The named file resides on a read-only file system and either O_WRONLY, O_RDWR, O_CREAT (if the file does not exist), or O_TRUNC is set in the oflag argument.
- creat.open.32
The open() function may fail if:
- creat.open.32.01
[EAGAIN] [XSI] The path argument names the slave side of a pseudo-terminal device that is locked.
- creat.open.32.02
[EINVAL] The value of the oflag argument is not valid.
- creat.open.32.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- creat.open.32.04
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- creat.open.32.05
[ENOMEM] [XSR] The path argument names a STREAMS file and the system is unable to allocate resources.
- creat.open.32.06
[ETXTBSY] The file is a pure procedure (shared text) file that is being executed and oflag is O_WRONLY or O_RDWR.
- [+]creat64 (40 / 0 / 0)
- creat64.open.01
The open() function shall establish the connection between a file and a file descriptor. It shall create an open file description that refers to a file and a file descriptor that refers to that open file description.
- creat64.open.02.01
The open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open for that process.
- creat64.open.02.02
The open file description is new, and therefore the file descriptor shall not share it with any other process in the system.
- creat64.open.02.03
The FD_CLOEXEC file descriptor flag associated with the new file descriptor shall be cleared.
- creat64.open.03
The file offset used to mark the current position within the file shall be set to the beginning of the file.
- creat64.open.04
The file status flags and file access modes of the open file description shall be set according to the value of oflag.
- creat64.open.06.02
Otherwise, the file shall be created;
- creat64.open.06.03
the user ID of the file shall be set to the effective user ID of the process;
- creat64.open.06.04
the group ID of the file shall be set to the group ID of the file's parent directory or to the effective group ID of the process;
- creat64.open.06.05
and the access permission bits (see <sys/stat.h>) of the file mode shall be set to the value of the third argument taken as type mode_t modified as follows: a bitwise AND is performed on the file-mode bits and the corresponding bits in the complement of the process' file mode creation mask. Thus, all bits in the file mode whose corresponding bit in the file mode creation mask is set are cleared.
- creat64.open.13.01
If the file exists and is a regular file, and the file is successfully opened O_RDWR or O_WRONLY, its length shall be truncated to 0, and the mode and owner shall be unchanged.
- creat64.open.14
If O_CREAT is set and the file did not previously exist, upon successful completion, open() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- creat64.open.15
If O_TRUNC is set and the file did previously exist, upon successful completion, open() shall mark for update the st_ctime and st_mtime fields of the file.
- creat64.open.30.01
Upon successful completion, the function shall open the file and return a non-negative integer representing the lowest numbered unused file descriptor.
- creat64.open.30.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- creat64.open.30.03
No files shall be created or modified if the function returns -1.
- creat64.open.31
The open() function shall fail if:
- creat64.open.31.01
[EACCES] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by oflag are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created, or O_TRUNC is specified and write permission is denied.
- creat64.open.31.02
[EEXIST] O_CREAT and O_EXCL are set, and the named file exists.
- creat64.open.31.03
[EINTR] A signal was caught during open().
- creat64.open.31.04
[EINVAL] [SIO] The implementation does not support synchronized I/O for this file.
- creat64.open.31.05
[EIO] [XSR] The path argument names a STREAMS file and a hangup or error occurred during the open().
- creat64.open.31.06
[EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR.
- creat64.open.31.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- creat64.open.31.08
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- creat64.open.31.09
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- creat64.open.31.10
[ENFILE] The maximum allowable number of files is currently open in the system.
- creat64.open.31.11
[ENOENT] O_CREAT is not set and the named file does not exist; or O_CREAT is set and either the path prefix does not exist or the path argument points to an empty string.
- creat64.open.31.12
[ENOSR] [XSR] The path argument names a STREAMS-based file and the system is unable to allocate a STREAM.
- creat64.open.31.13
[ENOSPC] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and O_CREAT is specified.
- creat64.open.31.14
[ENOTDIR] A component of the path prefix is not a directory.
- creat64.open.31.15
[ENXIO] O_NONBLOCK is set, the named file is a FIFO, O_WRONLY is set, and no process has the file open for reading.
- creat64.open.31.16
[ENXIO] The named file is a character special or block special file, and the device associated with this special file does not exist.
- creat64.open.31.17
[EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- creat64.open.31.18
[EROFS] The named file resides on a read-only file system and either O_WRONLY, O_RDWR, O_CREAT (if the file does not exist), or O_TRUNC is set in the oflag argument.
- creat64.open.32
The open() function may fail if:
- creat64.open.32.01
[EAGAIN] [XSI] The path argument names the slave side of a pseudo-terminal device that is locked.
- creat64.open.32.02
[EINVAL] The value of the oflag argument is not valid.
- creat64.open.32.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- creat64.open.32.04
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- creat64.open.32.05
[ENOMEM] [XSR] The path argument names a STREAMS file and the system is unable to allocate resources.
- creat64.open.32.06
[ETXTBSY] The file is a pure procedure (shared text) file that is being executed and oflag is O_WRONLY or O_RDWR.
- app.creat64.open.06.06
When bits other than the file permission bits are set, the effect is unspecified.
- [+]dup (8 / 6 / 0)
- dup.01
The dup() and dup2() functions provide an alternative interface to the service provided by fcntl() using the F_DUPFD command. The call:fid = dup(fildes);shall be equivalent to:fid = fcntl(fildes, F_DUPFD, 0);
- dup.06.01
Upon successful completion a non-negative integer, namely the file descriptor, shall be returned;
- dup.06.02
otherwise, -1 shall be returned and errno set to indicate the error.
- dup.07
The dup() function shall fail if:
- dup.07.01
[EBADF] The fildes argument is not a valid open file descriptor.
- dup.07.02
[EMFILE] The number of file descriptors in use by this process would exceed {OPEN_MAX}.
- dup.fcntl.01.01.01
Return a new file descriptor which shall be the lowest numbered available (that is, not already open) file descriptor greater than or equal to the third argument, arg, taken as an integer of type int.
- dup.fcntl.01.01.02
The new file descriptor shall refer to the same open file description as the original file descriptor, and shall share any locks.
- dup.fcntl.01.01.03
The FD_CLOEXEC flag associated with the new file descriptor shall be cleared to keep the file open across calls to one of the exec functions.
- app.dup.fcntl.27
If fildes refers to a typed memory object, the result of the fcntl() function is unspecified.
- [+]dup2 (13 / 10 / 0)
- dup2.01
The call:fid = dup2(fildes, fildes2);shall be equivalent to:close(fildes2);fid = fcntl(fildes, F_DUPFD, fildes2);
- dup2.02
If fildes2 is less than 0 or greater than or equal to {OPEN_MAX}, dup2() shall return -1 with errno set to [EBADF].
- dup2.03
If fildes is a valid file descriptor and is equal to fildes2, dup2() shall return fildes2 without closing it.
- dup2.04
If fildes is not a valid file descriptor, dup2() shall return -1 and shall not close fildes2.
- dup2.05.01
The value returned shall be equal to the value of fildes2 upon successful completion,
- dup2.05.02
or -1 upon failure.
- dup2.06.01
Upon successful completion a non-negative integer, namely the file descriptor, shall be returned;
- dup2.06.02
otherwise, -1 shall be returned and errno set to indicate the error.
- dup2.07
The dup2() function shall fail if:
- dup2.07.01
[EBADF] The fildes argument is not a valid open file descriptor or the argument fildes2 is negative or greater than or equal to {OPEN_MAX}.
- dup2.07.02
[EINTR] The dup2() function was interrupted by a signal.
- app.dup2.fcntl.27
If fildes refers to a typed memory object, the result of the fcntl() function is unspecified.
- dup2.fcntl.01.01.01
Return a new file descriptor which shall be the lowest numbered available (that is, not already open) file descriptor greater than or equal to the third argument, arg, taken as an integer of type int.
- dup2.fcntl.01.01.02
The new file descriptor shall refer to the same open file description as the original file descriptor, and shall share any locks.
- dup2.fcntl.01.01.03
The FD_CLOEXEC flag associated with the new file descriptor shall be cleared to keep the file open across calls to one of the exec functions.
- [+]fcntl (79 / 51 / 0)
- fcntl.01
The fcntl() function shall perform the operations described below on open files. The fildes argument is a file descriptor.The available values for cmd are defined in <fcntl.h> and are as follows:
- fcntl.01.01
F_DUPFD
- fcntl.01.01.01
Return a new file descriptor which shall be the lowest numbered available (that is, not already open) file descriptor greater than or equal to the third argument, arg, taken as an integer of type int.
- fcntl.01.01.02
The new file descriptor shall refer to the same open file description as the original file descriptor, and shall share any locks.
- fcntl.01.01.03
The FD_CLOEXEC flag associated with the new file descriptor shall be cleared to keep the file open across calls to one of the exec functions.
- fcntl.01.02
F_GETFD
- fcntl.01.02.01
Get the file descriptor flags defined in <fcntl.h> that are associated with the file descriptor fildes.
- fcntl.01.02.02
File descriptor flags are associated with a single file descriptor and do not affect other file descriptors that refer to the same file.
- fcntl.01.03
F_SETFD
- fcntl.01.03.01
Set the file descriptor flags defined in <fcntl.h>, that are associated with fildes, to the third argument, arg, taken as type int.
- fcntl.01.03.02
If the FD_CLOEXEC flag in the third argument is 0, the file shall remain open across the exec functions;
- fcntl.01.03.03
otherwise, the file shall be closed upon successful execution of one of the exec functions.
- fcntl.01.04
F_GETFL
- fcntl.01.04.01
Get the file status flags and file access modes, defined in <fcntl.h>, for the file description associated with fildes.
- fcntl.01.04.02
The file access modes can be extracted from the return value using the mask O_ACCMODE, which is defined in <fcntl.h>.
- fcntl.01.04.03
File status flags and file access modes are associated with the file description and do not affect other file descriptors that refer to the same file with different open file descriptions.
- fcntl.01.05
F_SETFL
- fcntl.01.05.01
Set the file status flags, defined in <fcntl.h>, for the file description associated with fildes from the corresponding bits in the third argument, arg, taken as type int.
- fcntl.01.05.02
Bits corresponding to the file access mode and the file creation flags, as defined in <fcntl.h>, that are set in arg shall be ignored.
- fcntl.01.06
F_GETOWN
- fcntl.01.06.01
If fildes refers to a socket, get the process or process group ID specified to receive SIGURG signals when out-of-band data is available.
- fcntl.01.06.02
Positive values indicate a process ID; negative values, other than -1, indicate a process group ID.
- fcntl.01.07
F_SETOWN
- fcntl.01.07.01
If fildes refers to a socket, set the process or process group ID specified to receive SIGURG signals when out-of-band data is available, using the value of the third argument, arg, taken as type int.
- fcntl.01.07.02
Positive values indicate a process ID; negative values, other than -1, indicate a process group ID.
- app.fcntl.01.05.03
If any bits in arg other than those mentioned here are changed by the application, the result is unspecified.
- app.fcntl.01.06.03
If fildes does not refer to a socket, the results are unspecified.
- app.fcntl.01.07.03
If fildes does not refer to a socket, the results are unspecified.
- fcntl.02
The following values for cmd are available for advisory record locking. Record locking shall be supported for regular files, and may be supported for other files.
- fcntl.02.01
F_GETLK
- fcntl.02.01.01
Get the first lock which blocks the lock description pointed to by the third argument, arg, taken as a pointer to type struct flock, defined in <fcntl.h>.
- fcntl.02.01.02
The information retrieved shall overwrite the information passed to fcntl() in the structure flock.
- fcntl.02.01.03
If no lock is found that would prevent this lock from being created, then the structure shall be left unchanged except for the lock type which shall be set to F_UNLCK.
- fcntl.02.02
F_SETLK
- fcntl.02.02.01
Set or clear a file segment lock according to the lock description pointed to by the third argument, arg, taken as a pointer to type struct flock, defined in <fcntl.h>.
- fcntl.02.02.02
F_SETLK can establish shared (or read) locks (F_RDLCK) or exclusive (or write) locks (F_WRLCK), as well as to remove either type of lock (F_UNLCK). F_RDLCK, F_WRLCK, and F_UNLCK are defined in <fcntl.h>.
- fcntl.02.02.03
If a shared or exclusive lock cannot be set, fcntl() shall return immediately with a return value of -1.
- fcntl.02.03
F_SETLKW
- fcntl.02.03.01
This command shall be equivalent to F_SETLK except that if a shared or exclusive lock is blocked by other locks, the thread shall wait until the request can be satisfied.
- fcntl.02.03.02
If a signal that is to be caught is received while fcntl() is waiting for a region, fcntl() shall be interrupted.
- fcntl.02.03.03
Upon return from the signal handler, fcntl() shall return -1 with errno set to [EINTR], and the lock operation shall not be done.
- fcntl.03
When a shared lock is set on a segment of a file, other processes shall be able to set shared locks on that segment or a portion of it.
- fcntl.04
A shared lock prevents any other process from setting an exclusive lock on any portion of the protected area.
- fcntl.05
A request for a shared lock shall fail if the file descriptor was not opened with read access.
- fcntl.06
An exclusive lock shall prevent any other process from setting a shared lock or an exclusive lock on any portion of the protected area.
- fcntl.07
A request for an exclusive lock shall fail if the file descriptor was not opened with write access.
- fcntl.08
The value of l_whence is SEEK_SET, SEEK_CUR, or SEEK_END, to indicate that the relative offset l_start bytes shall be measured from the start of the file, current position, or end of the file, respectively.
- fcntl.09
The value of l_len is the number of consecutive bytes to be locked. The value of l_len may be negative (where the definition of off_t permits negative values of l_len).
- fcntl.10
The l_pid field is only used with F_GETLK to return the process ID of the process holding a blocking lock.
- fcntl.11
After a successful F_GETLK request, when a blocking lock is found, the values returned in the flock structure shall be as follows:
- fcntl.11.01
l_type Type of blocking lock found.
- fcntl.11.02
l_whence SEEK_SET.
- fcntl.11.03
l_start Start of the blocking lock.
- fcntl.11.04
l_len Length of the blocking lock.
- fcntl.11.05
l_pid Process ID of the process that holds the blocking lock.
- fcntl.12
If the command is F_SETLKW and the process must wait for another process to release a lock, then the range of bytes to be locked shall be determined before the fcntl() function blocks.
- fcntl.13
If the file size or file descriptor seek offset change while fcntl() is blocked, this shall not affect the range of bytes locked.
- fcntl.14
If l_len is positive, the area affected shall start at l_start and end at l_start+ l_len-1.
- fcntl.15
If l_len is negative, the area affected shall start at l_start+ l_len and end at l_start-1.
- fcntl.16.01
Locks may start and extend beyond the current end of a file,
- fcntl.16.02
but shall not extend before the beginning of the file.
- fcntl.17
A lock shall be set to extend to the largest possible value of the file offset for that file by setting l_len to 0.
- fcntl.18
If such a lock also has l_start set to 0 and l_whence is set to SEEK_SET, the whole file shall be locked.
- fcntl.19
There shall be at most one type of lock set for each byte in the file.
- fcntl.20
Before a successful return from an F_SETLK or an F_SETLKW request when the calling process has previously existing locks on bytes in the region specified by the request, the previous lock type for each byte in the specified region shall be replaced by the new lock type.
- fcntl.21
As specified above under the descriptions of shared locks and exclusive locks, an F_SETLK or an F_SETLKW request (respectively) shall fail or block when another process has existing locks on bytes in the specified region and the type of any of those locks conflicts with the type specified in the request.
- fcntl.22
All locks associated with a file for a given process shall be removed when a file descriptor for that file is closed by that process or the process holding that file descriptor terminates.
- fcntl.23.01
Locks are not inherited by a child process.
- fcntl.23.02
A potential for deadlock occurs if a process controlling a locked region is put to sleep by attempting to lock another process' locked region. If the system detects that sleeping until a locked region is unlocked would cause a deadlock, fcntl() shall fail with an [EDEADLK] error.
- fcntl.24
An unlock (F_UNLCK) request in which l_len is non-zero and the offset of the last byte of the requested segment is the maximum value for an object of type off_t, when the process has an existing lock in which l_len is 0 and which includes the last byte of the requested segment, shall be treated as a request to unlock from the start of the requested segment with an l_len equal to 0.
- fcntl.25
Otherwise, an unlock (F_UNLCK) request shall attempt to unlock only the requested segment.
- app.fcntl.26
[SHM] When the file descriptor fildes refers to a shared memory object, the behavior of fcntl() shall be the same as for a regular file except the effect of the following values for the argument cmd shall be unspecified: F_SETFL, F_GETLK, F_SETLK, and F_SETLKW.
- app.fcntl.27
If fildes refers to a typed memory object, the result of the fcntl() function is unspecified.
- fcntl.28
Upon successful completion, the value returned shall depend on cmd as follows:
- fcntl.28.01
F_DUPFD A new file descriptor.
- fcntl.28.02
F_GETFD Value of flags defined in <fcntl.h>. The return value shall not be negative.
- fcntl.28.03
F_SETFD Value other than -1.
- fcntl.28.04
F_GETFL Value of file status flags and access modes. The return value is not negative.
- fcntl.28.05
F_SETFL Value other than -1.
- fcntl.28.06
F_GETLK Value other than -1.
- fcntl.28.07
F_SETLK Value other than -1.
- fcntl.28.08
F_SETLKW Value other than -1.
- fcntl.28.09
F_GETOWN Value of the socket owner process or process group; this will not be -1.
- fcntl.28.10
F_SETOWN Value other than -1.
- fcntl.29
Otherwise, -1 shall be returned and errno set to indicate the error.
- fcntl.30
The fcntl() function shall fail if:
- fcntl.30.01
[EACCES] or [EAGAIN] The cmd argument is F_SETLK; the type of lock ( l_type) is a shared (F_RDLCK) or exclusive (F_WRLCK) lock and the segment of a file to be locked is already exclusive-locked by another process, or the type is an exclusive lock and some portion of the segment of a file to be locked is already shared-locked or exclusive-locked by another process.
- fcntl.30.02
[EBADF]
- fcntl.30.02.01
The fildes argument is not a valid open file descriptor,
- fcntl.30.02.02
or the argument cmd is F_SETLK or F_SETLKW, the type of lock, l_type, is a shared lock (F_RDLCK), and fildes is not a valid file descriptor open for reading,
- fcntl.30.02.03
or the type of lock, l_type, is an exclusive lock (F_WRLCK), and fildes is not a valid file descriptor open for writing.
- fcntl.30.03
[EINTR] The cmd argument is F_SETLKW and the function was interrupted by a signal.
- fcntl.30.04
[EINVAL] The cmd argument is invalid, or the cmd argument is F_DUPFD and arg is negative or greater than or equal to {OPEN_MAX}, or the cmd argument is F_GETLK, F_SETLK, or F_SETLKW and the data pointed to by arg is not valid, or fildes refers to a file that does not support locking.
- fcntl.30.05
[EMFILE]
- fcntl.30.05.01
The argument cmd is F_DUPFD and {OPEN_MAX} file descriptors are currently open in the calling process,
- fcntl.30.05.02
or no file descriptors greater than or equal to arg are available.
- fcntl.30.06
[ENOLCK] The argument cmd is F_SETLK or F_SETLKW and satisfying the lock or unlock request would result in the number of locked regions in the system exceeding a system-imposed limit.
- fcntl.30.07
[EOVERFLOW] One of the values to be returned cannot be represented correctly.
- fcntl.30.08
[EOVERFLOW] The cmd argument is F_GETLK, F_SETLK, or F_SETLKW and the smallest or, if l_len is non-zero, the largest offset of any byte in the requested segment cannot be represented correctly in an object of type off_t.
- fcntl.31
The fcntl() function may fail if:
- fcntl.31.01
[EDEADLK] The cmd argument is F_SETLKW, the lock is blocked by a lock from another process, and putting the calling process to sleep to wait for that lock to become free would cause a deadlock.
- fcntl.60
According to ISO POSIX (2003), only an application sets fcntl() flags, for example O_LARGEFILE. However, this specification also allows an implementation to set the O_LARGEFILE flag in the case where the programming environment is one of _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX (2003) for a description of these environments. Thus, calling fcntl() with the F_GETFL command may return O_LARGEFILE as well as flags explicitly set by the application in the case that both the implementation and the application support an off_t of at least 64 bits.
- [+]fdatasync (8 / 2 / 0)
- fdatasync.01
The fdatasync() function shall force all currently queued I/O operations associated with the file indicated by file descriptor fildes to the synchronized I/O completion state.
- fdatasync.02
The functionality shall be equivalent to fsync() with the symbol _POSIX_SYNCHRONIZED_IO defined, with the exception that all I/O operations shall be completed as defined for synchronized I/O data integrity completion.
- fdatasync.03.01
If successful, the fdatasync() function shall return the value 0;
- fdatasync.03.02
otherwise, the function shall return the value -1 and set errno to indicate the error.
- fdatasync.04
If the fdatasync() function fails, outstanding I/O operations are not guaranteed to have been completed.
- fdatasync.05
The fdatasync() function shall fail if:
- fdatasync.05.01
[EBADF] The fildes argument is not a valid file descriptor open for writing.
- fdatasync.05.02
[EINVAL] This implementation does not support synchronized I/O for this file.
- fdatasync.06
In the event that any of the queued I/O operations fail, fdatasync() shall return the error conditions defined for read() and write().
- [+]flock (9 / 8 / 0)
- flock.01
flock() applies or removes an advisory lock on the open file fd.
- flock.02
Shared lock. More than one process may hold a shared lock for a given file at a given time.
- flock.03
Exclusive lock. Only one process may hold an exclusive lock for a given file at a given time.
- flock.04
A single file may not simultaneously have both shared and exclusive locks.
- flock.05.01
On success, 0 is returned.
- flock.05.02
On error, -1 is returned and the global variable errno is set appropriately.
- flock.06
[EWOULDBLOCK]
- flock.07
Unlock.
- flock.08
Don't block when locking. May be specified (by oring) along with one of the other operations.
- [+]fsync (11 / 2 / 0)
- fsync.01
The fsync() function shall request that all data for the open file descriptor named by fildes is to be transferred to the storage device associated with the file described by fildes.
- fsync.02
The fsync() function shall not return until the system has completed that action or until an error is detected.
- fsync.03
If _POSIX_SYNCHRONIZED_IO is defined, the fsync() function shall force all currently queued I/O operations associated with the file indicated by file descriptor fildes to the synchronized I/O completion state.
- fsync.04
All I/O operations shall be completed as defined for synchronized I/O file integrity completion.
- fsync.05.01
Upon successful completion, fsync() shall return 0.
- fsync.05.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- fsync.05.03
If the fsync() function fails, outstanding I/O operations are not guaranteed to have been completed.
- fsync.06
The fsync() function shall fail if:
- fsync.06.01
[EBADF] The fildes argument is not a valid descriptor.
- fsync.06.02
[EINTR] The fsync() function was interrupted by a signal.
- fsync.06.03
[EINVAL] The fildes argument does not refer to a file on which this operation is possible.
- fsync.06.04
[EIO] An I/O error occurred while reading from or writing to the file system.
- [+]ftruncate (26 / 13 / 0)
- ftruncate.01
If fildes is not a valid file descriptor open for writing, the ftruncate() function shall fail.
- ftruncate.02
If fildes refers to a regular file, the ftruncate() function shall cause the size of the file to be truncated to length.
- ftruncate.03
If the size of the file previously exceeded length, the extra data shall no longer be available to reads on the file.
- ftruncate.04
If the file previously was smaller than this size, ftruncate() shall either increase the size of the file or fail.
- ftruncate.05.01
If the file size is increased, the extended area shall appear as if it were zero-filled.
- ftruncate.05.02
The value of the seek pointer shall not be modified by a call to ftruncate().
- ftruncate.06.01
Upon successful completion, if fildes refers to a regular file, the ftruncate() function shall mark for update the st_ctime and st_mtime fields of the file
- ftruncate.06.02
and the S_ISUID and S_ISGID bits of the file mode may be cleared.
- ftruncate.07
If the ftruncate() function is unsuccessful, the file is unaffected.
- ftruncate.08
If fildes refers to a directory, ftruncate() shall fail.
- app.ftruncate.09
If fildes refers to any other file type, except a shared memory object, the result is unspecified.
- ftruncate.10
If fildes refers to a shared memory object, ftruncate() shall set the size of the shared memory object to length.
- ftruncate.11
If the effect of ftruncate() is to decrease the size of a shared memory object or memory mapped file and whole pages beyond the new end were previously mapped, then the whole pages beyond the new end shall be discarded.
- ftruncate.12
If the Memory Protection option is supported, references to discarded pages shall result in the generation of a SIGBUS signal; otherwise, the result of such references is undefined.
- ftruncate.13.01
Upon successful completion, ftruncate() shall return 0;
- ftruncate.13.02
otherwise, -1 shall be returned and errno set to indicate the error.
- ftruncate.14
The ftruncate() function shall fail if:
- ftruncate.14.01
[EINTR] A signal was caught during execution.
- ftruncate.14.02
[EINVAL] The length argument was less than 0.
- ftruncate.14.03
[EFBIG] or [EINVAL] The length argument was greater than the maximum file size.
- ftruncate.14.04
[EFBIG] [XSI] The file is a regular file and length is greater than the offset maximum established in the open file description associated with fildes.
- ftruncate.14.05
[EIO] An I/O error occurred while reading from or writing to a file system.
- ftruncate.14.06
[EBADF] or [EINVAL] The fildes argument is not a file descriptor open for writing.
- ftruncate.14.07
[EINVAL] The fildes argument references a file that was opened without write permission.
- ftruncate.14.08
[EROFS] The named file resides on a read-only file system.
- ftruncate.15
If the request would cause the file size to exceed the soft file size limit for the process, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- ftruncate.16
If the effect of ftruncate() is to increase the size of a shared memory object, it is unspecified whether the contents of any mapped pages between the old end-of-file and the new are flushed to the underlying object.
- ftruncate.17
XSI-conformant systems shall increase the size of the file.
- [+]ftruncate64 (27 / 0 / 0)
- ftruncate64.ftruncate.01
If fildes is not a valid file descriptor open for writing, the ftruncate() function shall fail.
- ftruncate64.ftruncate.02
If fildes refers to a regular file, the ftruncate() function shall cause the size of the file to be truncated to length.
- ftruncate64.ftruncate.03
If the size of the file previously exceeded length, the extra data shall no longer be available to reads on the file.
- ftruncate64.ftruncate.04
If the file previously was smaller than this size, ftruncate() shall either increase the size of the file or fail.
- ftruncate64.ftruncate.05.01
If the file size is increased, the extended area shall appear as if it were zero-filled.
- ftruncate64.ftruncate.05.02
The value of the seek pointer shall not be modified by a call to ftruncate().
- ftruncate64.ftruncate.06.01
Upon successful completion, if fildes refers to a regular file, the ftruncate() function shall mark for update the st_ctime and st_mtime fields of the file
- ftruncate64.ftruncate.06.02
and the S_ISUID and S_ISGID bits of the file mode may be cleared.
- ftruncate64.ftruncate.07
If the ftruncate() function is unsuccessful, the file is unaffected.
- ftruncate64.ftruncate.08
If fildes refers to a directory, ftruncate() shall fail.
- ftruncate64.ftruncate.09
If fildes refers to any other file type, except a shared memory object, the result is unspecified.
- ftruncate64.ftruncate.10
If fildes refers to a shared memory object, ftruncate() shall set the size of the shared memory object to length.
- ftruncate64.ftruncate.11
If the effect of ftruncate() is to decrease the size of a shared memory object or memory mapped file and whole pages beyond the new end were previously mapped, then the whole pages beyond the new end shall be discarded.
- ftruncate64.ftruncate.12
If the Memory Protection option is supported, references to discarded pages shall result in the generation of a SIGBUS signal; otherwise, the result of such references is undefined.
- ftruncate64.ftruncate.13.01
Upon successful completion, ftruncate() shall return 0;
- ftruncate64.ftruncate.13.02
otherwise, -1 shall be returned and errno set to indicate the error.
- ftruncate64.ftruncate.14
The ftruncate() function shall fail if:
- ftruncate64.ftruncate.14.01
[EINTR] A signal was caught during execution.
- ftruncate64.ftruncate.14.02
[EINVAL] The length argument was less than 0.
- ftruncate64.ftruncate.14.03
[EFBIG] or [EINVAL] The length argument was greater than the maximum file size.
- ftruncate64.ftruncate.14.04
[EFBIG] [XSI] The file is a regular file and length is greater than the offset maximum established in the open file description associated with fildes.
- ftruncate64.ftruncate.14.05
[EIO] An I/O error occurred while reading from or writing to a file system.
- ftruncate64.ftruncate.14.06
[EBADF] or [EINVAL] The fildes argument is not a file descriptor open for writing.
- ftruncate64.ftruncate.14.07
[EINVAL] The fildes argument references a file that was opened without write permission.
- ftruncate64.ftruncate.14.08
[EROFS] The named file resides on a read-only file system.
- ftruncate64.ftruncate.15
If the request would cause the file size to exceed the soft file size limit for the process, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- ftruncate64.ftruncate.16
If the effect of ftruncate() is to increase the size of a shared memory object, it is unspecified whether the contents of any mapped pages between the old end-of-file and the new are flushed to the underlying object.
- ftruncate64.ftruncate.17
XSI-conformant systems shall increase the size of the file.
- [+]lockf (36 / 25 / 0)
- lockf.01
The lockf() function shall lock sections of a file with advisory-mode locks.
- lockf.02
Calls to lockf() from other threads which attempt to lock the locked file section shall either return an error value or block until the section becomes unlocked.
- lockf.03
All the locks for a process are removed when the process terminates.
- lockf.04
The fildes argument is an open file descriptor. To establish a lock with this function, the file descriptor shall be opened with write-only permission (O_WRONLY) or with read/write permission (O_RDWR).
- lockf.05
F_TEST shall detect if a lock by another process is present on the specified section.
- lockf.06
F_LOCK and F_TLOCK shall both lock a section of a file if the section is available.
- lockf.07
F_ULOCK shall remove locks from a section of the file.
- lockf.08
The size argument is the number of contiguous bytes to be locked or unlocked. The section to be locked or unlocked starts at the current offset in the file and extends forward for a positive size or backward for a negative size (the preceding bytes up to but not including the current offset).
- lockf.09
If size is 0, the section from the current offset through the largest possible file offset shall be locked (that is, from the current offset through the present or any future end-of-file).
- lockf.10
The sections locked with F_LOCK or F_TLOCK may, in whole or in part, contain or be contained by a previously locked section for the same process. When this occurs, or if adjacent locked sections would occur, the sections shall be combined into a single locked section.
- lockf.11
If the request would cause the number of locks to exceed a system-imposed limit, the request shall fail.
- lockf.12.01
F_LOCK shall block the calling thread until the section is available.
- lockf.12.02
F_TLOCK shall cause the function to fail if the section is already locked by another process.
- lockf.12.03
File locks shall be released on first close by the locking process of any file descriptor for the file.
- lockf.13
F_ULOCK requests may release (wholly or in part) one or more locked sections controlled by the process. Locked sections shall be unlocked starting at the current file offset through size bytes or to the end-of-file if size is (off_t)0.
- lockf.14
When all of a locked section is not released (that is, when the beginning or end of the area to be unlocked falls within a locked section), the remaining portions of that section shall remain locked by the process.
- lockf.15
Releasing the center portion of a locked section shall cause the remaining locked beginning and end portions to become two separate locked sections.
- lockf.16
Blocking on a section shall be interrupted by any signal.
- lockf.17.01
An F_ULOCK request in which size is non-zero and the offset of the last byte of the requested section is the maximum value for an object of type off_t, when the process has an existing lock in which size is 0 and which includes the last byte of the requested section, shall be treated as a request to unlock from the start of the requested section with a size equal to 0.
- lockf.17.02
Otherwise, an F_ULOCK request shall attempt to unlock only the requested section.
- lockf.18.01
Upon successful completion, lockf() shall return 0.
- lockf.18.02
Otherwise, it shall return -1, set errno to indicate an error,
- lockf.18.03
and existing locks shall not be changed.
- lockf.19
The lockf() function shall fail if:
- lockf.19.01
[EBADF] The fildes argument is not a valid open file descriptor; or function is F_LOCK or F_TLOCK and fildes is not a valid file descriptor open for writing.
- lockf.19.02
[EACCES] or [EAGAIN] The function argument is F_TLOCK or F_TEST and the section is already locked by another process.
- lockf.19.03
[EDEADLK] The function argument is F_LOCK and a deadlock is detected.
- lockf.19.04
[EINTR] A signal was caught during execution of the function.
- lockf.19.05
[EINVAL] The function argument is not one of F_LOCK, F_TLOCK, F_TEST, or F_ULOCK; or size plus the current file offset is less than 0.
- lockf.19.06
[EOVERFLOW] The offset of the first, or if size is not 0 then the last, byte in the requested section cannot be represented correctly in an object of type off_t.
- lockf.20
The lockf() function may fail if:
- lockf.20.01
[EAGAIN] The function argument is F_LOCK or F_TLOCK and the file is mapped with mmap().
- lockf.20.02
[EDEADLK] or [ENOLCK] The function argument is F_LOCK, F_TLOCK, or F_ULOCK, and the request would cause the number of locks to exceed a system-imposed limit.
- lockf.20.03
[EOPNOTSUPP] or [EINVAL] The implementation does not support the locking of files of the type indicated by the fildes argument.
- app.lockf.21
Record locking with lockf() shall be supported for regular files and may be supported for other files.
- lockf.22
An area need not be allocated to the file to be locked because locks may exist past the end-of-file.
- lockf.23
If the request would cause the number of locks in the system to exceed a system-imposed limit, the request shall fail.
- lockf.24
A potential for deadlock occurs if the threads of a process controlling a locked section are blocked by accessing another process' locked section. If the system detects that deadlock would occur, lockf() shall fail with an [EDEADLK] error.
- app.lockf.25
The interaction between fcntl() and lockf() locks is unspecified.
- lockf.26
Attempting to lock a section of a file that is associated with a buffered stream produces unspecified results.
- [+]lockf64 (36 / 12 / 0)
- lockf64.lockf.01
The lockf() function shall lock sections of a file with advisory-mode locks.
- lockf64.lockf.02
Calls to lockf() from other threads which attempt to lock the locked file section shall either return an error value or block until the section becomes unlocked.
- lockf64.lockf.03
All the locks for a process are removed when the process terminates.
- lockf64.lockf.04
The fildes argument is an open file descriptor. To establish a lock with this function, the file descriptor shall be opened with write-only permission (O_WRONLY) or with read/write permission (O_RDWR).
- lockf64.lockf.05
F_TEST shall detect if a lock by another process is present on the specified section.
- lockf64.lockf.06
F_LOCK and F_TLOCK shall both lock a section of a file if the section is available.
- lockf64.lockf.07
F_ULOCK shall remove locks from a section of the file.
- lockf64.lockf.08
The size argument is the number of contiguous bytes to be locked or unlocked. The section to be locked or unlocked starts at the current offset in the file and extends forward for a positive size or backward for a negative size (the preceding bytes up to but not including the current offset).
- lockf64.lockf.09
If size is 0, the section from the current offset through the largest possible file offset shall be locked (that is, from the current offset through the present or any future end-of-file).
- lockf64.lockf.10
The sections locked with F_LOCK or F_TLOCK may, in whole or in part, contain or be contained by a previously locked section for the same process. When this occurs, or if adjacent locked sections would occur, the sections shall be combined into a single locked section.
- lockf64.lockf.11
If the request would cause the number of locks to exceed a system-imposed limit, the request shall fail.
- lockf64.lockf.12.01
F_LOCK shall block the calling thread until the section is available.
- lockf64.lockf.12.02
F_TLOCK shall cause the function to fail if the section is already locked by another process.
- lockf64.lockf.12.03
File locks shall be released on first close by the locking process of any file descriptor for the file.
- lockf64.lockf.13
F_ULOCK requests may release (wholly or in part) one or more locked sections controlled by the process. Locked sections shall be unlocked starting at the current file offset through size bytes or to the end-of-file if size is (off_t)0.
- lockf64.lockf.14
When all of a locked section is not released (that is, when the beginning or end of the area to be unlocked falls within a locked section), the remaining portions of that section shall remain locked by the process.
- lockf64.lockf.15
Releasing the center portion of a locked section shall cause the remaining locked beginning and end portions to become two separate locked sections.
- lockf64.lockf.16
Blocking on a section shall be interrupted by any signal.
- lockf64.lockf.17.01
An F_ULOCK request in which size is non-zero and the offset of the last byte of the requested section is the maximum value for an object of type off_t, when the process has an existing lock in which size is 0 and which includes the last byte of the requested section, shall be treated as a request to unlock from the start of the requested section with a size equal to 0.
- lockf64.lockf.17.02
Otherwise, an F_ULOCK request shall attempt to unlock only the requested section.
- lockf64.lockf.18.01
Upon successful completion, lockf() shall return 0.
- lockf64.lockf.18.02
Otherwise, it shall return -1, set errno to indicate an error,
- lockf64.lockf.18.03
and existing locks shall not be changed.
- lockf64.lockf.19
The lockf() function shall fail if:
- lockf64.lockf.19.01
[EBADF] The fildes argument is not a valid open file descriptor; or function is F_LOCK or F_TLOCK and fildes is not a valid file descriptor open for writing.
- lockf64.lockf.19.02
[EACCES] or [EAGAIN] The function argument is F_TLOCK or F_TEST and the section is already locked by another process.
- lockf64.lockf.19.03
[EDEADLK] The function argument is F_LOCK and a deadlock is detected.
- lockf64.lockf.19.04
[EINTR] A signal was caught during execution of the function.
- lockf64.lockf.19.05
[EINVAL] The function argument is not one of F_LOCK, F_TLOCK, F_TEST, or F_ULOCK; or size plus the current file offset is less than 0.
- lockf64.lockf.19.06
[EOVERFLOW] The offset of the first, or if size is not 0 then the last, byte in the requested section cannot be represented correctly in an object of type off_t.
- lockf64.lockf.20
The lockf() function may fail if:
- lockf64.lockf.20.01
[EAGAIN] The function argument is F_LOCK or F_TLOCK and the file is mapped with mmap().
- lockf64.lockf.20.02
[EDEADLK] or [ENOLCK] The function argument is F_LOCK, F_TLOCK, or F_ULOCK, and the request would cause the number of locks to exceed a system-imposed limit.
- lockf64.lockf.20.03
[EOPNOTSUPP] or [EINVAL] The implementation does not support the locking of files of the type indicated by the fildes argument.
- lockf64.lockf.22
An area need not be allocated to the file to be locked because locks may exist past the end-of-file.
- lockf64.lockf.23
If the request would cause the number of locks in the system to exceed a system-imposed limit, the request shall fail.
- lockf64.lockf.24
A potential for deadlock occurs if the threads of a process controlling a locked section are blocked by accessing another process' locked section. If the system detects that deadlock would occur, lockf() shall fail with an [EDEADLK] error.
- lockf64.lockf.26
Attempting to lock a section of a file that is associated with a buffered stream produces unspecified results.
- app.lockf64.lockf.21
Record locking with lockf() shall be supported for regular files and may be supported for other files.
- app.lockf64.lockf.25
The interaction between fcntl() and lockf() locks is unspecified.
- [+]lseek (13 / 8 / 0)
- lseek.01
If whence is SEEK_SET, the file offset shall be set to offset bytes.
- lseek.02
If whence is SEEK_CUR, the file offset shall be set to its current location plus offset.
- lseek.03
If whence is SEEK_END, the file offset shall be set to the size of the file plus offset.
- lseek.04
The lseek() function shall allow the file offset to be set beyond the end of the existing data in the file.
- lseek.05
If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
- lseek.06
The lseek() function shall not, by itself, extend the size of a file.
- app.lseek.07.01
If fildes refers to a shared memory object, the result of the lseek() function is unspecified.
- app.lseek.07.02
If fildes refers to a typed memory object, the result of the lseek() function is unspecified.
- lseek.08.01
Upon successful completion, the resulting offset, as measured in bytes from the beginning of the file, shall be returned.
- lseek.08.02
Otherwise, (off_t)-1 shall be returned, errno shall be set to indicate the error,
- lseek.08.03
and the file offset shall remain unchanged.
- lseek.09
The lseek() function shall fail if:
- lseek.09.01
[EBADF] The fildes argument is not an open file descriptor.
- lseek.09.02
[EINVAL] The whence argument is not a proper value, or the resulting file offset would be negative for a regular file, block special file, or directory.
- lseek.09.03
[EOVERFLOW] The resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- lseek.09.04
[ESPIPE] The fildes argument is associated with a pipe, FIFO, or socket.
- app.lseek.10
The behavior of lseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- [+]lseek64 (13 / 0 / 0)
- lseek64.lseek.01
If whence is SEEK_SET, the file offset shall be set to offset bytes.
- lseek64.lseek.02
If whence is SEEK_CUR, the file offset shall be set to its current location plus offset.
- lseek64.lseek.03
If whence is SEEK_END, the file offset shall be set to the size of the file plus offset.
- lseek64.lseek.04
The lseek() function shall allow the file offset to be set beyond the end of the existing data in the file.
- lseek64.lseek.05
If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
- lseek64.lseek.06
The lseek() function shall not, by itself, extend the size of a file.
- lseek64.lseek.08.01
Upon successful completion, the resulting offset, as measured in bytes from the beginning of the file, shall be returned.
- lseek64.lseek.08.02
Otherwise, (off_t)-1 shall be returned, errno shall be set to indicate the error,
- lseek64.lseek.08.03
and the file offset shall remain unchanged.
- lseek64.lseek.09
The lseek() function shall fail if:
- lseek64.lseek.09.01
[EBADF] The fildes argument is not an open file descriptor.
- lseek64.lseek.09.02
[EINVAL] The whence argument is not a proper value, or the resulting file offset would be negative for a regular file, block special file, or directory.
- lseek64.lseek.09.03
[EOVERFLOW] The resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- lseek64.lseek.09.04
[ESPIPE] The fildes argument is associated with a pipe, FIFO, or socket.
- app.lseek64.lseek.07.01
If fildes refers to a shared memory object, the result of the lseek() function is unspecified.
- app.lseek64.lseek.07.02
If fildes refers to a typed memory object, the result of the lseek() function is unspecified.
- app.lseek64.lseek.10
The behavior of lseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- [+]open (64 / 13 / 0)
- open.01
The open() function shall establish the connection between a file and a file descriptor. It shall create an open file description that refers to a file and a file descriptor that refers to that open file description.
- open.02.01
The open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open for that process.
- open.02.02
The open file description is new, and therefore the file descriptor shall not share it with any other process in the system.
- open.02.03
The FD_CLOEXEC file descriptor flag associated with the new file descriptor shall be cleared.
- open.03
The file offset used to mark the current position within the file shall be set to the beginning of the file.
- open.04
The file status flags and file access modes of the open file description shall be set according to the value of oflag.
- open.05
O_APPEND If set, the file offset shall be set to the end of the file prior to each write.
- app.open.06.06
When bits other than the file permission bits are set, the effect is unspecified.
- open.06.01
If the file exists, this flag has no effect except as noted under O_EXCL below.
- open.06.02
Otherwise, the file shall be created;
- open.06.03
the user ID of the file shall be set to the effective user ID of the process;
- open.06.04
the group ID of the file shall be set to the group ID of the file's parent directory or to the effective group ID of the process;
- open.06.05
and the access permission bits (see <sys/stat.h>) of the file mode shall be set to the value of the third argument taken as type mode_t modified as follows: a bitwise AND is performed on the file-mode bits and the corresponding bits in the complement of the process' file mode creation mask. Thus, all bits in the file mode whose corresponding bit in the file mode creation mask is set are cleared.
- open.07
O_DSYNC [SIO] Write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- app.open.08.04
If O_EXCL is set and O_CREAT is not set, the result is undefined.
- open.08.01
If O_CREAT and O_EXCL are set, open() shall fail if the file exists.
- open.08.02
The check for the existence of the file and the creation of the file if it does not exist shall be atomic with respect to other threads executing open() naming the same filename in the same directory with O_EXCL and O_CREAT set.
- open.08.03
If O_EXCL and O_CREAT are set, and path names a symbolic link, open() shall fail and set errno to [EEXIST], regardless of the contents of the symbolic link.
- open.09
O_NOCTTY If set and path identifies a terminal device, open() shall not cause the terminal device to become the controlling terminal for the process.
- open.10.01.01
If O_NONBLOCK is set, an open() for reading-only shall return without delay.
- open.10.01.02
An open() for writing-only shall return an error if no process currently has the file open for reading.
- open.10.02.01
If O_NONBLOCK is clear, an open() for reading-only shall block the calling thread until a thread opens the file for writing.
- open.10.02.02
An open() for writing-only shall block the calling thread until a thread opens the file for reading.
- open.10.03
If O_NONBLOCK is set, the open() function shall return without blocking for the device to be ready or available.
- open.10.04
If O_NONBLOCK is clear, the open() function shall block the calling thread until the device is ready or available before returning.
- app.open.10.05
Otherwise, the behavior of O_NONBLOCK is unspecified.
- app.open.104
Values for oflag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>.>Applications shall specify exactly one of the first three values (file access modes) below in the value of oflag:O_RDONLY Open for reading only. O_WRONLY Open for writing only. O_RDWR Open for reading and writing. The result is undefined if this flag is applied to a FIFO.
- open.11.01
Read I/O operations on the file descriptor shall complete at the same level of integrity as specified by the O_DSYNC and O_SYNC flags.
- open.11.02
If both O_DSYNC and O_RSYNC are set in oflag, all I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- open.11.03
If both O_SYNC and O_RSYNC are set in flags, all I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- app.open.118
If path names the master side of a pseudo-terminal device, then it is unspecified whether open() locks the slave side so that it cannot be opened.
- open.12
O_SYNC [SIO] Write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- open.13.01
If the file exists and is a regular file, and the file is successfully opened O_RDWR or O_WRONLY, its length shall be truncated to 0, and the mode and owner shall be unchanged.
- open.13.02
It shall have no effect on FIFO special files or terminal device files.
- app.open.13.03
Its effect on other file types is implementation-defined.
- app.open.13.04
The result of using O_TRUNC with O_RDONLY is undefined.
- open.14
If O_CREAT is set and the file did not previously exist, upon successful completion, open() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- open.15
If O_TRUNC is set and the file did previously exist, upon successful completion, open() shall mark for update the st_ctime and st_mtime fields of the file.
- open.16
If both the O_SYNC and O_DSYNC flags are set, the effect is as if only the O_SYNC flag was set.
- open.17
If path refers to a STREAMS file, oflag may be constructed from O_NONBLOCK OR'ed with either O_RDONLY, O_WRONLY, or O_RDWR. Other flag values are not applicable to STREAMS devices and shall have no effect on them.
- app.open.18
Conforming applications shall call unlockpt() before opening the slave side.
- open.19
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- open.30.01
Upon successful completion, the function shall open the file and return a non-negative integer representing the lowest numbered unused file descriptor.
- open.30.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- open.30.03
No files shall be created or modified if the function returns -1.
- open.31
The open() function shall fail if:
- open.31.01
[EACCES] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by oflag are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created, or O_TRUNC is specified and write permission is denied.
- open.31.02
[EEXIST] O_CREAT and O_EXCL are set, and the named file exists.
- open.31.03
[EINTR] A signal was caught during open().
- open.31.04
[EINVAL] [SIO] The implementation does not support synchronized I/O for this file.
- open.31.05
[EIO] [XSR] The path argument names a STREAMS file and a hangup or error occurred during the open().
- open.31.06
[EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR.
- open.31.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- open.31.08
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- open.31.09
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- open.31.10
[ENFILE] The maximum allowable number of files is currently open in the system.
- open.31.11
[ENOENT] O_CREAT is not set and the named file does not exist; or O_CREAT is set and either the path prefix does not exist or the path argument points to an empty string.
- open.31.12
[ENOSR] [XSR] The path argument names a STREAMS-based file and the system is unable to allocate a STREAM.
- open.31.13
[ENOSPC] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and O_CREAT is specified.
- open.31.14
[ENOTDIR] A component of the path prefix is not a directory.
- open.31.15
[ENXIO] O_NONBLOCK is set, the named file is a FIFO, O_WRONLY is set, and no process has the file open for reading.
- open.31.16
[ENXIO] The named file is a character special or block special file, and the device associated with this special file does not exist.
- open.31.17
[EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- open.31.18
[EROFS] The named file resides on a read-only file system and either O_WRONLY, O_RDWR, O_CREAT (if the file does not exist), or O_TRUNC is set in the oflag argument.
- open.32
The open() function may fail if:
- open.32.01
[EAGAIN] [XSI] The path argument names the slave side of a pseudo-terminal device that is locked.
- open.32.02
[EINVAL] The value of the oflag argument is not valid.
- open.32.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- open.32.04
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- open.32.05
[ENOMEM] [XSR] The path argument names a STREAMS file and the system is unable to allocate resources.
- open.32.06
[ETXTBSY] The file is a pure procedure (shared text) file that is being executed and oflag is O_WRONLY or O_RDWR.
- open.40.01
If a session leader has no controlling terminal, and opens a terminal device file that is not already associated with a session without using the O_NOCTTY option (see open()), it is implementation-defined whether the terminal becomes the controlling terminal of the session leader.
- open.40.02
If a process which is not a session leader opens a terminal file, or the O_NOCTTY option is used on open(), then that terminal shall not become the controlling terminal of the calling process.
- open.40.03
When a controlling terminal becomes associated with a session, its foreground process group shall be set to the process group of the session leader.
- [+]open64 (61 / 0 / 0)
- open64.open.01
The open() function shall establish the connection between a file and a file descriptor. It shall create an open file description that refers to a file and a file descriptor that refers to that open file description.
- open64.open.02.01
The open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open for that process.
- open64.open.02.02
The open file description is new, and therefore the file descriptor shall not share it with any other process in the system.
- open64.open.02.03
The FD_CLOEXEC file descriptor flag associated with the new file descriptor shall be cleared.
- open64.open.03
The file offset used to mark the current position within the file shall be set to the beginning of the file.
- open64.open.04
The file status flags and file access modes of the open file description shall be set according to the value of oflag.
- open64.open.05
O_APPEND If set, the file offset shall be set to the end of the file prior to each write.
- open64.open.06.01
If the file exists, this flag has no effect except as noted under O_EXCL below.
- open64.open.06.02
Otherwise, the file shall be created;
- open64.open.06.03
the user ID of the file shall be set to the effective user ID of the process;
- open64.open.06.04
the group ID of the file shall be set to the group ID of the file's parent directory or to the effective group ID of the process;
- open64.open.06.05
and the access permission bits (see <sys/stat.h>) of the file mode shall be set to the value of the third argument taken as type mode_t modified as follows: a bitwise AND is performed on the file-mode bits and the corresponding bits in the complement of the process' file mode creation mask. Thus, all bits in the file mode whose corresponding bit in the file mode creation mask is set are cleared.
- open64.open.07
O_DSYNC [SIO] Write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- open64.open.08.01
If O_CREAT and O_EXCL are set, open() shall fail if the file exists.
- open64.open.08.02
The check for the existence of the file and the creation of the file if it does not exist shall be atomic with respect to other threads executing open() naming the same filename in the same directory with O_EXCL and O_CREAT set.
- open64.open.08.03
If O_EXCL and O_CREAT are set, and path names a symbolic link, open() shall fail and set errno to [EEXIST], regardless of the contents of the symbolic link.
- open64.open.09
O_NOCTTY If set and path identifies a terminal device, open() shall not cause the terminal device to become the controlling terminal for the process.
- open64.open.10.01.01
If O_NONBLOCK is set, an open() for reading-only shall return without delay.
- open64.open.10.01.02
An open() for writing-only shall return an error if no process currently has the file open for reading.
- open64.open.10.02.01
If O_NONBLOCK is clear, an open() for reading-only shall block the calling thread until a thread opens the file for writing.
- open64.open.10.02.02
An open() for writing-only shall block the calling thread until a thread opens the file for reading.
- open64.open.10.03
If O_NONBLOCK is set, the open() function shall return without blocking for the device to be ready or available.
- open64.open.10.04
If O_NONBLOCK is clear, the open() function shall block the calling thread until the device is ready or available before returning.
- open64.open.11.01
Read I/O operations on the file descriptor shall complete at the same level of integrity as specified by the O_DSYNC and O_SYNC flags.
- open64.open.11.02
If both O_DSYNC and O_RSYNC are set in oflag, all I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- open64.open.11.03
If both O_SYNC and O_RSYNC are set in flags, all I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- open64.open.12
O_SYNC [SIO] Write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- open64.open.13.01
If the file exists and is a regular file, and the file is successfully opened O_RDWR or O_WRONLY, its length shall be truncated to 0, and the mode and owner shall be unchanged.
- open64.open.13.02
It shall have no effect on FIFO special files or terminal device files.
- open64.open.14
If O_CREAT is set and the file did not previously exist, upon successful completion, open() shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- open64.open.15
If O_TRUNC is set and the file did previously exist, upon successful completion, open() shall mark for update the st_ctime and st_mtime fields of the file.
- open64.open.16
If both the O_SYNC and O_DSYNC flags are set, the effect is as if only the O_SYNC flag was set.
- open64.open.17
If path refers to a STREAMS file, oflag may be constructed from O_NONBLOCK OR'ed with either O_RDONLY, O_WRONLY, or O_RDWR. Other flag values are not applicable to STREAMS devices and shall have no effect on them.
- open64.open.19
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- open64.open.30.01
Upon successful completion, the function shall open the file and return a non-negative integer representing the lowest numbered unused file descriptor.
- open64.open.30.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- open64.open.30.03
No files shall be created or modified if the function returns -1.
- open64.open.31
The open() function shall fail if:
- open64.open.31.01
[EACCES] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by oflag are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created, or O_TRUNC is specified and write permission is denied.
- open64.open.31.02
[EEXIST] O_CREAT and O_EXCL are set, and the named file exists.
- open64.open.31.03
[EINTR] A signal was caught during open().
- open64.open.31.04
[EINVAL] [SIO] The implementation does not support synchronized I/O for this file.
- open64.open.31.05
[EIO] [XSR] The path argument names a STREAMS file and a hangup or error occurred during the open().
- open64.open.31.06
[EISDIR] The named file is a directory and oflag includes O_WRONLY or O_RDWR.
- open64.open.31.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- open64.open.31.08
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- open64.open.31.09
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- open64.open.31.10
[ENFILE] The maximum allowable number of files is currently open in the system.
- open64.open.31.11
[ENOENT] O_CREAT is not set and the named file does not exist; or O_CREAT is set and either the path prefix does not exist or the path argument points to an empty string.
- open64.open.31.12
[ENOSR] [XSR] The path argument names a STREAMS-based file and the system is unable to allocate a STREAM.
- open64.open.31.13
[ENOSPC] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and O_CREAT is specified.
- open64.open.31.14
[ENOTDIR] A component of the path prefix is not a directory.
- open64.open.31.15
[ENXIO] O_NONBLOCK is set, the named file is a FIFO, O_WRONLY is set, and no process has the file open for reading.
- open64.open.31.16
[ENXIO] The named file is a character special or block special file, and the device associated with this special file does not exist.
- open64.open.31.17
[EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- open64.open.31.18
[EROFS] The named file resides on a read-only file system and either O_WRONLY, O_RDWR, O_CREAT (if the file does not exist), or O_TRUNC is set in the oflag argument.
- open64.open.32
The open() function may fail if:
- open64.open.32.01
[EAGAIN] [XSI] The path argument names the slave side of a pseudo-terminal device that is locked.
- open64.open.32.02
[EINVAL] The value of the oflag argument is not valid.
- open64.open.32.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- open64.open.32.04
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- open64.open.32.05
[ENOMEM] [XSR] The path argument names a STREAMS file and the system is unable to allocate resources.
- open64.open.32.06
[ETXTBSY] The file is a pure procedure (shared text) file that is being executed and oflag is O_WRONLY or O_RDWR.
- app.open64.open.06.06
When bits other than the file permission bits are set, the effect is unspecified.
- app.open64.open.08.04
If O_EXCL is set and O_CREAT is not set, the result is undefined.
- app.open64.open.10.05
Otherwise, the behavior of O_NONBLOCK is unspecified.
- app.open64.open.104
Values for oflag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>.>Applications shall specify exactly one of the first three values (file access modes) below in the value of oflag:O_RDONLY Open for reading only. O_WRONLY Open for writing only. O_RDWR Open for reading and writing. The result is undefined if this flag is applied to a FIFO.
- app.open64.open.118
If path names the master side of a pseudo-terminal device, then it is unspecified whether open() locks the slave side so that it cannot be opened.
- app.open64.open.13.03
Its effect on other file types is implementation-defined.
- app.open64.open.13.04
The result of using O_TRUNC with O_RDONLY is undefined.
- app.open64.open.18
Conforming applications shall call unlockpt() before opening the slave side.
- [+]pread (62 / 14 / 0)
- pread.01 (struct)
The read() function shall attempt to read nbyte bytes from the file associated with the open file descriptor, fildes, into the buffer pointed to by buf.
- app.pread.02
The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified.
- pread.03
Before any action described below is taken, and if nbyte is zero, the read() function may detect and return errors as described below.
- pread.04
In the absence of errors, or if error detection is not performed, the read() function shall return zero and have no other results.
- pread.05
On files that support seeking (for example, a regular file), the read() shall start at a position in the file given by the file offset associated with fildes.
- pread.07
Files that do not support seeking-for example, terminals-always read from the current position.
- pread.08
If the starting position is at or after the end-of-file, 0 shall be returned.
- pread.09
When attempting to read from an empty pipe or FIFO:
- pread.09.01
If no process has the pipe open for writing, read() shall return 0 to indicate end-of-file.
- pread.09.02
If some process has the pipe open for writing and O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- pread.09.03
If some process has the pipe open for writing and O_NONBLOCK is clear, read() shall block the calling thread until some data is written or the pipe is closed by all processes that had the pipe open for writing.
- pread.10
When attempting to read a file (other than a pipe or FIFO) that supports non-blocking reads and has no data currently available:
- pread.10.01
If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- pread.10.02 (struct)
If O_NONBLOCK is clear, read() shall block the calling thread until some data becomes available.
- pread.10.03
The use of the O_NONBLOCK flag has no effect if there is some data available.
- pread.11
If any portion of a regular file prior to the end-of-file has not been written, read() shall return bytes with value 0.
- pread.12
If data is later written at this point, subsequent reads in the gap between the previous end of data and the newly written data shall return bytes with value 0 until data is written into the gap.
- pread.13.01
Upon successful completion, where nbyte is greater than 0, read() shall mark for update the st_atime field of the file
- pread.13.02
and shall return the number of bytes read. This number shall never be greater than nbyte.
- pread.14
The value returned may be less than nbyte
- pread.14.01
if the number of bytes left in the file is less than nbyte,
- pread.14.02
if the read() request was interrupted by a signal,
- pread.14.03
or if the file is a pipe or FIFO or special file and has fewer than nbyte bytes immediately available for reading.
- pread.15
If a read() is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR].
- pread.16
If a read() is interrupted by a signal after it has successfully read some data, it shall return the number of bytes read.
- pread.17
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- pread.18
If the O_DSYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- pread.19
If the O_SYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- app.pread.20
If fildes refers to a shared memory object, the result of the read() function is unspecified.
- app.pread.21
If fildes refers to a typed memory object, the result of the read() function is unspecified.
- pread.22
The default shall be byte-stream mode.
- pread.23
In byte-stream mode, read() shall retrieve data from the STREAM until as many bytes as were requested are transferred, or until there is no more data to be retrieved. Byte-stream mode ignores message boundaries.
- pread.24
In STREAMS message-nondiscard mode, read() shall retrieve data until as many bytes as were requested are transferred, or until a message boundary is reached.
- pread.25
If read() does not retrieve all the data in a message, the remaining data shall be left on the STREAM, and can be retrieved by the next read() call.
- pread.26
Message-discard mode also retrieves data until as many bytes as were requested are transferred, or a message boundary is reached.
- pread.27
However, unread data remaining in a message after the read() returns shall be discarded, and shall not be available for a subsequent read(), getmsg(), or getpmsg() call.
- pread.28
In byte-stream mode, read() shall accept data until it has read nbyte bytes, or until there is no more data to read, or until a zero-byte message block is encountered.
- pread.29
The read() function shall then return the number of bytes read, and place the zero-byte message back on the STREAM to be retrieved by the next read(), getmsg(), or getpmsg().
- pread.30
In message-nondiscard mode or message-discard mode, a zero-byte message shall return 0 and the message shall be removed from the STREAM.
- pread.31
When a zero-byte message is read as the first message on a STREAM, the message shall be removed from the STREAM and 0 shall be returned, regardless of the read mode.
- pread.32
A read() from a STREAMS file shall return the data in the message at the front of the STREAM head read queue, regardless of the priority band of the message.
- pread.33
The read() shall fail if a message containing a control part is encountered at the STREAM head.
- pread.34
In control-data mode, read() shall convert any control part to data and pass it to the application before passing any data part originally present in the same message.
- pread.35
In control-discard mode, read() shall discard message control parts but return to the process any data part in the message.
- pread.36
In addition, read() shall fail if the STREAM head had processed an asynchronous error before the call. In this case, the value of errno shall not reflect the result of read(), but reflect the prior error.
- pread.37.01
If a hangup occurs on the STREAM being read, read() shall continue to operate normally until the STREAM head read queue is empty.
- pread.37.02
Thereafter, it shall return 0.
- pread.38
The pread() function shall be equivalent to read(), except that it shall read from a given position in the file without changing the file pointer.
- pread.39
The first three arguments to pread() are the same as read() with the addition of a fourth argument offset for the desired position inside the file.
- pread.40
An attempt to perform a pread() on a file that is incapable of seeking shall result in an error.
- pread.41.01
Upon successful completion, read() [XSI] and pread() shall return a non-negative integer indicating the number of bytes actually read.
- pread.41.02
Otherwise, the functions shall return -1 and set errno to indicate the error.
- pread.42
The read() and [XSI] pread() functions shall fail if:
- pread.42.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed.
- pread.42.02
[EBADF] The fildes argument is not a valid file descriptor open for reading.
- pread.42.03
[EBADMSG] [XSR] The file is a STREAM file that is set to control-normal mode and the message waiting to be read includes a control part.
- pread.42.04
[EINTR] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- pread.42.05
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- pread.42.06
[EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal, or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- pread.42.07
[EISDIR] [XSI] The fildes argument refers to a directory and the implementation does not allow the directory to be read using read() or pread(). The readdir() function should be used instead.
- pread.42.08
[EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- pread.44
The read() and [XSI] pread() functions may fail if:
- pread.44.01
[EIO] A physical I/O error has occurred.
- pread.44.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- pread.44.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- pread.44.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- pread.45
The pread() function shall fail, and the file pointer shall remain unchanged, if:
- pread.45.01
[EINVAL] [XSI] The offset argument is invalid. The value is negative.
- pread.45.02
[EOVERFLOW] [XSI] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the file.
- pread.45.03
[ENXIO] [XSI] A request was outside the capabilities of the device.
- pread.45.04
[ESPIPE] [XSI] fildes is associated with a pipe or FIFO.
- pread.50
If the file refers to a device special file, the result of subsequent read() requests is implementation-defined.
- app.pread.51
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- pread.52
The read() function reads data previously written to a file.
- [+]pread64 (62 / 0 / 0)
- pread64.pread.01 (struct)
The read() function shall attempt to read nbyte bytes from the file associated with the open file descriptor, fildes, into the buffer pointed to by buf.
- pread64.pread.03
Before any action described below is taken, and if nbyte is zero, the read() function may detect and return errors as described below.
- pread64.pread.04
In the absence of errors, or if error detection is not performed, the read() function shall return zero and have no other results.
- pread64.pread.05
On files that support seeking (for example, a regular file), the read() shall start at a position in the file given by the file offset associated with fildes.
- pread64.pread.07
Files that do not support seeking-for example, terminals-always read from the current position.
- pread64.pread.08
If the starting position is at or after the end-of-file, 0 shall be returned.
- pread64.pread.09
When attempting to read from an empty pipe or FIFO:
- pread64.pread.09.01
If no process has the pipe open for writing, read() shall return 0 to indicate end-of-file.
- pread64.pread.09.02
If some process has the pipe open for writing and O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- pread64.pread.09.03
If some process has the pipe open for writing and O_NONBLOCK is clear, read() shall block the calling thread until some data is written or the pipe is closed by all processes that had the pipe open for writing.
- pread64.pread.10
When attempting to read a file (other than a pipe or FIFO) that supports non-blocking reads and has no data currently available:
- pread64.pread.10.01
If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- pread64.pread.10.02 (struct)
If O_NONBLOCK is clear, read() shall block the calling thread until some data becomes available.
- pread64.pread.10.03
The use of the O_NONBLOCK flag has no effect if there is some data available.
- pread64.pread.11
If any portion of a regular file prior to the end-of-file has not been written, read() shall return bytes with value 0.
- pread64.pread.12
If data is later written at this point, subsequent reads in the gap between the previous end of data and the newly written data shall return bytes with value 0 until data is written into the gap.
- pread64.pread.13.01
Upon successful completion, where nbyte is greater than 0, read() shall mark for update the st_atime field of the file
- pread64.pread.13.02
and shall return the number of bytes read. This number shall never be greater than nbyte.
- pread64.pread.14
The value returned may be less than nbyte
- pread64.pread.14.01
if the number of bytes left in the file is less than nbyte,
- pread64.pread.14.02
if the read() request was interrupted by a signal,
- pread64.pread.14.03
or if the file is a pipe or FIFO or special file and has fewer than nbyte bytes immediately available for reading.
- pread64.pread.15
If a read() is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR].
- pread64.pread.16
If a read() is interrupted by a signal after it has successfully read some data, it shall return the number of bytes read.
- pread64.pread.17
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- pread64.pread.18
If the O_DSYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- pread64.pread.19
If the O_SYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- pread64.pread.22
The default shall be byte-stream mode.
- pread64.pread.23
In byte-stream mode, read() shall retrieve data from the STREAM until as many bytes as were requested are transferred, or until there is no more data to be retrieved. Byte-stream mode ignores message boundaries.
- pread64.pread.24
In STREAMS message-nondiscard mode, read() shall retrieve data until as many bytes as were requested are transferred, or until a message boundary is reached.
- pread64.pread.25
If read() does not retrieve all the data in a message, the remaining data shall be left on the STREAM, and can be retrieved by the next read() call.
- pread64.pread.26
Message-discard mode also retrieves data until as many bytes as were requested are transferred, or a message boundary is reached.
- pread64.pread.27
However, unread data remaining in a message after the read() returns shall be discarded, and shall not be available for a subsequent read(), getmsg(), or getpmsg() call.
- pread64.pread.28
In byte-stream mode, read() shall accept data until it has read nbyte bytes, or until there is no more data to read, or until a zero-byte message block is encountered.
- pread64.pread.29
The read() function shall then return the number of bytes read, and place the zero-byte message back on the STREAM to be retrieved by the next read(), getmsg(), or getpmsg().
- pread64.pread.30
In message-nondiscard mode or message-discard mode, a zero-byte message shall return 0 and the message shall be removed from the STREAM.
- pread64.pread.31
When a zero-byte message is read as the first message on a STREAM, the message shall be removed from the STREAM and 0 shall be returned, regardless of the read mode.
- pread64.pread.32
A read() from a STREAMS file shall return the data in the message at the front of the STREAM head read queue, regardless of the priority band of the message.
- pread64.pread.33
The read() shall fail if a message containing a control part is encountered at the STREAM head.
- pread64.pread.34
In control-data mode, read() shall convert any control part to data and pass it to the application before passing any data part originally present in the same message.
- pread64.pread.35
In control-discard mode, read() shall discard message control parts but return to the process any data part in the message.
- pread64.pread.36
In addition, read() shall fail if the STREAM head had processed an asynchronous error before the call. In this case, the value of errno shall not reflect the result of read(), but reflect the prior error.
- pread64.pread.37.01
If a hangup occurs on the STREAM being read, read() shall continue to operate normally until the STREAM head read queue is empty.
- pread64.pread.37.02
Thereafter, it shall return 0.
- pread64.pread.38
The pread() function shall be equivalent to read(), except that it shall read from a given position in the file without changing the file pointer.
- pread64.pread.39
The first three arguments to pread() are the same as read() with the addition of a fourth argument offset for the desired position inside the file.
- pread64.pread.40
An attempt to perform a pread() on a file that is incapable of seeking shall result in an error.
- pread64.pread.41.01
Upon successful completion, read() [XSI] and pread() shall return a non-negative integer indicating the number of bytes actually read.
- pread64.pread.41.02
Otherwise, the functions shall return -1 and set errno to indicate the error.
- pread64.pread.42
The read() and [XSI] pread() functions shall fail if:
- pread64.pread.42.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed.
- pread64.pread.42.02
[EBADF] The fildes argument is not a valid file descriptor open for reading.
- pread64.pread.42.03
[EBADMSG] [XSR] The file is a STREAM file that is set to control-normal mode and the message waiting to be read includes a control part.
- pread64.pread.42.04
[EINTR] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- pread64.pread.42.05
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- pread64.pread.42.06
[EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal, or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- pread64.pread.42.07
[EISDIR] [XSI] The fildes argument refers to a directory and the implementation does not allow the directory to be read using read() or pread(). The readdir() function should be used instead.
- pread64.pread.42.08
[EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- pread64.pread.44
The read() and [XSI] pread() functions may fail if:
- pread64.pread.44.01
[EIO] A physical I/O error has occurred.
- pread64.pread.44.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- pread64.pread.44.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- pread64.pread.44.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- pread64.pread.45
The pread() function shall fail, and the file pointer shall remain unchanged, if:
- pread64.pread.45.01
[EINVAL] [XSI] The offset argument is invalid. The value is negative.
- pread64.pread.45.02
[EOVERFLOW] [XSI] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the file.
- pread64.pread.45.03
[ENXIO] [XSI] A request was outside the capabilities of the device.
- pread64.pread.45.04
[ESPIPE] [XSI] fildes is associated with a pipe or FIFO.
- pread64.pread.50
If the file refers to a device special file, the result of subsequent read() requests is implementation-defined.
- pread64.pread.52
The read() function reads data previously written to a file.
- app.pread64.pread.02
The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified.
- app.pread64.pread.20
If fildes refers to a shared memory object, the result of the read() function is unspecified.
- app.pread64.pread.21
If fildes refers to a typed memory object, the result of the read() function is unspecified.
- app.pread64.pread.51
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- [+]pwrite (62 / 16 / 0)
- pwrite.02.01
Before any action described below is taken, and if nbyte is zero and the file is a regular file, the write() function may detect and return errors as described below.
- pwrite.02.02
In the absence of errors, or if error detection is not performed, the write() function shall return zero and have no other results.
- app.pwrite.03
If nbyte is zero and the file is not a regular file, the results are unspecified.
- pwrite.06
On a regular file, if this incremented file offset is greater than the length of the file, the length of the file shall be set to this file offset.
- pwrite.07
On a file not capable of seeking, writing shall always take place starting at the current position.
- pwrite.08.01
If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write
- pwrite.08.02
no intervening file modification operation shall occur between changing the file offset and the write operation.
- pwrite.09
If a write() requests that more bytes be written than there is room for (for example, [XSI] the process' file size limit or the physical end of a medium), only as many bytes as there is room for shall be written.
- pwrite.10
If the request would cause the file size to exceed the soft file size limit for the process and there is no room for any bytes to be written, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- pwrite.11
If write() is interrupted by a signal before it writes any data, it shall return -1 with errno set to [EINTR].
- pwrite.12
If write() is interrupted by a signal after it successfully writes some data, it shall return the number of bytes written.
- app.pwrite.13
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- pwrite.14
Any successful read() from each byte position in the file that was modified by that write shall return the data specified by the write() for that position until such byte positions are again modified.
- pwrite.15
Any subsequent successful write() to the same byte position in the file shall overwrite that file data.
- pwrite.16
There is no file offset associated with a pipe, hence each write request shall append to the end of the pipe.
- pwrite.17.01
Write requests of {PIPE_BUF} bytes or less shall not be interleaved with data from other processes doing writes on the same pipe.
- pwrite.17.02
Writes of greater than {PIPE_BUF} bytes may have data interleaved, on arbitrary boundaries, with writes by other processes, whether or not the O_NONBLOCK flag of the file status flags is set.
- pwrite.18
If the O_NONBLOCK flag is clear, a write request may cause the thread to block, but on normal completion it shall return nbyte.
- pwrite.19
If the O_NONBLOCK flag is set, write() requests shall be handled differently, in the following ways:
- pwrite.19.01
The write() function shall not block the thread.
- pwrite.19.02.01
A write request for {PIPE_BUF} or fewer bytes shall have the following effect: if there is sufficient space available in the pipe, write() shall transfer all the data and return the number of bytes requested.
- pwrite.19.02.02
Otherwise, write() shall transfer no data and return -1 with errno set to [EAGAIN].
- pwrite.19.03
A write request for more than {PIPE_BUF} bytes shall cause one of the following:
- pwrite.19.03.01
When at least one byte can be written, transfer what it can and return the number of bytes written. When all data previously written to the pipe is read, it shall transfer at least {PIPE_BUF} bytes.
- pwrite.19.03.02
When no data can be written, transfer no data, and return -1 with errno set to [EAGAIN].
- pwrite.20
When attempting to write to a file descriptor (other than a pipe or FIFO) that supports non-blocking writes and cannot accept the data immediately:
- pwrite.20.01 (struct)
If the O_NONBLOCK flag is clear, write() shall block the calling thread until the data can be accepted.
- pwrite.20.02.01
If the O_NONBLOCK flag is set, write() shall not block the thread.
- pwrite.20.02.02
If some data can be written without blocking the thread, write() shall write what it can and return the number of bytes written.
- pwrite.20.02.03
Otherwise, it shall return -1 and set errno to [EAGAIN].
- pwrite.22.01
Upon successful completion, where nbyte is greater than 0, write() shall mark for update the st_ctime and st_mtime fields of the file,
- pwrite.22.02
if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared.
- pwrite.23
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- pwrite.24
If the O_DSYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion
- pwrite.25
If the O_SYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- app.pwrite.26
If fildes refers to a shared memory object, the result of the write() function is unspecified.
- app.pwrite.27
If fildes refers to a typed memory object, the result of the write() function is unspecified.
- pwrite.28
If fildes refers to a STREAM, the operation of write() shall be determined by the values of the minimum and maximum nbyte range (packet size) accepted by the STREAM.
- pwrite.29
If nbyte falls within the packet size range, nbyte bytes shall be written.
- pwrite.30
If nbyte does not fall within the range and the minimum packet size value is 0, write() shall break the buffer into maximum packet size segments prior to sending the data downstream (the last segment may contain less than the maximum packet size).
- pwrite.31
If nbyte does not fall within the range and the minimum value is non-zero, write() shall fail with errno set to [ERANGE].
- pwrite.32
Writing a zero-length buffer ( nbyte is 0) to a STREAMS device sends 0 bytes with 0 returned
- pwrite.33
However, writing a zero-length buffer to a STREAMS-based pipe or FIFO sends no message and 0 is returned.
- pwrite.34
When writing to a STREAM, data messages are created with a priority band of 0.
- pwrite.35
When writing to a STREAM that is not a pipe or FIFO:
- pwrite.35.01
If O_NONBLOCK is clear, and the STREAM cannot accept data (the STREAM write queue is full due to internal flow control conditions), write() shall block until data can be accepted.
- pwrite.35.02
If O_NONBLOCK is set and the STREAM cannot accept data, write() shall return -1 and set errno to [EAGAIN].
- pwrite.35.03
If O_NONBLOCK is set and part of the buffer has been written while a condition in which the STREAM cannot accept additional data occurs, write() shall terminate and return the number of bytes written.
- pwrite.36.01
In addition, write() shall fail if the STREAM head has processed an asynchronous error before the call.
- pwrite.36.02
In this case, the value of errno does not reflect the result of write(), but reflects the prior error.
- pwrite.37
The pwrite() function shall be equivalent to write(), except that it writes into a given position without changing the file pointer.
- pwrite.38
The first three arguments to pwrite() are the same as write() with the addition of a fourth argument offset for the desired position inside the file.
- pwrite.40.01 (struct)
Upon successful completion, write() [XSI] and pwrite() shall return the number of bytes actually written to the file associated with fildes.
- pwrite.40.02
This number shall never be greater than nbyte.
- pwrite.40.03
Otherwise, -1 shall be returned and errno set to indicate the error.
- pwrite.41
The write() and [XSI] pwrite() functions shall fail if:
- pwrite.41.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write() operation.
- pwrite.41.02
[EBADF] The fildes argument is not a valid file descriptor open for writing.
- pwrite.41.03
[EFBIG] An attempt was made to write a file that exceeds the implementation-defined maximum file size [XSI] or the process' file size limit, and there was no room for any bytes to be written.
- pwrite.41.04
[EFBIG] The file is a regular file, nbyte is greater than 0, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- pwrite.41.05
[EINTR] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- pwrite.41.06
[EIO] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- pwrite.41.07
[ENOSPC] There was no free space remaining on the device containing the file.
- pwrite.41.08
[EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process, or that only has one end open. A SIGPIPE signal shall also be sent to the thread.
- pwrite.41.09
[ERANGE] [XSR] The transfer request size was outside the range supported by the STREAMS file associated with fildes.
- pwrite.43
The write() and [XSI] pwrite() functions may fail if:
- pwrite.43.01
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- pwrite.43.02
[EIO] A physical I/O error has occurred.
- pwrite.43.03
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- pwrite.43.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- pwrite.43.05
[ENXIO] [XSR] A hangup occurred on the STREAM being written to.
- pwrite.45
The pwrite() function shall fail and the file pointer remain unchanged if:
- pwrite.45.01
[EINVAL] [XSI] The offset argument is invalid. The value is negative.
- pwrite.45.02
[ESPIPE] [XSI] fildes is associated with a pipe or FIFO.
- pwrite.46
A write to a STREAMS file may fail if an error message has been received at the STREAM head. In this case, errno is set to the value included in the error message.
- [+]pwrite64 (62 / 8 / 0)
- pwrite64.pwrite.02.01
Before any action described below is taken, and if nbyte is zero and the file is a regular file, the write() function may detect and return errors as described below.
- pwrite64.pwrite.02.02
In the absence of errors, or if error detection is not performed, the write() function shall return zero and have no other results.
- pwrite64.pwrite.06
On a regular file, if this incremented file offset is greater than the length of the file, the length of the file shall be set to this file offset.
- pwrite64.pwrite.07
On a file not capable of seeking, writing shall always take place starting at the current position.
- pwrite64.pwrite.08.01
If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write
- pwrite64.pwrite.08.02
no intervening file modification operation shall occur between changing the file offset and the write operation.
- pwrite64.pwrite.09
If a write() requests that more bytes be written than there is room for (for example, [XSI] the process' file size limit or the physical end of a medium), only as many bytes as there is room for shall be written.
- pwrite64.pwrite.10
If the request would cause the file size to exceed the soft file size limit for the process and there is no room for any bytes to be written, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- pwrite64.pwrite.11
If write() is interrupted by a signal before it writes any data, it shall return -1 with errno set to [EINTR].
- pwrite64.pwrite.12
If write() is interrupted by a signal after it successfully writes some data, it shall return the number of bytes written.
- pwrite64.pwrite.14
Any successful read() from each byte position in the file that was modified by that write shall return the data specified by the write() for that position until such byte positions are again modified.
- pwrite64.pwrite.15
Any subsequent successful write() to the same byte position in the file shall overwrite that file data.
- pwrite64.pwrite.16
There is no file offset associated with a pipe, hence each write request shall append to the end of the pipe.
- pwrite64.pwrite.17.01
Write requests of {PIPE_BUF} bytes or less shall not be interleaved with data from other processes doing writes on the same pipe.
- pwrite64.pwrite.17.02
Writes of greater than {PIPE_BUF} bytes may have data interleaved, on arbitrary boundaries, with writes by other processes, whether or not the O_NONBLOCK flag of the file status flags is set.
- pwrite64.pwrite.18
If the O_NONBLOCK flag is clear, a write request may cause the thread to block, but on normal completion it shall return nbyte.
- pwrite64.pwrite.19
If the O_NONBLOCK flag is set, write() requests shall be handled differently, in the following ways:
- pwrite64.pwrite.19.01
The write() function shall not block the thread.
- pwrite64.pwrite.19.02.01
A write request for {PIPE_BUF} or fewer bytes shall have the following effect: if there is sufficient space available in the pipe, write() shall transfer all the data and return the number of bytes requested.
- pwrite64.pwrite.19.02.02
Otherwise, write() shall transfer no data and return -1 with errno set to [EAGAIN].
- pwrite64.pwrite.19.03
A write request for more than {PIPE_BUF} bytes shall cause one of the following:
- pwrite64.pwrite.19.03.01
When at least one byte can be written, transfer what it can and return the number of bytes written. When all data previously written to the pipe is read, it shall transfer at least {PIPE_BUF} bytes.
- pwrite64.pwrite.19.03.02
When no data can be written, transfer no data, and return -1 with errno set to [EAGAIN].
- pwrite64.pwrite.20
When attempting to write to a file descriptor (other than a pipe or FIFO) that supports non-blocking writes and cannot accept the data immediately:
- pwrite64.pwrite.20.01 (struct)
If the O_NONBLOCK flag is clear, write() shall block the calling thread until the data can be accepted.
- pwrite64.pwrite.20.02.01
If the O_NONBLOCK flag is set, write() shall not block the thread.
- pwrite64.pwrite.20.02.02
If some data can be written without blocking the thread, write() shall write what it can and return the number of bytes written.
- pwrite64.pwrite.20.02.03
Otherwise, it shall return -1 and set errno to [EAGAIN].
- pwrite64.pwrite.22.01
Upon successful completion, where nbyte is greater than 0, write() shall mark for update the st_ctime and st_mtime fields of the file,
- pwrite64.pwrite.22.02
if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared.
- pwrite64.pwrite.23
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- pwrite64.pwrite.24
If the O_DSYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion
- pwrite64.pwrite.25
If the O_SYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- pwrite64.pwrite.28
If fildes refers to a STREAM, the operation of write() shall be determined by the values of the minimum and maximum nbyte range (packet size) accepted by the STREAM.
- pwrite64.pwrite.29
If nbyte falls within the packet size range, nbyte bytes shall be written.
- pwrite64.pwrite.30
If nbyte does not fall within the range and the minimum packet size value is 0, write() shall break the buffer into maximum packet size segments prior to sending the data downstream (the last segment may contain less than the maximum packet size).
- pwrite64.pwrite.31
If nbyte does not fall within the range and the minimum value is non-zero, write() shall fail with errno set to [ERANGE].
- pwrite64.pwrite.32
Writing a zero-length buffer ( nbyte is 0) to a STREAMS device sends 0 bytes with 0 returned
- pwrite64.pwrite.33
However, writing a zero-length buffer to a STREAMS-based pipe or FIFO sends no message and 0 is returned.
- pwrite64.pwrite.34
When writing to a STREAM, data messages are created with a priority band of 0.
- pwrite64.pwrite.35
When writing to a STREAM that is not a pipe or FIFO:
- pwrite64.pwrite.35.01
If O_NONBLOCK is clear, and the STREAM cannot accept data (the STREAM write queue is full due to internal flow control conditions), write() shall block until data can be accepted.
- pwrite64.pwrite.35.02
If O_NONBLOCK is set and the STREAM cannot accept data, write() shall return -1 and set errno to [EAGAIN].
- pwrite64.pwrite.35.03
If O_NONBLOCK is set and part of the buffer has been written while a condition in which the STREAM cannot accept additional data occurs, write() shall terminate and return the number of bytes written.
- pwrite64.pwrite.36.01
In addition, write() shall fail if the STREAM head has processed an asynchronous error before the call.
- pwrite64.pwrite.36.02
In this case, the value of errno does not reflect the result of write(), but reflects the prior error.
- pwrite64.pwrite.37
The pwrite() function shall be equivalent to write(), except that it writes into a given position without changing the file pointer.
- pwrite64.pwrite.38
The first three arguments to pwrite() are the same as write() with the addition of a fourth argument offset for the desired position inside the file.
- pwrite64.pwrite.40.01 (struct)
Upon successful completion, write() [XSI] and pwrite() shall return the number of bytes actually written to the file associated with fildes.
- pwrite64.pwrite.40.02
This number shall never be greater than nbyte.
- pwrite64.pwrite.40.03
Otherwise, -1 shall be returned and errno set to indicate the error.
- pwrite64.pwrite.41
The write() and [XSI] pwrite() functions shall fail if:
- pwrite64.pwrite.41.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write() operation.
- pwrite64.pwrite.41.02
[EBADF] The fildes argument is not a valid file descriptor open for writing.
- pwrite64.pwrite.41.03
[EFBIG] An attempt was made to write a file that exceeds the implementation-defined maximum file size [XSI] or the process' file size limit, and there was no room for any bytes to be written.
- pwrite64.pwrite.41.04
[EFBIG] The file is a regular file, nbyte is greater than 0, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- pwrite64.pwrite.41.05
[EINTR] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- pwrite64.pwrite.41.06
[EIO] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- pwrite64.pwrite.41.07
[ENOSPC] There was no free space remaining on the device containing the file.
- pwrite64.pwrite.41.08
[EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process, or that only has one end open. A SIGPIPE signal shall also be sent to the thread.
- pwrite64.pwrite.41.09
[ERANGE] [XSR] The transfer request size was outside the range supported by the STREAMS file associated with fildes.
- pwrite64.pwrite.43
The write() and [XSI] pwrite() functions may fail if:
- pwrite64.pwrite.43.01
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- pwrite64.pwrite.43.02
[EIO] A physical I/O error has occurred.
- pwrite64.pwrite.43.03
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- pwrite64.pwrite.43.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- pwrite64.pwrite.43.05
[ENXIO] [XSR] A hangup occurred on the STREAM being written to.
- pwrite64.pwrite.45
The pwrite() function shall fail and the file pointer remain unchanged if:
- pwrite64.pwrite.45.01
[EINVAL] [XSI] The offset argument is invalid. The value is negative.
- pwrite64.pwrite.45.02
[ESPIPE] [XSI] fildes is associated with a pipe or FIFO.
- pwrite64.pwrite.46
A write to a STREAMS file may fail if an error message has been received at the STREAM head. In this case, errno is set to the value included in the error message.
- app.pwrite64.pwrite.03
If nbyte is zero and the file is not a regular file, the results are unspecified.
- app.pwrite64.pwrite.13
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- app.pwrite64.pwrite.26
If fildes refers to a shared memory object, the result of the write() function is unspecified.
- app.pwrite64.pwrite.27
If fildes refers to a typed memory object, the result of the write() function is unspecified.
- [+]read (109 / 30 / 0)
- read.01 (struct)
The read() function shall attempt to read nbyte bytes from the file associated with the open file descriptor, fildes, into the buffer pointed to by buf.
- app.read.02
The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified.
- read.03
Before any action described below is taken, and if nbyte is zero, the read() function may detect and return errors as described below.
- read.04
In the absence of errors, or if error detection is not performed, the read() function shall return zero and have no other results.
- read.05
On files that support seeking (for example, a regular file), the read() shall start at a position in the file given by the file offset associated with fildes.
- read.06
The file offset shall be incremented by the number of bytes actually read.
- read.07
Files that do not support seeking-for example, terminals-always read from the current position.
- read.08
If the starting position is at or after the end-of-file, 0 shall be returned.
- read.09
When attempting to read from an empty pipe or FIFO:
- read.09.01
If no process has the pipe open for writing, read() shall return 0 to indicate end-of-file.
- read.09.02
If some process has the pipe open for writing and O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- read.09.03
If some process has the pipe open for writing and O_NONBLOCK is clear, read() shall block the calling thread until some data is written or the pipe is closed by all processes that had the pipe open for writing.
- app.read.10
If IEXTEN is set, implementation-defined functions shall be recognized from the input data. It is implementation-defined how IEXTEN being set interacts with ICANON, ISIG, IXON, or IXOFF. If IEXTEN is not set, implementation-defined functions shall not be recognized and the corresponding input characters are processed as described for ICANON, ISIG, IXON, and IXOFF.
A special character is recognized not only by its value, but also by its context; for example, an implementation may support multi-byte sequences that have a meaning different from the meaning of the bytes when considered individually. Implementations may also support additional single-byte functions. These implementation-defined multi-byte or single-byte functions shall be recognized only if the IEXTEN flag is set; otherwise, data is received without interpretation, except as required to recognize the special characters defined in this section.
- read.10
When attempting to read a file (other than a pipe or FIFO) that supports non-blocking reads and has no data currently available:
- read.10.01
If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- read.10.02 (struct)
If O_NONBLOCK is clear, read() shall block the calling thread until some data becomes available.
- read.10.03
The use of the O_NONBLOCK flag has no effect if there is some data available.
- app.read.11
If {MAX_CANON} is defined for this terminal device, it shall be a limit on the number of bytes in a line. The behavior of the system when this limit is exceeded is implementation-defined. If {MAX_CANON} is not defined, there shall be no such limit;
- read.11
If any portion of a regular file prior to the end-of-file has not been written, read() shall return bytes with value 0.
- read.12
If data is later written at this point, subsequent reads in the gap between the previous end of data and the newly written data shall return bytes with value 0 until data is written into the gap.
- app.read.12
If two or more special characters have the same value, the function performed when that character is received is undefined.
- read.13.01
Upon successful completion, where nbyte is greater than 0, read() shall mark for update the st_atime field of the file
- read.13.02
and shall return the number of bytes read. This number shall never be greater than nbyte.
- app.read.13
If MIN is greater than {MAX_INPUT}, the response to the request is undefined.
- read.14
The value returned may be less than nbyte
- read.14.01
if the number of bytes left in the file is less than nbyte,
- read.14.02
if the read() request was interrupted by a signal,
- read.14.03
or if the file is a pipe or FIFO or special file and has fewer than nbyte bytes immediately available for reading.
- app.read.14
The system may impose a limit, {MAX_INPUT}, on the number of bytes that may be stored in the input queue. The behavior of the system when this limit is exceeded is implementation-defined.
- read.15
If a read() is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR].
- read.16
If a read() is interrupted by a signal after it has successfully read some data, it shall return the number of bytes read.
- read.17
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- read.18
If the O_DSYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- read.19
If the O_SYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- app.read.20
If fildes refers to a shared memory object, the result of the read() function is unspecified.
- app.read.21
If fildes refers to a typed memory object, the result of the read() function is unspecified.
- read.22
The default shall be byte-stream mode.
- read.23
In byte-stream mode, read() shall retrieve data from the STREAM until as many bytes as were requested are transferred, or until there is no more data to be retrieved. Byte-stream mode ignores message boundaries.
- read.24
In STREAMS message-nondiscard mode, read() shall retrieve data until as many bytes as were requested are transferred, or until a message boundary is reached.
- read.25
If read() does not retrieve all the data in a message, the remaining data shall be left on the STREAM, and can be retrieved by the next read() call.
- read.26
Message-discard mode also retrieves data until as many bytes as were requested are transferred, or a message boundary is reached.
- read.27
However, unread data remaining in a message after the read() returns shall be discarded, and shall not be available for a subsequent read(), getmsg(), or getpmsg() call.
- read.28
In byte-stream mode, read() shall accept data until it has read nbyte bytes, or until there is no more data to read, or until a zero-byte message block is encountered.
- read.29
The read() function shall then return the number of bytes read, and place the zero-byte message back on the STREAM to be retrieved by the next read(), getmsg(), or getpmsg().
- read.30
In message-nondiscard mode or message-discard mode, a zero-byte message shall return 0 and the message shall be removed from the STREAM.
- read.31
When a zero-byte message is read as the first message on a STREAM, the message shall be removed from the STREAM and 0 shall be returned, regardless of the read mode.
- read.31.01.01
Also, if no data is available, read() may either return 0, or return -1 with errno set to [EAGAIN].
- read.32
A read() from a STREAMS file shall return the data in the message at the front of the STREAM head read queue, regardless of the priority band of the message.
- read.33
The read() shall fail if a message containing a control part is encountered at the STREAM head.
- read.34
In control-data mode, read() shall convert any control part to data and pass it to the application before passing any data part originally present in the same message.
- read.35
In control-discard mode, read() shall discard message control parts but return to the process any data part in the message.
- read.36
In addition, read() shall fail if the STREAM head had processed an asynchronous error before the call. In this case, the value of errno shall not reflect the result of read(), but reflect the prior error.
- read.37.01
If a hangup occurs on the STREAM being read, read() shall continue to operate normally until the STREAM head read queue is empty.
- read.37.02
Thereafter, it shall return 0.
- read.41.01
Upon successful completion, read() [XSI] and pread() shall return a non-negative integer indicating the number of bytes actually read.
- read.41.02
Otherwise, the functions shall return -1 and set errno to indicate the error.
- read.42
The read() and [XSI] pread() functions shall fail if:
- read.42.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed.
- read.42.02
[EBADF] The fildes argument is not a valid file descriptor open for reading.
- read.42.03
[EBADMSG] [XSR] The file is a STREAM file that is set to control-normal mode and the message waiting to be read includes a control part.
- read.42.04
[EINTR] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- read.42.05
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- read.42.06
[EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal, or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- read.42.07
[EISDIR] [XSI] The fildes argument refers to a directory and the implementation does not allow the directory to be read using read() or pread(). The readdir() function should be used instead.
- read.42.08
[EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- read.43
The read() function shall fail if:
- read.43.01
[EAGAIN] or [EWOULDBLOCK] The file descriptor is for a socket, is marked O_NONBLOCK, and no data is waiting to be received.
- read.43.02
[ECONNRESET] A read was attempted on a socket and the connection was forcibly closed by its peer.
- read.43.03
[ENOTCONN] A read was attempted on a socket that is not connected.
- read.43.04
[ETIMEDOUT] A read was attempted on a socket and a transmission timeout occurred.
- read.44
The read() and [XSI] pread() functions may fail if:
- read.44.01
[EIO] A physical I/O error has occurred.
- read.44.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- read.44.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- read.44.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- read.50
If the file refers to a device special file, the result of subsequent read() requests is implementation-defined.
- app.read.51
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- read.52
The read() function reads data previously written to a file.
- read.55
Any subsequent read from the terminal device shall return the value of zero, indicating end-of-file; see read().
- read.60.01
If IGNBRK is set, a break condition detected on input shall be ignored; that is, not put on the input queue and therefore not read by any process.
- read.60.02.01
If IGNBRK is not set and BRKINT is set, the break condition shall flush the input and output queues,
- read.60.02.02
and if the terminal is the controlling terminal of a foreground process group, the break condition shall generate a single SIGINT signal to that foreground process group.
- read.60.03
If neither IGNBRK nor BRKINT is set, a break condition shall be read as a single 0x00, or if PARMRK is set, as 0xff 0x00 0x00.
- read.61.01
Special character on input, which is recognized if the ISIG flag is set. Generates a SIGINT signal which is sent to all processes in the foreground process group for which the terminal is the controlling terminal.
- read.61.02
If ISIG is set, the INTR character shall be discarded when processed.
- read.62.01
Special character on input, which is recognized if the ISIG flag is set. Generates a SIGQUIT signal which is sent to all processes in the foreground process group for which the terminal is the controlling terminal.
- read.62.02
If ISIG is set, the QUIT character shall be discarded when processed.
- read.63.01
If the ISIG flag is set, receipt of the SUSP character shall cause a SIGTSTP signal to be sent to all processes in the foreground process group for which the terminal is the controlling terminal,
- read.63.02
and the SUSP character shall be discarded when processed.
- read.64.01
Special character on both input and output, which is recognized if the IXON (output control) or IXOFF (input control) flag is set. Can be used to suspend output temporarily. It is useful with CRT terminals to prevent output from disappearing before it can be read.
If IXON is set, start/stop output control shall be enabled. A received STOP character shall suspend output
- read.64.02
When IXON is not set, the START and STOP characters shall be read.
If IXON is set, the STOP character shall be discarded when processed.
When IXON is set, START and STOP characters are not read, but merely perform flow control functions.
- read.65.01
and a received START character shall restart output.
Special character on both input and output, which is recognized if the IXON (output control) or IXOFF (input control) flag is set. Can be used to resume output that has been suspended by a STOP character.
- read.65.02
When IXON is not set, the START and STOP characters shall be read.
If IXON is set, the START character shall be discarded when processed.
When IXON is set, START and STOP characters are not read, but merely perform flow control functions.
- read.66.01
Special character on input, which is recognized if the ICANON flag is set. Erases the last character in the current line; see Canonical Mode Input Processing. It shall not erase beyond the start of a line, as delimited by an NL, EOF, or EOL character.
The ERASE character shall delete the last character in the current line, if there is one.
The ERASE and KILL characters shall have no effect if there is no data in the current line.
- read.66.02
If ICANON is set, the ERASE character shall be discarded when processed.
The ERASE and KILL characters themselves shall not be placed in the input queue.
- read.67.01
Special character on input, which is recognized if the ICANON flag is set. Deletes the entire line, as delimited by an NL, EOF, or EOL character.
The KILL character shall delete all data in the current line, if there is any.
The ERASE and KILL characters shall have no effect if there is no data in the current line.
- read.67.02
The ERASE and KILL characters themselves shall not be placed in the input queue.
If ICANON is set, the KILL character shall be discarded when processed.
- read.68.01
Special character on input, which is recognized if the ICANON flag is set. When received, all the bytes waiting to be read are immediately passed to the process without waiting for a newline, and the EOF is discarded. Thus, if there are no bytes waiting (that is, the EOF occurred at the beginning of a line), a byte count of zero shall be returned from the read(), representing an end-of-file indication.
- read.68.02
If ICANON is set, the EOF character shall be discarded when processed.
- read.69.01
Special character on input, which is recognized if the ICANON flag is set. It is the line delimiter newline.
- read.70
Special character on input, which is recognized if the ICANON flag is set. It is an additional line delimiter, like NL.
- read.71.01
Special character on input, which is recognized if the ICANON flag is set; it is the carriage-return character.
- read.71.02
If IGNCR is not set and ICRNL is set, a received CR character shall be translated into an NL character.
When ICANON and ICRNL are set and IGNCR is not set, this character shall be translated into an NL, and shall have the same effect as an NL character.
- read.72
If IGNPAR is set, a byte with a framing or parity error (other than break) shall be ignored.
- read.73.01
If PARMRK is set, and IGNPAR is not set, a byte with a framing or parity error (other than break) shall be given to the application as the three-byte sequence 0xff 0x00 X, where 0xff 0x00 is a two-byte flag preceding each sequence and X is the data of the byte received in error.
- read.73.02
To avoid ambiguity in this case, if ISTRIP is not set, a valid byte of 0xff is given to the application as 0xff 0xff.
- read.73.03
If neither PARMRK nor IGNPAR is set, a framing or parity error (other than break) shall be given to the application as a single byte 0x00.
- read.74
If INPCK is set, input parity checking shall be enabled.
- read.75
If ISTRIP is set, valid input bytes shall first be stripped to seven bits; otherwise, all eight bits shall be processed
- read.76.01
If INLCR is set, a received NL character shall be translated into a CR character.
- read.76.02
If IGNCR is set, a received CR character shall be ignored (not read).
- read.77
If IXANY is set, any input character shall restart output that has been suspended.
- read.79
If the O_NONBLOCK flag is clear, then the read request shall be blocked until data is available or a signal has been received.
- read.80.01
This means that a read request shall not return until an entire line has been typed or a signal has been received.
- read.80.02
Also, no matter how many bytes are requested in the read() call, at most one line shall be returned.
- read.81.01
Therefore, if O_NONBLOCK is set, read() may return immediately, regardless of the setting of MIN or TIME.
- read.82.01
As soon as one byte is received, the inter-byte timer shall be started.
In case A, TIME serves as an inter-byte timer which shall be activated after the first byte is received.
- read.82.02
Since it is an inter-byte timer, it shall be reset after a byte is received.
- read.82.03
If MIN bytes are received before the inter-byte timer expires (remember that the timer is reset upon receipt of each byte), the read shall be satisfied.
- read.82.04
If the timer expires before MIN bytes are received, the characters received to that point shall be returned to the user.
- read.82.05
Note that if TIME expires at least one byte shall be returned because the timer would not have been enabled unless a byte was received.
- read.83.01
In case B, since the value of TIME is zero, the timer plays no role and only MIN is significant. A pending read shall not be satisfied until MIN bytes are received (that is, the pending read shall block until MIN bytes are received), or a signal is received.
- read.83.02.03
If bytes are not received, the read shall not block indefinitely waiting for a byte; if no byte is received within TIME*0.1 seconds after the read is initiated, the read() shall return a value of zero, having read no data.
- read.84.01
In case C, since MIN=0, TIME no longer represents an inter-byte timer. It now serves as a read timer that shall be activated as soon as the read() function is processed.
- read.84.02
A read shall be satisfied as soon as a single byte is received or the read timer expires.
- read.84.02.01
Note that in case C if the timer expires, no bytes shall be returned.
- read.84.02.02
If the timer does not expire, the only way the read can be satisfied is if a byte is received.
- read.85
The minimum of either the number of bytes requested or the number of bytes currently available shall be returned without waiting for more bytes to be input. If no characters are available, read() shall return a value of zero, having read no data.
- [+]readv (64 / 20 / 0)
- readv.01
The readv() function shall place the input data into the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[ iovcnt-1].
- app.readv.02
The iovcnt argument is valid if greater than 0 and less than or equal to {IOV_MAX}.
- readv.03
Each iovec entry specifies the base address and length of an area in memory where data should be placed.
- readv.04
The readv() function shall always fill an area completely before proceeding to the next.
- readv.05
Upon successful completion, readv() shall mark for update the st_atime field of the file.
- readv.06
In addition, the readv() function shall fail if:
- readv.06.01
[EINVAL] The sum of the iov_len values in the iov array overflowed an ssize_t.
- readv.07
The readv() function may fail if:
- readv.07.01
[EINVAL] The iovcnt argument was less than or equal to 0, or greater than {IOV_MAX}.
- readv.45
The read() function shall fail if:
- readv.45.01
[EAGAIN] or [EWOULDBLOCK] The file descriptor is for a socket, is marked O_NONBLOCK, and no data is waiting to be received.
- readv.45.02
[ECONNRESET] A read was attempted on a socket and the connection was forcibly closed by its peer.
- readv.45.03
[ENOTCONN] A read was attempted on a socket that is not connected.
- readv.45.04
[ETIMEDOUT] A read was attempted on a socket and a transmission timeout occurred.
- readv.pread.05
On files that support seeking (for example, a regular file), the read() shall start at a position in the file given by the file offset associated with fildes.
- readv.pread.06
The file offset shall be incremented by the number of bytes actually read.
- readv.pread.07
Files that do not support seeking-for example, terminals-always read from the current position.
- readv.pread.08
If the starting position is at or after the end-of-file, 0 shall be returned.
- readv.pread.09
When attempting to read from an empty pipe or FIFO:
- readv.pread.09.01
If no process has the pipe open for writing, read() shall return 0 to indicate end-of-file.
- readv.pread.09.02
If some process has the pipe open for writing and O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- readv.pread.09.03
If some process has the pipe open for writing and O_NONBLOCK is clear, read() shall block the calling thread until some data is written or the pipe is closed by all processes that had the pipe open for writing.
- readv.pread.10
When attempting to read a file (other than a pipe or FIFO) that supports non-blocking reads and has no data currently available:
- readv.pread.10.01
If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].
- readv.pread.10.02 (struct)
If O_NONBLOCK is clear, read() shall block the calling thread until some data becomes available.
- readv.pread.10.03
The use of the O_NONBLOCK flag has no effect if there is some data available.
- readv.pread.11
If any portion of a regular file prior to the end-of-file has not been written, read() shall return bytes with value 0.
- readv.pread.12
If data is later written at this point, subsequent reads in the gap between the previous end of data and the newly written data shall return bytes with value 0 until data is written into the gap.
- readv.pread.13.01
Upon successful completion, where nbyte is greater than 0, read() shall mark for update the st_atime field of the file
- readv.pread.13.02
and shall return the number of bytes read. This number shall never be greater than nbyte.
- readv.pread.14
The value returned may be less than nbyte
- readv.pread.14.01
if the number of bytes left in the file is less than nbyte,
- readv.pread.14.02
if the read() request was interrupted by a signal,
- readv.pread.14.03
or if the file is a pipe or FIFO or special file and has fewer than nbyte bytes immediately available for reading.
- readv.pread.15
If a read() is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR].
- readv.pread.16
If a read() is interrupted by a signal after it has successfully read some data, it shall return the number of bytes read.
- readv.pread.17
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- readv.pread.18
If the O_DSYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion.
- readv.pread.19
If the O_SYNC and O_RSYNC bits have been set, read I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- readv.pread.22
The default shall be byte-stream mode.
- readv.pread.23
In byte-stream mode, read() shall retrieve data from the STREAM until as many bytes as were requested are transferred, or until there is no more data to be retrieved. Byte-stream mode ignores message boundaries.
- readv.pread.24
In STREAMS message-nondiscard mode, read() shall retrieve data until as many bytes as were requested are transferred, or until a message boundary is reached.
- readv.pread.25
If read() does not retrieve all the data in a message, the remaining data shall be left on the STREAM, and can be retrieved by the next read() call.
- readv.pread.26
Message-discard mode also retrieves data until as many bytes as were requested are transferred, or a message boundary is reached.
- readv.pread.27
However, unread data remaining in a message after the read() returns shall be discarded, and shall not be available for a subsequent read(), getmsg(), or getpmsg() call.
- readv.pread.28
In byte-stream mode, read() shall accept data until it has read nbyte bytes, or until there is no more data to read, or until a zero-byte message block is encountered.
- readv.pread.29
The read() function shall then return the number of bytes read, and place the zero-byte message back on the STREAM to be retrieved by the next read(), getmsg(), or getpmsg().
- readv.pread.30
In message-nondiscard mode or message-discard mode, a zero-byte message shall return 0 and the message shall be removed from the STREAM.
- readv.pread.31
When a zero-byte message is read as the first message on a STREAM, the message shall be removed from the STREAM and 0 shall be returned, regardless of the read mode.
- readv.pread.32
A read() from a STREAMS file shall return the data in the message at the front of the STREAM head read queue, regardless of the priority band of the message.
- readv.pread.33
The read() shall fail if a message containing a control part is encountered at the STREAM head.
- readv.pread.34
In control-data mode, read() shall convert any control part to data and pass it to the application before passing any data part originally present in the same message.
- readv.pread.35
In control-discard mode, read() shall discard message control parts but return to the process any data part in the message.
- readv.pread.36
In addition, read() shall fail if the STREAM head had processed an asynchronous error before the call. In this case, the value of errno shall not reflect the result of read(), but reflect the prior error.
- readv.pread.37.01
If a hangup occurs on the STREAM being read, read() shall continue to operate normally until the STREAM head read queue is empty.
- readv.pread.37.02
Thereafter, it shall return 0.
- readv.pread.41.01
Upon successful completion, read() [XSI] and pread() shall return a non-negative integer indicating the number of bytes actually read.
- readv.pread.41.02
Otherwise, the functions shall return -1 and set errno to indicate the error.
- readv.pread.42
The read() and [XSI] pread() functions shall fail if:
- readv.pread.42.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed.
- readv.pread.42.02
[EBADF] The fildes argument is not a valid file descriptor open for reading.
- readv.pread.42.03
[EBADMSG] [XSR] The file is a STREAM file that is set to control-normal mode and the message waiting to be read includes a control part.
- readv.pread.42.04
[EINTR] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- readv.pread.42.05
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- readv.pread.42.06
[EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal, or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- readv.pread.42.07
[EISDIR] [XSI] The fildes argument refers to a directory and the implementation does not allow the directory to be read using read() or pread(). The readdir() function should be used instead.
- readv.pread.42.08
[EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- readv.pread.44
The read() and [XSI] pread() functions may fail if:
- readv.pread.44.01
[EIO] A physical I/O error has occurred.
- readv.pread.44.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- readv.pread.44.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- readv.pread.44.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- readv.pread.50
If the file refers to a device special file, the result of subsequent read() requests is implementation-defined.
- readv.pread.52
The read() function reads data previously written to a file.
- app.readv.pread.02
The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified.
- app.readv.pread.20
If fildes refers to a shared memory object, the result of the read() function is unspecified.
- app.readv.pread.21
If fildes refers to a typed memory object, the result of the read() function is unspecified.
- [+]sync (2 / 0 / 0)
- sync.01
The sync() function shall cause all information in memory that updates file systems to be scheduled for writing out to all file systems.
- sync.02
The writing, although scheduled, is not necessarily complete upon return from sync().
- [+]truncate (22 / 7 / 0)
- truncate.01
The truncate() function shall cause the regular file named by path to have a size which shall be equal to length bytes.
- truncate.02
If the file previously was larger than length, the extra data is discarded.
- truncate.03
If the file was previously shorter than length, its size is increased, and the extended area appears as if it were zero-filled.
- truncate.04
If the request would cause the file size to exceed the soft file size limit for the process, the request shall fail and the implementation shall generate the SIGXFSZ signal for the process.
- truncate.05
This function shall not modify the file offset for any open file descriptions associated with the file.
- truncate.06
Upon successful completion, if the file size is changed, this function shall mark for update the st_ctime and st_mtime fields of the file, and the S_ISUID and S_ISGID bits of the file mode may be cleared.
- truncate.07.01
Upon successful completion, truncate() shall return 0.
- truncate.07.02
Otherwise, -1 shall be returned, and errno set to indicate the error.
- truncate.08
The truncate() function shall fail if:
- truncate.08.01
[EINTR] A signal was caught during execution.
- truncate.08.02
[EINVAL] The length argument was less than 0.
- truncate.08.03
[EFBIG] or [EINVAL] The length argument was greater than the maximum file size.
- truncate.08.04
[EIO] An I/O error occurred while reading from or writing to a file system.
- truncate.08.05
[EACCES] A component of the path prefix denies search permission, or write permission is denied on the file.
- truncate.08.06
[EISDIR] The named file is a directory.
- truncate.08.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- truncate.08.08
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- truncate.08.09
[ENOENT] A component of path does not name an existing file or path is an empty string.
- truncate.08.10
[ENOTDIR] A component of the path prefix of path is not a directory.
- truncate.08.11
[EROFS] The named file resides on a read-only file system.
- truncate.09
The truncate() function may fail if:
- truncate.09.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- truncate.09.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- truncate.10
The application shall ensure that the process has write permission for the file.
- [+]truncate64 (22 / 7 / 0)
- truncate64.truncate.01
The truncate() function shall cause the regular file named by path to have a size which shall be equal to length bytes.
- truncate64.truncate.02
If the file previously was larger than length, the extra data is discarded.
- truncate64.truncate.03
If the file was previously shorter than length, its size is increased, and the extended area appears as if it were zero-filled.
- truncate64.truncate.04
If the request would cause the file size to exceed the soft file size limit for the process, the request shall fail and the implementation shall generate the SIGXFSZ signal for the process.
- truncate64.truncate.05
This function shall not modify the file offset for any open file descriptions associated with the file.
- truncate64.truncate.06
Upon successful completion, if the file size is changed, this function shall mark for update the st_ctime and st_mtime fields of the file, and the S_ISUID and S_ISGID bits of the file mode may be cleared.
- truncate64.truncate.07.01
Upon successful completion, truncate() shall return 0.
- truncate64.truncate.07.02
Otherwise, -1 shall be returned, and errno set to indicate the error.
- truncate64.truncate.08
The truncate() function shall fail if:
- truncate64.truncate.08.01
[EINTR] A signal was caught during execution.
- truncate64.truncate.08.02
[EINVAL] The length argument was less than 0.
- truncate64.truncate.08.03
[EFBIG] or [EINVAL] The length argument was greater than the maximum file size.
- truncate64.truncate.08.04
[EIO] An I/O error occurred while reading from or writing to a file system.
- truncate64.truncate.08.05
[EACCES] A component of the path prefix denies search permission, or write permission is denied on the file.
- truncate64.truncate.08.06
[EISDIR] The named file is a directory.
- truncate64.truncate.08.07
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- truncate64.truncate.08.08
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- truncate64.truncate.08.09
[ENOENT] A component of path does not name an existing file or path is an empty string.
- truncate64.truncate.08.10
[ENOTDIR] A component of the path prefix of path is not a directory.
- truncate64.truncate.08.11
[EROFS] The named file resides on a read-only file system.
- truncate64.truncate.09
The truncate() function may fail if:
- truncate64.truncate.09.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- truncate64.truncate.09.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- truncate64.truncate.10
The application shall ensure that the process has write permission for the file.
- [+]write (95 / 27 / 0)
- write.01 (struct)
The write() function shall attempt to write nbyte bytes from the buffer pointed to by buf to the file associated with the open file descriptor, fildes.
- write.02.01
Before any action described below is taken, and if nbyte is zero and the file is a regular file, the write() function may detect and return errors as described below.
- write.02.02
In the absence of errors, or if error detection is not performed, the write() function shall return zero and have no other results.
- app.write.03
If nbyte is zero and the file is not a regular file, the results are unspecified.
- write.04
On a regular file or other file capable of seeking, the actual writing of data shall proceed from the position in the file indicated by the file offset associated with fildes.
- write.05
Before successful return from write(), the file offset shall be incremented by the number of bytes actually written.
- write.06
On a regular file, if this incremented file offset is greater than the length of the file, the length of the file shall be set to this file offset.
- write.07
On a file not capable of seeking, writing shall always take place starting at the current position.
- write.08.01
If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write
- write.08.02
no intervening file modification operation shall occur between changing the file offset and the write operation.
- write.09
If a write() requests that more bytes be written than there is room for (for example, [XSI] the process' file size limit or the physical end of a medium), only as many bytes as there is room for shall be written.
- write.10
If the request would cause the file size to exceed the soft file size limit for the process and there is no room for any bytes to be written, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- write.11
If write() is interrupted by a signal before it writes any data, it shall return -1 with errno set to [EINTR].
- write.12
If write() is interrupted by a signal after it successfully writes some data, it shall return the number of bytes written.
- app.write.13
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- write.14
Any successful read() from each byte position in the file that was modified by that write shall return the data specified by the write() for that position until such byte positions are again modified.
- write.15
Any subsequent successful write() to the same byte position in the file shall overwrite that file data.
- write.16
There is no file offset associated with a pipe, hence each write request shall append to the end of the pipe.
- write.17.01
Write requests of {PIPE_BUF} bytes or less shall not be interleaved with data from other processes doing writes on the same pipe.
- write.17.02
Writes of greater than {PIPE_BUF} bytes may have data interleaved, on arbitrary boundaries, with writes by other processes, whether or not the O_NONBLOCK flag of the file status flags is set.
- write.18
If the O_NONBLOCK flag is clear, a write request may cause the thread to block, but on normal completion it shall return nbyte.
- write.19
If the O_NONBLOCK flag is set, write() requests shall be handled differently, in the following ways:
- write.19.01
The write() function shall not block the thread.
- write.19.02.01
A write request for {PIPE_BUF} or fewer bytes shall have the following effect: if there is sufficient space available in the pipe, write() shall transfer all the data and return the number of bytes requested.
- write.19.02.02
Otherwise, write() shall transfer no data and return -1 with errno set to [EAGAIN].
- write.19.03
A write request for more than {PIPE_BUF} bytes shall cause one of the following:
- write.19.03.01
When at least one byte can be written, transfer what it can and return the number of bytes written. When all data previously written to the pipe is read, it shall transfer at least {PIPE_BUF} bytes.
- write.19.03.02
When no data can be written, transfer no data, and return -1 with errno set to [EAGAIN].
- write.20
When attempting to write to a file descriptor (other than a pipe or FIFO) that supports non-blocking writes and cannot accept the data immediately:
- write.20.01 (struct)
If the O_NONBLOCK flag is clear, write() shall block the calling thread until the data can be accepted.
- write.20.02.01
If the O_NONBLOCK flag is set, write() shall not block the thread.
- write.20.02.02
If some data can be written without blocking the thread, write() shall write what it can and return the number of bytes written.
- write.20.02.03
Otherwise, it shall return -1 and set errno to [EAGAIN].
- write.22.01
Upon successful completion, where nbyte is greater than 0, write() shall mark for update the st_ctime and st_mtime fields of the file,
- write.22.02
if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared.
- write.23
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- write.24
If the O_DSYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion
- write.25
If the O_SYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- app.write.26
If fildes refers to a shared memory object, the result of the write() function is unspecified.
- app.write.27
If fildes refers to a typed memory object, the result of the write() function is unspecified.
- write.28
If fildes refers to a STREAM, the operation of write() shall be determined by the values of the minimum and maximum nbyte range (packet size) accepted by the STREAM.
- write.29
If nbyte falls within the packet size range, nbyte bytes shall be written.
- write.30
If nbyte does not fall within the range and the minimum packet size value is 0, write() shall break the buffer into maximum packet size segments prior to sending the data downstream (the last segment may contain less than the maximum packet size).
- write.31
If nbyte does not fall within the range and the minimum value is non-zero, write() shall fail with errno set to [ERANGE].
- write.32
Writing a zero-length buffer ( nbyte is 0) to a STREAMS device sends 0 bytes with 0 returned
- write.33
However, writing a zero-length buffer to a STREAMS-based pipe or FIFO sends no message and 0 is returned.
- write.34
When writing to a STREAM, data messages are created with a priority band of 0.
- write.35
When writing to a STREAM that is not a pipe or FIFO:
- write.35.01
If O_NONBLOCK is clear, and the STREAM cannot accept data (the STREAM write queue is full due to internal flow control conditions), write() shall block until data can be accepted.
- write.35.02
If O_NONBLOCK is set and the STREAM cannot accept data, write() shall return -1 and set errno to [EAGAIN].
- write.35.03
If O_NONBLOCK is set and part of the buffer has been written while a condition in which the STREAM cannot accept additional data occurs, write() shall terminate and return the number of bytes written.
- write.36.01
In addition, write() shall fail if the STREAM head has processed an asynchronous error before the call.
- write.36.02
In this case, the value of errno does not reflect the result of write(), but reflects the prior error.
- write.40.01 (struct)
Upon successful completion, write() [XSI] and pwrite() shall return the number of bytes actually written to the file associated with fildes.
- write.40.02
This number shall never be greater than nbyte.
- write.40.03
Otherwise, -1 shall be returned and errno set to indicate the error.
- write.41
The write() and [XSI] pwrite() functions shall fail if:
- write.41.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write() operation.
- write.41.02
[EBADF] The fildes argument is not a valid file descriptor open for writing.
- write.41.03
[EFBIG] An attempt was made to write a file that exceeds the implementation-defined maximum file size [XSI] or the process' file size limit, and there was no room for any bytes to be written.
- write.41.04
[EFBIG] The file is a regular file, nbyte is greater than 0, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- write.41.05
[EINTR] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- write.41.06
[EIO] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- write.41.07
[ENOSPC] There was no free space remaining on the device containing the file.
- write.41.08
[EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process, or that only has one end open. A SIGPIPE signal shall also be sent to the thread.
- write.41.09
[ERANGE] [XSR] The transfer request size was outside the range supported by the STREAMS file associated with fildes.
- write.42
The write() function shall fail if:
- write.42.01
[EAGAIN] or [EWOULDBLOCK] The file descriptor is for a socket, is marked O_NONBLOCK, and write would block.
- write.42.02
[ECONNRESET] A write was attempted on a socket that is not connected.
- write.42.03
[EPIPE] A write was attempted on a socket that is shut down for writing, or is no longer connected. In the latter case, if the socket is of type SOCK_STREAM, a SIGPIPE signal shall also be sent to the thread.
- write.43
The write() and [XSI] pwrite() functions may fail if:
- write.43.01
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- write.43.02
[EIO] A physical I/O error has occurred.
- write.43.03
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- write.43.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- write.43.05
[ENXIO] [XSR] A hangup occurred on the STREAM being written to.
- write.44
The write() function may fail if:
- write.44.01
[EACCES] A write was attempted on a socket and the calling process does not have appropriate privileges.
- write.44.02
[ENETDOWN] A write was attempted on a socket and the local network interface used to reach the destination is down.
- write.44.03
[ENETUNREACH] A write was attempted on a socket and no route to the network is present.
- write.46
A write to a STREAMS file may fail if an error message has been received at the STREAM head. In this case, errno is set to the value included in the error message.
- write.50
Any subsequent write() to the terminal device shall return -1, with errno set to [EIO], until the device is closed.
- write.60.01
If OPOST is set, output data shall be post-processed as described below, so that lines of text are modified to appear appropriately on the terminal device;
- write.60.02
otherwise, characters shall be transmitted without change.
- write.61.01
If ONLCR is set, the NL character shall be transmitted as the CR-NL character pair.
- write.61.01.02.01
Newline delay shall last about 0.10 seconds.
- write.61.01.02.02
If OFILL is set, two fill characters shall be transmitted.
- write.61.01.03.01
Carriage-return delay type 1 shall be dependent on the current column position,
- write.61.01.03.02
type 2 shall be about 0.10 seconds,
- write.61.01.03.03
and type 3 shall be about 0.15 seconds.
- write.61.01.03.04.01
If OFILL is set, delay type 1 shall transmit two fill characters,
- write.61.01.03.04.02
and type 2 four fill characters.
- write.61.01.04.01
Horizontal-tab delay type 1 shall be dependent on the current column position.
- write.61.01.04.02
Type 2 shall be about 0.10 seconds.
- write.61.01.04.03
Type 3 specifies that tabs shall be expanded into spaces.
- write.61.01.04.04
If OFILL is set, two fill characters shall be transmitted for any delay.
- write.61.01.05.01
Backspace delay shall last about 0.05 seconds.
- write.61.01.05.02
If OFILL is set, one fill character shall be transmitted.
- write.61.02
If OCRNL is set, the CR character shall be transmitted as the NL character.
- write.61.03
If ONOCR is set, no CR character shall be transmitted when at column 0 (first position).
- write.61.04
If ONLRET is set, the NL character is assumed to do the carriage-return function;
- write.61.04.01
the column pointer shall be set to 0
- write.61.04.02
If ONLRET is set, the carriage-return delays shall be used instead of the newline delays.
and the delays specified for CR shall be used.
- write.61.05
Otherwise, the NL character is assumed to do just the line-feed function; the column pointer remains unchanged.
- write.61.06
The column pointer shall also be set to 0 if the CR character is actually transmitted.
- write.62.01
The delay bits specify how long transmission stops to allow for mechanical or other movement when certain characters are sent to the terminal.
- write.62.01.01.01
If a form-feed or vertical-tab delay is specified, it shall last for about 2 seconds.
- write.62.01.01.02
If a form-feed or vertical-tab delay is specified, it shall last for about 2 seconds.
- write.62.02
In all cases a value of 0 shall indicate no delay.
- write.62.03
If OFILL is set, fill characters shall be transmitted for delay instead of a timed delay.
- write.62.04.01
If OFDEL is set, the fill character shall be DEL;
- write.62.04.02
otherwise, NUL.
- write.63
The actual delays depend on line speed and system load.
- [+]writev (66 / 20 / 0)
- writev.01
The writev() function shall gather output data from the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1].
- writev.02
The iovcnt argument is valid if greater than 0 and less than or equal to {IOV_MAX}, as defined in <limits.h>.
- writev.03
Each iovec entry specifies the base address and length of an area in memory from which data should be written. The writev() function shall always write a complete area before proceeding to the next.
- writev.04
If fildes refers to a regular file and all of the iov_len members in the array pointed to by iov are 0, writev() shall return 0 and have no other effect.
- app.writev.05
For other file types, the behavior is unspecified.
- writev.06
If the sum of the iov_len values is greater than {SSIZE_MAX}, the operation shall fail and no data shall be transferred.
- writev.07.01 (struct)
Upon successful completion, writev() shall return the number of bytes actually written.
- writev.07.02
Otherwise, it shall return a value of -1,
- writev.07.03
the file-pointer shall remain unchanged,
- writev.07.04
and errno shall be set to indicate an error.
- writev.08
In addition, the writev() function shall fail if:
- writev.08.01
[EINVAL] The sum of the iov_len values in the iov array would overflow an ssize_t.
- writev.09
The writev() function may fail and set errno to:
- writev.09.01
[EINVAL] The iovcnt argument was less than or equal to 0, or greater than {IOV_MAX}.
- writev.11
Before successful return from write(), the file offset shall be incremented by the number of bytes actually written.
- writev.12
On a regular file, if this incremented file offset is greater than the length of the file, the length of the file shall be set to this file offset.
- writev.42
The write() function shall fail if:
- writev.42.01
[EAGAIN] or [EWOULDBLOCK] The file descriptor is for a socket, is marked O_NONBLOCK, and write would block.
- writev.42.02
[ECONNRESET] A write was attempted on a socket that is not connected.
- writev.42.03
[EPIPE] A write was attempted on a socket that is shut down for writing, or is no longer connected. In the latter case, if the socket is of type SOCK_STREAM, a SIGPIPE signal shall also be sent to the thread.
- writev.44
The write() function may fail if:
- writev.44.01
[EACCES] A write was attempted on a socket and the calling process does not have appropriate privileges.
- writev.44.02
[ENETDOWN] A write was attempted on a socket and the local network interface used to reach the destination is down.
- writev.44.03
[ENETUNREACH] A write was attempted on a socket and no route to the network is present.
- app.writev.pwrite.13
If the value of nbyte is greater than {SSIZE_MAX}, the result is implementation-defined.
- app.writev.pwrite.26
If fildes refers to a shared memory object, the result of the write() function is unspecified.
- app.writev.pwrite.27
If fildes refers to a typed memory object, the result of the write() function is unspecified.
- writev.pwrite.04
On a regular file or other file capable of seeking, the actual writing of data shall proceed from the position in the file indicated by the file offset associated with fildes.
- writev.pwrite.07
On a file not capable of seeking, writing shall always take place starting at the current position.
- writev.pwrite.08.01
If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write
- writev.pwrite.08.02
no intervening file modification operation shall occur between changing the file offset and the write operation.
- writev.pwrite.09
If a write() requests that more bytes be written than there is room for (for example, [XSI] the process' file size limit or the physical end of a medium), only as many bytes as there is room for shall be written.
- writev.pwrite.10
If the request would cause the file size to exceed the soft file size limit for the process and there is no room for any bytes to be written, the request shall fail and the implementation shall generate the SIGXFSZ signal for the thread.
- writev.pwrite.11
If write() is interrupted by a signal before it writes any data, it shall return -1 with errno set to [EINTR].
- writev.pwrite.12
If write() is interrupted by a signal after it successfully writes some data, it shall return the number of bytes written.
- writev.pwrite.14
Any successful read() from each byte position in the file that was modified by that write shall return the data specified by the write() for that position until such byte positions are again modified.
- writev.pwrite.15
Any subsequent successful write() to the same byte position in the file shall overwrite that file data.
- writev.pwrite.16
There is no file offset associated with a pipe, hence each write request shall append to the end of the pipe.
- writev.pwrite.17.01
Write requests of {PIPE_BUF} bytes or less shall not be interleaved with data from other processes doing writes on the same pipe.
- writev.pwrite.17.02
Writes of greater than {PIPE_BUF} bytes may have data interleaved, on arbitrary boundaries, with writes by other processes, whether or not the O_NONBLOCK flag of the file status flags is set.
- writev.pwrite.18
If the O_NONBLOCK flag is clear, a write request may cause the thread to block, but on normal completion it shall return nbyte.
- writev.pwrite.19
If the O_NONBLOCK flag is set, write() requests shall be handled differently, in the following ways:
- writev.pwrite.19.01
The write() function shall not block the thread.
- writev.pwrite.19.02.01
A write request for {PIPE_BUF} or fewer bytes shall have the following effect: if there is sufficient space available in the pipe, write() shall transfer all the data and return the number of bytes requested.
- writev.pwrite.19.02.02
Otherwise, write() shall transfer no data and return -1 with errno set to [EAGAIN].
- writev.pwrite.19.03
A write request for more than {PIPE_BUF} bytes shall cause one of the following:
- writev.pwrite.19.03.01
When at least one byte can be written, transfer what it can and return the number of bytes written. When all data previously written to the pipe is read, it shall transfer at least {PIPE_BUF} bytes.
- writev.pwrite.19.03.02
When no data can be written, transfer no data, and return -1 with errno set to [EAGAIN].
- writev.pwrite.20
When attempting to write to a file descriptor (other than a pipe or FIFO) that supports non-blocking writes and cannot accept the data immediately:
- writev.pwrite.20.01 (struct)
If the O_NONBLOCK flag is clear, write() shall block the calling thread until the data can be accepted.
- writev.pwrite.20.02.01
If the O_NONBLOCK flag is set, write() shall not block the thread.
- writev.pwrite.20.02.02
If some data can be written without blocking the thread, write() shall write what it can and return the number of bytes written.
- writev.pwrite.20.02.03
Otherwise, it shall return -1 and set errno to [EAGAIN].
- writev.pwrite.22.01
Upon successful completion, where nbyte is greater than 0, write() shall mark for update the st_ctime and st_mtime fields of the file,
- writev.pwrite.22.02
if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared.
- writev.pwrite.23
For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with fildes.
- writev.pwrite.24
If the O_DSYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O data integrity completion
- writev.pwrite.25
If the O_SYNC bit has been set, write I/O operations on the file descriptor shall complete as defined by synchronized I/O file integrity completion.
- writev.pwrite.28
If fildes refers to a STREAM, the operation of write() shall be determined by the values of the minimum and maximum nbyte range (packet size) accepted by the STREAM.
- writev.pwrite.34
When writing to a STREAM, data messages are created with a priority band of 0.
- writev.pwrite.35
When writing to a STREAM that is not a pipe or FIFO:
- writev.pwrite.35.01
If O_NONBLOCK is clear, and the STREAM cannot accept data (the STREAM write queue is full due to internal flow control conditions), write() shall block until data can be accepted.
- writev.pwrite.35.02
If O_NONBLOCK is set and the STREAM cannot accept data, write() shall return -1 and set errno to [EAGAIN].
- writev.pwrite.35.03
If O_NONBLOCK is set and part of the buffer has been written while a condition in which the STREAM cannot accept additional data occurs, write() shall terminate and return the number of bytes written.
- writev.pwrite.36.01
In addition, write() shall fail if the STREAM head has processed an asynchronous error before the call.
- writev.pwrite.36.02
In this case, the value of errno does not reflect the result of write(), but reflects the prior error.
- writev.pwrite.41
The write() and [XSI] pwrite() functions shall fail if:
- writev.pwrite.41.01
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write() operation.
- writev.pwrite.41.02
[EBADF] The fildes argument is not a valid file descriptor open for writing.
- writev.pwrite.41.03
[EFBIG] An attempt was made to write a file that exceeds the implementation-defined maximum file size [XSI] or the process' file size limit, and there was no room for any bytes to be written.
- writev.pwrite.41.04
[EFBIG] The file is a regular file, nbyte is greater than 0, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
- writev.pwrite.41.05
[EINTR] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- writev.pwrite.41.06
[EIO] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- writev.pwrite.41.07
[ENOSPC] There was no free space remaining on the device containing the file.
- writev.pwrite.41.08
[EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process, or that only has one end open. A SIGPIPE signal shall also be sent to the thread.
- writev.pwrite.41.09
[ERANGE] [XSR] The transfer request size was outside the range supported by the STREAMS file associated with fildes.
- writev.pwrite.43
The write() and [XSI] pwrite() functions may fail if:
- writev.pwrite.43.01
[EINVAL] [XSR] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.
- writev.pwrite.43.02
[EIO] A physical I/O error has occurred.
- writev.pwrite.43.03
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- writev.pwrite.43.04
[ENXIO] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- writev.pwrite.43.05
[ENXIO] [XSR] A hangup occurred on the STREAM being written to.
- [+]io.fstream.buffer (23 / 6 / 0)
- [+]setbuf (8 / 1 / 0)
- setbuf.01
Except that it returns no value, the function call:setbuf(stream, buf)shall be equivalent to:setvbuf(stream, buf, _IOFBF, BUFSIZ)if buf is not a null pointer, or to:
- setbuf.02
setvbuf(stream, buf, _IONBF, BUFSIZ)if buf is a null pointer.
- setbuf.03
The setbuf() function shall not return a value.
- app.setbuf.setvbuf.01
The setvbuf() function may be used after the stream pointed to by stream is associated with an open file but before any other operation (other than an unsuccessful call to setvbuf()) is performed on the stream.
- setbuf.setvbuf.02.01
{_IOFBF} shall cause input/output to be fully buffered.
- setbuf.setvbuf.02.03
{_IONBF} shall cause input/output to be unbuffered.
- setbuf.setvbuf.03.01
If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by setvbuf() and the argument size specifies the size of the array;
- setbuf.setvbuf.03.02
otherwise, size may determine the size of a buffer allocated by the setvbuf() function.
- setbuf.setvbuf.04
The contents of the array at any time are unspecified.
- [+]setbuffer (6 / 2 / 0)
- setbuffer.01
setbuffer() is an alias for the call to setvbuf(). It works the same, except that the size of the buffer in setbuffer() is up to the caller, rather than being determined by the default BUFSIZ.
- setbuffer.05.02
may set errno to indicate the error
- setbuffer.06
The setvbuf() function may fail if:
- setbuffer.06.01
[EBADF] [CX] The file descriptor underlying stream is not valid.
- app.setbuffer.setvbuf.01
The setvbuf() function may be used after the stream pointed to by stream is associated with an open file but before any other operation (other than an unsuccessful call to setvbuf()) is performed on the stream.
- app.setbuffer.setvbuf.03.01
If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by setvbuf() and the argument size specifies the size of the array;
- setbuffer.setvbuf.03.01
If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by setvbuf() and the argument size specifies the size of the array;
- setbuffer.setvbuf.03.02
otherwise, size may determine the size of a buffer allocated by the setvbuf() function.
- setbuffer.setvbuf.04
The contents of the array at any time are unspecified.
- [+]setvbuf (9 / 3 / 0)
- app.setvbuf.01
The setvbuf() function may be used after the stream pointed to by stream is associated with an open file but before any other operation (other than an unsuccessful call to setvbuf()) is performed on the stream.
- setvbuf.02
The argument type determines how stream shall be buffered, as follows:
- setvbuf.02.01
{_IOFBF} shall cause input/output to be fully buffered.
- setvbuf.02.02
{_IOLBF} shall cause input/output to be line buffered.
- setvbuf.02.03
{_IONBF} shall cause input/output to be unbuffered.
- setvbuf.03.01
If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by setvbuf() and the argument size specifies the size of the array;
- setvbuf.03.02
otherwise, size may determine the size of a buffer allocated by the setvbuf() function.
- app.setvbuf.03.01
If buf is not a null pointer, the array it points to may be used instead of a buffer allocated by setvbuf() and the argument size specifies the size of the array;
- setvbuf.04
The contents of the array at any time are unspecified.
- setvbuf.05.01
Upon successful completion, setvbuf() shall return 0.
- setvbuf.05.02
Otherwise, it shall return a non-zero value if an invalid value is given for type or if the request cannot be honored, [CX] and may set errno to indicate the error.
- setvbuf.06
The setvbuf() function may fail if:
- setvbuf.06.01
[EBADF] [CX] The file descriptor underlying stream is not valid.
- [+]io.fstream.fstream (746 / 199 / 0)
- [+]_IO_feof (1 / 1 / 0)
- _IO_feof.01
_IO_feof() tests the end-of-file indicator for the stream pointed to by __fp, returning a non-zero value if it is set.
- [+]_IO_getc (2 / 2 / 0)
- _IO_getc.01.01
_IO_getc() reads the next character from __fp and returns it as an unsigned char cast to an int,
- _IO_getc.01.02
or EOF on end-of-file or error.
- [+]_IO_putc (1 / 1 / 0)
- _IO_putc.01
_IO_putc() writes the character __c, cast to an unsigned char, to __fp.
- [+]_IO_puts (1 / 0 / 0)
- _IO_puts.01
_IO_puts() writes the string __s and a trailing newline to stdout.
- [+]__fpending (1 / 1 / 0)
- __fpending.01
__fpending() returns the amount of output in bytes pending on a stream.
- [+]clearerr (1 / 1 / 0)
- clearerr.01
The clearerr() function shall clear the end-of-file and error indicators for the stream to which stream points.
- [+]fclose (19 / 6 / 0)
- fclose.01
The fclose() function shall cause the stream pointed to by stream to be flushed and the associated file to be closed.
- fclose.02.01
Any unwritten buffered data for the stream shall be written to the file;
- fclose.02.02
any unread buffered data shall be discarded.
- fclose.03
Whether or not the call succeeds, the stream shall be disassociated from the file and any buffer set by the setbuf() or setvbuf() function shall be disassociated from the stream.
- fclose.04
If the associated buffer was automatically allocated, it shall be deallocated.
- fclose.05
The fclose() function shall mark for update the st_ctime and st_mtime fields of the underlying file, if the stream was writable, and if buffered data remains that has not yet been written to the file.
- fclose.06
The fclose() function shall perform the equivalent of a close() on the file descriptor that is associated with the stream pointed to by stream
- app.fclose.07
After the call to fclose(), any use of stream results in undefined behavior.
- fclose.08.01
Upon successful completion, fclose() shall return 0;
- fclose.08.02
otherwise, it shall return EOF [CX] and set errno to indicate the error.
- fclose.09
The fclose() function shall fail if:
- fclose.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fclose.09.02
[EBADF] [CX] The file descriptor underlying stream is not valid.
- fclose.09.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fclose.09.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fclose.09.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fclose.09.06
[EINTR] [CX] The fclose() function was interrupted by a signal.
- fclose.09.07
[EIO] [CX] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fclose.09.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fclose.09.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fclose.10
The fclose() function may fail if:
- fclose.10.01
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fdopen (21 / 6 / 0)
- fdopen.01
The fdopen() function shall associate a stream with a file descriptor.
- fdopen.02
The mode argument is a character string having one of the following values:
- fdopen.02.01
r or rb Open a file for reading.
- fdopen.02.02
w or wb Open a file for writing.
- fdopen.02.03
a or ab Open a file for writing at end-of-file.
- fdopen.02.04
r+ or rb+ or r+b Open a file for update (reading and writing).
- fdopen.02.05
w+ or wb+ or w+b Open a file for update (reading and writing).
- fdopen.02.06
a+ or ab+ or a+b Open a file for update (reading and writing) at end-of-file.
- fdopen.03
The meaning of these flags is exactly as specified in fopen(), except that modes beginning with w shall not cause truncation of the file.
- fdopen.04
Additional values for the mode argument may be supported by an implementation.
- fdopen.05
The application shall ensure that the mode of the stream as expressed by the mode argument is allowed by the file access mode of the open file description to which fildes refers.
- fdopen.06
The file position indicator associated with the new stream is set to the position indicated by the file offset associated with the file descriptor.
- fdopen.07
The error and end-of-file indicators for the stream shall be cleared.
- fdopen.08
The fdopen() function may cause the st_atime field of the underlying file to be marked for update.
- app.fdopen.09
If fildes refers to a shared memory object, the result of the fdopen() function is unspecified.
- app.fdopen.10
If fildes refers to a typed memory object, the result of the fdopen() function is unspecified.
- fdopen.11
The fdopen() function shall preserve the offset maximum previously set for the open file description corresponding to fildes.
- fdopen.12.01
Upon successful completion, fdopen() shall return a pointer to a stream;
- fdopen.12.02
otherwise, a null pointer shall be returned and errno set to indicate the error.
- fdopen.13
The fdopen() function may fail if:
- fdopen.13.01
[EBADF] The fildes argument is not a valid file descriptor.
- fdopen.13.02
[EINVAL] The mode argument is not a valid mode.
- fdopen.13.03
[EMFILE] {FOPEN_MAX} streams are currently open in the calling process.
- fdopen.13.04
[EMFILE] {STREAM_MAX} streams are currently open in the calling process.
- fdopen.13.05
[ENOMEM] Insufficient space to allocate a buffer.
- [+]feof (2 / 2 / 0)
- feof.01
The feof() function shall test the end-of-file indicator for the stream pointed to by stream.
- feof.02
The feof() function shall return non-zero if and only if the end-of-file indicator is set for stream.
- [+]ferror (2 / 0 / 0)
- ferror.01
The ferror() function shall test the error indicator for the stream pointed to by stream.
- ferror.02
The ferror() function shall return non-zero if and only if the error indicator is set for stream.
- [+]fflush (15 / 2 / 0)
- fflush.01
If stream points to an output stream or an update stream in which the most recent operation was not input, fflush() shall cause any unwritten data for that stream to be written to the file,
- fflush.02
and the st_ctime and st_mtime fields of the underlying file shall be marked for update.
- fflush.03
If stream is a null pointer, fflush() shall perform this flushing action on all streams for which the behavior is defined above.
- fflush.04.01
Upon successful completion, fflush() shall return 0;
- fflush.04.02
otherwise, it shall set the error indicator for the stream, return EOF, [CX] and set errno to indicate the error.
- fflush.05
The fflush() function shall fail if:
- fflush.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fflush.05.02
[EBADF] [CX] The file descriptor underlying stream is not valid.
- fflush.05.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fflush.05.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fflush.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fflush.05.06
[EINTR] [CX] The fflush() function was interrupted by a signal.
- fflush.05.07
[EIO] [CX] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fflush.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fflush.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fflush.06
The fflush() function may fail if:
- fflush.06.01
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fflush_unlocked (16 / 2 / 0)
- fflush_unlocked.01
fflush_unlocked() is the same as fflush() except that it need not be thread safe. That is, it may only be invoked in the ways which are legal for getc_unlocked().
- fflush_unlocked.fflush.01
If stream points to an output stream or an update stream in which the most recent operation was not input, fflush() shall cause any unwritten data for that stream to be written to the file,
- fflush_unlocked.fflush.02
and the st_ctime and st_mtime fields of the underlying file shall be marked for update.
- fflush_unlocked.fflush.03
If stream is a null pointer, fflush() shall perform this flushing action on all streams for which the behavior is defined above.
- fflush_unlocked.fflush.04.01
Upon successful completion, fflush() shall return 0;
- fflush_unlocked.fflush.04.02
otherwise, it shall set the error indicator for the stream, return EOF, [CX] and set errno to indicate the error.
- fflush_unlocked.fflush.05
The fflush() function shall fail if:
- fflush_unlocked.fflush.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fflush_unlocked.fflush.05.02
[EBADF] [CX] The file descriptor underlying stream is not valid.
- fflush_unlocked.fflush.05.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fflush_unlocked.fflush.05.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fflush_unlocked.fflush.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fflush_unlocked.fflush.05.06
[EINTR] [CX] The fflush() function was interrupted by a signal.
- fflush_unlocked.fflush.05.07
[EIO] [CX] The process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fflush_unlocked.fflush.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fflush_unlocked.fflush.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fflush_unlocked.fflush.06
The fflush() function may fail if:
- fflush_unlocked.fflush.06.01
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fgetc (15 / 8 / 0)
- fgetc.01.01
If the end-of-file indicator for the input stream pointed to by stream is not set and a next byte is present, the fgetc() function shall obtain the next byte as an unsigned char converted to an int, from the input stream pointed to by stream
- fgetc.01.02
and advance the associated file position indicator for the stream (if defined).
- fgetc.02
Since fgetc() operates on bytes, reading a character consisting of multiple bytes (or "a multi-byte character") may require multiple calls to fgetc().
- fgetc.03
The fgetc() function may mark the st_atime field of the file associated with stream for update.
- fgetc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fgetc.05
Upon successful completion, fgetc() shall return the next byte from the input stream pointed to by stream.
- fgetc.06
If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetc() shall return EOF.
- fgetc.07
If a read error occurs, the error indicator for the stream shall be set, fgetc() shall return EOF, [CX] and shall set errno to indicate the error.
- fgetc.08
The fgetc() function shall fail if data needs to be read and:
- fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fgetc.09
The fgetc() function may fail if:
- fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fgetpos (7 / 2 / 0)
- fgetpos.01
The fgetpos() function shall store the current values of the parse state (if any) and file position indicator for the stream pointed to by stream in the object pointed to by pos.
- fgetpos.02
The value stored contains unspecified information usable by fsetpos() for repositioning the stream to its position at the time of the call to fgetpos().
- fgetpos.03.01
Upon successful completion, fgetpos() shall return 0;
- fgetpos.03.02
otherwise, it shall return a non-zero value and set errno to indicate the error.
- fgetpos.04
The fgetpos() function shall fail if:
- fgetpos.04.01
[EOVERFLOW] [CX] The current value of the file position cannot be represented correctly in an object of type fpos_t.
- fgetpos.05
The fgetpos() function may fail if:
- fgetpos.05.01
[EBADF] [CX] The file descriptor underlying stream is not valid.
- fgetpos.05.02
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe, FIFO, or socket.
- [+]fgetpos64 (7 / 2 / 0)
- fgetpos64.01
The fgetpos() function shall store the current values of the parse state (if any) and file position indicator for the stream pointed to by stream in the object pointed to by pos.
- fgetpos64.02
The value stored contains unspecified information usable by fsetpos() for repositioning the stream to its position at the time of the call to fgetpos().
- fgetpos64.03.01
Upon successful completion, fgetpos() shall return 0;
- fgetpos64.03.02
otherwise, it shall return a non-zero value and set errno to indicate the error.
- fgetpos64.04
The fgetpos() function shall fail if:
- fgetpos64.04.01
[EOVERFLOW] [CX] The current value of the file position cannot be represented correctly in an object of type fpos_t.
- fgetpos64.05
The fgetpos() function may fail if:
- fgetpos64.05.01
[EBADF] [CX] The file descriptor underlying stream is not valid.
- fgetpos64.05.02
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe, FIFO, or socket.
- [+]fgets (14 / 5 / 0)
- fgets.01
The fgets() function shall read bytes from stream into the array pointed to by s, until n-1 bytes are read, or a <newline> is read and transferred to s, or an end-of-file condition is encountered.
- fgets.02
The string is then terminated with a null byte.
- fgets.03
The fgets() function may mark the st_atime field of the file associated with stream for update.
- fgets.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fgets.05
Upon successful completion, fgets() shall return s.
- fgets.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgets() shall return a null pointer.
- fgets.07
If a read error occurs, the error indicator for the stream shall be set, fgets() shall return a null pointer, [CX] and shall set errno to indicate the error.
- fgets.08
The fgetc() function shall fail if data needs to be read and:
- fgets.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- fgets.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fgets.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fgets.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fgets.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fgets.09
The fgetc() function may fail if:
- fgets.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- fgets.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fgetwc_unlocked (19 / 4 / 0)
- fgetwc_unlocked.01
fgetwc_unlocked() is the same as fgetwc() except that it need not be thread safe. That is, it may only be invoked in the ways which are legal for getc_unlocked().
- fgetwc_unlocked.fgetwc.01.01
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream,
- fgetwc_unlocked.fgetwc.01.02
convert that to the corresponding wide-character code,
- fgetwc_unlocked.fgetwc.01.03
and advance the associated file position indicator for the stream (if defined).
- fgetwc_unlocked.fgetwc.02
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- fgetwc_unlocked.fgetwc.03
The fgetwc() function may mark the st_atime field of the file associated with stream for update.
- fgetwc_unlocked.fgetwc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fgetwc_unlocked.fgetwc.05
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t.
- fgetwc_unlocked.fgetwc.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF.
- fgetwc_unlocked.fgetwc.07
If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, [CX] and shall set errno to indicate the error.
- fgetwc_unlocked.fgetwc.08
If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
- fgetwc_unlocked.fgetwc.09
The fgetwc() function shall fail if data needs to be read and:
- fgetwc_unlocked.fgetwc.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- fgetwc_unlocked.fgetwc.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fgetwc_unlocked.fgetwc.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- fgetwc_unlocked.fgetwc.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fgetwc_unlocked.fgetwc.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fgetwc_unlocked.fgetwc.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fgetwc_unlocked.fgetwc.10
The fgetwc() function may fail if:
- fgetwc_unlocked.fgetwc.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- fgetwc_unlocked.fgetwc.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fileno (4 / 3 / 0)
- fileno.01
The fileno() function shall return the integer file descriptor associated with the stream pointed to by stream.
- fileno.02.01
Upon successful completion, fileno() shall return the integer value of the file descriptor associated with stream.
- fileno.02.02
Otherwise, the value -1 shall be returned and errno set to indicate the error.
- fileno.03
The fileno() function may fail if:
- fileno.03.01
[EBADF] The stream argument is not a valid stream.
- [+]fopen (42 / 9 / 0)
- fopen.01
The fopen() function shall open the file whose pathname is the string pointed to by filename, and associates a stream with it.
- fopen.02
The mode argument points to a string. If the string is one of the following, the file shall be opened in the indicated mode
- fopen.02.01
r or rb Open file for reading.
- fopen.02.02
w or wb Truncate to zero length or create file for writing.
- fopen.02.03
a or ab Append; open or create file for writing at end-of-file.
- fopen.02.04
r+ or rb+ or r+b Open file for update (reading and writing).
- fopen.02.05
w+ or wb+ or w+b Truncate to zero length or create file for update.
- fopen.02.06
a+ or ab+ or a+b Append; open or create file for update, writing at end-of-file.
- app.fopen.03
Otherwise, the behavior is undefined.
- fopen.04
The character 'b' shall have no effect, but is allowed for ISO C standard conformance.
- fopen.05
Opening a file with read mode (r as the first character in the mode argument) shall fail if the file does not exist or cannot be read.
- fopen.06
Opening a file with append mode (a as the first character in the mode argument) shall cause all subsequent writes to the file to be forced to the then current end-of-file, regardless of intervening calls to fseek().
- fopen.07
When a file is opened with update mode ( '+' as the second or third character in the mode argument), both input and output may be performed on the associated stream.
- fopen.08
However, the application shall ensure that output is not directly followed by input without an intervening call to fflush() or to a file positioning function ( fseek(), fsetpos(), or rewind()), and input is not directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end-of-file.
- fopen.09
When opened, a stream is fully buffered if and only if it can be determined not to refer to an interactive device.
- fopen.10
The error and end-of-file indicators for the stream shall be cleared.
- fopen.11
If mode is w, wb, a, ab, w+, wb+, w+b, a+, ab+, or a+b, and the file did not previously exist, upon successful completion, the fopen() function shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- fopen.11.01
If mode is w, wb, w+, wb+, or w+b, and the file did previously exist, upon successful completion, fopen() shall mark for update the st_ctime and st_mtime fields of the file.
- fopen.11.02
The fopen() function shall allocate a file descriptor as open() does.
- fopen.12.01
After a successful call to the fopen() function, the orientation of the stream shall be cleared,
- fopen.12.02
the encoding rule shall be cleared,
- fopen.12.03
and the associated mbstate_t object shall be set to describe an initial conversion state.
- fopen.13
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- fopen.14.01
Upon successful completion, fopen() shall return a pointer to the object controlling the stream.
- fopen.14.02
Otherwise, a null pointer shall be returned, [CX] and errno shall be set to indicate the error.
- fopen.15
The fopen() function shall fail if:
- fopen.15.01
[EACCES] [CX] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by mode are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.
- fopen.15.02
[EINTR] [CX] A signal was caught during fopen().
- fopen.15.03
[EISDIR] [CX] The named file is a directory and mode requires write access.
- fopen.15.04
[ELOOP] [CX] A loop exists in symbolic links encountered during resolution of the path argument.
- fopen.15.05
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- fopen.15.06
[ENAMETOOLONG] [CX]
The length of the filename argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- fopen.15.07
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- fopen.15.08
[ENOENT] [CX] A component of filename does not name an existing file or filename is an empty string.
- fopen.15.09
[ENOSPC] [CX] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and the file was to be created.
- fopen.15.10
[ENOTDIR] [CX] A component of the path prefix is not a directory.
- fopen.15.11
[ENXIO] [CX] The named file is a character special or block special file, and the device associated with this special file does not exist.
- fopen.15.12
[EOVERFLOW] [CX] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- fopen.15.13
[EROFS] [CX] The named file resides on a read-only file system and mode requires write access.
- fopen.16
The fopen() function may fail if:
- fopen.16.01
[EINVAL] [CX] The value of the mode argument is not valid.
- fopen.16.02
[ELOOP] [CX] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- fopen.16.03
[EMFILE] [CX] {FOPEN_MAX} streams are currently open in the calling process.
- fopen.16.04
[EMFILE] [CX] {STREAM_MAX} streams are currently open in the calling process.
- fopen.16.05
[ENAMETOOLONG] [CX]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- fopen.16.06
[ENOMEM] [CX] Insufficient storage space is available.
- fopen.16.07
[ETXTBSY] [CX] The file is a pure procedure (shared text) file that is being executed and mode requires write access.
- [+]fopen64 (42 / 9 / 0)
- fopen64.01
The fopen() function shall open the file whose pathname is the string pointed to by filename, and associates a stream with it.
- fopen64.02
The mode argument points to a string. If the string is one of the following, the file shall be opened in the indicated mode
- fopen64.02.01
r or rb Open file for reading.
- fopen64.02.02
w or wb Truncate to zero length or create file for writing.
- fopen64.02.03
a or ab Append; open or create file for writing at end-of-file.
- fopen64.02.04
r+ or rb+ or r+b Open file for update (reading and writing).
- fopen64.02.05
w+ or wb+ or w+b Truncate to zero length or create file for update.
- fopen64.02.06
a+ or ab+ or a+b Append; open or create file for update, writing at end-of-file.
- app.fopen64.03
Otherwise, the behavior is undefined.
- fopen64.04
The character 'b' shall have no effect, but is allowed for ISO C standard conformance.
- fopen64.05
Opening a file with read mode (r as the first character in the mode argument) shall fail if the file does not exist or cannot be read.
- fopen64.06
Opening a file with append mode (a as the first character in the mode argument) shall cause all subsequent writes to the file to be forced to the then current end-of-file, regardless of intervening calls to fseek().
- fopen64.07
When a file is opened with update mode ( '+' as the second or third character in the mode argument), both input and output may be performed on the associated stream.
- fopen64.08
However, the application shall ensure that output is not directly followed by input without an intervening call to fflush() or to a file positioning function ( fseek(), fsetpos(), or rewind()), and input is not directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end-of-file.
- fopen64.09
When opened, a stream is fully buffered if and only if it can be determined not to refer to an interactive device.
- fopen64.10
The error and end-of-file indicators for the stream shall be cleared.
- fopen64.11
If mode is w, wb, a, ab, w+, wb+, w+b, a+, ab+, or a+b, and the file did not previously exist, upon successful completion, the fopen() function shall mark for update the st_atime, st_ctime, and st_mtime fields of the file and the st_ctime and st_mtime fields of the parent directory.
- fopen64.11.01
If mode is w, wb, w+, wb+, or w+b, and the file did previously exist, upon successful completion, fopen() shall mark for update the st_ctime and st_mtime fields of the file.
- fopen64.11.02
The fopen() function shall allocate a file descriptor as open() does.
- fopen64.12.01
After a successful call to the fopen() function, the orientation of the stream shall be cleared,
- fopen64.12.02
the encoding rule shall be cleared,
- fopen64.12.03
and the associated mbstate_t object shall be set to describe an initial conversion state.
- fopen64.13
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- fopen64.14.01
Upon successful completion, fopen() shall return a pointer to the object controlling the stream.
- fopen64.14.02
Otherwise, a null pointer shall be returned, [CX] and errno shall be set to indicate the error.
- fopen64.15
The fopen() function shall fail if:
- fopen64.15.01
[EACCES] [CX] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by mode are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.
- fopen64.15.02
[EINTR] [CX] A signal was caught during fopen().
- fopen64.15.03
[EISDIR] [CX] The named file is a directory and mode requires write access.
- fopen64.15.04
[ELOOP] [CX] A loop exists in symbolic links encountered during resolution of the path argument.
- fopen64.15.05
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- fopen64.15.06
[ENAMETOOLONG] [CX]
The length of the filename argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- fopen64.15.07
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- fopen64.15.08
[ENOENT] [CX] A component of filename does not name an existing file or filename is an empty string.
- fopen64.15.09
[ENOSPC] [CX] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and the file was to be created.
- fopen64.15.10
[ENOTDIR] [CX] A component of the path prefix is not a directory.
- fopen64.15.11
[ENXIO] [CX] The named file is a character special or block special file, and the device associated with this special file does not exist.
- fopen64.15.12
[EOVERFLOW] [CX] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- fopen64.15.13
[EROFS] [CX] The named file resides on a read-only file system and mode requires write access.
- fopen64.16
The fopen() function may fail if:
- fopen64.16.01
[EINVAL] [CX] The value of the mode argument is not valid.
- fopen64.16.02
[ELOOP] [CX] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- fopen64.16.03
[EMFILE] [CX] {FOPEN_MAX} streams are currently open in the calling process.
- fopen64.16.04
[EMFILE] [CX] {STREAM_MAX} streams are currently open in the calling process.
- fopen64.16.05
[ENAMETOOLONG] [CX]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- fopen64.16.06
[ENOMEM] [CX] Insufficient storage space is available.
- fopen64.16.07
[ETXTBSY] [CX] The file is a pure procedure (shared text) file that is being executed and mode requires write access.
- [+]fputc (17 / 5 / 0)
- fputc.01.01
The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- fputc.01.02
and shall advance the indicator appropriately.
- fputc.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the byte shall be appended to the output stream.
- fputc.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- fputc.04.01
Upon successful completion, fputc() shall return the value it has written.
- fputc.04.02
Otherwise, it shall return EOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- fputc.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- fputc.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fputc.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- fputc.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- fputc.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- fputc.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- fputc.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fputc.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fputc.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fputc.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fputc.06
The fputc() function may fail if:
- fputc.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- fputc.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fputs (16 / 4 / 0)
- fputs.01
The fputs() function shall write the null-terminated string pointed to by s to the stream pointed to by stream.
- fputs.02
The terminating null byte shall not be written.
- fputs.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputs() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- fputs.04.01
Upon successful completion, fputs() shall return a non-negative number.
- fputs.04.02
Otherwise, it shall return EOF, set an error indicator for the stream, [CX] and set errno to indicate the error.
- fputs.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- fputs.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fputs.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- fputs.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- fputs.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- fputs.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- fputs.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fputs.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fputs.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fputs.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fputs.06
The fputc() function may fail if:
- fputs.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- fputs.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fread (18 / 6 / 0)
- fread.01
The fread() function shall read into the array pointed to by ptr up to nitems elements whose size is specified by size in bytes, from the stream pointed to by stream.
- fread.02
For each object, size calls shall be made to the fgetc() function and the results stored, in the order read, in an array of unsigned char exactly overlaying the object.
- fread.03
The file position indicator for the stream (if defined) shall be advanced by the number of bytes successfully read.
- fread.04
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- fread.05
If a partial element is read, its value is unspecified.
- fread.06
The fread() function may mark the st_atime field of the file associated with stream for update.
- fread.07
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fread.08.01
Upon successful completion, fread() shall return the number of elements successfully read
- fread.08.02
which is less than nitems only if a read error or end-of-file is encountered.
- fread.08.03
Otherwise, if a read error occurs, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- fread.09
If size or nitems is 0, fread() shall return 0 and the contents of the array and the state of the stream remain unchanged.
- fread.fgetc.08
The fgetc() function shall fail if data needs to be read and:
- fread.fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- fread.fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fread.fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fread.fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fread.fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fread.fgetc.09
The fgetc() function may fail if:
- fread.fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- fread.fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]freopen (36 / 5 / 0)
- freopen.01
The freopen() function shall first attempt to flush the stream and close any file descriptor associated with stream.
- freopen.02
Failure to flush or close the file descriptor successfully shall be ignored.
- freopen.03
The error and end-of-file indicators for the stream shall be cleared.
- freopen.04
The freopen() function shall open the file whose pathname is the string pointed to by filename and associate the stream pointed to by stream with it.
- freopen.05
The mode argument shall be used just as in fopen().
- freopen.06
The original stream shall be closed regardless of whether the subsequent open succeeds.
- freopen.07
If filename is a null pointer, the freopen() function shall attempt to change the mode of the stream to that specified by mode, as if the name of the file currently associated with the stream had been used.
- freopen.08
In this case, the file descriptor associated with the stream need not be closed if the call to freopen() succeeds.
- freopen.09
It is implementation-defined which changes of mode are permitted (if any), and under what circumstances.
- freopen.10.01
After a successful call to the freopen() function, the orientation of the stream shall be cleared,
- freopen.10.02
the encoding rule shall be cleared,
- freopen.10.03
and the associated mbstate_t object shall be set to describe an initial conversion state.
- freopen.11
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- freopen.12.01
Upon successful completion, freopen() shall return the value of stream.
- freopen.12.02
Otherwise, a null pointer shall be returned, [CX] and errno shall be set to indicate the error.
- freopen.13
The freopen() function shall fail if:
- freopen.13.01
[EACCES] [CX] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by mode are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.
- freopen.13.02
[EBADF] [CX] The file descriptor underlying the stream is not a valid file descriptor when filename is a null pointer.
- freopen.13.03
[EINTR] [CX] A signal was caught during freopen().
- freopen.13.04
[EISDIR] [CX] The named file is a directory and mode requires write access.
- freopen.13.05
[ELOOP] [CX] A loop exists in symbolic links encountered during resolution of the path argument.
- freopen.13.06
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- freopen.13.07
[ENAMETOOLONG] [CX]
The length of the filename argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- freopen.13.08
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- freopen.13.09
[ENOENT] [CX] A component of filename does not name an existing file or filename is an empty string.
- freopen.13.10
[ENOSPC] [CX] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and it was to be created.
- freopen.13.11
[ENOTDIR] [CX] A component of the path prefix is not a directory.
- freopen.13.12
[ENXIO] [CX] The named file is a character special or block special file, and the device associated with this special file does not exist.
- freopen.13.13
[EOVERFLOW] [CX] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- freopen.13.14
[EROFS] [CX] The named file resides on a read-only file system and mode requires write access.
- freopen.14
The freopen() function may fail if:
- freopen.14.01
[EBADF] [CX] The mode with which the file descriptor underlying the stream was opened does not support the requested mode when filename is a null pointer.
- freopen.14.02
[EINVAL] [CX] The value of the mode argument is not valid.
- freopen.14.03
[ELOOP] [CX] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- freopen.14.04
[ENAMETOOLONG] [CX]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- freopen.14.05
[ENOMEM] [CX] Insufficient storage space is available.
- freopen.14.06
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- freopen.14.07
[ETXTBSY] [CX] The file is a pure procedure (shared text) file that is being executed and mode requires write access.
- [+]freopen64 (36 / 4 / 0)
- freopen64.01
The freopen() function shall first attempt to flush the stream and close any file descriptor associated with stream.
- freopen64.02
Failure to flush or close the file descriptor successfully shall be ignored.
- freopen64.03
The error and end-of-file indicators for the stream shall be cleared.
- freopen64.04
The freopen() function shall open the file whose pathname is the string pointed to by filename and associate the stream pointed to by stream with it.
- freopen64.05
The mode argument shall be used just as in fopen().
- freopen64.06
The original stream shall be closed regardless of whether the subsequent open succeeds.
- freopen64.07
If filename is a null pointer, the freopen() function shall attempt to change the mode of the stream to that specified by mode, as if the name of the file currently associated with the stream had been used.
- freopen64.08
In this case, the file descriptor associated with the stream need not be closed if the call to freopen() succeeds.
- freopen64.09
It is implementation-defined which changes of mode are permitted (if any), and under what circumstances.
- freopen64.10.01
After a successful call to the freopen() function, the orientation of the stream shall be cleared,
- freopen64.10.02
the encoding rule shall be cleared,
- freopen64.10.03
and the associated mbstate_t object shall be set to describe an initial conversion state.
- freopen64.11
The largest value that can be represented correctly in an object of type off_t shall be established as the offset maximum in the open file description.
- freopen64.12.01
Upon successful completion, freopen() shall return the value of stream.
- freopen64.12.02
Otherwise, a null pointer shall be returned, [CX] and errno shall be set to indicate the error.
- freopen64.13
The freopen() function shall fail if:
- freopen64.13.01
[EACCES] [CX] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by mode are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.
- freopen64.13.02
[EBADF] [CX] The file descriptor underlying the stream is not a valid file descriptor when filename is a null pointer.
- freopen64.13.03
[EINTR] [CX] A signal was caught during freopen().
- freopen64.13.04
[EISDIR] [CX] The named file is a directory and mode requires write access.
- freopen64.13.05
[ELOOP] [CX] A loop exists in symbolic links encountered during resolution of the path argument.
- freopen64.13.06
[EMFILE] [CX] {OPEN_MAX} file descriptors are currently open in the calling process.
- freopen64.13.07
[ENAMETOOLONG] [CX]
The length of the filename argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- freopen64.13.08
[ENFILE] [CX] The maximum allowable number of files is currently open in the system.
- freopen64.13.09
[ENOENT] [CX] A component of filename does not name an existing file or filename is an empty string.
- freopen64.13.10
[ENOSPC] [CX] The directory or file system that would contain the new file cannot be expanded, the file does not exist, and it was to be created.
- freopen64.13.11
[ENOTDIR] [CX] A component of the path prefix is not a directory.
- freopen64.13.12
[ENXIO] [CX] The named file is a character special or block special file, and the device associated with this special file does not exist.
- freopen64.13.13
[EOVERFLOW] [CX] The named file is a regular file and the size of the file cannot be represented correctly in an object of type off_t.
- freopen64.13.14
[EROFS] [CX] The named file resides on a read-only file system and mode requires write access.
- freopen64.14.01
[EBADF] [CX] The mode with which the file descriptor underlying the stream was opened does not support the requested mode when filename is a null pointer.
- freopen64.14.02
[EINVAL] [CX] The value of the mode argument is not valid.
- freopen64.14.03
[ELOOP] [CX] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- freopen64.14.04
[ENAMETOOLONG] [CX]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- freopen64.14.05
[ENOMEM] [CX] Insufficient storage space is available.
- freopen64.14.06
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- freopen64.14.07
[ETXTBSY] [CX] The file is a pure procedure (shared text) file that is being executed and mode requires write access.
- [+]fseek (30 / 7 / 0)
- fseek.01
The fseek() function shall set the file-position indicator for the stream pointed to by stream.
- fseek.02
If a read or write error occurs, the error indicator for the stream shall be set and fseek() fails.
- fseek.03
The new position, measured in bytes from the beginning of the file, shall be obtained by adding offset to the position specified by whence.
- fseek.04
The specified point is the beginning of the file for SEEK_SET, the current value of the file-position indicator for SEEK_CUR, or end-of-file for SEEK_END.
- fseek.05
If the stream is to be used with wide-character input/output functions, the application shall ensure that offset is either 0 or a value returned by an earlier call to ftell() on the same stream and whence is SEEK_SET.
- fseek.06
A successful call to fseek() shall clear the end-of-file indicator for the stream and undo any effects of ungetc() and ungetwc() on the same stream.
- fseek.07
After an fseek() call, the next operation on an update stream may be either input or output.
- fseek.08
If the most recent operation, other than ftell(), on a given stream is fflush(), the file offset in the underlying open file description shall be adjusted to reflect the location specified by fseek().
- fseek.09
The fseek() function shall allow the file-position indicator to be set beyond the end of existing data in the file.
- fseek.10
If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
- fseek.11
The behavior of fseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- fseek.12.01
If the stream is writable and buffered data had not been written to the underlying file, fseek() shall cause the unwritten data to be written to the file
- fseek.12.02
and shall mark the st_ctime and st_mtime fields of the file for update.
- fseek.13
In a locale with state-dependent encoding, whether fseek() restores the stream's shift state is implementation-defined.
- fseek.14.01
The fseek() [CX] and fseeko() functions shall return 0 if they succeed.
- fseek.14.02
Otherwise, they shall return -1 and set errno to indicate the error.
- fseek.15
The fseek() [CX] and fseeko() functions shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fseek() or fseeko() causes an underlying lseek() or write() to be invoked, and:
- fseek.15.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- fseek.15.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- fseek.15.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fseek.15.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fseek.15.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fseek.15.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fseek.15.07
[EINVAL] [CX] The whence argument is invalid. The resulting file-position indicator would be set to a negative value.
- fseek.15.08
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fseek.15.09
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fseek.15.10
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fseek.15.11
[EOVERFLOW] [CX] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long.
- fseek.15.12
[EOVERFLOW] [CX] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- fseek.15.13
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- fseek.15.14
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- [+]fseeko (31 / 7 / 0)
- fseeko.01
The fseek() function shall set the file-position indicator for the stream pointed to by stream.
- fseeko.02
If a read or write error occurs, the error indicator for the stream shall be set and fseek() fails.
- fseeko.03
The new position, measured in bytes from the beginning of the file, shall be obtained by adding offset to the position specified by whence.
- fseeko.04
The specified point is the beginning of the file for SEEK_SET, the current value of the file-position indicator for SEEK_CUR, or end-of-file for SEEK_END.
- fseeko.05
If the stream is to be used with wide-character input/output functions, the application shall ensure that offset is either 0 or a value returned by an earlier call to ftell() on the same stream and whence is SEEK_SET.
- fseeko.06
A successful call to fseek() shall clear the end-of-file indicator for the stream and undo any effects of ungetc() and ungetwc() on the same stream.
- fseeko.07
After an fseek() call, the next operation on an update stream may be either input or output.
- fseeko.08
If the most recent operation, other than ftell(), on a given stream is fflush(), the file offset in the underlying open file description shall be adjusted to reflect the location specified by fseek().
- fseeko.09
The fseek() function shall allow the file-position indicator to be set beyond the end of existing data in the file.
- fseeko.10
If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
- fseeko.11
The behavior of fseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- fseeko.12.01
If the stream is writable and buffered data had not been written to the underlying file, fseek() shall cause the unwritten data to be written to the file
- fseeko.12.02
and shall mark the st_ctime and st_mtime fields of the file for update.
- fseeko.13
In a locale with state-dependent encoding, whether fseek() restores the stream's shift state is implementation-defined.
- fseeko.14.01
The fseek() [CX] and fseeko() functions shall return 0 if they succeed.
- fseeko.14.02
Otherwise, they shall return -1 and set errno to indicate the error.
- fseeko.15
The fseek() [CX] and fseeko() functions shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fseek() or fseeko() causes an underlying lseek() or write() to be invoked, and:
- fseeko.15.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- fseeko.15.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- fseeko.15.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fseeko.15.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fseeko.15.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fseeko.15.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fseeko.15.07
[EINVAL] [CX] The whence argument is invalid. The resulting file-position indicator would be set to a negative value.
- fseeko.15.08
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fseeko.15.09
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fseeko.15.10
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fseeko.15.11
[EOVERFLOW] [CX] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long.
- fseeko.15.12
[EOVERFLOW] [CX] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- fseeko.15.13
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- fseeko.15.14
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- fseeko.16
The fseeko() function shall be equivalent to the fseek() function except that the offset argument is of type off_t.
Generalizes:
- fseeko.01
- fseeko.02
- fseeko.03
- fseeko.04
- fseeko.05
- fseeko.06
- fseeko.07
- fseeko.08
- fseeko.09
- fseeko.10
- fseeko.11
- fseeko.12.01
- fseeko.12.02
- fseeko.13
- fseeko.14.01
- fseeko.14.02
- fseeko.15.01
- fseeko.15.02
- fseeko.15.03
- fseeko.15.04
- fseeko.15.05
- fseeko.15.06
- fseeko.15.07
- fseeko.15.08
- fseeko.15.09
- fseeko.15.10
- fseeko.15.11
- fseeko.15.12
- fseeko.15.13
- fseeko.15.14
- [+]fseeko64 (31 / 7 / 0)
- fseeko64.01
The fseek() function shall set the file-position indicator for the stream pointed to by stream.
- fseeko64.02
If a read or write error occurs, the error indicator for the stream shall be set and fseek() fails.
- fseeko64.03
The new position, measured in bytes from the beginning of the file, shall be obtained by adding offset to the position specified by whence.
- fseeko64.04
The specified point is the beginning of the file for SEEK_SET, the current value of the file-position indicator for SEEK_CUR, or end-of-file for SEEK_END.
- fseeko64.05
If the stream is to be used with wide-character input/output functions, the application shall ensure that offset is either 0 or a value returned by an earlier call to ftell() on the same stream and whence is SEEK_SET.
- fseeko64.06
A successful call to fseek() shall clear the end-of-file indicator for the stream and undo any effects of ungetc() and ungetwc() on the same stream.
- fseeko64.07
After an fseek() call, the next operation on an update stream may be either input or output.
- fseeko64.08
If the most recent operation, other than ftell(), on a given stream is fflush(), the file offset in the underlying open file description shall be adjusted to reflect the location specified by fseek().
- fseeko64.09
The fseek() function shall allow the file-position indicator to be set beyond the end of existing data in the file.
- fseeko64.10
If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
- fseeko64.11
The behavior of fseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- fseeko64.12.01
If the stream is writable and buffered data had not been written to the underlying file, fseek() shall cause the unwritten data to be written to the file
- fseeko64.12.02
and shall mark the st_ctime and st_mtime fields of the file for update.
- fseeko64.13
In a locale with state-dependent encoding, whether fseek() restores the stream's shift state is implementation-defined.
- fseeko64.14.01
The fseek() [CX] and fseeko() functions shall return 0 if they succeed.
- fseeko64.14.02
Otherwise, they shall return -1 and set errno to indicate the error.
- fseeko64.15
The fseek() [CX] and fseeko() functions shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fseek() or fseeko() causes an underlying lseek() or write() to be invoked, and:
- fseeko64.15.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- fseeko64.15.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- fseeko64.15.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fseeko64.15.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fseeko64.15.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fseeko64.15.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fseeko64.15.07
[EINVAL] [CX] The whence argument is invalid. The resulting file-position indicator would be set to a negative value.
- fseeko64.15.08
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fseeko64.15.09
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fseeko64.15.10
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fseeko64.15.11
[EOVERFLOW] [CX] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long.
- fseeko64.15.12
[EOVERFLOW] [CX] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- fseeko64.15.13
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- fseeko64.15.14
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- fseeko64.16
The fseeko() function shall be equivalent to the fseek() function except that the offset argument is of type off_t.
Generalizes:
- fseeko64.01
- fseeko64.02
- fseeko64.03
- fseeko64.04
- fseeko64.05
- fseeko64.06
- fseeko64.07
- fseeko64.08
- fseeko64.09
- fseeko64.10
- fseeko64.11
- fseeko64.12.01
- fseeko64.12.02
- fseeko64.13
- fseeko64.14.01
- fseeko64.14.02
- fseeko64.15.01
- fseeko64.15.02
- fseeko64.15.03
- fseeko64.15.04
- fseeko64.15.05
- fseeko64.15.06
- fseeko64.15.07
- fseeko64.15.08
- fseeko64.15.09
- fseeko64.15.10
- fseeko64.15.11
- fseeko64.15.12
- fseeko64.15.13
- fseeko64.15.14
- [+]fsetpos (17 / 2 / 0)
- fsetpos.01
The fsetpos() function shall set the file position and state indicators for the stream pointed to by stream according to the value of the object pointed to by pos, which the application shall ensure is a value obtained from an earlier call to fgetpos() on the same stream.
- fsetpos.02
If a read or write error occurs, the error indicator for the stream shall be set and fsetpos() fails.
- fsetpos.03
A successful call to the fsetpos() function shall clear the end-of-file indicator for the stream and undo any effects of ungetc() on the same stream.
- fsetpos.04
After an fsetpos() call, the next operation on an update stream may be either input or output.
- app.fsetpos.05
The behavior of fsetpos() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- fsetpos.06.01
The fsetpos() function shall return 0 if it succeeds;
- fsetpos.06.02
otherwise, it shall return a non-zero value and set errno to indicate the error.
- fsetpos.07
The fsetpos() function shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fsetpos() causes an underlying lseek() or write() to be invoked, and:
- fsetpos.07.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- fsetpos.07.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- fsetpos.07.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fsetpos.07.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fsetpos.07.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fsetpos.07.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fsetpos.07.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fsetpos.07.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fsetpos.07.09
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fsetpos.07.10
[EPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- fsetpos.07.11
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- [+]fsetpos64 (17 / 2 / 0)
- fsetpos64.01
The fsetpos() function shall set the file position and state indicators for the stream pointed to by stream according to the value of the object pointed to by pos, which the application shall ensure is a value obtained from an earlier call to fgetpos() on the same stream.
- fsetpos64.02
If a read or write error occurs, the error indicator for the stream shall be set and fsetpos() fails.
- fsetpos64.03
A successful call to the fsetpos() function shall clear the end-of-file indicator for the stream and undo any effects of ungetc() on the same stream.
- fsetpos64.04
After an fsetpos() call, the next operation on an update stream may be either input or output.
- app.fsetpos64.05
The behavior of fsetpos() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- fsetpos64.06.01
The fsetpos() function shall return 0 if it succeeds;
- fsetpos64.06.02
otherwise, it shall return a non-zero value and set errno to indicate the error.
- fsetpos64.07
The fsetpos() function shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fsetpos() causes an underlying lseek() or write() to be invoked, and:
- fsetpos64.07.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- fsetpos64.07.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- fsetpos64.07.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- fsetpos64.07.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- fsetpos64.07.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fsetpos64.07.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fsetpos64.07.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fsetpos64.07.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fsetpos64.07.09
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fsetpos64.07.10
[EPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- fsetpos64.07.11
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- [+]ftell (9 / 4 / 0)
- ftell.01
The ftell() function shall obtain the current value of the file-position indicator for the stream pointed to by stream.
- ftell.02
The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t.
- ftell.03.01
Upon successful completion, ftell() [CX] and ftello() shall return the current value of the file-position indicator for the stream measured in bytes from the beginning of the file.
- ftell.03.02
Otherwise, ftell() [CX] and ftello() shall return -1, cast to long and off_t respectively, and set errno to indicate the error.
- ftell.04
The ftell() [CX] and ftello() functions shall fail if:
- ftell.04.01
[EBADF] [CX] The file descriptor underlying stream is not an open file descriptor.
- ftell.04.02
[EOVERFLOW] [CX] For ftell(), the current file offset cannot be represented correctly in an object of type long.
- ftell.04.03
[EOVERFLOW] [CX] For ftello(), the current file offset cannot be represented correctly in an object of type off_t.
- ftell.04.04
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- ftell.05
The ftell() function may fail if:
- ftell.05.01
[ESPIPE] [CX] The file descriptor underlying stream is associated with a socket.
- [+]ftello (9 / 4 / 0)
- ftello.01
The ftell() function shall obtain the current value of the file-position indicator for the stream pointed to by stream.
- ftello.02
The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t.
- ftello.03.01
Upon successful completion, ftell() [CX] and ftello() shall return the current value of the file-position indicator for the stream measured in bytes from the beginning of the file.
- ftello.03.02
Otherwise, ftell() [CX] and ftello() shall return -1, cast to long and off_t respectively, and set errno to indicate the error.
- ftello.04
The ftell() [CX] and ftello() functions shall fail if:
- ftello.04.01
[EBADF] [CX] The file descriptor underlying stream is not an open file descriptor.
- ftello.04.02
[EOVERFLOW] [CX] For ftell(), the current file offset cannot be represented correctly in an object of type long.
- ftello.04.03
[EOVERFLOW] [CX] For ftello(), the current file offset cannot be represented correctly in an object of type off_t.
- ftello.04.04
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- ftello.05
The ftell() function may fail if:
- ftello.05.01
[ESPIPE] [CX] The file descriptor underlying stream is associated with a socket.
- [+]ftello64 (9 / 4 / 0)
- ftello64.ftell.01
The ftell() function shall obtain the current value of the file-position indicator for the stream pointed to by stream.
- ftello64.ftell.02
The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t.
- ftello64.ftell.03.01
Upon successful completion, ftell() [CX] and ftello() shall return the current value of the file-position indicator for the stream measured in bytes from the beginning of the file.
- ftello64.ftell.03.02
Otherwise, ftell() [CX] and ftello() shall return -1, cast to long and off_t respectively, and set errno to indicate the error.
- ftello64.ftell.04
The ftell() [CX] and ftello() functions shall fail if:
- ftello64.ftell.04.01
[EBADF] [CX] The file descriptor underlying stream is not an open file descriptor.
- ftello64.ftell.04.02
[EOVERFLOW] [CX] For ftell(), the current file offset cannot be represented correctly in an object of type long.
- ftello64.ftell.04.03
[EOVERFLOW] [CX] For ftello(), the current file offset cannot be represented correctly in an object of type off_t.
- ftello64.ftell.04.04
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- ftello64.ftell.05
The ftell() function may fail if:
- ftello64.ftell.05.01
[ESPIPE] [CX] The file descriptor underlying stream is associated with a socket.
- [+]fwrite (20 / 4 / 0)
- fwrite.01
The fwrite() function shall write, from the array pointed to by ptr, up to nitems elements whose size is specified by size, to the stream pointed to by stream.
- fwrite.02
For each object, size calls shall be made to the fputc() function, taking the values (in order) from an array of unsigned char exactly overlaying the object.
- fwrite.03
The file-position indicator for the stream (if defined) shall be advanced by the number of bytes successfully written.
- fwrite.04
If an error occurs, the resulting value of the file-position indicator for the stream is unspecified.
- fwrite.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- fwrite.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fwrite.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- fwrite.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- fwrite.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- fwrite.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- fwrite.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fwrite.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fwrite.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fwrite.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fwrite.06
The fputc() function may fail if:
- fwrite.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- fwrite.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- fwrite.07
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fwrite() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort().
- fwrite.08.01
The fwrite() function shall return the number of elements successfully written,
- fwrite.08.02
which may be less than nitems if a write error is encountered.
- fwrite.09
If size or nitems is 0, fwrite() shall return 0 and the state of the stream remains unchanged.
- fwrite.10
Otherwise, if a write error occurs, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- [+]getc (16 / 8 / 0)
- getc.01
The getc() function shall be equivalent to fgetc() , except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.
- getc.fgetc.01.01
If the end-of-file indicator for the input stream pointed to by stream is not set and a next byte is present, the fgetc() function shall obtain the next byte as an unsigned char converted to an int, from the input stream pointed to by stream
- getc.fgetc.01.02
and advance the associated file position indicator for the stream (if defined).
- getc.fgetc.02
Since fgetc() operates on bytes, reading a character consisting of multiple bytes (or "a multi-byte character") may require multiple calls to fgetc().
- getc.fgetc.03
The fgetc() function may mark the st_atime field of the file associated with stream for update.
- getc.fgetc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getc.fgetc.05
Upon successful completion, fgetc() shall return the next byte from the input stream pointed to by stream.
- getc.fgetc.06
If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetc() shall return EOF.
- getc.fgetc.07
If a read error occurs, the error indicator for the stream shall be set, fgetc() shall return EOF, [CX] and shall set errno to indicate the error.
- getc.fgetc.08
The fgetc() function shall fail if data needs to be read and:
- getc.fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- getc.fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getc.fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getc.fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getc.fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getc.fgetc.09
The fgetc() function may fail if:
- getc.fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- getc.fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]getc_unlocked (15 / 8 / 0)
- getc_unlocked.fgetc.01.01
If the end-of-file indicator for the input stream pointed to by stream is not set and a next byte is present, the fgetc() function shall obtain the next byte as an unsigned char converted to an int, from the input stream pointed to by stream
- getc_unlocked.fgetc.01.02
and advance the associated file position indicator for the stream (if defined).
- getc_unlocked.fgetc.02
Since fgetc() operates on bytes, reading a character consisting of multiple bytes (or "a multi-byte character") may require multiple calls to fgetc().
- getc_unlocked.fgetc.03
The fgetc() function may mark the st_atime field of the file associated with stream for update.
- getc_unlocked.fgetc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getc_unlocked.fgetc.05
Upon successful completion, fgetc() shall return the next byte from the input stream pointed to by stream.
- getc_unlocked.fgetc.06
If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetc() shall return EOF.
- getc_unlocked.fgetc.07
If a read error occurs, the error indicator for the stream shall be set, fgetc() shall return EOF, [CX] and shall set errno to indicate the error.
- getc_unlocked.fgetc.08
The fgetc() function shall fail if data needs to be read and:
- getc_unlocked.fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- getc_unlocked.fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getc_unlocked.fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getc_unlocked.fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getc_unlocked.fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getc_unlocked.fgetc.09
The fgetc() function may fail if:
- getc_unlocked.fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- getc_unlocked.fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]getchar (16 / 8 / 0)
- getchar.01
The getchar() function shall be equivalent to getc(stdin).
- getchar.fgetc.01.01
If the end-of-file indicator for the input stream pointed to by stream is not set and a next byte is present, the fgetc() function shall obtain the next byte as an unsigned char converted to an int, from the input stream pointed to by stream
- getchar.fgetc.01.02
and advance the associated file position indicator for the stream (if defined).
- getchar.fgetc.02
Since fgetc() operates on bytes, reading a character consisting of multiple bytes (or "a multi-byte character") may require multiple calls to fgetc().
- getchar.fgetc.03
The fgetc() function may mark the st_atime field of the file associated with stream for update.
- getchar.fgetc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getchar.fgetc.05
Upon successful completion, fgetc() shall return the next byte from the input stream pointed to by stream.
- getchar.fgetc.06
If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetc() shall return EOF.
- getchar.fgetc.07
If a read error occurs, the error indicator for the stream shall be set, fgetc() shall return EOF, [CX] and shall set errno to indicate the error.
- getchar.fgetc.08
The fgetc() function shall fail if data needs to be read and:
- getchar.fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- getchar.fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getchar.fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getchar.fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getchar.fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getchar.fgetc.09
The fgetc() function may fail if:
- getchar.fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- getchar.fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]getchar_unlocked (15 / 8 / 0)
- getchar_unlocked.fgetc.01.01
If the end-of-file indicator for the input stream pointed to by stream is not set and a next byte is present, the fgetc() function shall obtain the next byte as an unsigned char converted to an int, from the input stream pointed to by stream
- getchar_unlocked.fgetc.01.02
and advance the associated file position indicator for the stream (if defined).
- getchar_unlocked.fgetc.02
Since fgetc() operates on bytes, reading a character consisting of multiple bytes (or "a multi-byte character") may require multiple calls to fgetc().
- getchar_unlocked.fgetc.03
The fgetc() function may mark the st_atime field of the file associated with stream for update.
- getchar_unlocked.fgetc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getchar_unlocked.fgetc.05
Upon successful completion, fgetc() shall return the next byte from the input stream pointed to by stream.
- getchar_unlocked.fgetc.06
If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetc() shall return EOF.
- getchar_unlocked.fgetc.07
If a read error occurs, the error indicator for the stream shall be set, fgetc() shall return EOF, [CX] and shall set errno to indicate the error.
- getchar_unlocked.fgetc.08
The fgetc() function shall fail if data needs to be read and:
- getchar_unlocked.fgetc.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- getchar_unlocked.fgetc.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getchar_unlocked.fgetc.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getchar_unlocked.fgetc.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getchar_unlocked.fgetc.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getchar_unlocked.fgetc.09
The fgetc() function may fail if:
- getchar_unlocked.fgetc.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- getchar_unlocked.fgetc.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]getw (14 / 6 / 0)
- getw.01
The getw() function reads the next word from the stream.
- getw.02
he size of a word is the size of an int and may vary from machine to machine.
- getw.03
The getw() function presumes no special alignment in the file.
- getw.04
The getw() function may mark the st_atime field of the file associated with stream for update. The st_atime field will be marked for update by the first successful execution of fgetc(), fgets(), fread(), getc(), getchar(), gets(), fscanf() or scanf() using stream that returns data not supplied by a prior call to ungetc().
- getw.05.01
Upon successful completion, getw() returns the next word from the input stream pointed to by stream.
- getw.05.02
If the stream is at end-of-file, the end-of-file indicator for the stream is set and getw() returns EOF
- getw.05.03
.If a read error occurs, the error indicator for the stream is set, getw() returns EOF and sets errno to indicate the error.
- getw.08
The fgetc() function shall fail if data needs to be read and:
- getw.08.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetc() operation.
- getw.08.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getw.08.03
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getw.08.04
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getw.08.05
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getw.09
The fgetc() function may fail if:
- getw.09.01
[ENOMEM] [CX] Insufficient storage space is available.
- getw.09.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putc (17 / 5 / 0)
- putc.01
The putc() function shall be equivalent to fputc(), except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.
- putc.01.01
The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putc.01.02
and shall advance the indicator appropriately.
- putc.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the byte shall be appended to the output stream.
- putc.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putc.04.01
Upon successful completion, fputc() shall return the value it has written.
- putc.04.02
Otherwise, it shall return EOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putc.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- putc.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putc.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putc.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- putc.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- putc.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- putc.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putc.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putc.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putc.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putc.06
The fputc() function may fail if:
- putc.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- putc.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putc_unlocked (17 / 5 / 0)
- putc_unlocked.01.01
The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putc_unlocked.01.02
and shall advance the indicator appropriately.
- putc_unlocked.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the byte shall be appended to the output stream.
- putc_unlocked.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putc_unlocked.04.01
Upon successful completion, fputc() shall return the value it has written.
- putc_unlocked.04.02
Otherwise, it shall return EOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putc_unlocked.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- putc_unlocked.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putc_unlocked.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putc_unlocked.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- putc_unlocked.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- putc_unlocked.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- putc_unlocked.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putc_unlocked.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putc_unlocked.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putc_unlocked.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putc_unlocked.06
The fputc() function may fail if:
- putc_unlocked.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- putc_unlocked.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putchar (17 / 5 / 0)
- putchar.01
The function call putchar(c) shall be equivalent to putc(c,stdout).
- putchar.01.01
The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putchar.01.02
and shall advance the indicator appropriately.
- putchar.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the byte shall be appended to the output stream.
- putchar.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putchar.04.01
Upon successful completion, fputc() shall return the value it has written.
- putchar.04.02
Otherwise, it shall return EOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putchar.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- putchar.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putchar.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putchar.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- putchar.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- putchar.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- putchar.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putchar.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putchar.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putchar.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putchar.06
The fputc() function may fail if:
- putchar.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- putchar.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putchar_unlocked (17 / 5 / 0)
- putchar_unlocked.01.01
The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putchar_unlocked.01.02
and shall advance the indicator appropriately.
- putchar_unlocked.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the byte shall be appended to the output stream.
- putchar_unlocked.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putchar_unlocked.04.01
Upon successful completion, fputc() shall return the value it has written.
- putchar_unlocked.04.02
Otherwise, it shall return EOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putchar_unlocked.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- putchar_unlocked.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putchar_unlocked.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putchar_unlocked.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- putchar_unlocked.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- putchar_unlocked.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- putchar_unlocked.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putchar_unlocked.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putchar_unlocked.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putchar_unlocked.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putchar_unlocked.06
The fputc() function may fail if:
- putchar_unlocked.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- putchar_unlocked.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]puts (16 / 2 / 0)
- puts.01
The puts() function shall write the string pointed to by s, followed by a <newline>, to the standard output stream stdout.
- puts.02
The terminating null byte shall not be written.
- puts.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of puts() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- puts.04.01
Upon successful completion, puts() shall return a non-negative number.
- puts.04.02
Otherwise, it shall return EOF, shall set an error indicator for the stream, [CX] and errno shall be set to indicate the error.
- puts.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- puts.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- puts.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- puts.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- puts.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- puts.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- puts.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- puts.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- puts.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- puts.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- puts.06
The fputc() function may fail if:
- puts.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- puts.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putw (17 / 3 / 0)
- putw.01
The putw() function writes the word (that is, type int) w to the output stream (at the position at which the file offset, if defined, is pointing).
- putw.02
The size of a word is the size of a type int and varies from machine to machine.
- putw.03
The putw() function neither assumes nor causes special alignment in the file.
- putw.04
The st_ctime and st_mtime fields of the file will be marked for update between the successful execution of putw() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putw.05.01
Upon successful completion, putw() returns 0.
- putw.05.02
Otherwise, a non-zero value is returned, the error indicators for the stream are set, and errno is set to indicate the error.
- putw.fputc.05
The fputc() function shall fail if either the stream is unbuffered or the stream's buffer needs to be flushed, and:
- putw.fputc.05.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putw.fputc.05.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putw.fputc.05.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size.
- putw.fputc.05.04
[EFBIG] [XSI] An attempt was made to write to a file that exceeds the process' file size limit.
- putw.fputc.05.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum.
- putw.fputc.05.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putw.fputc.05.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putw.fputc.05.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putw.fputc.05.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putw.fputc.06
The fputc() function may fail if:
- putw.fputc.06.01
[ENOMEM] [CX] Insufficient storage space is available.
- putw.fputc.06.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]rewind (28 / 4 / 0)
- rewind.01
The call:rewind(stream)shall be equivalent to:(void) fseek(stream, 0L, SEEK_SET)
- rewind.02
rewind() shall also clear the error indicator.
- rewind.03
Since rewind() does not return a value, an application wishing to detect errors should clear errno, then call rewind(), and if errno is non-zero, assume an error has occurred.
- rewind.fseek.01
The fseek() function shall set the file-position indicator for the stream pointed to by stream.
- rewind.fseek.02
If a read or write error occurs, the error indicator for the stream shall be set and fseek() fails.
- rewind.fseek.03
The new position, measured in bytes from the beginning of the file, shall be obtained by adding offset to the position specified by whence.
- rewind.fseek.04
The specified point is the beginning of the file for SEEK_SET, the current value of the file-position indicator for SEEK_CUR, or end-of-file for SEEK_END.
- rewind.fseek.05
If the stream is to be used with wide-character input/output functions, the application shall ensure that offset is either 0 or a value returned by an earlier call to ftell() on the same stream and whence is SEEK_SET.
- rewind.fseek.06
A successful call to fseek() shall clear the end-of-file indicator for the stream and undo any effects of ungetc() and ungetwc() on the same stream.
- rewind.fseek.07
After an fseek() call, the next operation on an update stream may be either input or output.
- rewind.fseek.08
If the most recent operation, other than ftell(), on a given stream is fflush(), the file offset in the underlying open file description shall be adjusted to reflect the location specified by fseek().
- rewind.fseek.11
The behavior of fseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
- rewind.fseek.12.01
If the stream is writable and buffered data had not been written to the underlying file, fseek() shall cause the unwritten data to be written to the file
- rewind.fseek.12.02
and shall mark the st_ctime and st_mtime fields of the file for update.
- rewind.fseek.13
In a locale with state-dependent encoding, whether fseek() restores the stream's shift state is implementation-defined.
- rewind.fseek.15
The fseek() [CX] and fseeko() functions shall fail if, [CX] either the stream is unbuffered or the stream's buffer needed to be flushed, and the call to fseek() or fseeko() causes an underlying lseek() or write() to be invoked, and:
- rewind.fseek.15.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor and the thread would be delayed in the write operation.
- rewind.fseek.15.02
[EBADF] [CX] The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is not open.
- rewind.fseek.15.03
[EFBIG] [CX] An attempt was made to write a file that exceeds the maximum file size.
- rewind.fseek.15.04
[EFBIG] [XSI] An attempt was made to write a file that exceeds the process' file size limit.
- rewind.fseek.15.05
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- rewind.fseek.15.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- rewind.fseek.15.08
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to perform a write() to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- rewind.fseek.15.09
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- rewind.fseek.15.10
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- rewind.fseek.15.11
[EOVERFLOW] [CX] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long.
- rewind.fseek.15.12
[EOVERFLOW] [CX] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- rewind.fseek.15.13
[EPIPE] [CX] An attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the thread.
- rewind.fseek.15.14
[ESPIPE] [CX] The file descriptor underlying stream is associated with a pipe or FIFO.
- [+]ungetc (13 / 1 / 0)
- ungetc.01
The ungetc() function shall push the byte specified by c (converted to an unsigned char) back onto the input stream pointed to by stream.
- ungetc.02
The pushed-back bytes shall be returned by subsequent reads on that stream in the reverse order of their pushing.
- ungetc.03
A successful intervening call (with the stream pointed to by stream) to a file-positioning function ( fseek(), fsetpos(), or rewind()) shall discard any pushed-back bytes for the stream.
- ungetc.04
The external storage corresponding to the stream shall be unchanged.
- ungetc.05.01
One byte of push-back shall be provided.
- ungetc.05.02
If ungetc() is called too many times on the same stream without an intervening read or file-positioning operation on that stream, the operation may fail.
- ungetc.06
If the value of c equals that of the macro EOF, the operation shall fail and the input stream shall be left unchanged.
- ungetc.07
A successful call to ungetc() shall clear the end-of-file indicator for the stream.
- ungetc.08
The value of the file-position indicator for the stream after reading or discarding all pushed-back bytes shall be the same as it was before the bytes were pushed back.
- ungetc.09.01
The file-position indicator is decremented by each successful call to ungetc();
- ungetc.09.02
if its value was 0 before a call, its value is unspecified after the call.
- ungetc.10.01
Upon successful completion, ungetc() shall return the byte pushed back after conversion.
- ungetc.10.02
Otherwise, it shall return EOF.
- [+]io.fstream.lock (30 / 18 / 0)
- [+]flockfile (10 / 6 / 0)
- flockfile.01
These functions shall provide for explicit application-level locking of stdio ( FILE *) objects. These functions can be used by a thread to delineate a sequence of I/O statements that are executed as a unit.
- flockfile.02
The flockfile() function shall acquire for a thread ownership of a ( FILE *) object.
- flockfile.04
The functions shall behave as if there is a lock count associated with each ( FILE *) object.
- flockfile.05
This count is implicitly initialized to zero when the ( FILE *) object is created.
- flockfile.06
The ( FILE *) object is unlocked when the count is zero.
- flockfile.07
When the count is positive, a single thread owns the ( FILE *) object.
- flockfile.08.01
When the flockfile() function is called, if the count is zero or if the count is positive and the caller owns the ( FILE *) object, the count shall be incremented.
- flockfile.08.02
Otherwise, the calling thread shall be suspended, waiting for the count to return to zero.
- flockfile.09
This allows matching calls to flockfile() (or successful calls to ftrylockfile()) and funlockfile() to be nested.
- flockfile.10
All functions that reference ( FILE *) objects shall behave as if they use flockfile() and funlockfile() internally to obtain ownership of these ( FILE *) objects.
- [+]ftrylockfile (11 / 7 / 0)
- ftrylockfile.01
These functions shall provide for explicit application-level locking of stdio ( FILE *) objects. These functions can be used by a thread to delineate a sequence of I/O statements that are executed as a unit.
- ftrylockfile.02
The ftrylockfile() function shall acquire for a thread ownership of a ( FILE *) object if the object is available; ftrylockfile() is a non-blocking version of flockfile().
- ftrylockfile.04
The functions shall behave as if there is a lock count associated with each ( FILE *) object.
- ftrylockfile.05
This count is implicitly initialized to zero when the ( FILE *) object is created.
- ftrylockfile.06
The ( FILE *) object is unlocked when the count is zero.
- ftrylockfile.07
When the count is positive, a single thread owns the ( FILE *) object.
- ftrylockfile.08.01
When the flockfile() function is called, if the count is zero or if the count is positive and the caller owns the ( FILE *) object, the count shall be incremented.
- ftrylockfile.09
This allows matching calls to flockfile() (or successful calls to ftrylockfile()) and funlockfile() to be nested.
- ftrylockfile.10
All functions that reference ( FILE *) objects shall behave as if they use flockfile() and funlockfile() internally to obtain ownership of these ( FILE *) objects.
- ftrylockfile.11.01
The ftrylockfile() function shall return zero for success
- ftrylockfile.11.02
and non-zero to indicate that the lock cannot be acquired.
- [+]funlockfile (9 / 5 / 0)
- funlockfile.01
These functions shall provide for explicit application-level locking of stdio ( FILE *) objects. These functions can be used by a thread to delineate a sequence of I/O statements that are executed as a unit.
- funlockfile.02
The funlockfile() function shall relinquish the ownership granted to the thread.
- app.funlockfile.03
The behavior is undefined if a thread other than the current owner calls the funlockfile() function.
- funlockfile.04
The functions shall behave as if there is a lock count associated with each ( FILE *) object.
- funlockfile.05
This count is implicitly initialized to zero when the ( FILE *) object is created.
- funlockfile.06
The ( FILE *) object is unlocked when the count is zero.
- funlockfile.07
When the count is positive, a single thread owns the ( FILE *) object.
- funlockfile.08
Each call to funlockfile() shall decrement the count.
- funlockfile.09
This allows matching calls to flockfile() (or successful calls to ftrylockfile()) and funlockfile() to be nested.
- funlockfile.10
All functions that reference ( FILE *) objects shall behave as if they use flockfile() and funlockfile() internally to obtain ownership of these ( FILE *) objects.
- [+]io.fstream.wstream (169 / 42 / 0)
- [+]fgetwc (18 / 4 / 0)
- fgetwc.01.01
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream,
- fgetwc.01.02
convert that to the corresponding wide-character code,
- fgetwc.01.03
and advance the associated file position indicator for the stream (if defined).
- fgetwc.02
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- fgetwc.03
The fgetwc() function may mark the st_atime field of the file associated with stream for update.
- fgetwc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fgetwc.05
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t.
- fgetwc.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF.
- fgetwc.07
If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, [CX] and shall set errno to indicate the error.
- fgetwc.08
If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
- fgetwc.09
The fgetwc() function shall fail if data needs to be read and:
- fgetwc.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- fgetwc.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fgetwc.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- fgetwc.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fgetwc.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fgetwc.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fgetwc.10
The fgetwc() function may fail if:
- fgetwc.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- fgetwc.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fgetws (19 / 4 / 0)
- fgetws.01.01
The fgetws() function shall read characters from the stream,
- fgetws.01.02
convert these to the corresponding wide-character codes,
- fgetws.01.03
place them in the wchar_t array pointed to by ws, until n-1 characters are read, or a <newline> is read,
- fgetws.01.04
converted, and transferred to ws, or an end-of-file condition is encountered.
- fgetws.02
he wide-character string, ws, shall then be terminated with a null wide-character code.
- fgetws.03
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- fgetws.04
The fgetws() function may mark the st_atime field of the file associated with stream for update.
- fgetws.05
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- fgetws.06
Upon successful completion, fgetws() shall return ws.
- fgetws.07
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetws() shall return a null pointer.
- fgetws.08
If a read error occurs, the error indicator for the stream shall be set, fgetws() shall return a null pointer, [CX] and shall set errno to indicate the error.
- fgetws.09
The fgetwc() function shall fail if data needs to be read and:
- fgetws.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- fgetws.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- fgetws.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- fgetws.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- fgetws.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- fgetws.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- fgetws.10
The fgetwc() function may fail if:
- fgetws.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- fgetws.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fputwc (18 / 5 / 0)
- fputwc.01.01
The fputwc() function shall write the character corresponding to the wide-character code wc to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- fputwc.01.02
and advances the indicator appropriately.
- fputwc.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the character is appended to the output stream.
- fputwc.03
If an error occurs while writing the character, the shift state of the output file is left in an undefined state.
- fputwc.04
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputwc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- fputwc.05.01
Upon successful completion, fputwc() shall return wc.
- fputwc.05.02
Otherwise, it shall return WEOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- fputwc.06
The fputwc() function shall fail if either the stream is unbuffered or data in the stream's buffer needs to be written, and:
- fputwc.06.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fputwc.06.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- fputwc.06.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size or the process' file size limit.
- fputwc.06.04
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fputwc.06.05
[EILSEQ] The wide-character code wc does not correspond to a valid character.
- fputwc.06.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fputwc.06.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fputwc.06.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fputwc.06.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fputwc.07
The fputwc() function may fail if:
- fputwc.07.01
[ENOMEM] [CX] Insufficient storage space is available.
- fputwc.07.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fputws (16 / 4 / 0)
- fputws.01
The fputws() function shall write a character string corresponding to the (null-terminated) wide-character string pointed to by ws to the stream pointed to by stream.
- fputws.02
No character corresponding to the terminating null wide-character code shall be written.
- fputws.03
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputws() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- fputws.04.01
Upon successful completion, fputws() shall return a non-negative number.
- fputws.04.02
Otherwise, it shall return -1, set an error indicator for the stream, [CX] and set errno to indicate the error.
- fputws.06
The fputwc() function shall fail if either the stream is unbuffered or data in the stream's buffer needs to be written, and:
- fputws.06.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- fputws.06.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- fputws.06.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size or the process' file size limit.
- fputws.06.04
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- fputws.06.05
[EILSEQ] The wide-character code wc does not correspond to a valid character.
- fputws.06.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- fputws.06.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- fputws.06.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- fputws.06.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- fputws.07
The fputwc() function may fail if:
- fputws.07.01
[ENOMEM] [CX] Insufficient storage space is available.
- fputws.07.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]fwide (10 / 1 / 0)
- fwide.01
The fwide() function shall determine the orientation of the stream pointed to by stream.
- fwide.02.01
If mode is greater than zero, the function first attempts to make the stream wide-oriented.
- fwide.02.02
If mode is less than zero, the function first attempts to make the stream byte-oriented.
- fwide.02.03
Otherwise, mode is zero and the function does not alter the orientation of the stream.
- fwide.03
If the orientation of the stream has already been determined, fwide() shall not change it.
- fwide.04
Since no return value is reserved to indicate an error, an application wishing to check for error situations should set errno to 0, then call fwide(), then check errno, and if it is non-zero, assume an error has occurred.
- fwide.05.01
The fwide() function shall return a value greater than zero if, after the call, the stream has wide-orientation,
- fwide.05.02
a value less than zero if the stream has byte-orientation,
- fwide.05.03
or zero if the stream has no orientation.
- fwide.06
The fwide() function may fail if:
- fwide.06.01
[EBADF] [CX] The stream argument is not a valid stream.
- [+]getwc (19 / 5 / 0)
- getwc.01
The getwc() function shall be equivalent to fgetwc(), except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.
- getwc.fgetwc.01.01
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream,
- getwc.fgetwc.01.02
convert that to the corresponding wide-character code,
- getwc.fgetwc.01.03
and advance the associated file position indicator for the stream (if defined).
- getwc.fgetwc.02
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- getwc.fgetwc.03
The fgetwc() function may mark the st_atime field of the file associated with stream for update.
- getwc.fgetwc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getwc.fgetwc.05
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t.
- getwc.fgetwc.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF.
- getwc.fgetwc.07
If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, [CX] and shall set errno to indicate the error.
- getwc.fgetwc.08
If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
- getwc.fgetwc.09
The fgetwc() function shall fail if data needs to be read and:
- getwc.fgetwc.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- getwc.fgetwc.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getwc.fgetwc.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- getwc.fgetwc.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getwc.fgetwc.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getwc.fgetwc.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getwc.fgetwc.10
The fgetwc() function may fail if:
- getwc.fgetwc.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- getwc.fgetwc.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]getwchar (19 / 5 / 0)
- getwchar.01
The getwchar() function shall be equivalent to getwc(stdin).
- getwchar.fgetwc.01.01
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream,
- getwchar.fgetwc.01.02
convert that to the corresponding wide-character code,
- getwchar.fgetwc.01.03
and advance the associated file position indicator for the stream (if defined).
- getwchar.fgetwc.02
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
- getwchar.fgetwc.03
The fgetwc() function may mark the st_atime field of the file associated with stream for update.
- getwchar.fgetwc.04
The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
- getwchar.fgetwc.05
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t.
- getwchar.fgetwc.06
If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF.
- getwchar.fgetwc.07
If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, [CX] and shall set errno to indicate the error.
- getwchar.fgetwc.08
If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
- getwchar.fgetwc.09
The fgetwc() function shall fail if data needs to be read and:
- getwchar.fgetwc.09.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the fgetwc() operation.
- getwchar.fgetwc.09.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for reading.
- getwchar.fgetwc.09.03
[EILSEQ] The data obtained from the input stream does not form a valid character.
- getwchar.fgetwc.09.04
[EINTR] [CX] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- getwchar.fgetwc.09.05
[EIO] [CX] A physical I/O error has occurred, or the process is in a background process group attempting to read from its controlling terminal, and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-defined reasons.
- getwchar.fgetwc.09.06
[EOVERFLOW] [CX] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.
- getwchar.fgetwc.10
The fgetwc() function may fail if:
- getwchar.fgetwc.10.01
[ENOMEM] [CX] Insufficient storage space is available.
- getwchar.fgetwc.10.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putwc (19 / 6 / 0)
- putwc.01
The putwc() function shall be equivalent to fputwc(), except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.
- putwc.fputwc.01.01
The fputwc() function shall write the character corresponding to the wide-character code wc to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putwc.fputwc.01.02
and advances the indicator appropriately.
- putwc.fputwc.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the character is appended to the output stream.
- putwc.fputwc.03
If an error occurs while writing the character, the shift state of the output file is left in an undefined state.
- putwc.fputwc.04
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputwc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putwc.fputwc.05.01
Upon successful completion, fputwc() shall return wc.
- putwc.fputwc.05.02
Otherwise, it shall return WEOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putwc.fputwc.06
The fputwc() function shall fail if either the stream is unbuffered or data in the stream's buffer needs to be written, and:
- putwc.fputwc.06.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putwc.fputwc.06.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putwc.fputwc.06.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size or the process' file size limit.
- putwc.fputwc.06.04
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- putwc.fputwc.06.05
[EILSEQ] The wide-character code wc does not correspond to a valid character.
- putwc.fputwc.06.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putwc.fputwc.06.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putwc.fputwc.06.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putwc.fputwc.06.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putwc.fputwc.07
The fputwc() function may fail if:
- putwc.fputwc.07.01
[ENOMEM] [CX] Insufficient storage space is available.
- putwc.fputwc.07.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]putwchar (19 / 6 / 0)
- putwchar.01
The function call putwchar(wc) shall be equivalent to putwc(wc,stdout).
- putwchar.fputwc.01.01
The fputwc() function shall write the character corresponding to the wide-character code wc to the output stream pointed to by stream, at the position indicated by the associated file-position indicator for the stream (if defined),
- putwchar.fputwc.01.02
and advances the indicator appropriately.
- putwchar.fputwc.02
If the file cannot support positioning requests, or if the stream was opened with append mode, the character is appended to the output stream.
- putwchar.fputwc.03
If an error occurs while writing the character, the shift state of the output file is left in an undefined state.
- putwchar.fputwc.04
The st_ctime and st_mtime fields of the file shall be marked for update between the successful execution of fputwc() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().
- putwchar.fputwc.05.01
Upon successful completion, fputwc() shall return wc.
- putwchar.fputwc.05.02
Otherwise, it shall return WEOF, the error indicator for the stream shall be set, [CX] and errno shall be set to indicate the error.
- putwchar.fputwc.06
The fputwc() function shall fail if either the stream is unbuffered or data in the stream's buffer needs to be written, and:
- putwchar.fputwc.06.01
[EAGAIN] [CX] The O_NONBLOCK flag is set for the file descriptor underlying stream and the thread would be delayed in the write operation.
- putwchar.fputwc.06.02
[EBADF] [CX] The file descriptor underlying stream is not a valid file descriptor open for writing.
- putwchar.fputwc.06.03
[EFBIG] [CX] An attempt was made to write to a file that exceeds the maximum file size or the process' file size limit.
- putwchar.fputwc.06.04
[EFBIG] [CX] The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream.
- putwchar.fputwc.06.05
[EILSEQ] The wide-character code wc does not correspond to a valid character.
- putwchar.fputwc.06.06
[EINTR] [CX] The write operation was terminated due to the receipt of a signal, and no data was transferred.
- putwchar.fputwc.06.07
[EIO] [CX] A physical I/O error has occurred, or the process is a member of a background process group attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined conditions.
- putwchar.fputwc.06.08
[ENOSPC] [CX] There was no free space remaining on the device containing the file.
- putwchar.fputwc.06.09
[EPIPE] [CX] An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to the thread.
- putwchar.fputwc.07
The fputwc() function may fail if:
- putwchar.fputwc.07.01
[ENOMEM] [CX] Insufficient storage space is available.
- putwchar.fputwc.07.02
[ENXIO] [CX] A request was made of a nonexistent device, or the request was outside the capabilities of the device.
- [+]ungetwc (12 / 2 / 0)
- ungetwc.01
The ungetwc() function shall push the character corresponding to the wide-character code specified by wc back onto the input stream pointed to by stream.
- ungetwc.02
The pushed-back characters shall be returned by subsequent reads on that stream in the reverse order of their pushing.
- ungetwc.03
A successful intervening call (with the stream pointed to by stream) to a file-positioning function ( fseek(), fsetpos(), or rewind()) discards any pushed-back characters for the stream.
- ungetwc.04
The external storage corresponding to the stream is unchanged.
- ungetwc.05
At least one character of push-back shall be provided. If ungetwc() is called too many times on the same stream without an intervening read or file-positioning operation on that stream, the operation may fail.
- ungetwc.06
If the value of wc equals that of the macro WEOF, the operation shall fail and the input stream shall be left unchanged.
- ungetwc.07
A successful call to ungetwc() shall clear the end-of-file indicator for the stream.
- ungetwc.08
The value of the file-position indicator for the stream after reading or discarding all pushed-back characters shall be the same as it was before the characters were pushed back.
- ungetwc.08.01
The file-position indicator is decremented (by one or more) by each successful call to ungetwc();
- ungetwc.08.02
if its value was 0 before a call, its value is unspecified after the call.
- ungetwc.09.01
Upon successful completion, ungetwc() shall return the wide-character code corresponding to the pushed-back character.
- ungetwc.09.02
Otherwise, it shall return WEOF.
- ungetwc.10
The ungetwc() function may fail if:
- ungetwc.10.01
[EILSEQ] [CX] An invalid character sequence is detected, or a wide-character code does not correspond to a valid character.
- [+]io.multiplex (68 / 21 / 0)
- [+]poll (30 / 13 / 0)
- poll.01
The poll() function provides applications with a mechanism for multiplexing input/output over a set of file descriptors.
Generalizes:
- &poll.02
- &poll.07.05
- poll.02
- poll.07.01.01
- poll.07.02.01
- poll.07.03.01
- poll.07.04.01
- poll.07.05.01
- poll.07.06.01
- poll.07.07.01
- poll.07.07.02
- poll.07.08.01
- poll.07.08.02
- poll.07.08.03
- poll.07.08.04
- poll.07.09.01
- poll.07.09.02
- poll.08
- poll.09
- poll.10
- poll.11
- poll.12
- poll.13.01
- poll.13.02
- poll.14
- poll.15
- poll.17
- poll.18
- poll.19
- poll.20.01.01
- poll.20.01.02
- poll.20.02
- poll.21.02
- poll.21.03
- poll.02
For each member of the array pointed to by fds, poll() shall examine the given file descriptor for the event(s) specified in events.
The poll() function shall identify those file descriptors on which an application can read or write data, or on which certain events have occurred.
- app.poll.03 (struct)
The number of pollfd structures in the fds array is specified by nfds.
- app.poll.04 (struct)
The fds argument specifies the file descriptors to be examined and the events of interest for each file descriptor.
- app.poll.05
It is a pointer to an array with one member for each open file descriptor of interest.
- app.poll.06 (struct)
The array's members are pollfd structures within which fd specifies an open file descriptor and events and revents are bitmasks constructed by OR'ing a combination of the following event flags:
- poll.07.01
POLLIN
- poll.07.01.01
Data other than high-priority data may be read without blocking.
- poll.07.02
POLLRDNORM
- poll.07.02.01
Normal data may be read without blocking.
- poll.07.03
POLLRDBAND
- poll.07.03.01
Priority data may be read without blocking.
- poll.07.04
POLLPRI
- poll.07.04.01
High-priority data may be read without blocking.
- poll.07.05
POLLOUT
- poll.07.05.01
Normal data may be written without blocking.
- poll.07.06
POLLWRBAND
- poll.07.06.01
Priority data may be written.
- poll.07.07
POLLERR
- poll.07.07.01
An error has occurred on the device or stream.
- poll.07.07.02
This flag is only valid in the revents bitmask; it shall be ignored in the events member.
- poll.07.08
POLLHUP
- poll.07.08.01
The device has been disconnected.
- poll.07.08.02
This event and POLLOUT are mutually-exclusive; a stream can never be writable if a hangup has occurred.
- poll.07.08.03 (struct)
However, this event and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not mutually-exclusive
- poll.07.08.04
This flag is only valid in the revents bitmask; it shall be ignored in the events member.
- poll.07.09
POLLNVAL
- poll.07.09.01
The specified fd value is invalid.
- poll.07.09.02
This flag is only valid in the revents member; it shall ignored in the events member.
- poll.08 (struct)
The significance and semantics of normal, priority, and high-priority data are file and device-specific.
- poll.09
If the value of fd is less than 0, events shall be ignored, and revents shall be set to 0 in that entry on return from poll().
- poll.10
In each pollfd structure, poll() shall clear the revents member, except that where the application requested a report on a condition by setting one of the bits of events listed above, poll() shall set the corresponding bit in revents if the requested condition is true.
- poll.11
In addition, poll() shall set the POLLHUP, POLLERR, and POLLNVAL flag in revents if the condition is true, even if the application did not set the corresponding bit in events.
- poll.12
If none of the defined events have occurred on any selected file descriptor, poll() shall wait at least timeout milliseconds for an event to occur on any of the selected file descriptors.
- poll.13.01
If the value of timeout is 0, poll() shall return immediately.
- poll.13.02
If the value of timeout is -1, poll() shall block until a requested event occurs or until the call is interrupted.
- poll.14 (struct)
Implementations may place limitations on the granularity of timeout intervals. If the requested timeout interval requires a finer granularity than the implementation supports, the actual timeout interval shall be rounded up to the next supported value.
- poll.15
The poll() function shall not be affected by the O_NONBLOCK flag.
- app.poll.16
The poll() function shall support regular files, terminal and pseudo-terminal devices, FIFOs, pipes, sockets and [XSR] STREAMS-based files. The behavior of poll() on eelements of fds that refer to other types of file is unspecified.
- poll.17
Regular files shall always poll TRUE for reading and writing.
- poll.18
A file descriptor for a socket that is listening for connections shall indicate that it is ready for reading, once connections are available.
- poll.19
A file descriptor for a socket that is connecting asynchronously shall indicate that it is ready for writing, once a connection has been established.
- poll.20.01
Upon successful completion, poll() shall return a non-negative value.
- poll.20.01.01
A positive value indicates the total number of file descriptors that have been selected (that is, file descriptors for which the revents member is non-zero).
- poll.20.01.02
A value of 0 indicates that the call timed out and no file descriptors have been selected.
- poll.20.02
Upon failure, poll() shall return -1 and set errno to indicate the error.
- poll.21
The poll() function shall fail if:
- poll.21.02
[EINTR] A signal was caught during poll().
- poll.21.03
[EINVAL] The nfds argument is greater than {OPEN_MAX} , [XSR] or one of the fd members refers to a STREAM or multiplexer that is linked (directly or indirectly) downstream from a multiplexer.
- [+]select (38 / 8 / 0)
- select.01
The select() function shall be equivalent to the pselect() function, except as follows:
- select.01.01
For the select() function, the timeout period is given in seconds and microseconds in an argument of type struct timeval, whereas for the pselect() function the timeout period is given in seconds and nanoseconds in an argument of type struct timespec.
- select.01.02 (struct)
The select() function has no sigmask argument; it shall behave as pselect() does when sigmask is a null pointer.
- select.01.03 (struct)
Upon successful completion, the select() function may modify the object pointed to by the timeout argument.
- app.select.02
The pselect() and select() functions shall support regular files, terminal and pseudo-terminal devices, [XSR] STREAMS-based files, FIFOs, pipes, and sockets. The behavior of pselect() and select() on file descriptors that refer to other types of file is unspecified.
- select.03 (struct)
The nfds argument specifies the range of descriptors to be tested.
- select.04
The first nfds descriptors shall be checked in each set; that is, the descriptors from zero through nfds-1 in the descriptor sets shall be examined.
- select.05
If the readfds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for being ready to read, and on output indicates which file descriptors are ready to read.
- select.06
If the writefds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for being ready to write, and on output indicates which file descriptors are ready to write.
- select.07
If the errorfds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for error conditions pending, and on output indicates which file descriptors have error conditions pending.
- select.08
Upon successful completion, the pselect() or select() function shall modify the objects pointed to by the readfds, writefds, and errorfds arguments to indicate which file descriptors are ready for reading, ready for writing, or have an error condition pending, respectively, and shall return the total number of ready descriptors in all the output sets.
- select.09
For each file descriptor less than nfds, the corresponding bit shall be set on successful completion if it was set on input and the associated condition is true for that file descriptor.
- select.10
If none of the selected descriptors are ready for the requested operation, the pselect() or select() function shall block until at least one of the requested operations becomes ready, until the timeout occurs, or until interrupted by a signal.
- select.11
The timeout parameter controls how long the pselect() or select() function shall take before timing out.
- select.12
If the timeout parameter is not a null pointer, it specifies a maximum interval to wait for the selection to complete.
- select.13
If the specified time interval expires without any requested operation becoming ready, the function shall return.
- select.14
If the timeout parameter is a null pointer, then the call to pselect() or select() shall block indefinitely until at least one descriptor meets the specified criteria.
- select.15 (struct)
To effect a poll, the timeout parameter should not be a null pointer, and should point to a zero-valued timespec structure.
- select.16
The use of a timeout does not affect any pending timers set up by alarm(), ualarm(), or setitimer().
- select.17 (struct)
Implementations may place limitations on the maximum timeout interval supported.
- select.20 (struct)
Implementations may also place limitations on the granularity of timeout intervals.
- select.23 (struct)
A descriptor shall be considered ready for reading when a call to an input function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully.
- select.24 (struct)
The function might return data, an end-of-file indication, or an error other than one indicating that it is blocked, and in each of these cases the descriptor shall be considered ready for reading.
- select.25 (struct)
A descriptor shall be considered ready for writing when a call to an output function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully.
- select.26
If a socket has a pending error, it shall be considered to have an exceptional condition pending.
- select.27
Otherwise, what constitutes an exceptional condition is file type-specific.
- select.28
For a file descriptor for use with a socket, it is protocol-specific except as noted below. For other file types it is implementation-defined.
- select.29
If the operation is meaningless for a particular file type, pselect() or select() shall indicate that the descriptor is ready for read or write operations, and shall indicate that the descriptor has no exceptional condition pending.
- select.30
If a descriptor refers to a socket, the implied input function is the recvmsg() function with parameters requesting normal and ancillary data, such that the presence of either type shall cause the socket to be marked as readable.
- select.31
The presence of out-of-band data shall be checked if the socket option SO_OOBINLINE has been enabled, as out-of-band data is enqueued with normal data.
- select.32
If the socket is currently listening, then it shall be marked as readable if an incoming connection request has been received, and a call to the accept() function shall complete without blocking.
- select.33
If a descriptor refers to a socket, the implied output function is the sendmsg() function supplying an amount of normal data equal to the current value of the SO_SNDLOWAT option for the socket.
- select.34
If a non-blocking call to the connect() function has been made for a socket, and the connection attempt has either succeeded or failed leaving a pending error, the socket shall be marked as writable.
- select.35
A socket shall be considered to have an exceptional condition pending if a receive operation with O_NONBLOCK clear for the open file description and with the MSG_OOB flag set would return out-of-band data without blocking.
- select.36
It is protocol-specific whether the MSG_OOB flag would be used to read out-of-band data.
- select.37
A socket shall also be considered to have an exceptional condition pending if an out-of-band data mark is present in the receive queue.
- select.38
Other circumstances under which a socket may be considered to have an exceptional condition pending are protocol-specific and implementation-defined.
- select.39
If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is not a null pointer, the pselect() or select() function shall block for the time specified, or until interrupted by a signal.
- select.40
If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is a null pointer, the pselect() or select() function shall block until interrupted by a signal.
- select.41
File descriptors associated with regular files shall always select true for ready to read, ready to write, and error conditions.
- select.42
On failure, the objects pointed to by the readfds, writefds, and errorfds arguments shall not be modified.
- select.43
If the timeout interval expires without the specified condition being true for any of the specified file descriptors, the objects pointed to by the readfds, writefds, and errorfds arguments shall have all bits set to 0.
- select.44.01
Upon successful completion, the pselect() and select() functions shall return the total number of bits set in the bit masks.
- select.44.02
Otherwise, -1 shall be returned, and errno shall be set to indicate the error.
- select.45
Under the following conditions, pselect() and select() shall fail and set errno to:
- select.45.01
[EBADF] One or more of the file descriptor sets specified a file descriptor that is not a valid open file descriptor.
- select.45.02
[EINTR] The function was interrupted before any of the selected events occurred and before the timeout interval expired. [XSI] If SA_RESTART has been set for the interrupting signal, it is implementation-defined whether the function restarts or returns with [EINTR].
- select.45.03
[EINVAL] An invalid timeout interval was specified.
- select.45.04
[EINVAL] The nfds argument is less than 0 or greater than FD_SETSIZE.
- select.45.05
[EINVAL] [XSR] One of the specified file descriptors refers to a STREAM or multiplexer that is linked (directly or indirectly) downstream from a multiplexer.
- [+]io.pipe (10 / 8 / 0)
- [+]pipe (10 / 8 / 0)
- pipe.01
The pipe() function shall create a pipe and place two file descriptors, one each into the arguments fildes[0] and fildes[1], that refer to the open file descriptions for the read and write ends of the pipe.
- pipe.02
Their integer values shall be the two lowest available at the time of the pipe() call.
- pipe.03
The O_NONBLOCK and FD_CLOEXEC flags shall be clear on both file descriptors.
- pipe.04
Data can be written to the file descriptor fildes[1] and read from the file descriptor fildes[0].
- pipe.05
read on the file descriptor fildes[0] shall access data written to the file descriptor fildes[1] on a first-in-first-out basis.
- app.pipe.06
It is unspecified whether fildes[0] is also open for writing and whether fildes[1] is also open for reading.
- pipe.07 (struct)
A process has the pipe open for reading (correspondingly writing) if it has a file descriptor open that refers to the read end, fildes[0] (write end, fildes[1]).
- pipe.08
Upon successful completion, pipe() shall mark for update the st_atime, st_ctime, and st_mtime fields of the pipe.
- pipe.09.01
Upon successful completion, 0 shall be returned;
- pipe.09.02
otherwise, -1 shall be returned and errno set to indicate the error.
- pipe.10
The pipe() function shall fail if:
- pipe.10.01
[EMFILE] More than {OPEN_MAX} minus two file descriptors are already in use by this process.
- pipe.10.02
[ENFILE] The number of simultaneously open files in the system would exceed a system-imposed limit.
- [+]io.streams (7 / 0 / 0)
- [+]ioctl (7 / 0 / 0)
- ioctl.01
The ioctl() function shall manipulate the underlying device parameters of special files.
- ioctl.02
On success, 0 is returned. An ioctl() may use the return value as an output parameter and return a non-negative value on success.
- ioctl.03
On error, -1 is returned and the global variable errno is set appropriately.
- ioctl.03.01
[EBADF] fildes is not a valid descriptor.
- ioctl.03.02
[EFAULT] The third parameter references an inaccessible memory area.
- ioctl.03.03
[ENOTTY] fildes is not associated with a character special device.
- ioctl.03.04
[ENOTTY] The specified request does not apply to the kind of object that fildes references.
- ioctl.03.05
[EINVAL] request or the third parameter is not valid.
- [+]io.syslog (63 / 13 / 0)
- [+]closelog (1 / 0 / 0)
- closelog.01
The closelog() function shall close any open file descriptors allocated by previous calls to openlog() or syslog().
- closelog.02 (struct)
The closelog(), openlog(), and syslog() functions shall not return a value.
- [+]openlog (19 / 3 / 0)
- openlog.01.L0
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L1
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L2
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L3
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L4
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L5
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L6
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.L7
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.01.USR
The facility indicates the application or system component generating the message. Possible facility values include:LOG_USER Messages generated by arbitrary processes. This is the default facility identifier if none is specified. LOG_LOCAL0 Reserved for local use. LOG_LOCAL1 Reserved for local use. LOG_LOCAL2 Reserved for local use. LOG_LOCAL3 Reserved for local use. LOG_LOCAL4 Reserved for local use. LOG_LOCAL5 Reserved for local use. LOG_LOCAL6 Reserved for local use. LOG_LOCAL7 Reserved for local use.
- openlog.02
The openlog() function shall set process attributes that affect subsequent calls to syslog().
Generalizes:
- openlog.01.L0
- openlog.01.L1
- openlog.01.L2
- openlog.01.L3
- openlog.01.L4
- openlog.01.L5
- openlog.01.L6
- openlog.01.L7
- openlog.01.USR
- openlog.03
- openlog.04.01.CON.01
- openlog.04.01.CON.02
- openlog.04.01.NDE
- openlog.04.01.NOW
- openlog.04.01.ODE
- openlog.04.01.PID
- openlog.05
- openlog.06
- openlog.07
- openlog.03
The ident argument is a string that is prepended to every message.
- openlog.04
The logopt argument indicates logging options.
- openlog.04.01
Values for logopt are constructed by a bitwise-inclusive OR of zero or more of the following:
- openlog.04.01.CON
LOG_CONS Write messages to the system console if they cannot be sent to the logging facility. The syslog() function ensures that the process does not acquire the console as a controlling terminal in the process of writing the message.
- openlog.04.01.CON.01
Write messages to the system console if they cannot be sent to the logging facility.
- openlog.04.01.CON.02
The syslog() function ensures that the process does not acquire the console as a controlling terminal in the process of writing the message.
- openlog.04.01.NDE
LOG_NDELAY Open the connection to the logging facility immediately. Normally the open is delayed until the first message is logged. This is useful for programs that need to manage the order in which file descriptors are allocated.
- openlog.04.01.NOW
LOG_NOWAIT Do not wait for child processes that may have been created during the course of logging the message. This option should be used by processes that enable notification of child termination using SIGCHLD, since syslog() may otherwise block waiting for a child whose exit status has already been collected.
- openlog.04.01.ODE
LOG_ODELAY Delay open until syslog() is called.
- openlog.04.01.PID
LOG_PID Log the process ID with each message. This is useful for identifying specific processes.
- openlog.05
The facility argument encodes a default facility to be assigned to all messages that do not have an explicit facility already encoded.
- openlog.06
The openlog() and syslog() functions may allocate a file descriptor.
- openlog.07 (struct)
The closelog(), openlog(), and syslog() functions shall not return a value.
- [+]setlogmask (4 / 4 / 0)
- setlogmask.01
The setlogmask() function shall set the log priority mask for the current process to maskpri and return the previous mask.
- setlogmask.02
If the maskpri argument is 0, the current log mask is not modified.
- setlogmask.03
A call to openlog() is not required prior to calling setlogmask().
- setlogmask.04
The setlogmask() function shall return the previous log priority mask.
- [+]syslog (19 / 3 / 0)
- syslog.01
The syslog() function shall send a message to an implementation-defined logging facility, which may log it in an implementation-defined system log, write it to the system console, forward it to a list of users, or forward it to the logging facility on another host over the network.
Generalizes:
- syslog.02.01
- syslog.02.02
- syslog.03
- syslog.05
- syslog.06.01
- syslog.06.02.ALE
- syslog.06.02.CRI
- syslog.06.02.DEB
- syslog.06.02.EME
- syslog.06.02.ERR
- syslog.06.02.INF
- syslog.06.02.NOT
- syslog.06.02.WAR
- syslog.07
- syslog.08
- syslog.09
- syslog.10
- syslog.11
- syslog.12
- syslog.02
The logged message shall include a message header and a message body.
- syslog.02.01
The message header contains at least a timestamp and a tag string.
- syslog.02.02
The message body is generated from the message and following arguments in the same manner as if these were arguments to printf(),
- syslog.03
except that the additional conversion specification %m shall be recognized; it shall convert no arguments, shall cause the output of the error message string associated with the value of errno on entry to syslog(), and may be mixed with argument specifications of the "%n$" form.
- app.syslog.04
If a complete conversion specification with the m conversion specifier character is not just %m, the behavior is undefined.
- syslog.05
A trailing <newline> may be added if needed.
- syslog.06
Values of the priority argument are formed by OR'ing together a severity-level value and an optional facility value.
- syslog.06.01
If no facility value is specified, the current default facility value is used.
- syslog.06.02.ALE
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.CRI
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.DEB
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.EME
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.ERR
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.INF
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.NOT
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.06.02.WAR
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- syslog.07
The initial default facility is LOG_USER.
- syslog.08
The openlog() and syslog() functions may allocate a file descriptor.
- syslog.09
It is not necessary to call openlog() prior to calling syslog().
Generalizes:
- syslog.01
- syslog.02.01
- syslog.02.02
- syslog.03
- syslog.05
- syslog.06.01
- syslog.06.02.ALE
- syslog.06.02.CRI
- syslog.06.02.DEB
- syslog.06.02.EME
- syslog.06.02.ERR
- syslog.06.02.INF
- syslog.06.02.NOT
- syslog.06.02.WAR
- syslog.07
- syslog.08
- syslog.10
- syslog.11
- syslog.12
- syslog.10
Calls by the current process to syslog() with a priority not set in maskpri shall be rejected.
- syslog.11
The default log mask allows all priorities to be logged.
- syslog.12 (struct)
The closelog(), openlog(), and syslog() functions shall not return a value.
- [+]vsyslog (20 / 3 / 0)
- vsyslog.01
The syslog() function shall send a message to an implementation-defined logging facility, which may log it in an implementation-defined system log, write it to the system console, forward it to a list of users, or forward it to the logging facility on another host over the network.
Generalizes:
- vsyslog.02.01
- vsyslog.02.02
- vsyslog.03
- vsyslog.05
- vsyslog.06.01
- vsyslog.06.02.ALE
- vsyslog.06.02.CRI
- vsyslog.06.02.DEB
- vsyslog.06.02.EME
- vsyslog.06.02.ERR
- vsyslog.06.02.INF
- vsyslog.06.02.NOT
- vsyslog.06.02.WAR
- vsyslog.07
- vsyslog.08
- vsyslog.09
- vsyslog.10
- vsyslog.11
- vsyslog.12
- vsyslog.13
- vsyslog.02
The logged message shall include a message header and a message body.
- vsyslog.02.01
The message header contains at least a timestamp and a tag string.
- vsyslog.02.02
The message body is generated from the message and following arguments in the same manner as if these were arguments to printf(),
- vsyslog.03
except that the additional conversion specification %m shall be recognized; it shall convert no arguments, shall cause the output of the error message string associated with the value of errno on entry to syslog(), and may be mixed with argument specifications of the "%n$" form.
- app.vsyslog.04
If a complete conversion specification with the m conversion specifier character is not just %m, the behavior is undefined.
- vsyslog.05
A trailing <newline> may be added if needed.
- vsyslog.06
Values of the priority argument are formed by OR'ing together a severity-level value and an optional facility value.
- vsyslog.06.01
If no facility value is specified, the current default facility value is used.
- vsyslog.06.02.ALE
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.CRI
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.DEB
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.EME
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.ERR
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.INF
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.NOT
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.06.02.WAR
Possible values of severity level include:LOG_EMERG A panic condition. LOG_ALERT A condition that should be corrected immediately, such as a corrupted system database. LOG_CRIT Critical conditions, such as hard device errors. LOG_ERR Errors. LOG_WARNING Warning messages. LOG_NOTICE Conditions that are not error conditions, but that may require special handling. LOG_INFO Informational messages. LOG_DEBUG Messages that contain information normally of use only when debugging a program.
- vsyslog.07
The initial default facility is LOG_USER.
- vsyslog.08
The openlog() and syslog() functions may allocate a file descriptor.
- vsyslog.09
It is not necessary to call openlog() prior to calling syslog().
Generalizes:
- vsyslog.01
- vsyslog.02.01
- vsyslog.02.02
- vsyslog.03
- vsyslog.05
- vsyslog.06.01
- vsyslog.06.02.ALE
- vsyslog.06.02.CRI
- vsyslog.06.02.DEB
- vsyslog.06.02.EME
- vsyslog.06.02.ERR
- vsyslog.06.02.INF
- vsyslog.06.02.NOT
- vsyslog.06.02.WAR
- vsyslog.07
- vsyslog.08
- vsyslog.10
- vsyslog.11
- vsyslog.12
- vsyslog.13
- vsyslog.10
Calls by the current process to syslog() with a priority not set in maskpri shall be rejected.
- vsyslog.11
The default log mask allows all priorities to be logged.
- vsyslog.12 (struct)
The closelog(), openlog(), and syslog() functions shall not return a value.
- vsyslog.13
The vsyslog() function is identical to syslog() as specified in ISO POSIX (2003), except that arglist (as defined by stdarg.h) replaces the variable number of arguments.
- [+]io.term (178 / 89 / 0)
- [+]cfgetispeed (1 / 1 / 0)
- cfgetispeed.01
The cfgetispeed() function shall extract the input baud rate from the termios structure to which the termios_p argument points.This function shall return exactly the value in the termios data structure, without interpretation.
- [+]cfgetospeed (1 / 1 / 0)
- cfgetospeed.01
The cfgetospeed() function shall extract the output baud rate from the termios structure to which the termios_p argument points.This function shall return exactly the value in the termios data structure, without interpretation.
- [+]cfmakeraw (4 / 4 / 0)
- cfmakeraw.01
The cfmakeraw() function shall set the attributes of the termios structure referenced by termios_p as follows: termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP |INLCR|IGNCR|ICRNL|IXON); termios_p->c_oflag &= ~OPOST; termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); termios_p->c_cflag &= ~(CSIZE|PARENB); termios_p->c_cflag |= CS8;
- cfmakeraw.01.01
termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP |INLCR|IGNCR|ICRNL|IXON);
- cfmakeraw.01.02
termios_p->c_oflag &= ~OPOST;
- cfmakeraw.01.03
termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
- cfmakeraw.01.04
termios_p->c_cflag &= ~(CSIZE|PARENB); termios_p->c_cflag |= CS8;
- [+]cfsetispeed (6 / 4 / 0)
- cfsetispeed.01
The cfsetispeed() function shall set the input baud rate stored in the structure pointed to by termios_p to speed.
- cfsetispeed.02
There shall be no effect on the baud rates set in the hardware until a subsequent successful call to tcsetattr() with the same termios structure. Similarly, errors resulting from attempts to set baud rates not supported by the terminal device need not be detected until the tcsetattr() function is called.
- cfsetispeed.03
Upon successful completion, cfsetispeed() shall return 0;
- cfsetispeed.04
otherwise, -1 shall be returned, and errno may be set to indicate the error.
- cfsetispeed.05
The cfsetispeed() function may fail if:
- cfsetispeed.05.01
[EINVAL] The speed value is not a valid baud rate.
- cfsetispeed.05.02
[EINVAL] The value of speed is outside the range of possible speed values as specified in <termios.h>.
- [+]cfsetospeed (6 / 3 / 0)
- cfsetospeed.01
The cfsetospeed() function shall set the output baud rate stored in the structure pointed to by termios_p to speed.
- cfsetospeed.02
There shall be no effect on the baud rates set in the hardware until a subsequent successful call to tcsetattr() with the same termios structure. Similarly, errors resulting from attempts to set baud rates not supported by the terminal device need not be detected until the tcsetattr() function is called.
- cfsetospeed.03
Upon successful completion, cfsetospeed() shall return 0;
- cfsetospeed.04
otherwise, it shall return -1 and errno may be set to indicate the error.
- cfsetospeed.05
The cfsetospeed() function may fail if:
- cfsetospeed.05.01
[EINVAL] The speed value is not a valid baud rate.
- cfsetospeed.05.02
[EINVAL] The value of speed is outside the range of possible speed values as specified in <termios.h>.
- [+]cfsetspeed (4 / 3 / 0)
- cfsetspeed.01
cfsetspeed() sets both the input and output baud rates in the termios structure referenced by t to speed.
cfsetspeed() sets the baud rate values in the termios structure.
- cfsetspeed.02
The effects of the function on the terminal as described below do not become effective, nor are all errors detected, until the tcsetattr() function is called.
- cfsetspeed.03
On success, 0 is returned.
- cfsetspeed.04
On error, -1 is returned and the global variable errno is set appropriately.
- cfsetspeed.04.01
[EINVAL] Invalid speed argument
- [+]ctermid (3 / 2 / 0)
- app.ctermid.01
Otherwise, s is assumed to point to a character array of at least L_ctermid bytes;
- ctermid.01
The ctermid() function shall generate a string that, when used as a pathname, refers to the current controlling terminal for the current process.
- ctermid.02
the string is placed in this array and the value of s shall be returned.
- ctermid.03
The ctermid() function shall return an empty string if the pathname that would refer to the controlling terminal cannot be determined, or if the function is unsuccessful.
- [+]getlogin (7 / 3 / 0)
- getlogin.01
The getlogin() function shall return a pointer to a string containing the user name associated by the login activity with the controlling terminal of the current process. If getlogin() returns a non-null pointer, then that pointer points to the name that the user logged in under, even if there are several login names with the same user ID.
- getlogin.02
The maximum size of the login name is {LOGIN_NAME_MAX}.
- getlogin.03
Upon successful completion, getlogin() shall return a pointer to the login name or a null pointer if the user's login name cannot be found.
- getlogin.04
Otherwise, it shall return a null pointer and set errno to indicate the error.
- getlogin.05
The getlogin() and getlogin_r() functions may fail if:
- getlogin.05.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getlogin.05.02
[ENFILE] The maximum allowable number of files is currently open in the system.
- getlogin.05.03
[ENXIO] The calling process has no controlling terminal.
- [+]getlogin_r (8 / 3 / 0)
- getlogin_r.01
If getlogin_r() is successful, name points to the name the user used at login, even if there are several login names with the same user ID.
The getlogin_r() function shall put the name associated by the login activity with the controlling terminal of the current process in the character array pointed to by name.
- app.getlogin_r.01
The array is namesize characters long and should have space for the name and the terminating null character.
- getlogin_r.02
The maximum size of the login name is {LOGIN_NAME_MAX}.
- getlogin_r.03
If successful, the getlogin_r() function shall return zero;
- getlogin_r.04
otherwise, an error number shall be returned to indicate the error.
- getlogin_r.05
The getlogin() and getlogin_r() functions may fail if:
- getlogin_r.05.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getlogin_r.05.02
[ENFILE] The maximum allowable number of files is currently open in the system.
- getlogin_r.05.03
[ENXIO] The calling process has no controlling terminal.
- getlogin_r.05.04
[ERANGE] [TSF] The value of namesize is smaller than the length of the string to be returned including the terminating null character.
- [+]grantpt (8 / 5 / 0)
- app.grantpt.01
The fildes argument is a file descriptor that refers to a master pseudo-terminal device.
- grantpt.01
The grantpt() function shall change the mode and ownership of the slave pseudo-terminal device associated with its master pseudo-terminal counterpart.
- grantpt.01.01
The user ID of the slave shall be set to the real UID of the calling process
- grantpt.01.02
the group ID shall be set to an unspecified group ID.
- grantpt.01.03
The permission mode of the slave pseudo-terminal shall be set to readable and writable by the owner, and writable by the group.
- grantpt.02
Upon successful completion, grantpt() shall return 0;
- app.grantpt.02
The behavior of the grantpt() function is unspecified if the application has installed a signal handler to catch SIGCHLD signals.
- grantpt.03
otherwise, it shall return -1 and set errno to indicate the error.
- grantpt.04
The grantpt() function may fail if:
- grantpt.04.01
[EBADF] The fildes argument is not a valid open file descriptor.
- grantpt.04.02
[EINVAL] The fildes argument is not associated with a master pseudo-terminal device.
- grantpt.04.03
[EACCES] The corresponding slave pseudo-terminal device could not be accessed.
- [+]isatty (4 / 4 / 0)
- isatty.01
The isatty() function shall test whether fildes, an open file descriptor, is associated with a terminal device.
- isatty.01.01
The isatty() function shall return 1 if fildes is associated with a terminal;
- isatty.01.02
otherwise, it shall return 0 and may set errno to indicate the error.
- isatty.02
The isatty() function may fail if:
- isatty.02.01
[EBADF] The fildes argument is not a valid open file descriptor.
- isatty.02.02
[ENOTTY] The fildes argument is not associated with a terminal.
- [+]login_tty (8 / 1 / 0)
- login_tty.01
The login_tty() function shall prepare the terminal device referenced by the file descriptor fdr.
Generalizes:
- login_tty.02.01
- login_tty.02.02
- login_tty.02.03
- login_tty.03
- login_tty.04.01
- login_tty.04.02
- login_tty.05.01
- login_tty.02
This function
- login_tty.02.01
shall create a new session,
- login_tty.02.02
make the terminal the controlling terminal for the current process,
- login_tty.02.03
and set the standard input, output, and error streams of the current process to the terminal
- login_tty.03
If fdr is not the standard input, output or error stream, then login_tty() shall close fdr.
- login_tty.04.01
On success, login_tty() shall return zero;
- login_tty.04.02
otherwise -1 is returned, and errno shall be set appropriately.
- login_tty.05.01
[ENOTTY] fdr does not refer to a terminal device.
- [+]openpty (6 / 5 / 0)
- openpty.01
The openpty() function shall find an available pseudo-terminal and return file descriptors for the master and slave devices in the locations referenced by amaster and aslave respectively.
- openpty.02
If name is not NULL, the filename of the slave shall be placed in the user supplied buffer referenced by name.
- openpty.03
If termp is not NULL, it shall point to a termios structure used to initialize the terminal parameters of the slave pseudo-terminal device.
- openpty.04
If winp is not NULL, it shall point to a winsize structure used to initialize the window size parameters of the slave pseudo-terminal device.
- openpty.05
On success, zero is returned.
- openpty.06
On error, -1 is returned, and errno is set appropriately.
- openpty.06.01
[ENOENT] There are no available pseudo-terminals.
- [+]posix_openpt (9 / 4 / 0)
- app.posix_openpt.01
Values for oflag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>:O_RDWR Open for reading and writing. O_NOCTTY If set posix_openpt() shall not cause the terminal device to become the controlling terminal for the process. The behavior of other values for the oflag argument is unspecified.
- posix_openpt.01
Upon successful completion, the posix_openpt() function shall open a master pseudo-terminal device
The posix_openpt() function shall establish a connection between a master device for a pseudo-terminal and a file descriptor.
- posix_openpt.02
The file status flags and file access modes of the open file description shall be set according to the value of oflag.
- posix_openpt.03
and return a non-negative integer representing the lowest numbered unused file descriptor.
- posix_openpt.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- posix_openpt.05
The posix_openpt() function shall fail if:
- posix_openpt.05.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- posix_openpt.05.02
[ENFILE] The maximum allowable number of files is currently open in the system.
- posix_openpt.06
The posix_openpt() function may fail if:
- posix_openpt.06.01
[EINVAL] The value of oflag is not valid.
- posix_openpt.06.02
[EAGAIN] Out of pseudo-terminal resources.
- posix_openpt.06.03
[ENOSR] [XSR] Out of STREAMS resources.
- [+]ptsname (3 / 3 / 0)
- app.ptsname.01
The fildes argument is a file descriptor that refers to the master device.
- ptsname.01
Upon successful completion, ptsname() shall return a pointer to a string which is the name of the pseudo-terminal slave device.
The ptsname() function shall return a pointer to a string containing the pathname of the corresponding slave device.
The ptsname() function shall return the name of the slave pseudo-terminal device associated with a master pseudo-terminal device.
- ptsname.02
Upon failure, ptsname() shall return a null pointer.
- ptsname.02.01
This could occur if fildes is an invalid file descriptor
- ptsname.02.02
if the slave device name does not exist in the file system.
- [+]tcdrain (9 / 3 / 0)
- tcdrain.01
The tcdrain() function shall block until all output written to the object referred to by fildes is transmitted.
- tcdrain.02.01
Any attempts to use tcdrain() from a process which is a member of a background process group on a fildes associated with its controlling terminal, shall cause the process group to be sent a SIGTTOU signal.
- tcdrain.02.02
If the calling process is blocking or ignoring SIGTTOU signals, the process shall be allowed to perform the operation, and no signal is sent.
- tcdrain.03
Upon successful completion, 0 shall be returned.
- tcdrain.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcdrain.05
The tcdrain() function shall fail if:
- tcdrain.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcdrain.05.02
[EINTR] A signal interrupted tcdrain().
- tcdrain.05.03
[ENOTTY] The file associated with fildes is not a terminal.
- tcdrain.06
The tcdrain() function may fail if:
- tcdrain.06.01
[EIO] The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.
- [+]tcflow (12 / 6 / 0)
- tcflow.01
The tcflow() function shall suspend or restart transmission or reception of data on the object referred to by fildes, depending on the value of action.
- tcflow.01.01
If action is TCOOFF, output shall be suspended.
- tcflow.01.02
If action is TCOON, suspended output shall be restarted.
- tcflow.01.03
If action is TCIOFF, the system shall transmit a STOP character, which is intended to cause the terminal device to stop transmitting data to the system.
- tcflow.01.04
If action is TCION, the system shall transmit a START character, which is intended to cause the terminal device to start transmitting data to the system.
- tcflow.02.01
Attempts to use tcflow() from a process which is a member of a background process group on a fildes associated with its controlling terminal, shall cause the process group to be sent a SIGTTOU signal.
- tcflow.02.02
If the calling process is blocking or ignoring SIGTTOU signals, the process shall be allowed to perform the operation, and no signal is sent.
- tcflow.03
Upon successful completion, 0 shall be returned.
- tcflow.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcflow.05
The tcflow() function shall fail if:
- tcflow.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcflow.05.02
[EINVAL] The action argument is not a supported value.
- tcflow.05.03
[ENOTTY] The file associated with fildes is not a terminal.
- tcflow.06
The tcflow() function may fail if:
- tcflow.06.01
[EIO] The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.
- [+]tcflush (11 / 5 / 0)
- tcflush.01
Upon successful completion, tcflush() shall discard data written to the object referred to by fildes (an open file descriptor associated with a terminal) but not transmitted, or data received but not read, depending on the value of queue_selector:
- tcflush.01.01
If queue_selector is TCIFLUSH, it shall flush data received but not read.
- tcflush.01.02
If queue_selector is TCOFLUSH, it shall flush data written but not transmitted.
- tcflush.01.03
If queue_selector is TCIOFLUSH, it shall flush both data received but not read and data written but not transmitted.
- tcflush.02.01
Attempts to use tcflush() from a process which is a member of a background process group on a fildes associated with its controlling terminal shall cause the process group to be sent a SIGTTOU signal.
- tcflush.02.02
If the calling process is blocking or ignoring SIGTTOU signals, the process shall be allowed to perform the operation, and no signal is sent.
- tcflush.03
Upon successful completion, 0 shall be returned.
- tcflush.04
Otherwise, -1 shall be returned and errno set to indicate the error
- tcflush.05
The tcflush() function shall fail if:
- tcflush.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcflush.05.02
[EINVAL] The queue_selector argument is not a supported value.
- tcflush.05.03
[ENOTTY] The file associated with fildes is not a terminal.
- tcflush.06
The tcflush() function may fail if:
- tcflush.06.01
[EIO] The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.
- [+]tcgetattr (6 / 2 / 0)
- tcgetattr.01
The tcgetattr() function shall get the parameters associated with the terminal referred to by fildes and store them in the termios structure referenced by termios_p.
- tcgetattr.01.01
If the terminal device supports different input and output baud rates, the baud rates stored in the termios structure returned by tcgetattr() shall reflect the actual baud rates, even if they are equal.
- tcgetattr.01.02
If differing baud rates are not supported, the rate returned as the output baud rate shall be the actual baud rate. If the terminal device does not support split baud rates, the input baud rate stored in the termios structure shall be the output rate (as one of the symbolic values).
- app.tcgetattr.01
The termios_p argument is a pointer to a termios structure.
- tcgetattr.02
Upon successful completion, 0 shall be returned.
- tcgetattr.03
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcgetattr.04
The tcgetattr() function shall fail if:
- tcgetattr.04.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcgetattr.04.02
[ENOTTY] The file associated with fildes is not a terminal.
- [+]tcgetpgrp (6 / 1 / 0)
- tcgetpgrp.01
The tcgetpgrp() function shall return the value of the process group ID of the foreground process group associated with the terminal.
- tcgetpgrp.02
If there is no foreground process group, tcgetpgrp() shall return a value greater than 1 that does not match the process group ID of any existing process group.
- tcgetpgrp.03
Upon successful completion, tcgetpgrp() shall return the value of the process group ID of the foreground process associated with the terminal.
- tcgetpgrp.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcgetpgrp.05
The tcgetpgrp() function shall fail if:
- tcgetpgrp.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcgetpgrp.05.02
[ENOTTY] The calling process does not have a controlling terminal, or the file is not the controlling terminal.
- [+]tcgetsid (5 / 2 / 0)
- tcgetsid.01
The tcgetsid() function shall obtain the process group ID of the session for which the terminal specified by fildes is the controlling terminal.
- tcgetsid.02
Upon successful completion, tcgetsid() shall return the process group ID associated with the terminal.
- tcgetsid.03
Otherwise, a value of (pid_t)-1 shall be returned and errno set to indicate the error.
- tcgetsid.04
The tcgetsid() function shall fail if:
- tcgetsid.04.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcgetsid.04.02
[ENOTTY] The calling process does not have a controlling terminal, or the file is not the controlling terminal.
- [+]tcsendbreak (8 / 2 / 0)
- tcsendbreak.01
If the terminal is using asynchronous serial data transmission, tcsendbreak() shall cause transmission of a continuous stream of zero-valued bits for a specific duration.
- tcsendbreak.02.01
Attempts to use tcsendbreak() from a process which is a member of a background process group on a fildes associated with its controlling terminal shall cause the process group to be sent a SIGTTOU signal.
- tcsendbreak.02.02
If the calling process is blocking or ignoring SIGTTOU signals, the process shall be allowed to perform the operation, and no signal is sent.
- tcsendbreak.03
Upon successful completion, 0 shall be returned.
- tcsendbreak.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcsendbreak.05
The tcsendbreak() function shall fail if:
- tcsendbreak.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcsendbreak.05.02
[ENOTTY] The file associated with fildes is not a terminal.
- tcsendbreak.06
The tcsendbreak() function may fail if:
- tcsendbreak.06.01
[EIO] The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.
- [+]tcsetattr (17 / 9 / 0)
- app.tcsetattr.01
The effect of tcsetattr() is undefined if the value of the termios structure pointed to by termios_p was not derived from the result of a call to tcgetattr() on fildes; an application should modify only fields and flags defined by this volume of IEEE Std 1003.1-2001 between the call to tcgetattr() and tcsetattr(), leaving all other fields and flags unmodified.
- tcsetattr.01
The tcsetattr() function shall set the parameters associated with the terminal referred to by the open file descriptor fildes (an open file descriptor associated with a terminal) from the termios structure referenced by termios_p as follows:
- tcsetattr.01.01
If optional_actions is TCSANOW, the change shall occur immediately.
- tcsetattr.01.02
If optional_actions is TCSADRAIN, the change shall occur after all output written to fildes is transmitted. This function should be used when changing parameters that affect output.
- tcsetattr.01.03
If optional_actions is TCSAFLUSH, the change shall occur after all output written to fildes is transmitted, and all input so far received but not read shall be discarded before the change is made.
- tcsetattr.02
If the output baud rate stored in the termios structure pointed to by termios_p is the zero baud rate, B0, the modem control lines shall no longer be asserted. Normally, this shall disconnect the line.
- tcsetattr.03
If the input baud rate stored in the termios structure pointed to by termios_p is 0, the input baud rate given to the hardware is the same as the output baud rate stored in the termios structure.
- tcsetattr.04
The tcsetattr() function shall return successfully if it was able to perform any of the requested actions, even if some of the requested actions could not be performed. It shall set all the attributes that the implementation supports as requested and leave all the attributes not supported by the implementation unchanged.
- tcsetattr.05
If the input and output baud rates differ and are a combination that is not supported, neither baud rate shall be changed.
- tcsetattr.06
The tcsetattr() function shall not change the values found in the termios structure under any circumstances.
- tcsetattr.07
If tcsetattr() is called from a process which is a member of a background process group on a fildes associated with its controlling terminal:
- tcsetattr.07.01
If the calling process is blocking or ignoring SIGTTOU signals, the operation completes normally and no signal is sent.
- tcsetattr.07.02
Otherwise, a SIGTTOU signal shall be sent to the process group.
- tcsetattr.08
Upon successful completion, 0 shall be returned.
- tcsetattr.09
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcsetattr.10
The tcsetattr() function shall fail if:
- tcsetattr.10.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcsetattr.10.02
[EINTR] A signal interrupted tcsetattr().
- tcsetattr.10.03
[EINVAL] The optional_actions argument is not a supported value, or an attempt was made to change an attribute represented in the termios structure to an unsupported value.
If no part of the request can be honored, it shall return -1 and set errno to [EINVAL].
- tcsetattr.10.04
[ENOTTY] The file associated with fildes is not a terminal.
- tcsetattr.11
The tcsetattr() function may fail if:
- tcsetattr.11.01
[EIO] The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.
- [+]tcsetpgrp (8 / 2 / 0)
- tcsetpgrp.01
If the process has a controlling terminal, tcsetpgrp() shall set the foreground process group ID associated with the terminal to pgid_id.
- tcsetpgrp.02.01
If the calling process is blocking or ignoring SIGTTOU signals, the process shall be allowed to perform the operation, and no signal is sent.
Attempts to use tcsetpgrp() from a process which is a member of a background process group on a fildes associated with its controlling terminal shall cause the process group to be sent a SIGTTOU signal.
- tcsetpgrp.03
Upon successful completion, 0 shall be returned.
- tcsetpgrp.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- tcsetpgrp.05
The tcsetpgrp() function shall fail if:
- tcsetpgrp.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- tcsetpgrp.05.02
[EINVAL] This implementation does not support the value in the pgid_id argument.
- tcsetpgrp.05.03
[ENOTTY] The calling process does not have a controlling terminal, or the file is not the controlling terminal, or the controlling terminal is no longer associated with the session of the calling process.
- tcsetpgrp.05.04
[EPERM] The value of pgid_id is a value supported by the implementation, but does not match the process group ID of a process in the same session as the calling process.
- [+]ttyname (6 / 4 / 0)
- ttyname.01
The ttyname() function shall return a pointer to a string containing a null-terminated pathname of the terminal associated with file descriptor fildes.
- ttyname.02
The maximum length of the terminal name shall be {TTY_NAME_MAX}.
- ttyname.03
Upon successful completion, ttyname() shall return a pointer to a string.
- ttyname.04
Otherwise, a null pointer shall be returned and errno set to indicate the error.
- ttyname.05
The ttyname() function may fail if:
- ttyname.05.01
[EBADF] The fildes argument is not a valid file descriptor.
- ttyname.05.02
[ENOTTY] The fildes argument does not refer to a terminal.
- [+]ttyname_r (7 / 4 / 0)
- ttyname_r.01
The ttyname_r() function shall store the null-terminated pathname of the terminal associated with the file descriptor fildes in the character array referenced by name.
- app.ttyname_r.01
The array is namesize characters long and should have space for the name and the terminating null character.
- ttyname_r.02
The maximum length of the terminal name shall be {TTY_NAME_MAX}.
- ttyname_r.03
If successful, the ttyname_r() function shall return zero.
- ttyname_r.04
Otherwise, an error number shall be returned to indicate the error.
- ttyname_r.05
The ttyname_r() function may fail if:
- ttyname_r.05.01
[EBADF] [TSF] The fildes argument is not a valid file descriptor.
- ttyname_r.05.02
[ENOTTY] [TSF] The fildes argument does not refer to a terminal.
- ttyname_r.05.03
[ERANGE] [TSF] The value of namesize is smaller than the length of the string to be returned including the terminating null character.
- [+]unlockpt (5 / 3 / 0)
- unlockpt.01
The unlockpt() function shall unlock the slave pseudo-terminal device associated with the master to which fildes refers.
- unlockpt.02
Upon successful completion, unlockpt() shall return 0.
- unlockpt.03
Otherwise, it shall return -1 and set errno to indicate the error.
- unlockpt.04
The unlockpt() function may fail if:
- unlockpt.04.01
[EBADF] The fildes argument is not a file descriptor open for writing.
- unlockpt.04.02
[EINVAL] The fildes argument is not associated with a master pseudo-terminal device.
- [+]locale.collate (10 / 6 / 0)
- [+]strcoll (4 / 2 / 0)
- strcoll.01
The strcoll() function shall compare the string pointed to by s1 to the string pointed to by s2, both interpreted as appropriate to the LC_COLLATE category of the current locale.
- strcoll.01.01
Upon successful completion, strcoll() shall return an integer greater than, equal to, or less than 0, according to whether the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2 when both are interpreted as appropriate to the current locale.
- strcoll.02
The strcoll() function shall not change the setting of errno if successful.
- app.strcoll.03
Since no return value is reserved to indicate an error, an application wishing to check for error situations should set errno to 0, then call strcoll(), then check errno.
- strcoll.04
[CX] On error, strcoll() may set errno, but no return value is reserved to indicate an error.
- strcoll.05
The strcoll() function may fail if:
- strcoll.05.01
[EINVAL] [CX] The s1 or s2 arguments contain characters outside the domain of the collating sequence.
- [+]strxfrm (6 / 4 / 0)
- strxfrm.01
The strxfrm() function shall transform the string pointed to by s2 and place the resulting string into the array pointed to by s1. The transformation is such that if strcmp() is applied to two transformed strings, it shall return a value greater than, equal to, or less than 0, corresponding to the result of strcoll() applied to the same two original strings.
- strxfrm.02
No more than n bytes are placed into the resulting array pointed to by s1, including the terminating null byte.
- app.strxfrm.03
If n is 0, s1 is permitted to be a null pointer.
- app.strxfrm.04
If copying takes place between objects that overlap, the behavior is undefined.
- strxfrm.05
The strxfrm() function shall not change the setting of errno if successful.
- app.strxfrm.06
Since no return value is reserved to indicate an error, an application wishing to check for error situations should set errno to 0, then call strxfrm(), then check errno.
- strxfrm.07
Upon successful completion, strxfrm() shall return the length of the transformed string (not including the terminating null byte).
- strxfrm.08 (struct)
If the value returned is n or more, the contents of the array pointed to by s1 are unspecified.
- strxfrm.09
[CX] On error, strxfrm() may set errno but no return value is reserved to indicate an error.
- strxfrm.10
The strxfrm() function may fail if:
- strxfrm.10.01
[EINVAL] [CX] The string pointed to by the s2 argument contains characters outside the domain of the collating sequence.
- [+]locale.ctrans (18 / 8 / 0)
- [+]__ctype_tolower_loc (5 / 1 / 0)
- __ctype_tolower_loc.01
The __ctype_tolower_loc() function shall return a pointer into an array of characters in the current locale that contains lower case equivalents for each character in the current character set.
- __ctype_tolower_loc.02
The array shall contain a total of 384 characters,
- __ctype_tolower_loc.03
and can be indexed with any signed or unsigned char (i.e. with an index value between -128 and 255).
- __ctype_tolower_loc.04
If the application is multithreaded, the array shall be local to the current thread.
- __ctype_tolower_loc.05
The __ctype_tolower_loc() function shall return a pointer to the array of characters to be used for the ctype() family of functions (see <ctype.h>).
- [+]__ctype_toupper_loc (5 / 1 / 0)
- __ctype_toupper_loc.01
The __ctype_toupper_loc() function shall return a pointer into an array of characters in the current locale that contains upper case equivalents for each character in the current character set.
- __ctype_toupper_loc.02
The array shall contain a total of 384 characters,
- __ctype_toupper_loc.03
and can be indexed with any signed or unsigned char (i.e. with an index value between -128 and 255).
- __ctype_toupper_loc.04
If the application is multithreaded, the array shall be local to the current thread.
- __ctype_toupper_loc.05
The __ctype_toupper_loc() function shall return a pointer to the array of characters to be used for the ctype() family of functions (see <ctype.h>).
- [+]_tolower (2 / 1 / 0)
- _tolower.01
The _tolower() macro shall be equivalent to tolower(c)
- app._tolower.02
except that the application shall ensure that the argument c is an uppercase letter.
- _tolower.03
Upon successful completion, _tolower() shall return the lowercase letter corresponding to the argument passed.
- [+]_toupper (2 / 1 / 0)
- _toupper.01
The _toupper() macro shall be equivalent to toupper()
- app._toupper.02
except that the application shall ensure that the argument c is a lowercase letter.
- _toupper.03
Upon successful completion, _toupper() shall return the uppercase letter corresponding to the argument passed.
- [+]tolower (2 / 2 / 0)
- app.tolower.01
The tolower() function has as a domain a type int, the value of which is representable as an unsigned char or the value of EOF. If the argument has any other value, the behavior is undefined.
- tolower.02
If the argument of tolower() represents an uppercase letter, and there exists a corresponding lowercase letter [CX] (as defined by character type information in the program locale category LC_CTYPE ), the result shall be the corresponding lowercase letter.
- tolower.02.01
Upon successful completion, tolower() shall return the lowercase letter corresponding to the argument passed;
- tolower.03
All other arguments in the domain are returned unchanged.
- tolower.03.01
otherwise, it shall return the argument unchanged.
- [+]toupper (2 / 2 / 0)
- app.toupper.01
The toupper() function has as a domain a type int, the value of which is representable as an unsigned char or the value of EOF. If the argument has any other value, the behavior is undefined.
- toupper.02
If the argument of toupper() represents a lowercase letter, and there exists a corresponding uppercase letter [CX] (as defined by character type information in the program locale category LC_CTYPE ), the result shall be the corresponding uppercase letter.
- toupper.02.01
Upon successful completion, toupper() shall return the uppercase letter corresponding to the argument passed.
- toupper.03
All other arguments in the domain are returned unchanged.
- [+]locale.ctype (30 / 14 / 0)
- [+]__ctype_b_loc (3 / 2 / 0)
- __ctype_b_loc.01
The __ctype_b_loc() function shall return a pointer into an array of characters in the current locale that contains characteristics for each character in the current character set.
- __ctype_b_loc.02
The array shall contain a total of 384 characters, and can be indexed with any signed or unsigned char (i.e. with an index value between -128 and 255).
- __ctype_b_loc.03
If the application is multithreaded, the array shall be local to the current thread.
- [+]__ctype_get_mb_cur_max (1 / 0 / 0)
- __ctype_get_mb_cur_max.01
__ctype_get_mb_cur_max() returns the maximum length of a multibyte character in the current locale.
- [+]isalnum (2 / 1 / 0)
- isalnum.01
The isalnum() function shall test whether c is a character of class alpha or digit in the program's current locale
- isalnum.01.01
The isalnum() function shall return non-zero if c is an alphanumeric character
- isalnum.01.02
otherwise, it shall return 0.
- app.isalnum.02
The c argument is an int, the value of which the application shall ensure is representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isalpha (2 / 1 / 0)
- isalpha.01
The isalpha() function shall test whether c is a character of class alpha in the program's current locale
- isalpha.01.01
The isalpha() function shall return non-zero if c is an alphabetic character
- isalpha.01.02
otherwise, it shall return 0.
- app.isalpha.02
The c argument is an int, the value of which the application shall ensure is representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isascii (2 / 2 / 0)
- isascii.01
The isascii() function shall test whether c is a 7-bit US-ASCII character code.
- isascii.01.01
The isascii() function shall return non-zero if c is a 7-bit US-ASCII character code between 0 and octal 0177 inclusive
- isascii.01.02
otherwise, it shall return 0.
- app.isascii.02
The isascii() function is defined on all integer values.
- [+]isblank (2 / 1 / 0)
- isblank.01
The isblank() function shall test whether c is a character of class blank in the program's current locale
- isblank.01.01
The isblank() function shall return non-zero if c is a <blank>
- isblank.01.02
otherwise, it shall return 0.
- app.isblank.02
The c argument is a type int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]iscntrl (2 / 0 / 0)
- iscntrl.01
The iscntrl() function shall test whether c is a character of class cntrl in the program's current locale
- iscntrl.01.01
The iscntrl() function shall return non-zero if c is a control character
- iscntrl.01.02
otherwise, it shall return 0.
- app.iscntrl.02
The c argument is a type int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isdigit (2 / 1 / 0)
- isdigit.01
The isdigit() function shall test whether c is a character of class digit in the program's current locale
- isdigit.01.01
The isdigit() function shall return non-zero if c is a decimal digit
- isdigit.01.02
otherwise, it shall return 0.
- app.isdigit.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isgraph (2 / 1 / 0)
- isgraph.01
The isgraph() function shall test whether c is a character of class graph in the program's current locale
- isgraph.01.01
The isgraph() function shall return non-zero if c is a character with a visible representation
- isgraph.01.02
otherwise, it shall return 0.
- app.isgraph.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]islower (2 / 1 / 0)
- islower.01
The islower() function shall test whether c is a character of class lower in the program's current locale
- islower.01.01
The islower() function shall return non-zero if c is a lowercase letter
- islower.01.02
otherwise, it shall return 0.
- app.islower.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isprint (2 / 1 / 0)
- isprint.01
The isprint() function shall test whether c is a character of class print in the program's current locale
- isprint.01.01
The isprint() function shall return non-zero if c is a printable character
- isprint.01.02
otherwise, it shall return 0.
- app.isprint.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]ispunct (2 / 0 / 0)
- ispunct.01
The ispunct() function shall test whether c is a character of class punct in the program's current locale
- ispunct.01.01
The ispunct() function shall return non-zero if c is a punctuation character
- ispunct.01.02
otherwise, it shall return 0.
- app.ispunct.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isspace (2 / 1 / 0)
- isspace.01
The isspace() function shall test whether c is a character of class space in the program's current locale
- isspace.01.01
The isspace() function shall return non-zero if c is a white-space character
- isspace.01.02
otherwise, it shall return 0.
- app.isspace.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isupper (2 / 1 / 0)
- isupper.01
The isupper() function shall test whether c is a character of class upper in the program's current locale
- isupper.01.01
The isupper() function shall return non-zero if c is an uppercase letter
- isupper.01.02
otherwise, it shall return 0.
- app.isupper.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]isxdigit (2 / 1 / 0)
- isxdigit.01
The isxdigit() function shall test whether c is a character of class xdigit in the program's current locale
- isxdigit.01.01
The isxdigit() function shall return non-zero if c is a hexadecimal digit
- isxdigit.01.02
otherwise, it shall return 0.
- app.isxdigit.02
The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.
- [+]locale.iconv (36 / 10 / 0)
- [+]iconv (21 / 6 / 0)
- iconv.01
The iconv() function shall convert the sequence of characters from one codeset, in the array specified by inbuf, into a sequence of corresponding characters in another codeset, in the array specified by outbuf. The codesets are those specified in the iconv_open() call that returned the conversion descriptor, cd.
- app.iconv.02
The inbuf argument points to a variable that points to the first character in the input buffer
- app.iconv.03
inbytesleft indicates the number of bytes to the end of the buffer to be converted.
- app.iconv.04
The outbuf argument points to a variable that points to the first available byte in the output buffer
- app.iconv.05
outbytesleft indicates the number of the available bytes to the end of the buffer.
- iconv.06
For state-dependent encodings, the conversion descriptor cd is placed into its initial shift state by a call for which inbuf is a null pointer, or for which inbuf points to a null pointer.
- iconv.07
When iconv() is called in this way, and if outbuf is not a null pointer or a pointer to a null pointer, and outbytesleft points to a positive value, iconv() shall place, into the output buffer, the byte sequence to change the output buffer to its initial shift state.
- iconv.08
If the output buffer is not large enough to hold the entire reset sequence, iconv() shall fail and set errno to [E2BIG].
- iconv.09
Subsequent calls with inbuf as other than a null pointer or a pointer to a null pointer cause the conversion to take place from the current state of the conversion descriptor.
- iconv.10
If a sequence of input bytes does not form a valid character in the specified codeset, conversion shall stop after the previous successfully converted character.
- iconv.11
If the input buffer ends with an incomplete character or shift sequence, conversion shall stop after the previous successfully converted bytes.
- iconv.12
If the output buffer is not large enough to hold the entire converted input, conversion shall stop just prior to the input bytes that would cause the output buffer to overflow.
- iconv.13
The variable pointed to by inbuf shall be updated to point to the byte following the last byte successfully used in the conversion.
- iconv.14
The value pointed to by inbytesleft shall be decremented to reflect the number of bytes still not converted in the input buffer.
- iconv.15
The variable pointed to by outbuf shall be updated to point to the byte following the last byte of converted output data.
- iconv.16
The value pointed to by outbytesleft shall be decremented to reflect the number of bytes still available in the output buffer.
- iconv.17
For state-dependent encodings, the conversion descriptor shall be updated to reflect the shift state in effect at the end of the last successfully converted byte sequence.
- iconv.19
The iconv() function shall update the variables pointed to by the arguments to reflect the extent of the conversion and return the number of non-identical conversions performed.
- iconv.20
If the entire string in the input buffer is converted, the value pointed to by inbytesleft shall be 0.
- iconv.21
If the input conversion is stopped due to any conditions mentioned above, the value pointed to by inbytesleft shall be non-zero and errno shall be set to indicate the condition.
- iconv.22
If an error occurs, iconv() shall return (size_t)-1 and set errno to indicate the error.
- iconv.23
The iconv() function shall fail if:
- iconv.23.01
[EILSEQ] Input conversion stopped due to an input byte that does not belong to the input codeset.
- iconv.23.02
[E2BIG] Input conversion stopped due to lack of space in the output buffer.
- iconv.23.03
[EINVAL] Input conversion stopped due to an incomplete character or shift sequence at the end of the input buffer.
- iconv.24
The iconv() function may fail if:
- iconv.24.01
[EBADF] The cd argument is not a valid open conversion descriptor.
- [+]iconv_close (5 / 3 / 0)
- iconv_close.01
The iconv_close() function shall deallocate the conversion descriptor cd and all other associated resources allocated by iconv_open().
- iconv_close.02
If a file descriptor is used to implement the type iconv_t, that file descriptor shall be closed.
- iconv_close.03
Upon successful completion, 0 shall be returned;
- iconv_close.04
otherwise, -1 shall be returned and errno set to indicate the error.
- iconv_close.05
The iconv_close() function may fail if:
- iconv_close.05.01
[EBADF] The conversion descriptor is invalid.
- [+]iconv_open (10 / 1 / 0)
- iconv_open.01
The iconv_open() function shall return a conversion descriptor that describes a conversion from the codeset specified by the string pointed to by the fromcode argument to the codeset specified by the string pointed to by the tocode argument.
- iconv_open.02
For state-dependent encodings, the conversion descriptor shall be in a codeset-dependent initial shift state, ready for immediate use with iconv().
- iconv_open.03
A conversion descriptor shall remain valid until it is closed by iconv_close() or an implicit close
- iconv_open.04
If a file descriptor is used to implement conversion descriptors, the FD_CLOEXEC flag shall be set; see <fcntl.h>.
- iconv_open.05
Upon successful completion, iconv_open() shall return a conversion descriptor for use on subsequent calls to iconv().
- iconv_open.06
Otherwise, iconv_open() shall return (iconv_t)-1 and set errno to indicate the error.
- iconv_open.07
The iconv_open() function may fail if:
- iconv_open.07.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- iconv_open.07.02
[ENFILE] Too many files are currently open in the system.
- iconv_open.07.03
[ENOMEM] Insufficient storage space is available.
- iconv_open.07.04
[EINVAL] The conversion specified by fromcode and tocode is not supported by the implementation.
- [+]locale.locale (115 / 0 / 0)
- [+]duplocale (4 / 0 / 0)
- duplocale.01
The duplocale() function shall provide a new locale object based on the locale object provided in locale, suitable for use in the newlocale() or uselocale() functions.
- app.duplocale.02
The new object may be released by calling freelocale().
- duplocale.03
On success, the duplocale() function shall return a locale object.
- duplocale.04
Otherwise, it shall return NULL, and set errno to indicate the error.
- duplocale.05
The duplocale() function shall fail if:
- duplocale.05.01
[ENOMEM] Insufficient memory.
- [+]freelocale (1 / 0 / 0)
- freelocale.01
The freelocale() function shall free the locale object locale, and release any resources associated with it.
- [+]localeconv (79 / 0 / 0)
- localeconv.01 (struct)
The localeconv() function shall set the components of an object with the type struct lconv with the values appropriate for the formatting of numeric quantities (monetary and otherwise) according to the rules of the current locale.
- localeconv.02
The members of the structure with type char * are pointers to strings, any of which (except decimal_point) can point to "", to indicate that the value is not available in the current locale or is of zero length.
- localeconv.02.01
char *decimal_point The radix character used to format non-monetary quantities.
- localeconv.02.02
char *thousands_sep The character used to separate groups of digits before the decimal-point character in formatted non-monetary quantities.
- localeconv.02.03
char *grouping A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted non-monetary quantities.
- localeconv.02.04
char *int_curr_symbol The international currency symbol applicable to the current locale. The first three characters contain the alphabetic international currency symbol in accordance with those specified in the ISO 4217:2001 standard. The fourth character (immediately preceding the null byte) is the character used to separate the international currency symbol from the monetary quantity.
- localeconv.02.05
char *currency_symbol The local currency symbol applicable to the current locale.
- localeconv.02.06
char *mon_decimal_point The radix character used to format monetary quantities.
- localeconv.02.07
char *mon_thousands_sep The separator for groups of digits before the decimal-point in formatted monetary quantities.
- localeconv.02.08
char *mon_grouping A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted monetary quantities.
- localeconv.02.09
char *positive_sign The string used to indicate a non-negative valued formatted monetary quantity.
- localeconv.02.10
char *negative_sign The string used to indicate a negative valued formatted monetary quantity.
- localeconv.03
The members with type char are non-negative numbers, any of which can be {CHAR_MAX} to indicate that the value is not available in the current locale.
- localeconv.03.01
char int_frac_digits The number of fractional digits (those after the decimal-point) to be displayed in an internationally formatted monetary quantity.
- localeconv.03.02
char frac_digits The number of fractional digits (those after the decimal-point) to be displayed in a formatted monetary quantity.
- localeconv.03.03
char p_cs_precedes Set to 1 if the currency_symbol precedes the value for a non-negative formatted monetary quantity. Set to 0 if the symbol succeeds the value.
- localeconv.03.04
char p_sep_by_space Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a non-negative formatted monetary quantity.
- localeconv.03.05
char n_cs_precedes Set to 1 if the currency_symbol precedes the value for a negative formatted monetary quantity. Set to 0 if the symbol succeeds the value.
- localeconv.03.06
char n_sep_by_space Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a negative formatted monetary quantity.
- localeconv.03.07
char p_sign_posn Set to a value indicating the positioning of the positive_sign for a non-negative formatted monetary quantity.
- localeconv.03.08
char n_sign_posn Set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity.
- localeconv.03.09
char int_p_cs_precedes Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a non-negative internationally formatted monetary quantity.
- localeconv.03.10
char int_n_cs_precedes Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a negative internationally formatted monetary quantity.
- localeconv.03.11
char int_p_sep_by_space Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a non-negative internationally formatted monetary quantity.
- localeconv.03.12
char int_n_sep_by_space Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a negative internationally formatted monetary quantity.
- localeconv.03.13
char int_p_sign_posn Set to a value indicating the positioning of the positive_sign for a non-negative internationally formatted monetary quantity.
- localeconv.03.14
char int_n_sign_posn Set to a value indicating the positioning of the negative_sign for a negative internationally formatted monetary quantity.
- localeconv.04
The members include the following:
- localeconv.04.01
char *decimal_point The radix character used to format non-monetary quantities.
- localeconv.04.02
char *thousands_sep The character used to separate groups of digits before the decimal-point character in formatted non-monetary quantities.
- localeconv.04.03
char *grouping A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted non-monetary quantities.
- localeconv.04.03.01
The elements of grouping and mon_grouping are interpreted according to the following:
- localeconv.04.03.01.01
{CHAR_MAX} No further grouping is to be performed.
- localeconv.04.03.01.02
0 The previous element is to be repeatedly used for the remainder of the digits.
- localeconv.04.03.01.03
other The integer value is the number of digits that comprise the current group. The next element is examined to determine the size of the next group of digits before the current group.
- localeconv.04.04
char *int_curr_symbol The international currency symbol applicable to the current locale. The first three characters contain the alphabetic international currency symbol in accordance with those specified in the ISO 4217:2001 standard. The fourth character (immediately preceding the null byte) is the character used to separate the international currency symbol from the monetary quantity.
- localeconv.04.05
char *currency_symbol The local currency symbol applicable to the current locale.
- localeconv.04.06
char *mon_decimal_point The radix character used to format monetary quantities.
- localeconv.04.07
char *mon_thousands_sep The separator for groups of digits before the decimal-point in formatted monetary quantities.
- localeconv.04.08
char *mon_grouping A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted monetary quantities.
- localeconv.04.08.01
The elements of grouping and mon_grouping are interpreted according to the following:
- localeconv.04.08.01.01
{CHAR_MAX} No further grouping is to be performed.
- localeconv.04.08.01.02
0 The previous element is to be repeatedly used for the remainder of the digits.
- localeconv.04.08.01.03
other The integer value is the number of digits that comprise the current group. The next element is examined to determine the size of the next group of digits before the current group.
- localeconv.04.09
char *positive_sign The string used to indicate a non-negative valued formatted monetary quantity.
- localeconv.04.10
char *negative_sign The string used to indicate a negative valued formatted monetary quantity.
- localeconv.04.11
char int_frac_digits The number of fractional digits (those after the decimal-point) to be displayed in an internationally formatted monetary quantity.
- localeconv.04.12
char frac_digits The number of fractional digits (those after the decimal-point) to be displayed in a formatted monetary quantity.
- localeconv.04.13
char p_cs_precedes Set to 1 if the currency_symbol precedes the value for a non-negative formatted monetary quantity. Set to 0 if the symbol succeeds the value.
- localeconv.04.14
char p_sep_by_space Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a non-negative formatted monetary quantity.
- localeconv.04.14.01
The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, and int_n_sep_by_space are interpreted according to the following:
- localeconv.04.14.01.01
0 No space separates the currency symbol and value.
- localeconv.04.14.01.02
1 If the currency symbol and sign string are adjacent, a space separates them from the value; otherwise, a space separates the currency symbol from the value.
- localeconv.04.14.01.03
2 If the currency symbol and sign string are adjacent, a space separates them; otherwise, a space separates the sign string from the value.
- localeconv.04.15
char n_cs_precedes Set to 1 if the currency_symbol precedes the value for a negative formatted monetary quantity. Set to 0 if the symbol succeeds the value.
- localeconv.04.16
char n_sep_by_space Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a negative formatted monetary quantity.
- localeconv.04.16.01
The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, and int_n_sep_by_space are interpreted according to the following:
- localeconv.04.16.01.01
0 No space separates the currency symbol and value.
- localeconv.04.16.01.02
1 If the currency symbol and sign string are adjacent, a space separates them from the value; otherwise, a space separates the currency symbol from the value.
- localeconv.04.16.01.03
2 If the currency symbol and sign string are adjacent, a space separates them; otherwise, a space separates the sign string from the value.
- localeconv.04.17
char p_sign_posn Set to a value indicating the positioning of the positive_sign for a non-negative formatted monetary quantity.
- localeconv.04.17.01
The values of p_sign_posn, n_sign_posn, int_p_sign_posn, and int_n_sign_posn are interpreted according to the following:
- localeconv.04.17.01.01
0 Parentheses surround the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.17.01.02
1 The sign string precedes the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.17.01.03
2 The sign string succeeds the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.17.01.04
3 The sign string immediately precedes the currency_symbol or int_curr_symbol.
- localeconv.04.17.01.05
4 The sign string immediately succeeds the currency_symbol or int_curr_symbol.
- localeconv.04.18
char n_sign_posn Set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity.
- localeconv.04.18.01
The values of p_sign_posn, n_sign_posn, int_p_sign_posn, and int_n_sign_posn are interpreted according to the following:
- localeconv.04.18.01.01
0 Parentheses surround the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.18.01.02
1 The sign string precedes the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.18.01.03
2 The sign string succeeds the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.18.01.04
3 The sign string immediately precedes the currency_symbol or int_curr_symbol.
- localeconv.04.18.01.05
4 The sign string immediately succeeds the currency_symbol or int_curr_symbol.
- localeconv.04.19
char int_p_cs_precedes Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a non-negative internationally formatted monetary quantity.
- localeconv.04.20
char int_n_cs_precedes Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a negative internationally formatted monetary quantity.
- localeconv.04.21
char int_p_sep_by_space Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a non-negative internationally formatted monetary quantity.
- localeconv.04.21.01
The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, and int_n_sep_by_space are interpreted according to the following:
- localeconv.04.21.01.01
0 No space separates the currency symbol and value.
- localeconv.04.21.01.02
1 If the currency symbol and sign string are adjacent, a space separates them from the value; otherwise, a space separates the currency symbol from the value.
- localeconv.04.21.01.03
2 If the currency symbol and sign string are adjacent, a space separates them; otherwise, a space separates the sign string from the value.
- localeconv.04.21.02
For int_p_sep_by_space and int_n_sep_by_space, the fourth character of int_curr_symbol is used instead of a space.
- localeconv.04.22
char int_n_sep_by_space Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a negative internationally formatted monetary quantity.
- localeconv.04.22.01
The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, and int_n_sep_by_space are interpreted according to the following:
- localeconv.04.22.01.01
0 No space separates the currency symbol and value.
- localeconv.04.22.01.02
1 If the currency symbol and sign string are adjacent, a space separates them from the value; otherwise, a space separates the currency symbol from the value.
- localeconv.04.22.01.03
2 If the currency symbol and sign string are adjacent, a space separates them; otherwise, a space separates the sign string from the value.
- localeconv.04.22.02
For int_p_sep_by_space and int_n_sep_by_space, the fourth character of int_curr_symbol is used instead of a space.
- localeconv.04.23
char int_p_sign_posn Set to a value indicating the positioning of the positive_sign for a non-negative internationally formatted monetary quantity.
- localeconv.04.23.01
The values of p_sign_posn, n_sign_posn, int_p_sign_posn, and int_n_sign_posn are interpreted according to the following:
- localeconv.04.23.01.01
0 Parentheses surround the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.23.01.02
1 The sign string precedes the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.23.01.03
2 The sign string succeeds the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.23.01.04
3 The sign string immediately precedes the currency_symbol or int_curr_symbol.
- localeconv.04.23.01.05
4 The sign string immediately succeeds the currency_symbol or int_curr_symbol.
- localeconv.04.24
char int_n_sign_posn Set to a value indicating the positioning of the negative_sign for a negative internationally formatted monetary quantity.
- localeconv.04.24.01
The values of p_sign_posn, n_sign_posn, int_p_sign_posn, and int_n_sign_posn are interpreted according to the following:
- localeconv.04.24.01.01
0 Parentheses surround the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.24.01.02
1 The sign string precedes the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.24.01.03
2 The sign string succeeds the quantity and currency_symbol or int_curr_symbol.
- localeconv.04.24.01.04
3 The sign string immediately precedes the currency_symbol or int_curr_symbol.
- localeconv.04.24.01.05
4 The sign string immediately succeeds the currency_symbol or int_curr_symbol.
- localeconv.06
The localeconv() function shall return a pointer to the filled-in object.
- [+]newlocale (8 / 0 / 0)
- newlocale.01
The newlocale() function shall initialize a locale object.
- newlocale.02
If base is NULL, then newlocale() shall first allocate the object;
- newlocale.03
otherwise it shall use the locale object referenced by base.
- newlocale.04
The object shall be initialized for the locale named by locale, and for the categories selected in category_mask.
- app.newlocale.05
The category_mask value is a bitwise inclusive OR of the required LC_name_MASK values, or the value LC_ALL_MASK.
- newlocale.06
On success, the newlocale() function shall return the initialized locale object.
- newlocale.07
Otherwise, it shall return NULL, and set errno to indicate the error.
- newlocale.08
The newlocale() function shall fail if:
- newlocale.08.01
[ENOMEM] Insufficient memory.
- newlocale.08.02
[EINVAL] An invalid category_mask was provided, or the locale was NULL.
- [+]nl_langinfo (3 / 0 / 0)
- nl_langinfo.01
The nl_langinfo() function shall return a pointer to a string containing information relevant to the particular language or cultural area defined in the program's locale (see <langinfo.h>). The manifest constant names and values of item are defined in <langinfo.h>.
- nl_langinfo.03
In a locale where langinfo data is not defined, nl_langinfo() shall return a pointer to the corresponding string in the POSIX locale.
- nl_langinfo.04
In all locales, nl_langinfo() shall return a pointer to an empty string if item contains an invalid setting.
- [+]setlocale (16 / 0 / 0)
- setlocale.01
The setlocale() function selects the appropriate piece of the program's locale, as specified by the category and locale arguments, and may be used to change or query the program's entire locale or portions thereof.
- setlocale.02
other values for category name only a part of the program's locale:
- setlocale.02.01
The value LC_ALL for category names the program's entire locale;
- setlocale.02.02
LC_COLLATE Affects the behavior of regular expressions and the collation functions.
- setlocale.02.03
LC_CTYPE Affects the behavior of regular expressions, character classification, character conversion functions, and wide-character functions.
- setlocale.02.04
LC_MESSAGES [CX] Affects what strings are expected by commands and utilities as affirmative or negative responses. [XSI] It also affects what strings are given by commands and utilities as affirmative or negative responses, and the content of messages.
- setlocale.02.05
LC_MONETARY Affects the behavior of functions that handle monetary values.
- setlocale.02.06
LC_NUMERIC Affects the behavior of functions that handle numeric values.
- setlocale.02.07
LC_TIME Affects the behavior of the time conversion functions.
- app.setlocale.03
The locale argument is a pointer to a character string containing the required setting of category. The contents of this string are implementation-defined. In addition, the following preset values of locale are defined for all settings of category:
- app.setlocale.03.01
"POSIX" [CX] Specifies the minimal environment for C-language translation called the POSIX locale. If setlocale() is not invoked, the POSIX locale is the default at entry to main().
- app.setlocale.03.02
"C" Equivalent to "POSIX".
- app.setlocale.03.03
"" Specifies an implementation-defined native environment. [CX] The determination of the name of the new locale for the specified category depends on the value of the associated environment variables, LC_* and LANG ; see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale and the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables.
- app.setlocale.03.04
A null pointer Used to direct setlocale() to query the current internationalized environment and return the name of the locale.
- setlocale.04
Setting all of the categories of the locale of the process is similar to successively setting each individual category of the locale of the process, except that all error checking is done before any actions are performed. To set all the categories of the locale of the process, setlocale() is invoked as:
setlocale(LC_ALL, "");
- setlocale.04.01
In this case, setlocale() shall first verify that the values of all the environment variables it needs according to the precedence rules (described in the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables) indicate supported locales. If the value of any of these environment variable searches yields a locale that is not supported (and non-null), setlocale() shall return a null pointer and the locale of the process shall not be changed.
- setlocale.04.02
If all environment variables name supported locales, setlocale() shall proceed as if it had been called for each category, using the appropriate value from the associated environment variable or from the implementation-defined default if there is no such value.
- setlocale.08
The locale state is common to all threads within a process.
- setlocale.09
Upon successful completion, setlocale() shall return the string associated with the specified category for the new locale.
- setlocale.10
Otherwise, setlocale() shall return a null pointer and the program's locale is not changed.
- setlocale.11.1
A null pointer for locale causes setlocale() to return a pointer to the string associated with the category for the program's current locale.
- setlocale.11.2
The program's locale shall not be changed.
- setlocale.12
The string returned by setlocale() is such that a subsequent call with that string and its associated category shall restore that part of the program's locale.
- [+]uselocale (4 / 0 / 0)
- uselocale.01
The uselocale() function shall set the locale for the calling thread to the locale specified by newloc.
- uselocale.02
If newloc is the value LC_GLOBAL_LOCALE, the thread's locale shall be set to the process current global locale, as set by setlocale().
- uselocale.03
If newloc is NULL, the thread's locale is not altered.
- uselocale.04
The uselocale() function shall return the previous locale, or LC_GLOBAL_LOCALE if the thread local locale has not been previously set.
- [+]locale.messages (18 / 4 / 0)
- [+]perror (5 / 2 / 0)
- perror.01
The perror() function shall map the error number accessed through the symbol errno to a language-dependent error message,
Generalizes:
- &perror.02.02
- perror.02.01
- perror.02.02
- perror.03
- perror.04
- perror.05
- perror.02
which shall be written to the standard error stream as follows:
- perror.02.01
First (if s is not a null pointer and the character pointed to by s is not the null byte), the string pointed to by s followed by a colon and a <space>.
- perror.02.02
Then an error message string followed by a <newline>.
The contents of the error message strings shall be the same as those returned by strerror() with argument errno.
- perror.03
[CX] The perror() function shall mark the file associated with the standard error stream as having been written (st_ctime, st_mtime marked for update) at some time between its successful completion and exit(), abort(), or the completion of fflush() or fclose() on stderr.
- perror.04
The perror() function shall not change the orientation of the standard error stream.
- perror.05 (struct)
The perror() function shall not return a value.
- [+]strerror (7 / 1 / 0)
- strerror.01
The strerror() function shall map the error number in errnum to a locale-dependent error message string and shall return a pointer to it.
Generalizes:
- &strerror.12
- strerror.02
- strerror.04
- strerror.05
- strerror.06
- strerror.07
- strerror.10
- strerror.11
- strerror.12.01
- strerror.02
strerror() shall map any value of type int to a message.
- app.strerror.03 (struct)
The string pointed to shall not be modified by the application,
- strerror.04 (struct)
but may be overwritten by a subsequent call to strerror() [CX] or perror().
- strerror.05
[CX] The contents of the error message strings returned by strerror() should be determined by the setting of the LC_MESSAGES category in the current locale.
- strerror.06
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls strerror().
- strerror.07
[CX] The strerror() function shall not change the setting of errno if successful.
- app.strerror.09
The strerror() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- strerror.10
Upon successful completion, strerror() shall return a pointer to the generated message string.
- strerror.11 (struct)
but no return value is reserved to indicate an error.
- strerror.12
These functions may fail if:
- strerror.12.01
[EINVAL] The value of errnum is not a valid error number.
- [+]strerror_r (6 / 1 / 0)
- strerror_r.01
strerror() shall map any value of type int to a message.
- strerror_r.02
[TSF] The strerror_r() function shall map the error number in errnum to a locale-dependent error message string and shall return the string in the buffer pointed to by strerrbuf, with length buflen.
- strerror_r.03
Upon successful completion, strerror_r() shall return 0.
- strerror_r.04
Otherwise, an error number shall be returned to indicate the error.
- strerror_r.05
These functions may fail if:
- strerror_r.05.01
[EINVAL] The value of errnum is not a valid error number.
- strerror_r.05.02
[ERANGE] [TSF] Insufficient storage was supplied via strerrbuf and buflen to contain the generated message string.
- [+]locale.nlcat (42 / 2 / 0)
- [+]catclose (5 / 0 / 0)
- catclose.01
The catclose() function shall close the message catalog identified by catd.
Generalizes:
- catclose.03
- catclose.04
- catclose.05.01
- catclose.05.02
- catclose.03
Upon successful completion, catclose() shall return 0;
- catclose.04
otherwise, -1 shall be returned, and errno set to indicate the error.
- catclose.05
The catclose() function may fail if:
- catclose.05.01
[EBADF] The catalog descriptor is not valid.
- catclose.05.02
[EINTR] The catclose() function was interrupted by a signal.
- [+]catgets (8 / 1 / 0)
- catgets.01
The catgets() function shall attempt to read message msg_id, in set set_id, from the message catalog identified by catd.
Generalizes:
- catgets.03
- catgets.04
- catgets.05.01
- catgets.05.02
- catgets.05.03
- catgets.05.04
- catgets.05.05
- app.catgets.02
The catgets() function need not be reentrant.
- catgets.03
If the identified message is retrieved successfully, catgets() shall return a pointer to an internal buffer area containing the null-terminated message string.
- catgets.04
If the call is unsuccessful for any reason, s shall be returned and errno may be set to indicate the error.
- catgets.05
The catgets() function may fail if:
- catgets.05.01
[EBADF] The catd argument is not a valid message catalog descriptor open for reading.
- catgets.05.02
[EBADMSG] The message identified by set_id and msg_id in the specified message catalog did not satisfy implementation-defined security criteria.
- catgets.05.03
[EINTR] The read operation was terminated due to the receipt of a signal, and no data was transferred.
- catgets.05.04
[EINVAL] The message catalog identified by catd is corrupted.
- catgets.05.05
[ENOMSG] The message identified by set_id and msg_id is not in the message catalog.
- [+]catopen (29 / 1 / 0)
- catopen.01
The catopen() function shall open a message catalog and return a message catalog descriptor.
Generalizes:
- &catopen.04.01
- &catopen.04.02
- catopen.02.01
- catopen.02.02
- catopen.04
- catopen.05
- catopen.06
- catopen.07
- catopen.08
- catopen.09
- catopen.10.01
- catopen.10.02
- catopen.10.03
- catopen.10.04
- catopen.10.05
- catopen.10.06
- catopen.10.07
- catopen.10.08
- catopen.11
- catopen.12.01
- catopen.12.02
- catopen.12.03
- catopen.12.04
- catopen.12.05
- catopen.12.06
- catopen.13
- catopen.14
- catopen.15
- catopen.16
- catopen.17
- catopen.02
The name argument specifies the name of the message catalog to be opened.
- catopen.02.01
If name contains a '/', then name specifies a complete name for the message catalog.
- catopen.02.02
Otherwise, the environment variable NLSPATH is used with name substituted for the %N conversion specification (see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables).
- app.catopen.03
If NLSPATH exists in the environment when the process starts, then if the process has appropriate privileges, the behavior of catopen() is undefined.
- catopen.04
If NLSPATH does not exist in the environment, or if a message catalog cannot be found in any of the components specified by NLSPATH , then an implementation-defined default path shall be used.
- catopen.05
A message catalog descriptor shall remain valid in a process until that process closes it, or a successful call to one of the exec functions.
- catopen.06
A change in the setting of the LC_MESSAGES category may invalidate existing open catalogs.
- catopen.07
If a file descriptor is used to implement message catalog descriptors, the FD_CLOEXEC flag shall be set; see <fcntl.h>.
- catopen.08
Upon successful completion, catopen() shall return a message catalog descriptor for use on subsequent calls to catgets() and catclose().
- catopen.09
Otherwise, catopen() shall return ( nl_catd) -1 and set errno to indicate the error.
- catopen.10
The catopen() function may fail if:
- catopen.10.01
[EACCES] Search permission is denied for the component of the path prefix of the message catalog or read permission is denied for the message catalog.
- catopen.10.02
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- catopen.10.03
[ENAMETOOLONG] The length of a pathname of the message catalog exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- catopen.10.04
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- catopen.10.05
[ENFILE] Too many files are currently open in the system.
- catopen.10.06
[ENOENT] The message catalog does not exist or the name argument points to an empty string.
- catopen.10.07
[ENOMEM] Insufficient storage space is available.
- catopen.10.08
[ENOTDIR] A component of the path prefix of the message catalog is not a directory.
- catopen.11
defines that catopen() should look for all message catalogs in the directory /system/nlslib, where the catalog name should be constructed from the name parameter passed to catopen() ( %N ), with the suffix .cat.
- catopen.12
Conversion specifications consist of a '%' symbol, followed by a single-letter keyword. The following keywords are currently defined:
- catopen.12.01
%N The value of the name parameter passed to catopen().
- catopen.12.02
%L The value of the LC_MESSAGES category.
- catopen.12.03
%l The language element from the LC_MESSAGES category.
- catopen.12.04
%t The territory element from the LC_MESSAGES category.
- catopen.12.05
%c The codeset element from the LC_MESSAGES category.
- catopen.12.06
%% A single '%' character.
- catopen.13
An empty string is substituted if the specified value is not currently defined.
- catopen.14
The separators underscore ( '_' ) and period ( '.' ) are not included in the %t and %c conversion specifications.
- catopen.15
Templates defined in NLSPATH are separated by colons ( ':' ).
- catopen.16
A leading or two adjacent colons "::" is equivalent to specifying %N.
- catopen.17
indicates to catopen() that it should look for the requested message catalog in name, name.cat, and /nlslib/category/name.cat, where category is the value of the LC_MESSAGES category of the current locale.
- [+]locale.textdomain (86 / 56 / 0)
- [+]bind_textdomain_codeset (14 / 9 / 0)
- bind_textdomain_codeset.01
The bind_textdomain_codeset() function can be used to specify the output codeset for message catalogs for domain domainname.
- app.bind_textdomain_codeset.02
The codeset argument shall be a valid codeset name which can be used tor the iconv_open function, or a null pointer.
- bind_textdomain_codeset.03
If the codeset argument is the null pointer, then function returns the currently selected codeset for the domain with the name domainname.
- bind_textdomain_codeset.04
It shall return a null pointer if no codeset has yet been selected.
- bind_textdomain_codeset.05
Each successive call to bind_textdomain_codeset() function overrrides the settings made by the preceding call with the same domainname.
- bind_textdomain_codeset.06
The bind_textdomain_codeset() function shall return a pointer to a string containing the name of the selected codeset.
- bind_textdomain_codeset.07
The string
- bind_textdomain_codeset.07.01
shall be allocated internally in the function
- app.bind_textdomain_codeset.08
The string
- bind_textdomain_codeset.11
The domainname argument is applied to the currently active LC_MESSAGE locale.
- bind_textdomain_codeset.14
The name of the output codeset for the selected domain
- bind_textdomain_codeset.15
or NULL to select the current codeset.
- bind_textdomain_codeset.16
If domainname is the null pointer, or is an empty string, bind_textdomain_codeset()
- bind_textdomain_codeset.16.01
shall fail
- bind_textdomain_codeset.16.02
need not set errno.
- bind_textdomain_codeset.17
Returns the currently selected codeset name.
- bind_textdomain_codeset.18
It returns a null pointer if no codeset has yet been selected.
- bind_textdomain_codeset.19
[ENOMEM] Insufficient memory available to allocate return value.
- [+]bindtextdomain (11 / 9 / 0)
- bindtextdomain.01
The bindtextdomain() shall set the the base directory of the hierarchy containing message catalogs for a given message domain.
- bindtextdomain.01.01
The bindtextdomain() function specifies that the domainname message catalog can be found in the dirname directory hierarchy, rather than in the system default locale data base.
- bindtextdomain.02
If dirname is not NULL, the base directory for message catalogs belonging to domain domainname shall be set to dirname.
- bindtextdomain.03
If dirname is NULL, the base directory for message catalogs shall not be altered.
- bindtextdomain.05
If domainname is the null pointer, or is an empty string, bindtextdomain()
- bindtextdomain.05.01
shall fail
- bindtextdomain.05.02
need not set errno.
- bindtextdomain.06
The bindtextdomain() function shall return a pointer to a string containing the name of the selected directory.
- bindtextdomain.07
The string
- bindtextdomain.07.01
shall be allocated internally in the function
- bindtextdomain.08
On success, bindtextdomain() shall return a pointer to a string containing the directory pathname currently bound to the domain.
- bindtextdomain.09
On failure,
- bindtextdomain.09.01
a NULL pointer is returned
- bindtextdomain.09.02
the global variable errno may be set to indicate the error.
- bindtextdomain.10
[ENOMEM] Insufficient memory was available.
- [+]dcgettext (9 / 5 / 0)
- dcgettext.01
The dcgettext() function shall lookup the translation in the current locale of the message identified by msgid in the domain specified by domainname and in the locale category specified by category.
- dcgettext.02
If domainname is NULL, the current default domain shall be used.
- app.dcgettext.03
The msgid argument shall be a NULL-terminated string to be matched in the catalogue.
- dcgettext.04
category shall specify the locale category to be used for retrieving message strings.
- dcgettext.05
The category parameter shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME.
- dcgettext.06
The default domain shall not be changed by a call to dcgettext().
- dcgettext.07
If a translation was found in one of the specified catalogs, it shall be converted to the current locale's codeset and returned.
- dcgettext.08
The resulting NULL-terminated string
- dcgettext.08.01
shall be allocated by the dcgettext function
- dcgettext.10
If no translation was found, or category was invalid, msgid shall be returned.
- dcgettext.11
dcgettext() shall not modify the errno global variable.
- [+]dcngettext (12 / 8 / 0)
- dcngettext.01
The dcngettext() function shall lookup the translation in the current locale of the message identified by msgid1 in the domain specified by domainname and in the locale category specified by category.
- dcngettext.02
If domainname is NULL, the current default domain shall be used.
- app.dcngettext.03
The msgid1 argument shall be a NULL-terminated string to be matched in the catalogue.
- dcngettext.04
category shall specify the locale category to be used for retrieving message strings.
- dcngettext.05
The category parameter shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME.
- dcngettext.06
The default domain shall not be changed by a call to dcngettext().
- dcngettext.07
If n is 1 then the singular version of the message is returned
- dcngettext.08
otherwise one of the plural forms is returned, depending on the value of n and the current locale settings.
- dcngettext.09
If a translation corresponding to the value of n was found in one of the specified catalogs for msgid1, it shall be converted to the current locale's codeset and returned.
- dcngettext.10
The resulting NULL-terminated string
- dcngettext.10.01
shall be allocated by the dcngettext() function
- dcngettext.12
If no translation was found, or category was invalid, msgid1 shall be returned if n has the value 1
- dcngettext.13
otherwise msgid2 shall be returned.
- dcngettext.14
dcngettext() shall not modify the errno global variable.
- [+]dgettext (7 / 4 / 0)
- dgettext.01
The dgettext() function shall search the currently selected message catalogs in the domain domainname for a string identified by the string msgid.
- dgettext.02
If a string is located, that string shall be returned. The domain specified by domainname applies to the currently active LC_MESSAGE locale.
- dgettext.03
The default domain shall not be changed by a call to dgettext().
- dgettext.05
The dgettext() function is equivalent to dcgettext(domainname, msgid, LC_MESSAGES).
- dgettext.06
On success of a msgid query, the translated NULL-terminated string is returned.
- dgettext.07
On error, the original msgid is returned.
- dgettext.09
dgettext() shall not modify the errno global variable.
- [+]dngettext (11 / 7 / 0)
- dngettext.01
The dcngettext() function shall lookup the translation in the current locale of the message identified by msgid1 in the domain specified by domainname and in the locale category specified by category.
- dngettext.02
If domainname is NULL, the current default domain shall be used.
- app.dngettext.03
The msgid1 argument shall be a NULL-terminated string to be matched in the catalogue.
- dngettext.06
The default domain shall not be changed by a call to dcngettext().
- dngettext.07
If n is 1 then the singular version of the message is returned
- dngettext.08
otherwise one of the plural forms is returned, depending on the value of n and the current locale settings.
- dngettext.09
If a translation corresponding to the value of n was found in one of the specified catalogs for msgid1, it shall be converted to the current locale's codeset and returned.
- dngettext.10
The resulting NULL-terminated string
- dngettext.10.01
shall be allocated by the dcngettext() function
- dngettext.12
If no translation was found, or category was invalid, msgid1 shall be returned if n has the value 1
- dngettext.13
otherwise msgid2 shall be returned.
- dngettext.14
dcngettext() shall not modify the errno global variable.
- dngettext.30
dngettext() shall be equivalent to a call to dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES)
- [+]gettext (6 / 4 / 0)
- gettext.01
The gettext() function shall search the currently selected message catalogs for a string identified by the string msgid.
- gettext.02
If a string is located, that string shall be returned.
- gettext.03
The gettext() function is equivalent to dcgettext(NULL, msgid, LC_MESSAGES).
- gettext.04
If a string is found in the currently selected message catalogs for msgid, then a pointer to that string shall be returned.
- gettext.05
Otherwise, a pointer to msgid shall be returned.
- gettext.07
The gettext() function shall not modify errno.
- [+]ngettext (9 / 5 / 0)
- ngettext.01
The ngettext() function shall search the currently selected message catalogs for a string matching the singular string msgid1.
- ngettext.02
If a string is located, and if n is 1, that string shall be returned.
- ngettext.03
If n is not 1, a pluralized version (dependent on n) of the string shall be returned.
- ngettext.05
The ngettext() function is equivalent to dcngettext(NULL, msgid1, msgid2, n, LC_MESSAGES)().
- ngettext.06
If a string is found in the currently selected message catalogs for msgid1, then
- ngettext.06.01
if n is 1 a pointer to the located string shall be returned.
- ngettext.06.02
If n is not 1, a pointer to an appropriately pluralized version of the string shall be returned.
- ngettext.07
If no message could be found in the currently selected mesage catalogs, then if n is 1, a pointer to msgid1 shall be returned
- ngettext.08
otherwise a pointer to msgid2 shall be returned.
- ngettext.10
The ngettext() function shall not modify errno.
- [+]textdomain (7 / 5 / 0)
- textdomain.01
The textdomain() function shall set the current default message domain to domainname.
- textdomain.02
If domainname is NULL, the default message domain shall not be altered.
- textdomain.03
If domainname is "", textdomain() shall reset the default domain to the system default of "messages".
- textdomain.04
On success, textdomain() shall return the currently selected domain.
- textdomain.05
Otherwise, a null pointer shall be returned
- textdomain.06
and errno is set to indicate the error.
- textdomain.07
[ENOMEM] Insufficent memory available.
- [+]locale.wcollate (11 / 7 / 0)
- [+]wcscoll (4 / 2 / 0)
- wcscoll.01
The wcscoll() function shall compare the wide-character string pointed to by ws1 to the wide-character string pointed to by ws2, both interpreted as appropriate to the LC_COLLATE category of the current locale.
- wcscoll.01.01
Upon successful completion, wcscoll() shall return an integer greater than, equal to, or less than 0, according to whether the wide-character string pointed to by ws1 is greater than, equal to, or less than the wide-character string pointed to by ws2, when both are interpreted as appropriate to the current locale.
- wcscoll.02
The wcscoll() function shall not change the setting of errno if successful.
- app.wcscoll.03
An application wishing to check for error situations should set errno to 0 before calling wcscoll(). If errno is non-zero on return, an error has occurred.
- wcscoll.04
On error, wcscoll() shall set errno, but no return value is reserved to indicate an error.
- wcscoll.05
The wcscoll() function may fail if:
- wcscoll.05.01
[EINVAL] [CX] The ws1 or ws2 arguments contain wide-character codes outside the domain of the collating sequence.
- [+]wcsxfrm (7 / 5 / 0)
- wcsxfrm.01
The wcsxfrm() function shall transform the wide-character string pointed to by ws2 and place the resulting wide-character string into the array pointed to by ws1. The transformation shall be such that if wcscmp() is applied to two transformed wide strings, it shall return a value greater than, equal to, or less than 0, corresponding to the result of wcscoll() applied to the same two original wide-character strings.
- wcsxfrm.02
No more than n wide-character codes shall be placed into the resulting array pointed to by ws1, including the terminating null wide-character code.
- app.wcsxfrm.03
If n is 0, ws1 is permitted to be a null pointer.
- app.wcsxfrm.04
If copying takes place between objects that overlap, the behavior is undefined.
- wcsxfrm.05
The wcsxfrm() function shall not change the setting of errno if successful.
- app.wcsxfrm.06
Since no return value is reserved to indicate an error, an application wishing to check for error situations should set errno to 0, then call wcsxfrm(), then check errno.
- wcsxfrm.07
The wcsxfrm() function shall return the length of the transformed wide-character string (not including the terminating null wide-character code).
- wcsxfrm.08
If the value returned is n or more, the contents of the array pointed to by ws1 are unspecified.
- wcsxfrm.09
[CX] On error, the wcsxfrm() function may set errno, but no return value is reserved to indicate an error.
- wcsxfrm.10
The wcsxfrm() function may fail if:
- wcsxfrm.10.01
[EINVAL] [CX] The wide-character string pointed to by ws2 contains wide-character codes outside the domain of the collating sequence.
- [+]locale.wctrans (12 / 4 / 0)
- [+]towctrans (3 / 0 / 0)
- towctrans.01
The towctrans() function shall transliterate the wide-character code wc using the mapping described by desc.
- towctrans.01.01
If successful, the towctrans() function shall return the mapped value of wc using the mapping described by desc.
- towctrans.01.02
Otherwise, it shall return wc unchanged.
- app.towctrans.02
The current setting of the LC_CTYPE category should be the same as during the call to wctrans() that returned the value desc. [CX] If the value of desc is invalid (that is, not obtained by a call to wctrans() or desc is invalidated by a subsequent call to setlocale() that has affected category LC_CTYPE ), the result is unspecified.
- app.towctrans.03
An application wishing to check for error situations should set errno to 0 before calling towctrans(). If errno is non-zero on return, an error has occurred.
- towctrans.04
The towctrans() function may fail if:
- towctrans.04.01
[EINVAL] [CX] desc contains an invalid transliteration descriptor.
- [+]towlower (2 / 2 / 0)
- app.towlower.01
The towlower() function has as a domain a type wint_t, the value of which the application shall ensure is a character representable as a wchar_t, and a wide-character code corresponding to a valid character in the current locale or the value of WEOF. If the argument has any other value, the behavior is undefined.
- towlower.02
If the argument of towlower() represents an uppercase wide-character code, and there exists a corresponding lowercase wide-character code (as defined by character type information in the program locale category LC_CTYPE ), the result shall be the corresponding lowercase wide-character code.
- towlower.02.01
Upon successful completion, towlower() shall return the lowercase letter corresponding to the argument passed;
- towlower.03
All other arguments in the domain are returned unchanged.
- towlower.03.01
otherwise, it shall return the argument unchanged.
- [+]towupper (2 / 2 / 0)
- app.towupper.01
The towupper() function has as a domain a type wint_t, the value of which the application shall ensure is a character representable as a wchar_t, and a wide-character code corresponding to a valid character in the current locale or the value of WEOF. If the argument has any other value, the behavior is undefined.
- towupper.02
If the argument of towupper() represents a lowercase wide-character code, and there exists a corresponding uppercase wide-character code (as defined by character type information in the program locale category LC_CTYPE ), the result shall be the corresponding uppercase wide-character code.
- towupper.02.01
Upon successful completion, towupper() shall return the uppercase letter corresponding to the argument passed.
- towupper.03
All other arguments in the domain are returned unchanged.
- towupper.03.01
Otherwise, it shall return the argument unchanged.
- [+]wctrans (5 / 0 / 0)
- app.wctrans.01
The wctrans() function is defined for valid character mapping names identified in the current locale. The charclass is a string identifying a generic character mapping name for which codeset-specific information is required. The following character mapping names are defined in all locales: tolower and toupper.
- app.wctrans.03
The function shall return a value of type wctrans_t, which can be used as the second argument to subsequent calls of towctrans().
- wctrans.04
The wctrans() function shall determine values of wctrans_t according to the rules of the coded character set defined by character mapping information in the program's locale (category LC_CTYPE ).
- wctrans.05
The values returned by wctrans() shall be valid until a call to setlocale() that modifies the category LC_CTYPE .
- wctrans.06.01
The wctrans() function shall return 0 [CX] and may set errno to indicate the error if the given character mapping name is not valid for the current locale (category LC_CTYPE );
- wctrans.06.02
otherwise, it shall return a non-zero object of type wctrans_t that can be used in calls to towctrans().
- wctrans.07
The wctrans() function may fail if:
- wctrans.07.01
[EINVAL] [CX] The character mapping name pointed to by charclass is not valid in the current locale.
- [+]locale.wctype (37 / 10 / 0)
- [+]iswalnum (2 / 1 / 0)
- iswalnum.01
The iswalnum() function shall test whether wc is a wide-character code representing a character of class alpha or digit in the program's current locale
- iswalnum.01.01
The iswalnum() function shall return non-zero if wc is an alphanumeric wide-character code
- iswalnum.01.02
otherwise, it shall return 0.
- app.iswalnum.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswalpha (2 / 1 / 0)
- iswalpha.01
The iswalpha() function shall test whether wc is a wide-character code representing a character of class alpha in the program's current locale
- iswalpha.01.01
The iswalpha() function shall return non-zero if wc is an alphabetic wide-character code
- iswalpha.01.02
otherwise, it shall return 0.
- app.iswalpha.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswblank (2 / 1 / 0)
- iswblank.01
The iswblank() function shall test whether wc is a wide-character code representing a character of class blank in the program's current locale
- iswblank.01.01
The iswblank() function shall return non-zero if wc is a blank wide-character code
- iswblank.01.02
otherwise, it shall return 0.
- app.iswblank.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswcntrl (2 / 0 / 0)
- iswcntrl.01
The iswcntrl() function shall test whether wc is a wide-character code representing a character of class cntrl in the program's current locale
- iswcntrl.01.01
The iswcntrl() function shall return non-zero if wc is a control wide-character code
- iswcntrl.01.02
otherwise, it shall return 0.
- app.iswcntrl.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswctype (2 / 0 / 0)
- iswctype.01
The iswctype() function shall determine whether the wide-character code wc has the character class charclass, returning true or false.
- iswctype.01.01
The iswctype() function shall return non-zero (true) if and only if wc has the property described by charclass.
- iswctype.01.02
[CX] If charclass is 0, iswctype() shall return 0.
- app.iswctype.02
The iswctype() function is defined on WEOF and wide-character codes corresponding to the valid character encodings in the current locale. If the wc argument is not in the domain of the function, the result is undefined.
- app.iswctype.03
If the value of charclass is invalid (that is, not obtained by a call to wctype() or charclass is invalidated by a subsequent call to setlocale() that has affected category LC_CTYPE ) the result is unspecified.
- [+]iswdigit (2 / 1 / 0)
- iswdigit.01
The iswdigit() function shall test whether wc is a wide-character code representing a character of class digit in the program's current locale
- iswdigit.01.01
The iswdigit() function shall return non-zero if wc is a decimal digit wide-character code
- iswdigit.01.02
otherwise, it shall return 0.
- app.iswdigit.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswgraph (2 / 1 / 0)
- iswgraph.01
The iswgraph() function shall test whether wc is a wide-character code representing a character of class graph in the program's current locale
- iswgraph.01.01
The iswgraph() function shall return non-zero if wc is a wide-character code with a visible representation
- iswgraph.01.02
otherwise, it shall return 0.
- app.iswgraph.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswlower (2 / 1 / 0)
- iswlower.01
The iswlower() function shall test whether wc is a wide-character code representing a character of class lower in the program's current locale
- iswlower.01.01
The iswlower() function shall return non-zero if wc is a lowercase letter wide-character code
- iswlower.01.02
otherwise, it shall return 0.
- app.iswlower.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswprint (2 / 1 / 0)
- iswprint.01
The iswprint() function shall test whether wc is a wide-character code representing a character of class print in the program's current locale
- iswprint.01.01
The iswprint() function shall return non-zero if wc is a printable wide-character code
- iswprint.01.02
otherwise, it shall return 0.
- app.iswprint.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswpunct (2 / 0 / 0)
- iswpunct.01
The iswpunct() function shall test whether wc is a wide-character code representing a character of class punct in the program's current locale
- iswpunct.01.01
The iswpunct() function shall return non-zero if wc is a punctuation wide-character code
- iswpunct.01.02
otherwise, it shall return 0.
- app.iswpunct.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswspace (2 / 1 / 0)
- iswspace.01
The iswspace() function shall test whether wc is a wide-character code representing a character of class space in the program's current locale
- iswspace.01.01
The iswspace() function shall return non-zero if wc is a white-space wide-character code
- iswspace.01.02
otherwise, it shall return 0.
- app.iswspace.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswupper (2 / 1 / 0)
- iswupper.01
The iswupper() function shall test whether wc is a wide-character code representing a character of class upper in the program's current locale
- iswupper.01.01
The iswupper() function shall return non-zero if wc is an uppercase letter wide-character code
- iswupper.01.02
otherwise, it shall return 0.
- app.iswupper.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]iswxdigit (2 / 1 / 0)
- iswxdigit.01
The iswxdigit() function shall test whether wc is a wide-character code representing a character of class xdigit in the program's current locale
- iswxdigit.01.01
The iswxdigit() function shall return non-zero if wc is a hexadecimal digit wide-character code
- iswxdigit.01.02
otherwise, it shall return 0.
- app.iswxdigit.02
The wc argument is a wint_t, the value of which the application shall ensure is a wide-character code corresponding to a valid character in the current locale, or equal to the value of the macro WEOF. If the argument has any other value, the behavior is undefined.
- [+]wcswidth (3 / 0 / 0)
- wcswidth.01
The wcswidth() function shall determine the number of column positions required for n wide-character codes (or fewer than n wide-character codes if a null wide-character code is encountered before n wide-character codes are exhausted) in the string pointed to by pwcs.
- wcswidth.01.01
The wcswidth() function either shall return 0 (if pwcs points to a null wide-character code),
- wcswidth.01.02
or return the number of column positions to be occupied by the wide-character string pointed to by pwcs,
- wcswidth.01.03
or return -1 (if any of the first n wide-character codes in the wide-character string pointed to by pwcs is not a printable wide-character code).
- [+]wctype (5 / 0 / 0)
- app.wctype.01
The wctype() function is defined for valid character class names as defined in the current locale. The property argument is a string identifying a generic character class for which codeset-specific type information is required.
- wctype.02
The following character class names shall be defined in all locales:
alnum
alpha
blank
cntrl
digit
graph
lower
print
punct
space
upper
xdigit
- app.wctype.03
Additional character class names defined in the locale definition file (category LC_CTYPE ) can also be specified.
- app.wctype.04
The function shall return a value of type wctype_t, which can be used as the second argument to subsequent calls of iswctype().
- wctype.05
The wctype() function shall determine values of wctype_t according to the rules of the coded character set defined by character type information in the program's locale (category LC_CTYPE ).
- wctype.06
The values returned by wctype() shall be valid until a call to setlocale() that modifies the category LC_CTYPE .
- wctype.07.01
The wctype() function shall return 0 if the given character class name is not valid for the current locale (category LC_CTYPE )
- wctype.07.02
otherwise, it shall return an object of type wctype_t that can be used in calls to iswctype().
- [+]wcwidth (3 / 0 / 0)
- wcwidth.01
The wcwidth() function shall determine the number of column positions required for the wide character wc.
- wcwidth.01.01
The wcwidth() function shall either return 0 (if wc is a null wide-character code),
- wcwidth.01.02
or return the number of column positions to be occupied by the wide-character code wc,
- wcwidth.01.03
or return -1 (if wc does not correspond to a printable wide-character code).
- app.wcwidth.02
The application shall ensure that the value of wc is a character representable as a wchar_t
- app.wcwidth.03
and is a wide-character code corresponding to a valid character in the current locale.
- [+]math.bessel (327 / 105 / 0)
- [+]j0 (18 / 3 / 0)
- j0.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j0.02
- j0.03
- j0.04
- j0.05
- j0.06
- j0.07.01.01
- j0.07.01.02
- j0.08
- j0.09.01
- j0.09.02
- j0.09.03
- j0.10.01
- j0.10.02
- j0.10.03
- j0.10.04
- j0.10.05
- j0.11
- j0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j0.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j0.06
If x is NaN, a NaN shall be returned.
- j0.07
These functions may fail if:
- j0.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j0.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j0.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j0.08
If x is Inf, a 0 shall be returned.
- j0.09
If x is 0, functions shall return following values:
- j0.09.01
j0(x=0)=1
- j0.09.02
j1(x=0)=0
- j0.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j0.10
Functions shall answer following statements for each value of order n and argument x:
- j0.10.01
j0(-x)=j0(x)
- j0.10.02
j1(-x)=-j1(x)
- j0.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j0.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j0.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j0.11
Functions shall return value with the correct sign
- [+]j0f (19 / 3 / 0)
- j0f.08
j0f() has the same specification as j0() in ISO POSIX (2003), except that the argument type for j0f is known to be float.
Generalizes:
- j0f.j0.01
- j0f.j0.02
- j0f.j0.03
- j0f.j0.04
- j0f.j0.05
- j0f.j0.06
- j0f.j0.07.01.01
- j0f.j0.07.01.02
- j0f.j0.08
- j0f.j0.09.01
- j0f.j0.09.02
- j0f.j0.09.03
- j0f.j0.10.01
- j0f.j0.10.02
- j0f.j0.10.03
- j0f.j0.10.04
- j0f.j0.10.05
- j0f.j0.11
- j0f.j0.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j0f.j0.02
- j0f.j0.03
- j0f.j0.04
- j0f.j0.05
- j0f.j0.06
- j0f.j0.07.01.01
- j0f.j0.07.01.02
- j0f.j0.08
- j0f.j0.09.01
- j0f.j0.09.02
- j0f.j0.09.03
- j0f.j0.10.01
- j0f.j0.10.02
- j0f.j0.10.03
- j0f.j0.10.04
- j0f.j0.10.05
- j0f.j0.11
- j0f.j0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j0f.j0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j0f.j0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j0f.j0.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j0f.j0.06
If x is NaN, a NaN shall be returned.
- j0f.j0.07
These functions may fail if:
- j0f.j0.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j0f.j0.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j0f.j0.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j0f.j0.08
If x is Inf, a 0 shall be returned.
- j0f.j0.09
If x is 0, functions shall return following values:
- j0f.j0.09.01
j0(x=0)=1
- j0f.j0.09.02
j1(x=0)=0
- j0f.j0.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j0f.j0.10
Functions shall answer following statements for each value of order n and argument x:
- j0f.j0.10.01
j0(-x)=j0(x)
- j0f.j0.10.02
j1(-x)=-j1(x)
- j0f.j0.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j0f.j0.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j0f.j0.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j0f.j0.11
Functions shall return value with the correct sign
- [+]j0l (19 / 3 / 0)
- j0l.08
j0l() has the same specification as j0() in ISO POSIX (2003), except that the argument type for j0l is known to be long double.
Generalizes:
- j0l.j0.01
- j0l.j0.02
- j0l.j0.03
- j0l.j0.04
- j0l.j0.05
- j0l.j0.06
- j0l.j0.07.01.01
- j0l.j0.07.01.02
- j0l.j0.08
- j0l.j0.09.01
- j0l.j0.09.02
- j0l.j0.09.03
- j0l.j0.10.01
- j0l.j0.10.02
- j0l.j0.10.03
- j0l.j0.10.04
- j0l.j0.10.05
- j0l.j0.11
- j0l.j0.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j0l.j0.02
- j0l.j0.03
- j0l.j0.04
- j0l.j0.05
- j0l.j0.06
- j0l.j0.07.01.01
- j0l.j0.07.01.02
- j0l.j0.08
- j0l.j0.09.01
- j0l.j0.09.02
- j0l.j0.09.03
- j0l.j0.10.01
- j0l.j0.10.02
- j0l.j0.10.03
- j0l.j0.10.04
- j0l.j0.10.05
- j0l.j0.11
- j0l.j0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j0l.j0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j0l.j0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j0l.j0.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j0l.j0.06
If x is NaN, a NaN shall be returned.
- j0l.j0.07
These functions may fail if:
- j0l.j0.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j0l.j0.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j0l.j0.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j0l.j0.08
If x is Inf, a 0 shall be returned.
- j0l.j0.09
If x is 0, functions shall return following values:
- j0l.j0.09.01
j0(x=0)=1
- j0l.j0.09.02
j1(x=0)=0
- j0l.j0.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j0l.j0.10
Functions shall answer following statements for each value of order n and argument x:
- j0l.j0.10.01
j0(-x)=j0(x)
- j0l.j0.10.02
j1(-x)=-j1(x)
- j0l.j0.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j0l.j0.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j0l.j0.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j0l.j0.11
Functions shall return value with the correct sign
- [+]j1 (18 / 3 / 0)
- j1.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j1.02
- j1.03
- j1.04
- j1.05
- j1.06
- j1.07.01.01
- j1.07.01.02
- j1.08
- j1.09.01
- j1.09.02
- j1.09.03
- j1.10.01
- j1.10.02
- j1.10.03
- j1.10.04
- j1.10.05
- j1.11
- j1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j1.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j1.06
If x is NaN, a NaN shall be returned.
- j1.07
These functions may fail if:
- j1.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j1.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j1.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j1.08
If x is Inf, a 0 shall be returned.
- j1.09
If x is 0, functions shall return following values:
- j1.09.01
j0(x=0)=1
- j1.09.02
j1(x=0)=0
- j1.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j1.10
Functions shall answer following statements for each value of order n and argument x:
- j1.10.01
j0(-x)=j0(x)
- j1.10.02
j1(-x)=-j1(x)
- j1.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j1.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j1.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j1.11
Functions shall return value with the correct sign
- [+]j1f (19 / 3 / 0)
- j1f.08
j1f() has the same specification as j1() in ISO POSIX (2003), except that the argument type for j1f is known to be float.
Generalizes:
- j1f.j1.01
- j1f.j1.02
- j1f.j1.03
- j1f.j1.04
- j1f.j1.05
- j1f.j1.06
- j1f.j1.07.01.01
- j1f.j1.07.01.02
- j1f.j1.08
- j1f.j1.09.01
- j1f.j1.09.02
- j1f.j1.09.03
- j1f.j1.10.01
- j1f.j1.10.02
- j1f.j1.10.03
- j1f.j1.10.04
- j1f.j1.10.05
- j1f.j1.11
- j1f.j1.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j1f.j1.02
- j1f.j1.03
- j1f.j1.04
- j1f.j1.05
- j1f.j1.06
- j1f.j1.07.01.01
- j1f.j1.07.01.02
- j1f.j1.08
- j1f.j1.09.01
- j1f.j1.09.02
- j1f.j1.09.03
- j1f.j1.10.01
- j1f.j1.10.02
- j1f.j1.10.03
- j1f.j1.10.04
- j1f.j1.10.05
- j1f.j1.11
- j1f.j1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j1f.j1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j1f.j1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j1f.j1.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j1f.j1.06
If x is NaN, a NaN shall be returned.
- j1f.j1.07
These functions may fail if:
- j1f.j1.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j1f.j1.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j1f.j1.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j1f.j1.08
If x is Inf, a 0 shall be returned.
- j1f.j1.09
If x is 0, functions shall return following values:
- j1f.j1.09.01
j0(x=0)=1
- j1f.j1.09.02
j1(x=0)=0
- j1f.j1.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j1f.j1.10
Functions shall answer following statements for each value of order n and argument x:
- j1f.j1.10.01
j0(-x)=j0(x)
- j1f.j1.10.02
j1(-x)=-j1(x)
- j1f.j1.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j1f.j1.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j1f.j1.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j1f.j1.11
Functions shall return value with the correct sign
- [+]j1l (19 / 3 / 0)
- j1l.08
j1l() has the same specification as j1() in ISO POSIX (2003), except that the argument type for j1l is known to be long double.
Generalizes:
- j1l.j1.01
- j1l.j1.02
- j1l.j1.03
- j1l.j1.04
- j1l.j1.05
- j1l.j1.06
- j1l.j1.07.01.01
- j1l.j1.07.01.02
- j1l.j1.08
- j1l.j1.09.01
- j1l.j1.09.02
- j1l.j1.09.03
- j1l.j1.10.01
- j1l.j1.10.02
- j1l.j1.10.03
- j1l.j1.10.04
- j1l.j1.10.05
- j1l.j1.11
- j1l.j1.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- j1l.j1.02
- j1l.j1.03
- j1l.j1.04
- j1l.j1.05
- j1l.j1.06
- j1l.j1.07.01.01
- j1l.j1.07.01.02
- j1l.j1.08
- j1l.j1.09.01
- j1l.j1.09.02
- j1l.j1.09.03
- j1l.j1.10.01
- j1l.j1.10.02
- j1l.j1.10.03
- j1l.j1.10.04
- j1l.j1.10.05
- j1l.j1.11
- j1l.j1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- j1l.j1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- j1l.j1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- j1l.j1.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- j1l.j1.06
If x is NaN, a NaN shall be returned.
- j1l.j1.07
These functions may fail if:
- j1l.j1.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- j1l.j1.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- j1l.j1.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- j1l.j1.08
If x is Inf, a 0 shall be returned.
- j1l.j1.09
If x is 0, functions shall return following values:
- j1l.j1.09.01
j0(x=0)=1
- j1l.j1.09.02
j1(x=0)=0
- j1l.j1.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- j1l.j1.10
Functions shall answer following statements for each value of order n and argument x:
- j1l.j1.10.01
j0(-x)=j0(x)
- j1l.j1.10.02
j1(-x)=-j1(x)
- j1l.j1.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- j1l.j1.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- j1l.j1.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- j1l.j1.11
Functions shall return value with the correct sign
- [+]jn (18 / 3 / 0)
- jn.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- jn.02
- jn.03
- jn.04
- jn.05
- jn.06
- jn.07.01.01
- jn.07.01.02
- jn.08
- jn.09.01
- jn.09.02
- jn.09.03
- jn.10.01
- jn.10.02
- jn.10.03
- jn.10.04
- jn.10.05
- jn.11
- jn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- jn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- jn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- jn.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- jn.06
If x is NaN, a NaN shall be returned.
- jn.07
These functions may fail if:
- jn.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- jn.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- jn.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- jn.08
If x is Inf, a 0 shall be returned.
- jn.09
If x is 0, functions shall return following values:
- jn.09.01
j0(x=0)=1
- jn.09.02
j1(x=0)=0
- jn.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- jn.10
Functions shall answer following statements for each value of order n and argument x:
- jn.10.01
j0(-x)=j0(x)
- jn.10.02
j1(-x)=-j1(x)
- jn.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- jn.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- jn.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- jn.11
Functions shall return value with the correct sign
- [+]jnf (19 / 3 / 0)
- jnf.08
jnf() has the same specification as jn() in ISO POSIX (2003), except that the argument type for jnf is known to be float.
Generalizes:
- jnf.jn.01
- jnf.jn.02
- jnf.jn.03
- jnf.jn.04
- jnf.jn.05
- jnf.jn.06
- jnf.jn.07.01.01
- jnf.jn.07.01.02
- jnf.jn.08
- jnf.jn.09.01
- jnf.jn.09.02
- jnf.jn.09.03
- jnf.jn.10.01
- jnf.jn.10.02
- jnf.jn.10.03
- jnf.jn.10.04
- jnf.jn.10.05
- jnf.jn.11
- jnf.jn.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- jnf.jn.02
- jnf.jn.03
- jnf.jn.04
- jnf.jn.05
- jnf.jn.06
- jnf.jn.07.01.01
- jnf.jn.07.01.02
- jnf.jn.08
- jnf.jn.09.01
- jnf.jn.09.02
- jnf.jn.09.03
- jnf.jn.10.01
- jnf.jn.10.02
- jnf.jn.10.03
- jnf.jn.10.04
- jnf.jn.10.05
- jnf.jn.11
- jnf.jn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- jnf.jn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- jnf.jn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- jnf.jn.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- jnf.jn.06
If x is NaN, a NaN shall be returned.
- jnf.jn.07
These functions may fail if:
- jnf.jn.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- jnf.jn.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- jnf.jn.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- jnf.jn.08
If x is Inf, a 0 shall be returned.
- jnf.jn.09
If x is 0, functions shall return following values:
- jnf.jn.09.01
j0(x=0)=1
- jnf.jn.09.02
j1(x=0)=0
- jnf.jn.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- jnf.jn.10
Functions shall answer following statements for each value of order n and argument x:
- jnf.jn.10.01
j0(-x)=j0(x)
- jnf.jn.10.02
j1(-x)=-j1(x)
- jnf.jn.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- jnf.jn.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- jnf.jn.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- jnf.jn.11
Functions shall return value with the correct sign
- [+]jnl (19 / 3 / 0)
- jnl.08
jnl() has the same specification as jn() in ISO POSIX (2003), except that the argument type for jnl is known to be long double.
Generalizes:
- jnl.jn.01
- jnl.jn.02
- jnl.jn.03
- jnl.jn.04
- jnl.jn.05
- jnl.jn.06
- jnl.jn.07.01.01
- jnl.jn.07.01.02
- jnl.jn.08
- jnl.jn.09.01
- jnl.jn.09.02
- jnl.jn.09.03
- jnl.jn.10.01
- jnl.jn.10.02
- jnl.jn.10.03
- jnl.jn.10.04
- jnl.jn.10.05
- jnl.jn.11
- jnl.jn.01
The j0(), j1(), and jn() functions shall compute Bessel functions of x of the first kind of orders 0, 1, and n, respectively.
Generalizes:
- jnl.jn.02
- jnl.jn.03
- jnl.jn.04
- jnl.jn.05
- jnl.jn.06
- jnl.jn.07.01.01
- jnl.jn.07.01.02
- jnl.jn.08
- jnl.jn.09.01
- jnl.jn.09.02
- jnl.jn.09.03
- jnl.jn.10.01
- jnl.jn.10.02
- jnl.jn.10.03
- jnl.jn.10.04
- jnl.jn.10.05
- jnl.jn.11
- jnl.jn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- jnl.jn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- jnl.jn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the first kind.
- jnl.jn.05
If the x argument is too large in magnitude, or the correct result would cause underflow, 0 shall be returned and a range error may occur.
- jnl.jn.06
If x is NaN, a NaN shall be returned.
- jnl.jn.07
These functions may fail if:
- jnl.jn.07.01
Range Error The value of x was too large in magnitude, or an underflow occurred.
- jnl.jn.07.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- jnl.jn.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- jnl.jn.08
If x is Inf, a 0 shall be returned.
- jnl.jn.09
If x is 0, functions shall return following values:
- jnl.jn.09.01
j0(x=0)=1
- jnl.jn.09.02
j1(x=0)=0
- jnl.jn.09.03
jn(n, x=0)=1 if n equal 0 and jn(n, x=0)=0 if n not equal 0
- jnl.jn.10
Functions shall answer following statements for each value of order n and argument x:
- jnl.jn.10.01
j0(-x)=j0(x)
- jnl.jn.10.02
j1(-x)=-j1(x)
- jnl.jn.10.03
jn(n, -x)=jn(n, x)*(-1)^n
- jnl.jn.10.04
jn(-n, x)=jn(n, x)*(-1)^n
- jnl.jn.10.05
jn(n-1, x)+jn(n+1, x)=(2n/x)*jn(n, x)
- jnl.jn.11
Functions shall return value with the correct sign
- [+]y0 (17 / 8 / 0)
- y0.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y0.02
- y0.03
- y0.04
- y0.05
- y0.06
- y0.07
- y0.08
- y0.09
- y0.10.01.01
- y0.10.01.02
- y0.10.02.01
- y0.10.02.02
- y0.10.03.01
- y0.10.03.02
- y0.10.04.01
- y0.10.04.02
- y0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y0.05
If x is NaN, NaN shall be returned.
- y0.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y0.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y0.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y0.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y0.10
These functions may fail if:
- y0.10.01
Domain Error The value of x is negative.
- y0.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y0.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y0.10.02
Pole Error The value of x is zero.
- y0.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y0.10.03
Range Error The correct result would cause overflow.
- y0.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y0.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y0.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]y0f (18 / 8 / 0)
- y0f.11
y0f() has the same specification as y0() in ISO POSIX (2003), except that the argument type for y0f is known to be float.
Generalizes:
- y0f.y0.01
- y0f.y0.02
- y0f.y0.03
- y0f.y0.04
- y0f.y0.05
- y0f.y0.06
- y0f.y0.07
- y0f.y0.08
- y0f.y0.09
- y0f.y0.10.01.01
- y0f.y0.10.01.02
- y0f.y0.10.02.01
- y0f.y0.10.02.02
- y0f.y0.10.03.01
- y0f.y0.10.03.02
- y0f.y0.10.04.01
- y0f.y0.10.04.02
- y0f.y0.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y0f.y0.02
- y0f.y0.03
- y0f.y0.04
- y0f.y0.05
- y0f.y0.06
- y0f.y0.07
- y0f.y0.08
- y0f.y0.09
- y0f.y0.10.01.01
- y0f.y0.10.01.02
- y0f.y0.10.02.01
- y0f.y0.10.02.02
- y0f.y0.10.03.01
- y0f.y0.10.03.02
- y0f.y0.10.04.01
- y0f.y0.10.04.02
- y0f.y0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y0f.y0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y0f.y0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y0f.y0.05
If x is NaN, NaN shall be returned.
- y0f.y0.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y0f.y0.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y0f.y0.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y0f.y0.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y0f.y0.10
These functions may fail if:
- y0f.y0.10.01
Domain Error The value of x is negative.
- y0f.y0.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y0f.y0.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y0f.y0.10.02
Pole Error The value of x is zero.
- y0f.y0.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0f.y0.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y0f.y0.10.03
Range Error The correct result would cause overflow.
- y0f.y0.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0f.y0.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y0f.y0.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y0f.y0.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0f.y0.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]y0l (18 / 8 / 0)
- y0l.11
y0l() has the same specification as y0() in ISO POSIX (2003), except that the argument type for y0l is known to be long double.
Generalizes:
- y0l.y0.01
- y0l.y0.02
- y0l.y0.03
- y0l.y0.04
- y0l.y0.05
- y0l.y0.06
- y0l.y0.07
- y0l.y0.08
- y0l.y0.09
- y0l.y0.10.01.01
- y0l.y0.10.01.02
- y0l.y0.10.02.01
- y0l.y0.10.02.02
- y0l.y0.10.03.01
- y0l.y0.10.03.02
- y0l.y0.10.04.01
- y0l.y0.10.04.02
- y0l.y0.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y0l.y0.02
- y0l.y0.03
- y0l.y0.04
- y0l.y0.05
- y0l.y0.06
- y0l.y0.07
- y0l.y0.08
- y0l.y0.09
- y0l.y0.10.01.01
- y0l.y0.10.01.02
- y0l.y0.10.02.01
- y0l.y0.10.02.02
- y0l.y0.10.03.01
- y0l.y0.10.03.02
- y0l.y0.10.04.01
- y0l.y0.10.04.02
- y0l.y0.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y0l.y0.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y0l.y0.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y0l.y0.05
If x is NaN, NaN shall be returned.
- y0l.y0.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y0l.y0.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y0l.y0.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y0l.y0.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y0l.y0.10
These functions may fail if:
- y0l.y0.10.01
Domain Error The value of x is negative.
- y0l.y0.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y0l.y0.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y0l.y0.10.02
Pole Error The value of x is zero.
- y0l.y0.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0l.y0.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y0l.y0.10.03
Range Error The correct result would cause overflow.
- y0l.y0.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0l.y0.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y0l.y0.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y0l.y0.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y0l.y0.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]y1 (17 / 9 / 0)
- y1.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y1.02
- y1.03
- y1.04
- y1.05
- y1.06
- y1.07
- y1.08
- y1.09
- y1.10.01.01
- y1.10.01.02
- y1.10.02.01
- y1.10.02.02
- y1.10.03.01
- y1.10.03.02
- y1.10.04.01
- y1.10.04.02
- y1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y1.05
If x is NaN, NaN shall be returned.
- y1.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y1.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y1.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y1.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y1.10
These functions may fail if:
- y1.10.01
Domain Error The value of x is negative.
- y1.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y1.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y1.10.02
Pole Error The value of x is zero.
- y1.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y1.10.03
Range Error The correct result would cause overflow.
- y1.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y1.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y1.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]y1f (18 / 9 / 0)
- y1f.11
y1f() has the same specification as y1() in ISO POSIX (2003), except that the argument type for y1f is known to be float.
Generalizes:
- y1f.y1.01
- y1f.y1.02
- y1f.y1.03
- y1f.y1.04
- y1f.y1.05
- y1f.y1.06
- y1f.y1.07
- y1f.y1.08
- y1f.y1.09
- y1f.y1.10.01.01
- y1f.y1.10.01.02
- y1f.y1.10.02.01
- y1f.y1.10.02.02
- y1f.y1.10.03.01
- y1f.y1.10.03.02
- y1f.y1.10.04.01
- y1f.y1.10.04.02
- y1f.y1.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y1f.y1.02
- y1f.y1.03
- y1f.y1.04
- y1f.y1.05
- y1f.y1.06
- y1f.y1.07
- y1f.y1.08
- y1f.y1.09
- y1f.y1.10.01.01
- y1f.y1.10.01.02
- y1f.y1.10.02.01
- y1f.y1.10.02.02
- y1f.y1.10.03.01
- y1f.y1.10.03.02
- y1f.y1.10.04.01
- y1f.y1.10.04.02
- y1f.y1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y1f.y1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y1f.y1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y1f.y1.05
If x is NaN, NaN shall be returned.
- y1f.y1.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y1f.y1.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y1f.y1.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y1f.y1.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y1f.y1.10
These functions may fail if:
- y1f.y1.10.01
Domain Error The value of x is negative.
- y1f.y1.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y1f.y1.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y1f.y1.10.02
Pole Error The value of x is zero.
- y1f.y1.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1f.y1.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y1f.y1.10.03
Range Error The correct result would cause overflow.
- y1f.y1.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1f.y1.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y1f.y1.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y1f.y1.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1f.y1.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]y1l (18 / 9 / 0)
- y1l.11
y1l() has the same specification as y1() in ISO POSIX (2003), except that the argument type for y1l is known to be long double.
Generalizes:
- y1l.y1.01
- y1l.y1.02
- y1l.y1.03
- y1l.y1.04
- y1l.y1.05
- y1l.y1.06
- y1l.y1.07
- y1l.y1.08
- y1l.y1.09
- y1l.y1.10.01.01
- y1l.y1.10.01.02
- y1l.y1.10.02.01
- y1l.y1.10.02.02
- y1l.y1.10.03.01
- y1l.y1.10.03.02
- y1l.y1.10.04.01
- y1l.y1.10.04.02
- y1l.y1.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- y1l.y1.02
- y1l.y1.03
- y1l.y1.04
- y1l.y1.05
- y1l.y1.06
- y1l.y1.07
- y1l.y1.08
- y1l.y1.09
- y1l.y1.10.01.01
- y1l.y1.10.01.02
- y1l.y1.10.02.01
- y1l.y1.10.02.02
- y1l.y1.10.03.01
- y1l.y1.10.03.02
- y1l.y1.10.04.01
- y1l.y1.10.04.02
- y1l.y1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- y1l.y1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- y1l.y1.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- y1l.y1.05
If x is NaN, NaN shall be returned.
- y1l.y1.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- y1l.y1.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- y1l.y1.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- y1l.y1.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- y1l.y1.10
These functions may fail if:
- y1l.y1.10.01
Domain Error The value of x is negative.
- y1l.y1.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- y1l.y1.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- y1l.y1.10.02
Pole Error The value of x is zero.
- y1l.y1.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1l.y1.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- y1l.y1.10.03
Range Error The correct result would cause overflow.
- y1l.y1.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1l.y1.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- y1l.y1.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- y1l.y1.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- y1l.y1.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]yn (17 / 9 / 0)
- yn.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- yn.02
- yn.03
- yn.04
- yn.05
- yn.06
- yn.07
- yn.08
- yn.09
- yn.10.01.01
- yn.10.01.02
- yn.10.02.01
- yn.10.02.02
- yn.10.03.01
- yn.10.03.02
- yn.10.04.01
- yn.10.04.02
- yn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- yn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- yn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- yn.05
If x is NaN, NaN shall be returned.
- yn.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- yn.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- yn.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- yn.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- yn.10
These functions may fail if:
- yn.10.01
Domain Error The value of x is negative.
- yn.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- yn.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- yn.10.02
Pole Error The value of x is zero.
- yn.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- yn.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- yn.10.03
Range Error The correct result would cause overflow.
- yn.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- yn.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- yn.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- yn.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- yn.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]ynf (18 / 9 / 0)
- ynf.11
ynf() has the same specification as yn() in ISO POSIX (2003), except that the argument type for ynf is known to be float.
Generalizes:
- ynf.yn.01
- ynf.yn.02
- ynf.yn.03
- ynf.yn.04
- ynf.yn.05
- ynf.yn.06
- ynf.yn.07
- ynf.yn.08
- ynf.yn.09
- ynf.yn.10.01.01
- ynf.yn.10.01.02
- ynf.yn.10.02.01
- ynf.yn.10.02.02
- ynf.yn.10.03.01
- ynf.yn.10.03.02
- ynf.yn.10.04.01
- ynf.yn.10.04.02
- ynf.yn.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- ynf.yn.02
- ynf.yn.03
- ynf.yn.04
- ynf.yn.05
- ynf.yn.06
- ynf.yn.07
- ynf.yn.08
- ynf.yn.09
- ynf.yn.10.01.01
- ynf.yn.10.01.02
- ynf.yn.10.02.01
- ynf.yn.10.02.02
- ynf.yn.10.03.01
- ynf.yn.10.03.02
- ynf.yn.10.04.01
- ynf.yn.10.04.02
- ynf.yn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ynf.yn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ynf.yn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- ynf.yn.05
If x is NaN, NaN shall be returned.
- ynf.yn.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- ynf.yn.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- ynf.yn.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- ynf.yn.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- ynf.yn.10
These functions may fail if:
- ynf.yn.10.01
Domain Error The value of x is negative.
- ynf.yn.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- ynf.yn.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- ynf.yn.10.02
Pole Error The value of x is zero.
- ynf.yn.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynf.yn.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- ynf.yn.10.03
Range Error The correct result would cause overflow.
- ynf.yn.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynf.yn.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- ynf.yn.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- ynf.yn.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynf.yn.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]ynl (18 / 9 / 0)
- ynl.11
ynl() has the same specification as yn() in ISO POSIX (2003), except that the argument type for ynl is known to be long double.
Generalizes:
- ynl.yn.01
- ynl.yn.02
- ynl.yn.03
- ynl.yn.04
- ynl.yn.05
- ynl.yn.06
- ynl.yn.07
- ynl.yn.08
- ynl.yn.09
- ynl.yn.10.01.01
- ynl.yn.10.01.02
- ynl.yn.10.02.01
- ynl.yn.10.02.02
- ynl.yn.10.03.01
- ynl.yn.10.03.02
- ynl.yn.10.04.01
- ynl.yn.10.04.02
- ynl.yn.01
The y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively.
Generalizes:
- ynl.yn.02
- ynl.yn.03
- ynl.yn.04
- ynl.yn.05
- ynl.yn.06
- ynl.yn.07
- ynl.yn.08
- ynl.yn.09
- ynl.yn.10.01.01
- ynl.yn.10.01.02
- ynl.yn.10.02.01
- ynl.yn.10.02.02
- ynl.yn.10.03.01
- ynl.yn.10.03.02
- ynl.yn.10.04.01
- ynl.yn.10.04.02
- ynl.yn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ynl.yn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ynl.yn.04
Upon successful completion, these functions shall return the relevant Bessel value of x of the second kind.
- ynl.yn.05
If x is NaN, NaN shall be returned.
- ynl.yn.06
If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
- ynl.yn.07
If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur.
- ynl.yn.08
If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
- ynl.yn.09
If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.
- ynl.yn.10
These functions may fail if:
- ynl.yn.10.01
Domain Error The value of x is negative.
- ynl.yn.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- ynl.yn.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- ynl.yn.10.02
Pole Error The value of x is zero.
- ynl.yn.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynl.yn.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- ynl.yn.10.03
Range Error The correct result would cause overflow.
- ynl.yn.10.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynl.yn.10.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- ynl.yn.10.04
Range Error The value of x is too large in magnitude, or the correct result would cause underflow.
- ynl.yn.10.04.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ynl.yn.10.04.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]math.cexp (183 / 30 / 4)
- [+]cexp (16 / 2 / 0)
- cexp.01
These functions shall compute the complex exponent of z, defined as ez.
- cexp.02
These functions shall return the complex exponential value of z.
- cexp.ext.03
cexp(conj(z)) = conj(cexp(z)), where conj(z) is the complex conjugate of z.
- cexp.ext.04
cexp(?0 + i * 0) returns 1 + i * 0.
- cexp.ext.05
cexp(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- cexp.ext.06
cexp(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cexp.ext.07
cexp(+Inf + i * 0) returns +Inf + i * 0.
- cexp.ext.08
cexp(-Inf + i * y) returns +0 * cis(y), for finite y (where cis(y) = cos(y) + i * sin(y)).
- cexp.ext.09
cexp(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- cexp.ext.10
cexp(-Inf + i * Inf) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexp.ext.11
cexp(+Inf + i * Inf) returns ?Inf + i * NaN and raises the "invalid" floating-point exception (where the sign of the real part of the result is unspecified).
- cexp.ext.12
cexp(-Inf + i *NaN) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexp.ext.13
cexp(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- cexp.ext.14
cexp(NaN + i * 0) returns NaN + i * 0.
- cexp.ext.15
cexp(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all non-zero numbers y.
- cexp.ext.16
cexp(NaN + i * NaN) returns NaN + i * NaN.
- [+]cexpf (16 / 2 / 0)
- cexpf.01
These functions shall compute the complex exponent of z, defined as ez.
- cexpf.02
These functions shall return the complex exponential value of z.
- cexpf.ext.03
cexp(conj(z)) = conj(cexp(z)), where conj(z) is the complex conjugate of z.
- cexpf.ext.04
cexp(?0 + i * 0) returns 1 + i * 0.
- cexpf.ext.05
cexp(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- cexpf.ext.06
cexp(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cexpf.ext.07
cexp(+Inf + i * 0) returns +Inf + i * 0.
- cexpf.ext.08
cexp(-Inf + i * y) returns +0 * cis(y), for finite y (where cis(y) = cos(y) + i * sin(y)).
- cexpf.ext.09
cexp(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- cexpf.ext.10
cexp(-Inf + i * Inf) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexpf.ext.11
cexp(+Inf + i * Inf) returns ?Inf + i * NaN and raises the "invalid" floating-point exception (where the sign of the real part of the result is unspecified).
- cexpf.ext.12
cexp(-Inf + i *NaN) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexpf.ext.13
cexp(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- cexpf.ext.14
cexp(NaN + i * 0) returns NaN + i * 0.
- cexpf.ext.15
cexp(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all non-zero numbers y.
- cexpf.ext.16
cexp(NaN + i * NaN) returns NaN + i * NaN.
- [+]cexpl (16 / 2 / 0)
- cexpl.01
These functions shall compute the complex exponent of z, defined as ez.
- cexpl.02
These functions shall return the complex exponential value of z.
- cexpl.ext.03
cexp(conj(z)) = conj(cexp(z)), where conj(z) is the complex conjugate of z.
- cexpl.ext.04
cexp(?0 + i * 0) returns 1 + i * 0.
- cexpl.ext.05
cexp(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- cexpl.ext.06
cexp(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cexpl.ext.07
cexp(+Inf + i * 0) returns +Inf + i * 0.
- cexpl.ext.08
cexp(-Inf + i * y) returns +0 * cis(y), for finite y (where cis(y) = cos(y) + i * sin(y)).
- cexpl.ext.09
cexp(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- cexpl.ext.10
cexp(-Inf + i * Inf) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexpl.ext.11
cexp(+Inf + i * Inf) returns ?Inf + i * NaN and raises the "invalid" floating-point exception (where the sign of the real part of the result is unspecified).
- cexpl.ext.12
cexp(-Inf + i *NaN) returns ?0 ? i * 0 (where the signs of the real and imaginary parts of the result are unspecified).
- cexpl.ext.13
cexp(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- cexpl.ext.14
cexp(NaN + i * 0) returns NaN + i * 0.
- cexpl.ext.15
cexp(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all non-zero numbers y.
- cexpl.ext.16
cexp(NaN + i * NaN) returns NaN + i * NaN.
- [+]clog (15 / 2 / 0)
- clog.01
These functions shall compute the complex natural (base e) logarithm of z, with a branch cut along the negative real axis.
- clog.02
These functions shall return the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clog.ext.03
clog(conj(z)) = conj(clog(z)), where conj(z) is the complex conjugate of z.
- clog.ext.04
clog(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clog.ext.05
clog(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clog.ext.06
clog(x + i * Inf) returns +Inf + i * /2, for finite x.
- clog.ext.07
clog(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clog.ext.08
clog(-Inf + i * y) returns +Inf + i * , for finite positive-signed y.
- clog.ext.09
clog(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clog.ext.10
clog(-Inf + i * Inf) returns +Inf + i * 3/4.
- clog.ext.11
clog(+Inf + i * Inf) returns +Inf + i * /4.
- clog.ext.12
clog(?Inf + i * NaN) returns +Inf + i * NaN.
- clog.ext.13
clog(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clog.ext.14
clog(NaN + i * Inf) returns +Inf + i * NaN.
- clog.ext.15
clog(NaN + i * NaN) returns NaN + i * NaN.
- [+]clog10 (15 / 2 / 0)
- clog10.01
These functions shall compute the complex common (base 10) logarithm of z, with a branch cut along the negative real axis.
- clog10.02
These functions shall return the complex common logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clog10.ext.03
clog10(conj(z)) = conj(clog10(z)), where conj(z) is the complex conjugate of z.
- clog10.ext.04
clog10(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clog10.ext.05
clog10(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clog10.ext.06
clog10(x + i * Inf) returns +Inf + i * / (2 * ln(10), for finite x.
- clog10.ext.07
clog10(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clog10.ext.08
clog10(-Inf + i * y) returns +Inf + i * / ln(10), for finite positive-signed y.
- clog10.ext.09
clog10(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clog10.ext.10
clog10(-Inf + i * Inf) returns +Inf + i * 3/ (4 * ln10).
- clog10.ext.11
clog10(+Inf + i * Inf) returns +Inf + i * / (4 * ln10).
- clog10.ext.12
clog10(?Inf + i * NaN) returns +Inf + i * NaN.
- clog10.ext.13
clog10(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clog10.ext.14
clog10(NaN + i * Inf) returns +Inf + i * NaN.
- clog10.ext.15
clog10(NaN + i * NaN) returns NaN + i * NaN.
- [+]clog10f (15 / 2 / 0)
- clog10f.01
These functions shall compute the complex common (base 10) logarithm of z, with a branch cut along the negative real axis.
- clog10f.02
These functions shall return the complex common logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clog10f.ext.03
clog10(conj(z)) = conj(clog10(z)), where conj(z) is the complex conjugate of z.
- clog10f.ext.04
clog10(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clog10f.ext.05
clog10(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clog10f.ext.06
clog10(x + i * Inf) returns +Inf + i * / (2 * ln(10), for finite x.
- clog10f.ext.07
clog10(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clog10f.ext.08
clog10(-Inf + i * y) returns +Inf + i * / ln(10), for finite positive-signed y.
- clog10f.ext.09
clog10(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clog10f.ext.10
clog10(-Inf + i * Inf) returns +Inf + i * 3/ (4 * ln10).
- clog10f.ext.11
clog10(+Inf + i * Inf) returns +Inf + i * / (4 * ln10).
- clog10f.ext.12
clog10(?Inf + i * NaN) returns +Inf + i * NaN.
- clog10f.ext.13
clog10(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clog10f.ext.14
clog10(NaN + i * Inf) returns +Inf + i * NaN.
- clog10f.ext.15
clog10(NaN + i * NaN) returns NaN + i * NaN.
- [+]clog10l (15 / 2 / 0)
- clog10l.01
These functions shall compute the complex common (base 10) logarithm of z, with a branch cut along the negative real axis.
- clog10l.02
These functions shall return the complex common logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clog10l.ext.03
clog10(conj(z)) = conj(clog10(z)), where conj(z) is the complex conjugate of z.
- clog10l.ext.04
clog10(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clog10l.ext.05
clog10(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clog10l.ext.06
clog10(x + i * Inf) returns +Inf + i * / (2 * ln(10), for finite x.
- clog10l.ext.07
clog10(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clog10l.ext.08
clog10(-Inf + i * y) returns +Inf + i * / ln(10), for finite positive-signed y.
- clog10l.ext.09
clog10(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clog10l.ext.10
clog10(-Inf + i * Inf) returns +Inf + i * 3/ (4 * ln10).
- clog10l.ext.11
clog10(+Inf + i * Inf) returns +Inf + i * / (4 * ln10).
- clog10l.ext.12
clog10(?Inf + i * NaN) returns +Inf + i * NaN.
- clog10l.ext.13
clog10(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clog10l.ext.14
clog10(NaN + i * Inf) returns +Inf + i * NaN.
- clog10l.ext.15
clog10(NaN + i * NaN) returns NaN + i * NaN.
- [+]clogf (15 / 2 / 0)
- clogf.01
These functions shall compute the complex natural (base e) logarithm of z, with a branch cut along the negative real axis.
- clogf.02
These functions shall return the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clogf.ext.03
clog(conj(z)) = conj(clog(z)), where conj(z) is the complex conjugate of z.
- clogf.ext.04
clog(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clogf.ext.05
clog(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clogf.ext.06
clog(x + i * Inf) returns +Inf + i * /2, for finite x.
- clogf.ext.07
clog(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clogf.ext.08
clog(-Inf + i * y) returns +Inf + i * , for finite positive-signed y.
- clogf.ext.09
clog(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clogf.ext.10
clog(-Inf + i * Inf) returns +Inf + i * 3/4.
- clogf.ext.11
clog(+Inf + i * Inf) returns +Inf + i * /4.
- clogf.ext.12
clog(?Inf + i * NaN) returns +Inf + i * NaN.
- clogf.ext.13
clog(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clogf.ext.14
clog(NaN + i * Inf) returns +Inf + i * NaN.
- clogf.ext.15
clog(NaN + i * NaN) returns NaN + i * NaN.
- [+]clogl (15 / 2 / 0)
- clogl.01
These functions shall compute the complex natural (base e) logarithm of z, with a branch cut along the negative real axis.
- clogl.02
These functions shall return the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i, +i] along the imaginary axis.
- clogl.ext.03
clog(conj(z)) = conj(clog(z)), where conj(z) is the complex conjugate of z.
- clogl.ext.04
clog(-0 + i * 0) returns -Inf + i * and raises the "divide-by-zero" floating-point exception
- clogl.ext.05
clog(+0 + i * 0) returns -Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- clogl.ext.06
clog(x + i * Inf) returns +Inf + i * /2, for finite x.
- clogl.ext.07
clog(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- clogl.ext.08
clog(-Inf + i * y) returns +Inf + i * , for finite positive-signed y.
- clogl.ext.09
clog(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- clogl.ext.10
clog(-Inf + i * Inf) returns +Inf + i * 3/4.
- clogl.ext.11
clog(+Inf + i * Inf) returns +Inf + i * /4.
- clogl.ext.12
clog(?Inf + i * NaN) returns +Inf + i * NaN.
- clogl.ext.13
clog(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- clogl.ext.14
clog(NaN + i * Inf) returns +Inf + i * NaN.
- clogl.ext.15
clog(NaN + i * NaN) returns NaN + i * NaN.
- [+]cpow (3 / 2 / 2)
- cpow.01 (failed)
These functions shall compute the complex power function xy, with a branch cut for the first parameter along the negative real axis.
- cpow.02 (failed)
These functions shall return the complex power function value.
- cpow.ext.03
The cpow function raise floating-point exception if appropriate for the calculation of the parts of the result, and may raise spurious exceptions. This allow cpow(z, c) to be implemented as cexp(c * clog(z)) without precluding implementations that special cases more carefully.
- [+]cpowf (3 / 2 / 0)
- cpowf.01
These functions shall compute the complex power function xy, with a branch cut for the first parameter along the negative real axis.
- cpowf.02
These functions shall return the complex power function value.
- cpowf.ext.03
The cpow function raise floating-point exception if appropriate for the calculation of the parts of the result, and may raise spurious exceptions. This allow cpow(z, c) to be implemented as cexp(c * clog(z)) without precluding implementations that special cases more carefully.
- [+]cpowl (3 / 2 / 2)
- cpowl.01 (failed)
These functions shall compute the complex power function xy, with a branch cut for the first parameter along the negative real axis.
- cpowl.02 (failed)
These functions shall return the complex power function value.
- cpowl.ext.03
The cpow function raise floating-point exception if appropriate for the calculation of the parts of the result, and may raise spurious exceptions. This allow cpow(z, c) to be implemented as cexp(c * clog(z)) without precluding implementations that special cases more carefully.
- [+]csqrt (12 / 2 / 0)
- csqrt.01
These functions shall compute the complex square root of z, with a branch cut along the negative real axis.
- csqrt.02
These functions shall return the complex square root value, in the range of the right half-plane (including the imaginary axis).
- csqrt.ext.03
csqrt(conj(z)) = conj(csqrt(z)), where conj(z) is the complex conjugate of z.
- csqrt.ext.04
csqrt(?0 + i * 0) returns +0 + i * 0.
- csqrt.ext.05
csqrt(x + i * Inf) returns +Inf + i * Inf, for all x (including NaN).
- csqrt.ext.06
csqrt(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- csqrt.ext.07
csqrt(-Inf + i * y) returns +0 + i * Inf, for finite positive-signed y.
- csqrt.ext.08
csqrt(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- csqrt.ext.09
csqrt(-Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csqrt.ext.10
csqrt(+Inf + i * NaN) returns +Inf + i * NaN.
- csqrt.ext.11
csqrt(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- csqrt.ext.12
csqrt(NaN + i * NaN) returns NaN + i * NaN.
- [+]csqrtf (12 / 2 / 0)
- csqrtf.01
These functions shall compute the complex square root of z, with a branch cut along the negative real axis.
- csqrtf.02
These functions shall return the complex square root value, in the range of the right half-plane (including the imaginary axis).
- csqrtf.ext.03
csqrt(conj(z)) = conj(csqrt(z)), where conj(z) is the complex conjugate of z.
- csqrtf.ext.04
csqrt(?0 + i * 0) returns +0 + i * 0.
- csqrtf.ext.05
csqrt(x + i * Inf) returns +Inf + i * Inf, for all x (including NaN).
- csqrtf.ext.06
csqrt(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- csqrtf.ext.07
csqrt(-Inf + i * y) returns +0 + i * Inf, for finite positive-signed y.
- csqrtf.ext.08
csqrt(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- csqrtf.ext.09
csqrt(-Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csqrtf.ext.10
csqrt(+Inf + i * NaN) returns +Inf + i * NaN.
- csqrtf.ext.11
csqrt(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- csqrtf.ext.12
csqrt(NaN + i * NaN) returns NaN + i * NaN.
- [+]csqrtl (12 / 2 / 0)
- csqrtl.01
These functions shall compute the complex square root of z, with a branch cut along the negative real axis.
- csqrtl.02
These functions shall return the complex square root value, in the range of the right half-plane (including the imaginary axis).
- csqrtl.ext.03
csqrt(conj(z)) = conj(csqrt(z)), where conj(z) is the complex conjugate of z.
- csqrtl.ext.04
csqrt(?0 + i * 0) returns +0 + i * 0.
- csqrtl.ext.05
csqrt(x + i * Inf) returns +Inf + i * Inf, for all x (including NaN).
- csqrtl.ext.06
csqrt(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- csqrtl.ext.07
csqrt(-Inf + i * y) returns +0 + i * Inf, for finite positive-signed y.
- csqrtl.ext.08
csqrt(+Inf + i * y) returns +Inf + i * 0, for finite positive-signed y.
- csqrtl.ext.09
csqrt(-Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csqrtl.ext.10
csqrt(+Inf + i * NaN) returns +Inf + i * NaN.
- csqrtl.ext.11
csqrt(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- csqrtl.ext.12
csqrt(NaN + i * NaN) returns NaN + i * NaN.
- [+]math.chyper (273 / 36 / 0)
- [+]cacosh (16 / 2 / 0)
- cacosh.01
These functions shall compute the complex arc hyperbolic cosine of z, with a branch cut at values less than 1 along the real axis.
- cacosh.02
These functions shall return the complex arc hyperbolic cosine value, in the range of a half-strip of non-negative values along the real axis and in the interval [-i, +i] along the imaginary axis.
- cacosh.ext.03
cacosh(conj(z)) = conj(cacosh(z)), where conj(z) is the complex conjugate of z.
- cacosh.ext.04
cacosh(?0 + i * 0) returns +0 + i * /2.
- cacosh.ext.05
cacosh(x + i * Inf) returns +Inf + i * /2, for finite x.
- cacosh.ext.06
cacosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cacosh.ext.07
cacosh(-Inf + i * y) returns +Inf + i * , for positive-signed finite y.
- cacosh.ext.08
cacosh(+Inf + i * y) returns +Inf + i * 0, for positive - singed finite y.
- cacosh.ext.09
cacosh(-Inf + i * Inf) returns +Inf + i * 3/4.
- cacosh.ext.10
cacosh(+Inf + i * Inf) returns +Inf + i * /4.
- cacosh.ext.11
cacosh(?Inf + i * NaN) returns +Inf + i * NaN.
- cacosh.ext.12
cacosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacosh.ext.13
cacosh(NaN + i * Inf) return +Inf + i * NaN.
- cacosh.ext.14
cacosh(NaN + i * NaN) returns NaN + i * NaN.
- cacosh.ext.15
cacosh(1 + i * 0) returns 0 + i * 0.
- cacosh.ext.16
cacosh(-1 + i * 0) returns 0 + i * .
- [+]cacoshf (16 / 2 / 0)
- cacoshf.01
These functions shall compute the complex arc hyperbolic cosine of z, with a branch cut at values less than 1 along the real axis.
- cacoshf.02
These functions shall return the complex arc hyperbolic cosine value, in the range of a half-strip of non-negative values along the real axis and in the interval [-i, +i] along the imaginary axis.
- cacoshf.ext.03
cacosh(conj(z)) = conj(cacosh(z)), where conj(z) is the complex conjugate of z.
- cacoshf.ext.04
cacosh(?0 + i * 0) returns +0 + i * /2.
- cacoshf.ext.05
cacosh(x + i * Inf) returns +Inf + i * /2, for finite x.
- cacoshf.ext.06
cacosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cacoshf.ext.07
cacosh(-Inf + i * y) returns +Inf + i * , for positive-signed finite y.
- cacoshf.ext.08
cacosh(+Inf + i * y) returns +Inf + i * 0, for positive - singed finite y.
- cacoshf.ext.09
cacosh(-Inf + i * Inf) returns +Inf + i * 3/4.
- cacoshf.ext.10
cacosh(+Inf + i * Inf) returns +Inf + i * /4.
- cacoshf.ext.11
cacosh(?Inf + i * NaN) returns +Inf + i * NaN.
- cacoshf.ext.12
cacosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacoshf.ext.13
cacosh(NaN + i * Inf) return +Inf + i * NaN.
- cacoshf.ext.14
cacosh(NaN + i * NaN) returns NaN + i * NaN.
- cacoshf.ext.15
cacosh(1 + i * 0) returns 0 + i * 0.
- cacoshf.ext.16
cacosh(-1 + i * 0) returns 0 + i * .
- [+]cacoshl (16 / 2 / 0)
- cacoshl.01
These functions shall compute the complex arc hyperbolic cosine of z, with a branch cut at values less than 1 along the real axis.
- cacoshl.02
These functions shall return the complex arc hyperbolic cosine value, in the range of a half-strip of non-negative values along the real axis and in the interval [-i, +i] along the imaginary axis.
- cacoshl.ext.03
cacosh(conj(z)) = conj(cacosh(z)), where conj(z) is the complex conjugate of z.
- cacoshl.ext.04
cacosh(?0 + i * 0) returns +0 + i * /2.
- cacoshl.ext.05
cacosh(x + i * Inf) returns +Inf + i * /2, for finite x.
- cacoshl.ext.06
cacosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- cacoshl.ext.07
cacosh(-Inf + i * y) returns +Inf + i * , for positive-signed finite y.
- cacoshl.ext.08
cacosh(+Inf + i * y) returns +Inf + i * 0, for positive - singed finite y.
- cacoshl.ext.09
cacosh(-Inf + i * Inf) returns +Inf + i * 3/4.
- cacoshl.ext.10
cacosh(+Inf + i * Inf) returns +Inf + i * /4.
- cacoshl.ext.11
cacosh(?Inf + i * NaN) returns +Inf + i * NaN.
- cacoshl.ext.12
cacosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacoshl.ext.13
cacosh(NaN + i * Inf) return +Inf + i * NaN.
- cacoshl.ext.14
cacosh(NaN + i * NaN) returns NaN + i * NaN.
- cacoshl.ext.15
cacosh(1 + i * 0) returns 0 + i * 0.
- cacoshl.ext.16
cacosh(-1 + i * 0) returns 0 + i * .
- [+]casinh (15 / 2 / 0)
- casinh.01
These functions shall compute the complex arc hyperbolic sine of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- casinh.02
These functions shall return the complex arc hyperbolic sine value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- casinh.ext.03
casinh(conj(z)) = conj(casinh(z)), where conj(z) is the complex conjugate of z.
- casinh.ext.04
and casinh is odd
- casinh.ext.05
casinh(+0 + i * 0) returns +0 + i * 0.
- casinh.ext.06
casinh(x + i * Inf) returns +Inf + i * /2 for positive-signed finite x.
- casinh.ext.07
casinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- casinh.ext.08
casinh(+Inf + i * y) returns +Inf + i * 0 for positive-signed finite y.
- casinh.ext.09
casinh(+Inf + i * Inf) returns +Inf + i * /4.
- casinh.ext.10
casinh(+Inf + i * NaN) returns +Inf + i * NaN.
- casinh.ext.11
casinh(NaN + i * 0) returns NaN + i * 0.
- casinh.ext.12
casinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- casinh.ext.13
casinh(NaN + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- casinh.ext.14
casinh(NaN + i * NaN) returns NaN + i * NaN.
- casinh.ext.15
casinh(0 + i) returns +0 + i * /2.
- [+]casinhf (15 / 2 / 0)
- casinhf.01
These functions shall compute the complex arc hyperbolic sine of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- casinhf.02
These functions shall return the complex arc hyperbolic sine value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- casinhf.ext.03
casinh(conj(z)) = conj(casinh(z)), where conj(z) is the complex conjugate of z.
- casinhf.ext.04
and casinh is odd
- casinhf.ext.05
casinh(+0 + i * 0) returns +0 + i * 0.
- casinhf.ext.06
casinh(x + i * Inf) returns +Inf + i * /2 for positive-signed finite x.
- casinhf.ext.07
casinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- casinhf.ext.08
casinh(+Inf + i * y) returns +Inf + i * 0 for positive-signed finite y.
- casinhf.ext.09
casinh(+Inf + i * Inf) returns +Inf + i * /4.
- casinhf.ext.10
casinh(+Inf + i * NaN) returns +Inf + i * NaN.
- casinhf.ext.11
casinh(NaN + i * 0) returns NaN + i * 0.
- casinhf.ext.12
casinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- casinhf.ext.13
casinh(NaN + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- casinhf.ext.14
casinh(NaN + i * NaN) returns NaN + i * NaN.
- casinhf.ext.15
casinh(0 + i) returns +0 + i * /2.
- [+]casinhl (15 / 2 / 0)
- casinhl.01
These functions shall compute the complex arc hyperbolic sine of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- casinhl.02
These functions shall return the complex arc hyperbolic sine value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- casinhl.ext.03
casinh(conj(z)) = conj(casinh(z)), where conj(z) is the complex conjugate of z.
- casinhl.ext.04
and casinh is odd
- casinhl.ext.05
casinh(+0 + i * 0) returns +0 + i * 0.
- casinhl.ext.06
casinh(x + i * Inf) returns +Inf + i * /2 for positive-signed finite x.
- casinhl.ext.07
casinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- casinhl.ext.08
casinh(+Inf + i * y) returns +Inf + i * 0 for positive-signed finite y.
- casinhl.ext.09
casinh(+Inf + i * Inf) returns +Inf + i * /4.
- casinhl.ext.10
casinh(+Inf + i * NaN) returns +Inf + i * NaN.
- casinhl.ext.11
casinh(NaN + i * 0) returns NaN + i * 0.
- casinhl.ext.12
casinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- casinhl.ext.13
casinh(NaN + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- casinhl.ext.14
casinh(NaN + i * NaN) returns NaN + i * NaN.
- casinhl.ext.15
casinh(0 + i) returns +0 + i * /2.
- [+]catanh (15 / 2 / 0)
- catanh.01
These functions shall compute the complex arc hyperbolic tangent of z, with branch cuts outside the interval [-1, +1] along the real axis.
- catanh.02
These functions shall return the complex arc hyperbolic tangent value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- catanh.ext.03
catanh(conj(z)) = conj(catanh(z)), where conj(z) is the complex conjugate of z
- catanh.ext.04
and catanh is odd.
- catanh.ext.05
catanh(+0 + i * 0) returns +0 + i * 0.
- catanh.ext.06
catanh(+0 + i * NaN) returns +0 + i * NaN.
- catanh.ext.07
catanh(+1 + i * 0) returns +Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- catanh.ext.08
catanh(x + i * Inf) returns +0 + i * /2, for finite positive-signed x.
- catanh.ext.09
catanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- catanh.ext.10
catanh(+Inf + i * y) returns +0 + i * /2, for finite positive-signed y.
- catanh.ext.11
catanh(+Inf + i * Inf) returns +0 + i * /2.
- catanh.ext.12
catanh(+Inf + i * NaN) returns +0 + i * NaN.
- catanh.ext.13
catanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- catanh.ext.14
catanh(NaN + i * Inf) returns ?0 + i * /2 (where the sign of the real part of the result is unspecified).
- catanh.ext.15
catanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]catanhf (15 / 2 / 0)
- catanhf.01
These functions shall compute the complex arc hyperbolic tangent of z, with branch cuts outside the interval [-1, +1] along the real axis.
- catanhf.02
These functions shall return the complex arc hyperbolic tangent value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- catanhf.ext.03
catanh(conj(z)) = conj(catanh(z)), where conj(z) is the complex conjugate of z
- catanhf.ext.04
and catanh is odd.
- catanhf.ext.05
catanh(+0 + i * 0) returns +0 + i * 0.
- catanhf.ext.06
catanh(+0 + i * NaN) returns +0 + i * NaN.
- catanhf.ext.07
catanh(+1 + i * 0) returns +Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- catanhf.ext.08
catanh(x + i * Inf) returns +0 + i * /2, for finite positive-signed x.
- catanhf.ext.09
catanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- catanhf.ext.10
catanh(+Inf + i * y) returns +0 + i * /2, for finite positive-signed y.
- catanhf.ext.11
catanh(+Inf + i * Inf) returns +0 + i * /2.
- catanhf.ext.12
catanh(+Inf + i * NaN) returns +0 + i * NaN.
- catanhf.ext.13
catanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- catanhf.ext.14
catanh(NaN + i * Inf) returns ?0 + i * /2 (where the sign of the real part of the result is unspecified).
- catanhf.ext.15
catanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]catanhl (15 / 2 / 0)
- catanhl.01
These functions shall compute the complex arc hyperbolic tangent of z, with branch cuts outside the interval [-1, +1] along the real axis.
- catanhl.02
These functions shall return the complex arc hyperbolic tangent value, in the range of a strip mathematically unbounded along the real axis and in the interval [-i/2, +i/2] along the imaginary axis.
- catanhl.ext.03
catanh(conj(z)) = conj(catanh(z)), where conj(z) is the complex conjugate of z
- catanhl.ext.04
and catanh is odd.
- catanhl.ext.05
catanh(+0 + i * 0) returns +0 + i * 0.
- catanhl.ext.06
catanh(+0 + i * NaN) returns +0 + i * NaN.
- catanhl.ext.07
catanh(+1 + i * 0) returns +Inf + i * 0 and raises the "divide-by-zero" floating-point exception.
- catanhl.ext.08
catanh(x + i * Inf) returns +0 + i * /2, for finite positive-signed x.
- catanhl.ext.09
catanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- catanhl.ext.10
catanh(+Inf + i * y) returns +0 + i * /2, for finite positive-signed y.
- catanhl.ext.11
catanh(+Inf + i * Inf) returns +0 + i * /2.
- catanhl.ext.12
catanh(+Inf + i * NaN) returns +0 + i * NaN.
- catanhl.ext.13
catanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- catanhl.ext.14
catanh(NaN + i * Inf) returns ?0 + i * /2 (where the sign of the real part of the result is unspecified).
- catanhl.ext.15
catanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccosh (16 / 2 / 0)
- ccosh.01
These functions shall compute the complex hyperbolic cosine of z.
- ccosh.02
These functions shall return the complex hyperbolic cosine value.
- ccosh.ext.03
ccosh(conj(z)) = conj(ccosh(z)), where conj(z) is the complex conjugate of z
- ccosh.ext.04
and ccosh is even.
- ccosh.ext.05
ccosh(+0 + i * 0) returns 1 + i * 0.
- ccosh.ext.06
ccosh(+0 + i * Inf) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosh.ext.07
ccosh(+0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccosh.ext.08
ccosh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero x.
- ccosh.ext.09
ccosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- ccosh.ext.10
ccosh(+Inf + i * 0) returns +Inf + i * 0.
- ccosh.ext.11
ccosh(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- ccosh.ext.12
ccosh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosh.ext.13
ccosh(+Inf + i * NaN) returns +Inf + i * NaN.
- ccosh.ext.14
ccosh(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccosh.ext.15
ccosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ccosh.ext.16
ccosh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccoshf (16 / 2 / 0)
- ccoshf.01
These functions shall compute the complex hyperbolic cosine of z.
- ccoshf.02
These functions shall return the complex hyperbolic cosine value.
- ccoshf.ext.03
ccosh(conj(z)) = conj(ccosh(z)), where conj(z) is the complex conjugate of z
- ccoshf.ext.04
and ccosh is even.
- ccoshf.ext.05
ccosh(+0 + i * 0) returns 1 + i * 0.
- ccoshf.ext.06
ccosh(+0 + i * Inf) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccoshf.ext.07
ccosh(+0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccoshf.ext.08
ccosh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero x.
- ccoshf.ext.09
ccosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- ccoshf.ext.10
ccosh(+Inf + i * 0) returns +Inf + i * 0.
- ccoshf.ext.11
ccosh(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- ccoshf.ext.12
ccosh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccoshf.ext.13
ccosh(+Inf + i * NaN) returns +Inf + i * NaN.
- ccoshf.ext.14
ccosh(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccoshf.ext.15
ccosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ccoshf.ext.16
ccosh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccoshl (16 / 2 / 0)
- ccoshl.01
These functions shall compute the complex hyperbolic cosine of z.
- ccoshl.02
These functions shall return the complex hyperbolic cosine value.
- ccoshl.ext.03
ccosh(conj(z)) = conj(ccosh(z)), where conj(z) is the complex conjugate of z
- ccoshl.ext.04
and ccosh is even.
- ccoshl.ext.05
ccosh(+0 + i * 0) returns 1 + i * 0.
- ccoshl.ext.06
ccosh(+0 + i * Inf) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccoshl.ext.07
ccosh(+0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccoshl.ext.08
ccosh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero x.
- ccoshl.ext.09
ccosh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- ccoshl.ext.10
ccosh(+Inf + i * 0) returns +Inf + i * 0.
- ccoshl.ext.11
ccosh(+Inf + i * y) returns +Inf * cis(y), for finite nonzero y (where cis(y) = cos(y) + i * sin(y)).
- ccoshl.ext.12
ccosh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccoshl.ext.13
ccosh(+Inf + i * NaN) returns +Inf + i * NaN.
- ccoshl.ext.14
ccosh(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccoshl.ext.15
ccosh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ccoshl.ext.16
ccosh(NaN + i * NaN) returns NaN + i * NaN.
- [+]csinh (16 / 2 / 0)
- csinh.01
These functions shall compute the complex hyperbolic sine of z.
- csinh.02
These functions shall return the complex hyperbolic sine value.
- csinh.ext.03
csinh(conj(z)) = conj(csinh(z)), where conj(z) is the complex conjugate of z
- csinh.ext.04
and csinh is odd.
- csinh.ext.05
csinh(+0 + i * 0) returns +0 + i * 0.
- csinh.ext.06
csinh(+0 + i * Inf) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinh.ext.07
csinh(+0 + i * NaN) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified).
- csinh.ext.08
csinh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite x.
- csinh.ext.09
csinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- csinh.ext.10
csinh(+Inf + i * 0) returns +Inf + i * 0.
- csinh.ext.11
csinh(+Inf + i * y) returns +Inf * cis(y), for positive finite y (where cis(y) = cos(y) + i * sin(y)).
- csinh.ext.12
csinh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinh.ext.13
csinh(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- csinh.ext.14
csinh(NaN + i * 0) returns NaN + i * 0.
- csinh.ext.15
csinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- csinh.ext.16
csinh(NaN + i * NaN) returns NaN + i * NaN.
- [+]csinhf (16 / 2 / 0)
- csinhf.01
These functions shall compute the complex hyperbolic sine of z.
- csinhf.02
These functions shall return the complex hyperbolic sine value.
- csinhf.ext.03
csinh(conj(z)) = conj(csinh(z)), where conj(z) is the complex conjugate of z
- csinhf.ext.04
and csinh is odd.
- csinhf.ext.05
csinh(+0 + i * 0) returns +0 + i * 0.
- csinhf.ext.06
csinh(+0 + i * Inf) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinhf.ext.07
csinh(+0 + i * NaN) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified).
- csinhf.ext.08
csinh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite x.
- csinhf.ext.09
csinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- csinhf.ext.10
csinh(+Inf + i * 0) returns +Inf + i * 0.
- csinhf.ext.11
csinh(+Inf + i * y) returns +Inf * cis(y), for positive finite y (where cis(y) = cos(y) + i * sin(y)).
- csinhf.ext.12
csinh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinhf.ext.13
csinh(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- csinhf.ext.14
csinh(NaN + i * 0) returns NaN + i * 0.
- csinhf.ext.15
csinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- csinhf.ext.16
csinh(NaN + i * NaN) returns NaN + i * NaN.
- [+]csinhl (16 / 2 / 0)
- csinhl.01
These functions shall compute the complex hyperbolic sine of z.
- csinhl.02
These functions shall return the complex hyperbolic sine value.
- csinhl.ext.03
csinh(conj(z)) = conj(csinh(z)), where conj(z) is the complex conjugate of z
- csinhl.ext.04
and csinh is odd.
- csinhl.ext.05
csinh(+0 + i * 0) returns +0 + i * 0.
- csinhl.ext.06
csinh(+0 + i * Inf) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinhl.ext.07
csinh(+0 + i * NaN) returns ?0 + i * NaN (where the sign of the real part of the result is unspecified).
- csinhl.ext.08
csinh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite x.
- csinhl.ext.09
csinh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- csinhl.ext.10
csinh(+Inf + i * 0) returns +Inf + i * 0.
- csinhl.ext.11
csinh(+Inf + i * y) returns +Inf * cis(y), for positive finite y (where cis(y) = cos(y) + i * sin(y)).
- csinhl.ext.12
csinh(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinhl.ext.13
csinh(+Inf + i * NaN) returns ?Inf + i * NaN (where the sign of the real part of the result is unspecified).
- csinhl.ext.14
csinh(NaN + i * 0) returns NaN + i * 0.
- csinhl.ext.15
csinh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- csinhl.ext.16
csinh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctanh (13 / 2 / 0)
- ctanh.01
These functions shall compute the complex hyperbolic tangent of z.
- ctanh.02
These functions shall return the complex hyperbolic tangent value.
- ctanh.ext.03
ctanh(conj(z)) = conj(ctanh(z)), where conj(z) is the complex conjugate of z
- ctanh.ext.04
and ctanh is odd.
- ctanh.ext.05
ctanh(+0 + i * 0) returns +0 + i * 0.
- ctanh.ext.06
ctanh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- ctanh.ext.07
ctanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- ctanh.ext.08
ctanh(+Inf + i * y) returns 1 + i * 0 * sin(2y), for positive-signed finite y.
- ctanh.ext.09
ctanh(+Inf + i * Inf) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanh.ext.10
ctanh(+Inf + i * NaN) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanh.ext.11
ctanh(NaN + i * 0) returns NaN + i * 0.
- ctanh.ext.12
ctanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ctanh.ext.13
ctanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctanhf (13 / 2 / 0)
- ctanhf.01
These functions shall compute the complex hyperbolic tangent of z.
- ctanhf.02
These functions shall return the complex hyperbolic tangent value.
- ctanhf.ext.03
ctanh(conj(z)) = conj(ctanh(z)), where conj(z) is the complex conjugate of z
- ctanhf.ext.04
and ctanh is odd.
- ctanhf.ext.05
ctanh(+0 + i * 0) returns +0 + i * 0.
- ctanhf.ext.06
ctanh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- ctanhf.ext.07
ctanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- ctanhf.ext.08
ctanh(+Inf + i * y) returns 1 + i * 0 * sin(2y), for positive-signed finite y.
- ctanhf.ext.09
ctanh(+Inf + i * Inf) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanhf.ext.10
ctanh(+Inf + i * NaN) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanhf.ext.11
ctanh(NaN + i * 0) returns NaN + i * 0.
- ctanhf.ext.12
ctanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ctanhf.ext.13
ctanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctanhl (13 / 2 / 0)
- ctanhl.01
These functions shall compute the complex hyperbolic tangent of z.
- ctanhl.02
These functions shall return the complex hyperbolic tangent value.
- ctanhl.ext.03
ctanh(conj(z)) = conj(ctanh(z)), where conj(z) is the complex conjugate of z
- ctanhl.ext.04
and ctanh is odd.
- ctanhl.ext.05
ctanh(+0 + i * 0) returns +0 + i * 0.
- ctanhl.ext.06
ctanh(x + i * Inf) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite x.
- ctanhl.ext.07
ctanh(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- ctanhl.ext.08
ctanh(+Inf + i * y) returns 1 + i * 0 * sin(2y), for positive-signed finite y.
- ctanhl.ext.09
ctanh(+Inf + i * Inf) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanhl.ext.10
ctanh(+Inf + i * NaN) returns 1 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ctanhl.ext.11
ctanh(NaN + i * 0) returns NaN + i * 0.
- ctanhl.ext.12
ctanh(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers y.
- ctanhl.ext.13
ctanh(NaN + i * NaN) returns NaN + i * NaN.
- [+]math.complex (39 / 36 / 0)
- [+]cabs (2 / 2 / 0)
- cabs.01
These functions shall compute the complex absolute value (also called norm, modulus, or magnitude) of z.
- cabs.02
These functions shall return the complex absolute value.
- [+]cabsf (2 / 2 / 0)
- cabsf.01
These functions shall compute the complex absolute value (also called norm, modulus, or magnitude) of z.
- cabsf.02
These functions shall return the complex absolute value.
- [+]cabsl (2 / 2 / 0)
- cabsl.01
These functions shall compute the complex absolute value (also called norm, modulus, or magnitude) of z.
- cabsl.02
These functions shall return the complex absolute value.
- [+]carg (2 / 2 / 0)
- carg.01
These functions shall compute the argument (also called phase angle) of z, with a branch cut along the negative real axis.
- carg.02
These functions shall return the value of the argument in the interval [-, +].
- [+]cargf (2 / 2 / 0)
- cargf.01
These functions shall compute the argument (also called phase angle) of z, with a branch cut along the negative real axis.
- cargf.02
These functions shall return the value of the argument in the interval [-, +].
- [+]cargl (2 / 2 / 0)
- cargl.01
These functions shall compute the argument (also called phase angle) of z, with a branch cut along the negative real axis.
- cargl.02
These functions shall return the value of the argument in the interval [-, +].
- [+]cimag (2 / 2 / 0)
- cimag.01
These functions shall compute the imaginary part of z.
- cimag.02
These functions shall return the imaginary part value (as a real).
- [+]cimagf (2 / 2 / 0)
- cimagf.01
These functions shall compute the imaginary part of z.
- cimagf.02
These functions shall return the imaginary part value (as a real).
- [+]cimagl (2 / 2 / 0)
- cimagl.01
These functions shall compute the imaginary part of z.
- cimagl.02
These functions shall return the imaginary part value (as a real).
- [+]conj (2 / 2 / 0)
- conj.01
These functions shall compute the complex conjugate of z, by reversing the sign of its imaginary part.
- conj.02
These functions return the complex conjugate value.
- [+]conjf (2 / 2 / 0)
- conjf.01
These functions shall compute the complex conjugate of z, by reversing the sign of its imaginary part.
- conjf.02
These functions return the complex conjugate value.
- [+]conjl (2 / 2 / 0)
- conjl.01
These functions shall compute the complex conjugate of z, by reversing the sign of its imaginary part.
- conjl.02
These functions return the complex conjugate value.
- [+]cproj (3 / 2 / 0)
- cproj.01
These functions shall compute a projection of z onto the Riemann sphere: z projects to z, except that all complex infinities (even those with one infinite part and one NaN part) project to positive infinity on the real axis.
- cproj.02
If z has an infinite part, then cproj( z) shall be equivalent to: INFINITY + I * copysign(0.0, cimag(z))
- cproj.03
These functions shall return the value of the projection onto the Riemann sphere.
Generalizes:
- [+]cprojf (3 / 2 / 0)
- cprojf.01
These functions shall compute a projection of z onto the Riemann sphere: z projects to z, except that all complex infinities (even those with one infinite part and one NaN part) project to positive infinity on the real axis.
- cprojf.02
If z has an infinite part, then cproj( z) shall be equivalent to: INFINITY + I * copysign(0.0, cimag(z))
- cprojf.03
These functions shall return the value of the projection onto the Riemann sphere.
Generalizes:
- [+]cprojl (3 / 2 / 0)
- cprojl.01
These functions shall compute a projection of z onto the Riemann sphere: z projects to z, except that all complex infinities (even those with one infinite part and one NaN part) project to positive infinity on the real axis.
- cprojl.02
If z has an infinite part, then cproj( z) shall be equivalent to: INFINITY + I * copysign(0.0, cimag(z))
- cprojl.03
These functions shall return the value of the projection onto the Riemann sphere.
Generalizes:
- [+]creal (2 / 2 / 0)
- creal.01
These functions shall compute the real part of z.
- creal.02
These functions shall return the real part value.
- [+]crealf (2 / 2 / 0)
- crealf.01
These functions shall compute the real part of z.
- crealf.02
These functions shall return the real part value.
- [+]creall (2 / 2 / 0)
- creall.01
These functions shall compute the real part of z.
- creall.02
These functions shall return the real part value.
- [+]math.ctrig (282 / 36 / 0)
- [+]cacos (15 / 2 / 0)
- cacos.01
These functions shall compute the complex arc cosine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- cacos.02
These functions shall return the complex arc cosine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [0, ] along the real axis.
- cacos.ext.03
cacos(conj(z)) = conj(cacos(z)), where conj(z) is the complex conjugate of z.
- cacos.ext.04
cacos(?0 + i * 0) returns /2 - i * 0.
- cacos.ext.05
cacos(?0 + i * NaN ) returns /2 + i * NaN.
- cacos.ext.06
cacos(x + i * Inf) returns /2 - i * Inf, for finite x.
- cacos.ext.07
cacos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- cacos.ext.08
cacos(-Inf + i * y) returns - i * Inf, for positive-signed finite y.
- cacos.ext.09
cacos(+Inf + i * y) returns +0 - i * Inf, for positive-signed finite y.
- cacos.ext.10
cacos(-Inf + i * Inf) returns 3/4 - i * Inf.
- cacos.ext.11
cacos(+Inf + i * Inf) returns /4 - i * Inf.
- cacos.ext.12
cacos(?Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- cacos.ext.13
cacos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacos.ext.14
cacos(NaN + i * Inf) returns NaN - i * Inf.
- cacos.ext.15
cacos(NaN + i * NaN) returns NaN + i * NaN.
- [+]cacosf (15 / 2 / 0)
- cacosf.01
These functions shall compute the complex arc cosine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- cacosf.02
These functions shall return the complex arc cosine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [0, ] along the real axis.
- cacosf.ext.03
cacos(conj(z)) = conj(cacos(z)), where conj(z) is the complex conjugate of z.
- cacosf.ext.04
cacos(?0 + i * 0) returns /2 - i * 0.
- cacosf.ext.05
cacos(?0 + i * NaN ) returns /2 + i * NaN.
- cacosf.ext.06
cacos(x + i * Inf) returns /2 - i * Inf, for finite x.
- cacosf.ext.07
cacos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- cacosf.ext.08
cacos(-Inf + i * y) returns - i * Inf, for positive-signed finite y.
- cacosf.ext.09
cacos(+Inf + i * y) returns +0 - i * Inf, for positive-signed finite y.
- cacosf.ext.10
cacos(-Inf + i * Inf) returns 3/4 - i * Inf.
- cacosf.ext.11
cacos(+Inf + i * Inf) returns /4 - i * Inf.
- cacosf.ext.12
cacos(?Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- cacosf.ext.13
cacos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacosf.ext.14
cacos(NaN + i * Inf) returns NaN - i * Inf.
- cacosf.ext.15
cacos(NaN + i * NaN) returns NaN + i * NaN.
- [+]cacosl (15 / 2 / 0)
- cacosl.01
These functions shall compute the complex arc cosine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- cacosl.02
These functions shall return the complex arc cosine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [0, ] along the real axis.
- cacosl.ext.03
cacos(conj(z)) = conj(cacos(z)), where conj(z) is the complex conjugate of z.
- cacosl.ext.04
cacos(?0 + i * 0) returns /2 - i * 0.
- cacosl.ext.05
cacos(?0 + i * NaN ) returns /2 + i * NaN.
- cacosl.ext.06
cacos(x + i * Inf) returns /2 - i * Inf, for finite x.
- cacosl.ext.07
cacos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite x.
- cacosl.ext.08
cacos(-Inf + i * y) returns - i * Inf, for positive-signed finite y.
- cacosl.ext.09
cacos(+Inf + i * y) returns +0 - i * Inf, for positive-signed finite y.
- cacosl.ext.10
cacos(-Inf + i * Inf) returns 3/4 - i * Inf.
- cacosl.ext.11
cacos(+Inf + i * Inf) returns /4 - i * Inf.
- cacosl.ext.12
cacos(?Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- cacosl.ext.13
cacos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- cacosl.ext.14
cacos(NaN + i * Inf) returns NaN - i * Inf.
- cacosl.ext.15
cacos(NaN + i * NaN) returns NaN + i * NaN.
- [+]casin (15 / 2 / 0)
- casin.01
These functions shall compute the complex arc sine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- casin.02
These functions shall return the complex arc sine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- casin.ext.03
casin(z) = -i * casinh(iz).
- casin.ext.04
casin(conj(z)) = conj(casin(z)), where conj(z) is the complex conjugate of z
- casin.ext.05
and casin is odd.
- casin.ext.06
casin(+0 + i * 0) returns +0 + i * 0.
- casin.ext.07
casin(0 + i * NaN) returns +0 + i * NaN.
- casin.ext.08
casin(x + i * Inf) returns +0 + i * Inf for positive-signed finite x.
- casin.ext.09
casin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- casin.ext.10
casin(+Inf + i * y) returns /2 + i * Inf for positive-signed finite y.
- casin.ext.11
casin(+Inf + i * Inf) returns /4 + i * Inf.
- casin.ext.12
casin(+Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- casin.ext.13
casin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- casin.ext.14
casin(NaN + i * Inf) returns NaN + i * Inf.
- casin.ext.15
casin(NaN + i * NaN) returns NaN + i * NaN.
- [+]casinf (15 / 2 / 0)
- casinf.01
These functions shall compute the complex arc sine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- casinf.02
These functions shall return the complex arc sine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- casinf.ext.03
casin(z) = -i * casinh(iz).
- casinf.ext.04
casin(conj(z)) = conj(casin(z)), where conj(z) is the complex conjugate of z
- casinf.ext.05
and casin is odd.
- casinf.ext.06
casin(+0 + i * 0) returns +0 + i * 0.
- casinf.ext.07
casin(0 + i * NaN) returns +0 + i * NaN.
- casinf.ext.08
casin(x + i * Inf) returns +0 + i * Inf for positive-signed finite x.
- casinf.ext.09
casin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- casinf.ext.10
casin(+Inf + i * y) returns /2 + i * Inf for positive-signed finite y.
- casinf.ext.11
casin(+Inf + i * Inf) returns /4 + i * Inf.
- casinf.ext.12
casin(+Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- casinf.ext.13
casin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- casinf.ext.14
casin(NaN + i * Inf) returns NaN + i * Inf.
- casinf.ext.15
casin(NaN + i * NaN) returns NaN + i * NaN.
- [+]casinl (15 / 2 / 0)
- casinl.01
These functions shall compute the complex arc sine of z, with branch cuts outside the interval [-1, +1] along the real axis.
- casinl.02
These functions shall return the complex arc sine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- casinl.ext.03
casin(z) = -i * casinh(iz).
- casinl.ext.04
casin(conj(z)) = conj(casin(z)), where conj(z) is the complex conjugate of z
- casinl.ext.05
and casin is odd.
- casinl.ext.06
casin(+0 + i * 0) returns +0 + i * 0.
- casinl.ext.07
casin(0 + i * NaN) returns +0 + i * NaN.
- casinl.ext.08
casin(x + i * Inf) returns +0 + i * Inf for positive-signed finite x.
- casinl.ext.09
casin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero x.
- casinl.ext.10
casin(+Inf + i * y) returns /2 + i * Inf for positive-signed finite y.
- casinl.ext.11
casin(+Inf + i * Inf) returns /4 + i * Inf.
- casinl.ext.12
casin(+Inf + i * NaN) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- casinl.ext.13
casin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- casinl.ext.14
casin(NaN + i * Inf) returns NaN + i * Inf.
- casinl.ext.15
casin(NaN + i * NaN) returns NaN + i * NaN.
- [+]catan (16 / 2 / 0)
- catan.01
These functions shall compute the complex arc tangent of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- catan.02
These functions shall return the complex arc tangent value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- catan.ext.03
catan(z) = -i * catanh(iz).
- catan.ext.04
catan(conj(z)) = conj(catan(z)), where conj(z) is the complex conjugate of z
- catan.ext.05
and catan is odd.
- catan.ext.06
catan(+0 + i * 0) returns +0 + i * 0.
- catan.ext.07
catan(+0 + i * 1) returns +0 + i * Inf and raises the "divide-by-zero" floating-point exception.
- catan.ext.08
catan(x + i * Inf) returns /2 + i * 0, for finite positive-signed x.
- catan.ext.09
catan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- catan.ext.10
catan(+Inf + i * y) returns /2 + i * 0, for finite positive-signed y.
- catan.ext.11
catan(+Inf + i * Inf) returns /2 + i * 0.
- catan.ext.12
catan(+Inf + i * NaN) returns /2 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- catan.ext.13
catan(NaN + i * 0) returns NaN + i * 0.
- catan.ext.14
catan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite y.
- catan.ext.15
catan(NaN + i * Inf) returns NaN + i * 0.
- catan.ext.16
catan(NaN + i * NaN) returns NaN + i * NaN.
- [+]catanf (16 / 2 / 0)
- catanf.01
These functions shall compute the complex arc tangent of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- catanf.02
These functions shall return the complex arc tangent value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- catanf.ext.03
catan(z) = -i * catanh(iz).
- catanf.ext.04
catan(conj(z)) = conj(catan(z)), where conj(z) is the complex conjugate of z
- catanf.ext.05
and catan is odd.
- catanf.ext.06
catan(+0 + i * 0) returns +0 + i * 0.
- catanf.ext.07
catan(+0 + i * 1) returns +0 + i * Inf and raises the "divide-by-zero" floating-point exception.
- catanf.ext.08
catan(x + i * Inf) returns /2 + i * 0, for finite positive-signed x.
- catanf.ext.09
catan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- catanf.ext.10
catan(+Inf + i * y) returns /2 + i * 0, for finite positive-signed y.
- catanf.ext.11
catan(+Inf + i * Inf) returns /2 + i * 0.
- catanf.ext.12
catan(+Inf + i * NaN) returns /2 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- catanf.ext.13
catan(NaN + i * 0) returns NaN + i * 0.
- catanf.ext.14
catan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite y.
- catanf.ext.15
catan(NaN + i * Inf) returns NaN + i * 0.
- catanf.ext.16
catan(NaN + i * NaN) returns NaN + i * NaN.
- [+]catanl (16 / 2 / 0)
- catanl.01
These functions shall compute the complex arc tangent of z, with branch cuts outside the interval [-i, +i] along the imaginary axis.
- catanl.02
These functions shall return the complex arc tangent value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-/2, +/2] along the real axis.
- catanl.ext.03
catan(z) = -i * catanh(iz).
- catanl.ext.04
catan(conj(z)) = conj(catan(z)), where conj(z) is the complex conjugate of z
- catanl.ext.05
and catan is odd.
- catanl.ext.06
catan(+0 + i * 0) returns +0 + i * 0.
- catanl.ext.07
catan(+0 + i * 1) returns +0 + i * Inf and raises the "divide-by-zero" floating-point exception.
- catanl.ext.08
catan(x + i * Inf) returns /2 + i * 0, for finite positive-signed x.
- catanl.ext.09
catan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite x.
- catanl.ext.10
catan(+Inf + i * y) returns /2 + i * 0, for finite positive-signed y.
- catanl.ext.11
catan(+Inf + i * Inf) returns /2 + i * 0.
- catanl.ext.12
catan(+Inf + i * NaN) returns /2 ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- catanl.ext.13
catan(NaN + i * 0) returns NaN + i * 0.
- catanl.ext.14
catan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for nonzero finite y.
- catanl.ext.15
catan(NaN + i * Inf) returns NaN + i * 0.
- catanl.ext.16
catan(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccos (17 / 2 / 0)
- ccos.01
These functions shall compute the complex cosine of z.
- ccos.02
These functions shall return the complex cosine value.
- ccos.ext.03
ccos(z) = ccos(iz).
- ccos.ext.04
ccos(conj(z)) = conj(ccos(z)), where conj(z) is the complex conjugate of z
- ccos.ext.05
and ccos is even.
- ccos.ext.06
ccos(+0 + i * 0) returns 1 - i * 0.
- ccos.ext.07
ccos(+0 + i * Inf) returns +Inf - i * 0.
- ccos.ext.08
ccos(0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccos.ext.09
ccos(x + i * Inf) returns +Inf * conj( cis(y) ), for finite nonzero x (where conj( cis(y) ) = cos(y) - i * sin(y)).
- ccos.ext.10
ccos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ccos.ext.11
ccos(Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccos.ext.12
ccos(Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero y.
- ccos.ext.13
ccos(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccos.ext.14
ccos(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccos.ext.15
ccos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- ccos.ext.16
ccos(NaN + i * Inf) returns +Inf + i * NaN.
- ccos.ext.17
ccos(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccosf (17 / 2 / 0)
- ccosf.01
These functions shall compute the complex cosine of z.
- ccosf.02
These functions shall return the complex cosine value.
- ccosf.ext.03
ccos(z) = ccos(iz).
- ccosf.ext.04
ccos(conj(z)) = conj(ccos(z)), where conj(z) is the complex conjugate of z
- ccosf.ext.05
and ccos is even.
- ccosf.ext.06
ccos(+0 + i * 0) returns 1 - i * 0.
- ccosf.ext.07
ccos(+0 + i * Inf) returns +Inf - i * 0.
- ccosf.ext.08
ccos(0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccosf.ext.09
ccos(x + i * Inf) returns +Inf * conj( cis(y) ), for finite nonzero x (where conj( cis(y) ) = cos(y) - i * sin(y)).
- ccosf.ext.10
ccos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ccosf.ext.11
ccos(Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosf.ext.12
ccos(Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero y.
- ccosf.ext.13
ccos(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosf.ext.14
ccos(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccosf.ext.15
ccos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- ccosf.ext.16
ccos(NaN + i * Inf) returns +Inf + i * NaN.
- ccosf.ext.17
ccos(NaN + i * NaN) returns NaN + i * NaN.
- [+]ccosl (17 / 2 / 0)
- ccosl.01
These functions shall compute the complex cosine of z.
- ccosl.02
These functions shall return the complex cosine value.
- ccosl.ext.03
ccos(z) = ccos(iz).
- ccosl.ext.04
ccos(conj(z)) = conj(ccos(z)), where conj(z) is the complex conjugate of z
- ccosl.ext.05
and ccos is even.
- ccosl.ext.06
ccos(+0 + i * 0) returns 1 - i * 0.
- ccosl.ext.07
ccos(+0 + i * Inf) returns +Inf - i * 0.
- ccosl.ext.08
ccos(0 + i * NaN) returns NaN ? i * 0 (where the sign of the imaginary part of the resul is unspecified).
- ccosl.ext.09
ccos(x + i * Inf) returns +Inf * conj( cis(y) ), for finite nonzero x (where conj( cis(y) ) = cos(y) - i * sin(y)).
- ccosl.ext.10
ccos(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ccosl.ext.11
ccos(Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosl.ext.12
ccos(Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite nonzero y.
- ccosl.ext.13
ccos(+Inf + i * Inf) returns ?Inf + i * NaN (where the sign of real part of the result is unspecified) and raises the "invalid" floating-point exception.
- ccosl.ext.14
ccos(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- ccosl.ext.15
ccos(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- ccosl.ext.16
ccos(NaN + i * Inf) returns +Inf + i * NaN.
- ccosl.ext.17
ccos(NaN + i * NaN) returns NaN + i * NaN.
- [+]csin (17 / 2 / 0)
- csin.01
These functions shall compute the complex sine of z.
- csin.02
These functions shall return the complex sine value.
- csin.ext.03
csin(z) = -i * csinh(iz).
- csin.ext.04
csin(conj(z)) = conj(csin(z)), where conj(z) is the complex conjugate of z
- csin.ext.05
and csin is odd.
- csin.ext.06
csin(+0 + i * 0) returns +0 + i * 0.
- csin.ext.07
csin(+0 + i * Inf) returns +0 + i * Inf.
- csin.ext.08
csin(+0 + i * NaN) returns +0 + i * NaN.
- csin.ext.09
csin(x + i * Inf) returns +Inf * sic(x), for positive finite x (where sic(x) = sin(x) - i * cos(x)).
- csin.ext.10
csin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- csin.ext.11
csin(+Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csin.ext.12
csin(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite y.
- csin.ext.13
csin(+Inf + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csin.ext.14
csin(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- csin.ext.15
csin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- csin.ext.16
csin(NaN + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csin.ext.17
csin(NaN + i * NaN) returns NaN + i * NaN.
- [+]csinf (17 / 2 / 0)
- csinf.01
These functions shall compute the complex sine of z.
- csinf.02
These functions shall return the complex sine value.
- csinf.ext.03
csin(z) = -i * csinh(iz).
- csinf.ext.04
csin(conj(z)) = conj(csin(z)), where conj(z) is the complex conjugate of z
- csinf.ext.05
and csin is odd.
- csinf.ext.06
csin(+0 + i * 0) returns +0 + i * 0.
- csinf.ext.07
csin(+0 + i * Inf) returns +0 + i * Inf.
- csinf.ext.08
csin(+0 + i * NaN) returns +0 + i * NaN.
- csinf.ext.09
csin(x + i * Inf) returns +Inf * sic(x), for positive finite x (where sic(x) = sin(x) - i * cos(x)).
- csinf.ext.10
csin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- csinf.ext.11
csin(+Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinf.ext.12
csin(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite y.
- csinf.ext.13
csin(+Inf + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinf.ext.14
csin(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- csinf.ext.15
csin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- csinf.ext.16
csin(NaN + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csinf.ext.17
csin(NaN + i * NaN) returns NaN + i * NaN.
- [+]csinl (17 / 2 / 0)
- csinl.01
These functions shall compute the complex sine of z.
- csinl.02
These functions shall return the complex sine value.
- csinl.ext.03
csin(z) = -i * csinh(iz).
- csinl.ext.04
csin(conj(z)) = conj(csin(z)), where conj(z) is the complex conjugate of z
- csinl.ext.05
and csin is odd.
- csinl.ext.06
csin(+0 + i * 0) returns +0 + i * 0.
- csinl.ext.07
csin(+0 + i * Inf) returns +0 + i * Inf.
- csinl.ext.08
csin(+0 + i * NaN) returns +0 + i * NaN.
- csinl.ext.09
csin(x + i * Inf) returns +Inf * sic(x), for positive finite x (where sic(x) = sin(x) - i * cos(x)).
- csinl.ext.10
csin(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- csinl.ext.11
csin(+Inf + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinl.ext.12
csin(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for positive finite y.
- csinl.ext.13
csin(+Inf + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified) and raises the "invalid" floating-point exception.
- csinl.ext.14
csin(NaN + i * 0) returns NaN ? i * 0 (where the sign of the imaginary part of the result is unspecified).
- csinl.ext.15
csin(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite nonzero y.
- csinl.ext.16
csin(NaN + i * Inf) returns NaN ? i * Inf (where the sign of the imaginary part of the result is unspecified).
- csinl.ext.17
csin(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctan (14 / 2 / 0)
- ctan.01
These functions shall compute the complex tangent of z.
- ctan.02
These functions shall return the complex tangent value.
- ctan.ext.03
ctan(z) = -i * ctanh(iz).
- ctan.ext.04
ctan(conj(z)) = conj(ctan(z)), where conj(z) is the complex conjugate of z
- ctan.ext.05
and ctan is odd.
- ctan.ext.06
ctan(+0 + i * 0) returns +0 + i * 0.
- ctan.ext.07
ctan(+0 + i * NaN) returns +0 + i * NaN.
- ctan.ext.08
ctan(x + i * Inf) returns +0 * sin(2x) + i, for positive-signed finite x.
- ctan.ext.09
ctan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ctan.ext.10
ctan(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite y.
- ctan.ext.11
ctan(+Inf + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctan.ext.12
ctan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- ctan.ext.13
ctan(NaN + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctan.ext.14
ctan(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctanf (14 / 2 / 0)
- ctanf.01
These functions shall compute the complex tangent of z.
- ctanf.02
These functions shall return the complex tangent value.
- ctanf.ext.03
ctan(z) = -i * ctanh(iz).
- ctanf.ext.04
ctan(conj(z)) = conj(ctan(z)), where conj(z) is the complex conjugate of z
- ctanf.ext.05
and ctan is odd.
- ctanf.ext.06
ctan(+0 + i * 0) returns +0 + i * 0.
- ctanf.ext.07
ctan(+0 + i * NaN) returns +0 + i * NaN.
- ctanf.ext.08
ctan(x + i * Inf) returns +0 * sin(2x) + i, for positive-signed finite x.
- ctanf.ext.09
ctan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ctanf.ext.10
ctan(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite y.
- ctanf.ext.11
ctan(+Inf + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctanf.ext.12
ctan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- ctanf.ext.13
ctan(NaN + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctanf.ext.14
ctan(NaN + i * NaN) returns NaN + i * NaN.
- [+]ctanl (14 / 2 / 0)
- ctanl.01
These functions shall compute the complex tangent of z.
- ctanl.02
These functions shall return the complex tangent value.
- ctanl.ext.03
ctan(z) = -i * ctanh(iz).
- ctanl.ext.04
ctan(conj(z)) = conj(ctan(z)), where conj(z) is the complex conjugate of z
- ctanl.ext.05
and ctan is odd.
- ctanl.ext.06
ctan(+0 + i * 0) returns +0 + i * 0.
- ctanl.ext.07
ctan(+0 + i * NaN) returns +0 + i * NaN.
- ctanl.ext.08
ctan(x + i * Inf) returns +0 * sin(2x) + i, for positive-signed finite x.
- ctanl.ext.09
ctan(x + i * NaN) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for all nonzero numbers x.
- ctanl.ext.10
ctan(+Inf + i * y) returns NaN + i * NaN and raises the "invalid" floating-point exception, for finite y.
- ctanl.ext.11
ctan(+Inf + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctanl.ext.12
ctan(NaN + i * y) returns NaN + i * NaN and optionally raises the "invalid" floating-point exception, for finite y.
- ctanl.ext.13
ctan(NaN + i * Inf) returns ?0 + i (where the sign of the real part of the result is unspecified).
- ctanl.ext.14
ctan(NaN + i * NaN) returns NaN + i * NaN.
- [+]math.error (66 / 38 / 0)
- [+]erf (10 / 6 / 0)
- erf.01
These functions shall compute the error function of their argument x, defined as:
Generalizes:
- erf.02
- erf.03
- erf.04
- erf.05
- erf.06
- erf.07
- erf.08
- erf.09.01.01
- erf.09.01.02
- erf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erf.04
Upon successful completion, these functions shall return the value of the error function.
- erf.05
[MX] If x is NaN, a NaN shall be returned.
- erf.06
If x is ?0, ?0 shall be returned.
- erf.07
If x is ?Inf, ?1 shall be returned.
- erf.08
If x is subnormal, a range error may occur, and 2 * x/ sqrt() should be returned.
- erf.09
These functions may fail if:
- erf.09.01
Range Error [MX] The result underflows.
- erf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]erfc (12 / 7 / 0)
- erfc.01
These functions shall compute the complementary error function 1.0 - erf(x).
Generalizes:
- erfc.02
- erfc.03
- erfc.04
- erfc.05
- erfc.06
- erfc.07
- erfc.08
- erfc.09
- erfc.10
- erfc.11.01.01
- erfc.11.01.02
- erfc.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erfc.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erfc.04
Upon successful completion, these functions shall return the value of the complementary error function.
- erfc.05
If the correct value would cause underflow and is not representable, a range error may occur and [MX] either 0.0 (if representable), or an implementation-defined value shall be returned.
- erfc.06
[MX] If x is NaN, a NaN shall be returned.
- erfc.07
If x is ?0, +1 shall be returned.
- erfc.08
If x is -Inf, +2 shall be returned.
- erfc.09
If x is +Inf, +0 shall be returned.
- erfc.10
If the correct value would cause underflow and is representable, a range error may occur and the correct value shall be returned.
- erfc.11
These functions may fail if:
- erfc.11.01
Range Error The result underflows.
- erfc.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erfc.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]erfcf (12 / 7 / 0)
- erfcf.01
These functions shall compute the complementary error function 1.0 - erf(x).
Generalizes:
- erfcf.02
- erfcf.03
- erfcf.04
- erfcf.05
- erfcf.06
- erfcf.07
- erfcf.08
- erfcf.09
- erfcf.10
- erfcf.11.01.01
- erfcf.11.01.02
- erfcf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erfcf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erfcf.04
Upon successful completion, these functions shall return the value of the complementary error function.
- erfcf.05
If the correct value would cause underflow and is not representable, a range error may occur and [MX] either 0.0 (if representable), or an implementation-defined value shall be returned.
- erfcf.06
[MX] If x is NaN, a NaN shall be returned.
- erfcf.07
If x is ?0, +1 shall be returned.
- erfcf.08
If x is -Inf, +2 shall be returned.
- erfcf.09
If x is +Inf, +0 shall be returned.
- erfcf.10
If the correct value would cause underflow and is representable, a range error may occur and the correct value shall be returned.
- erfcf.11
These functions may fail if:
- erfcf.11.01
Range Error The result underflows.
- erfcf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erfcf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]erfcl (12 / 6 / 0)
- erfcl.01
These functions shall compute the complementary error function 1.0 - erf(x).
Generalizes:
- erfcl.02
- erfcl.03
- erfcl.04
- erfcl.05
- erfcl.06
- erfcl.07
- erfcl.08
- erfcl.09
- erfcl.10
- erfcl.11.01.01
- erfcl.11.01.02
- erfcl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erfcl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erfcl.04
Upon successful completion, these functions shall return the value of the complementary error function.
- erfcl.05
If the correct value would cause underflow and is not representable, a range error may occur and [MX] either 0.0 (if representable), or an implementation-defined value shall be returned.
- erfcl.06
[MX] If x is NaN, a NaN shall be returned.
- erfcl.07
If x is ?0, +1 shall be returned.
- erfcl.08
If x is -Inf, +2 shall be returned.
- erfcl.09
If x is +Inf, +0 shall be returned.
- erfcl.10
If the correct value would cause underflow and is representable, a range error may occur and the correct value shall be returned.
- erfcl.11
These functions may fail if:
- erfcl.11.01
Range Error The result underflows.
- erfcl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erfcl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]erff (10 / 6 / 0)
- erff.01
These functions shall compute the error function of their argument x, defined as:
Generalizes:
- erff.02
- erff.03
- erff.04
- erff.05
- erff.06
- erff.07
- erff.08
- erff.09.01.01
- erff.09.01.02
- erff.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erff.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erff.04
Upon successful completion, these functions shall return the value of the error function.
- erff.05
[MX] If x is NaN, a NaN shall be returned.
- erff.06
If x is ?0, ?0 shall be returned.
- erff.07
If x is ?Inf, ?1 shall be returned.
- erff.08
If x is subnormal, a range error may occur, and 2 * x/ sqrt() should be returned.
- erff.09
These functions may fail if:
- erff.09.01
Range Error [MX] The result underflows.
- erff.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erff.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]erfl (10 / 6 / 0)
- erfl.01
These functions shall compute the error function of their argument x, defined as:
Generalizes:
- erfl.02
- erfl.03
- erfl.04
- erfl.05
- erfl.06
- erfl.07
- erfl.08
- erfl.09.01.01
- erfl.09.01.02
- erfl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- erfl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- erfl.04
Upon successful completion, these functions shall return the value of the error function.
- erfl.05
[MX] If x is NaN, a NaN shall be returned.
- erfl.06
If x is ?0, ?0 shall be returned.
- erfl.07
If x is ?Inf, ?1 shall be returned.
- erfl.08
If x is subnormal, a range error may occur, and 2 * x/ sqrt() should be returned.
- erfl.09
These functions may fail if:
- erfl.09.01
Range Error [MX] The result underflows.
- erfl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- erfl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]math.exp (507 / 287 / 6)
- [+]cbrt (4 / 3 / 0)
- cbrt.01
These functions shall compute the real cube root of their argument x.
Generalizes:
- cbrt.02
Upon successful completion, these functions shall return the cube root of x.
- cbrt.03
[MX] If x is NaN, a NaN shall be returned.
- cbrt.04
If x is ?0 or ?Inf, x shall be returned.
- [+]cbrtf (4 / 3 / 0)
- cbrtf.01
These functions shall compute the real cube root of their argument x.
Generalizes:
- cbrtf.02
- cbrtf.03
- cbrtf.04
- cbrtf.02
Upon successful completion, these functions shall return the cube root of x.
- cbrtf.03
[MX] If x is NaN, a NaN shall be returned.
- cbrtf.04
If x is ?0 or ?Inf, x shall be returned.
- [+]cbrtl (4 / 3 / 0)
- cbrtl.01
These functions shall compute the real cube root of their argument x.
Generalizes:
- cbrtl.02
- cbrtl.03
- cbrtl.04
- cbrtl.02
Upon successful completion, these functions shall return the cube root of x.
- cbrtl.03
[MX] If x is NaN, a NaN shall be returned.
- cbrtl.04
If x is ?0 or ?Inf, x shall be returned.
- [+]exp (15 / 9 / 0)
- exp.01
These functions shall compute the base- e exponential of x.
- exp.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- exp.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- exp.04
Upon successful completion, these functions shall return the exponential value of x.
- exp.05
If the correct value would cause overflow, a range error shall occur and exp(), expf(), and expl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- exp.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- exp.07
[MX] If x is NaN, a NaN shall be returned.
- exp.08
If x is ?0, 1 shall be returned.
- exp.09
If x is -Inf, +0 shall be returned.
- exp.10
If x is +Inf, x shall be returned.
- exp.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- exp.12
These functions shall fail if:
- exp.12.01
Range Error The result overflows.
- exp.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- exp.13
These functions may fail if:
- exp.13.01
Range Error The result underflows.
- exp.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]exp2 (15 / 10 / 0)
- exp2.01
These functions shall compute the base-2 exponential of x.
- exp2.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- exp2.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- exp2.04
Upon successful completion, these functions shall return 2x.
- exp2.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- exp2.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- exp2.07
[MX] If x is NaN, a NaN shall be returned.
- exp2.08
If x is ?0, 1 shall be returned.
- exp2.09
If x is -Inf, +0 shall be returned.
- exp2.10
If x is +Inf, x shall be returned.
- exp2.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- exp2.12
These functions shall fail if:
- exp2.12.01
Range Error The result overflows.
- exp2.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- exp2.13
These functions may fail if:
- exp2.13.01
Range Error The result underflows.
- exp2.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]exp2f (15 / 10 / 0)
- exp2f.01
These functions shall compute the base-2 exponential of x.
- exp2f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- exp2f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- exp2f.04
Upon successful completion, these functions shall return 2x.
- exp2f.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- exp2f.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- exp2f.07
[MX] If x is NaN, a NaN shall be returned.
- exp2f.08
If x is ?0, 1 shall be returned.
- exp2f.09
If x is -Inf, +0 shall be returned.
- exp2f.10
If x is +Inf, x shall be returned.
- exp2f.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- exp2f.12
These functions shall fail if:
- exp2f.12.01
Range Error The result overflows.
- exp2f.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2f.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- exp2f.13
These functions may fail if:
- exp2f.13.01
Range Error The result underflows.
- exp2f.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- exp2f.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]expf (15 / 9 / 0)
- expf.01
These functions shall compute the base- e exponential of x.
- expf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- expf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- expf.04
Upon successful completion, these functions shall return the exponential value of x.
- expf.05
If the correct value would cause overflow, a range error shall occur and exp(), expf(), and expl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- expf.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- expf.07
[MX] If x is NaN, a NaN shall be returned.
- expf.08
If x is ?0, 1 shall be returned.
- expf.09
If x is -Inf, +0 shall be returned.
- expf.10
If x is +Inf, x shall be returned.
- expf.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- expf.12
These functions shall fail if:
- expf.12.01
Range Error The result overflows.
- expf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- expf.13
These functions may fail if:
- expf.13.01
Range Error The result underflows.
- expf.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expf.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]expl (15 / 9 / 0)
- expl.01
These functions shall compute the base- e exponential of x.
- expl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- expl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- expl.04
Upon successful completion, these functions shall return the exponential value of x.
- expl.05
If the correct value would cause overflow, a range error shall occur and exp(), expf(), and expl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- expl.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- expl.07
[MX] If x is NaN, a NaN shall be returned.
- expl.08
If x is ?0, 1 shall be returned.
- expl.09
If x is -Inf, +0 shall be returned.
- expl.10
If x is +Inf, x shall be returned.
- expl.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- expl.12
These functions shall fail if:
- expl.12.01
Range Error The result overflows.
- expl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- expl.13
These functions may fail if:
- expl.13.01
Range Error The result underflows.
- expl.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expl.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]expm1 (14 / 8 / 0)
- expm1.01
These functions shall compute ex-1.0.
- expm1.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- expm1.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- expm1.04
Upon successful completion, these functions return ex-1.0.
- expm1.05
If the correct value would cause overflow, a range error shall occur and expm1(), expm1f(), and expm1l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- expm1.06
[MX] If x is NaN, a NaN shall be returned.
- expm1.07
If x is ?0, ?0 shall be returned.
- expm1.08
If x is -Inf, -1 shall be returned.
- expm1.09
If x is +Inf, x shall be returned.
- expm1.10
If x is subnormal, a range error may occur and x should be returned.
- expm1.11
These functions shall fail if:
- expm1.11.01
Range Error The result overflows.
- expm1.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- expm1.12
These functions may fail if:
- expm1.12.01
Range Error [MX] The value of x is subnormal.
- expm1.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]expm1f (14 / 8 / 0)
- expm1f.01
These functions shall compute ex-1.0.
- expm1f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- expm1f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- expm1f.04
Upon successful completion, these functions return ex-1.0.
- expm1f.05
If the correct value would cause overflow, a range error shall occur and expm1(), expm1f(), and expm1l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- expm1f.06
[MX] If x is NaN, a NaN shall be returned.
- expm1f.07
If x is ?0, ?0 shall be returned.
- expm1f.08
If x is -Inf, -1 shall be returned.
- expm1f.09
If x is +Inf, x shall be returned.
- expm1f.10
If x is subnormal, a range error may occur and x should be returned.
- expm1f.11
These functions shall fail if:
- expm1f.11.01
Range Error The result overflows.
- expm1f.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1f.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- expm1f.12
These functions may fail if:
- expm1f.12.01
Range Error [MX] The value of x is subnormal.
- expm1f.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1f.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]expm1l (14 / 8 / 0)
- expm1l.01
These functions shall compute ex-1.0.
- expm1l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- expm1l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- expm1l.04
Upon successful completion, these functions return ex-1.0.
- expm1l.05
If the correct value would cause overflow, a range error shall occur and expm1(), expm1f(), and expm1l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- expm1l.06
[MX] If x is NaN, a NaN shall be returned.
- expm1l.07
If x is ?0, ?0 shall be returned.
- expm1l.08
If x is -Inf, -1 shall be returned.
- expm1l.09
If x is +Inf, x shall be returned.
- expm1l.10
If x is subnormal, a range error may occur and x should be returned.
- expm1l.11
These functions shall fail if:
- expm1l.11.01
Range Error The result overflows.
- expm1l.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1l.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- expm1l.12
These functions may fail if:
- expm1l.12.01
Range Error [MX] The value of x is subnormal.
- expm1l.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- expm1l.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]hypot (12 / 6 / 0)
- hypot.01
These functions shall compute the value of the square root of x2+ y2 without undue overflow or underflow.
- hypot.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- hypot.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- hypot.04
Upon successful completion, these functions shall return the length of the hypotenuse of a right-angled triangle with sides of length x and y.
- hypot.05
If the correct value would cause overflow, a range error shall occur and hypot(), hypotf(), and hypotl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- hypot.06
[MX] If x or y is ?Inf, +Inf shall be returned (even if one of x or y is NaN).
- hypot.07
If x or y is NaN, and the other is not ?Inf, a NaN shall be returned.
- hypot.08
If both arguments are subnormal and the correct result is subnormal, a range error may occur and the correct result is returned.
- hypot.09
These functions shall fail if:
- hypot.09.01
Range Error The result overflows.
- hypot.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypot.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- hypot.10
These functions may fail if:
- hypot.10.01
Range Error [MX] The result underflows.
- hypot.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypot.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]hypotf (12 / 6 / 0)
- hypotf.01
These functions shall compute the value of the square root of x2+ y2 without undue overflow or underflow.
- hypotf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- hypotf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- hypotf.04
Upon successful completion, these functions shall return the length of the hypotenuse of a right-angled triangle with sides of length x and y.
- hypotf.05
If the correct value would cause overflow, a range error shall occur and hypot(), hypotf(), and hypotl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- hypotf.06
[MX] If x or y is ?Inf, +Inf shall be returned (even if one of x or y is NaN).
- hypotf.07
If x or y is NaN, and the other is not ?Inf, a NaN shall be returned.
- hypotf.08
If both arguments are subnormal and the correct result is subnormal, a range error may occur and the correct result is returned.
- hypotf.09
These functions shall fail if:
- hypotf.09.01
Range Error The result overflows.
- hypotf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypotf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- hypotf.10
These functions may fail if:
- hypotf.10.01
Range Error [MX] The result underflows.
- hypotf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypotf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]hypotl (12 / 6 / 0)
- hypotl.01
These functions shall compute the value of the square root of x2+ y2 without undue overflow or underflow.
- hypotl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- hypotl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- hypotl.04
Upon successful completion, these functions shall return the length of the hypotenuse of a right-angled triangle with sides of length x and y.
- hypotl.05
If the correct value would cause overflow, a range error shall occur and hypot(), hypotf(), and hypotl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- hypotl.06
[MX] If x or y is ?Inf, +Inf shall be returned (even if one of x or y is NaN).
- hypotl.07
If x or y is NaN, and the other is not ?Inf, a NaN shall be returned.
- hypotl.08
If both arguments are subnormal and the correct result is subnormal, a range error may occur and the correct result is returned.
- hypotl.09
These functions shall fail if:
- hypotl.09.01
Range Error The result overflows.
- hypotl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypotl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- hypotl.10
These functions may fail if:
- hypotl.10.01
Range Error [MX] The result underflows.
- hypotl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- hypotl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]log (13 / 8 / 0)
- log.01
These functions shall compute the natural logarithm of their argument x, loge(x).
- log.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log.04
Upon successful completion, these functions shall return the natural logarithm of x.
- log.05
If x is ?0, a pole error shall occur and log(), logf(), and logl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log.07
[MX] If x is NaN, a NaN shall be returned.
- log.08
If x is 1, +0 shall be returned.
- log.09
If x is +Inf, x shall be returned.
- log.10
These functions shall fail if:
- log.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- log.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log.10.01.02
If theinteger expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log.10.02
Pole Error The value of x is zero.
- log.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log10 (13 / 8 / 0)
- log10.01
These functions shall compute the base 10 logarithm of their argument x, log10(x).
- log10.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log10.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log10.04
Upon successful completion, these functions shall return the base 10 logarithm of x.
- log10.05
If x is ?0, a pole error shall occur and log10(), log10f(), and log10l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log10.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log10.07
[MX] If x is NaN, a NaN shall be returned.
- log10.08
If x is 1, +0 shall be returned.
- log10.09
If x is +Inf, +Inf shall be returned.
- log10.10
These functions shall fail if:
- log10.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- log10.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log10.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log10.10.02
Pole Error The value of x is zero.
- log10.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log10.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log10f (13 / 8 / 0)
- log10f.01
These functions shall compute the base 10 logarithm of their argument x, log10(x).
- log10f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log10f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log10f.04
Upon successful completion, these functions shall return the base 10 logarithm of x.
- log10f.05
If x is ?0, a pole error shall occur and log10(), log10f(), and log10l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log10f.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log10f.07
[MX] If x is NaN, a NaN shall be returned.
- log10f.08
If x is 1, +0 shall be returned.
- log10f.09
If x is +Inf, +Inf shall be returned.
- log10f.10
These functions shall fail if:
- log10f.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- log10f.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log10f.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log10f.10.02
Pole Error The value of x is zero.
- log10f.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log10f.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log10l (13 / 8 / 0)
- log10l.01
These functions shall compute the base 10 logarithm of their argument x, log10(x).
- log10l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log10l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log10l.04
Upon successful completion, these functions shall return the base 10 logarithm of x.
- log10l.05
If x is ?0, a pole error shall occur and log10(), log10f(), and log10l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log10l.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log10l.07
[MX] If x is NaN, a NaN shall be returned.
- log10l.08
If x is 1, +0 shall be returned.
- log10l.09
If x is +Inf, +Inf shall be returned.
- log10l.10
These functions shall fail if:
- log10l.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- log10l.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log10l.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log10l.10.02
Pole Error The value of x is zero.
- log10l.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log10l.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log1p (15 / 6 / 2)
- log1p.01
These functions shall compute loge(1.0 + x).
- log1p.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log1p.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log1p.04
Upon successful completion, these functions shall return the natural logarithm of 1.0 + x.
- log1p.05
If x is -1, a pole error shall occur and log1p(), log1pf(), and log1pl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log1p.06
For finite values of x that are less than -1, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log1p.07
[MX] If x is NaN, a NaN shall be returned.
- log1p.08
If x is ?0, or +Inf, x shall be returned.
- log1p.09
If x is subnormal, a range error may occur and x should be returned.
- log1p.10
These functions shall fail if:
- log1p.10.01
Domain Error The finite value of x is less than -1, [MX] or x is -Inf.
- log1p.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log1p.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log1p.10.02
Pole Error The value of x is -1.
- log1p.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1p.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- log1p.11
These functions may fail if:
- log1p.11.01
Range Error [MX] The value of x is subnormal.
- log1p.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1p.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]log1pf (15 / 6 / 2)
- log1pf.01
These functions shall compute loge(1.0 + x).
- log1pf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log1pf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log1pf.04
Upon successful completion, these functions shall return the natural logarithm of 1.0 + x.
- log1pf.05
If x is -1, a pole error shall occur and log1p(), log1pf(), and log1pl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log1pf.06
For finite values of x that are less than -1, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log1pf.07
[MX] If x is NaN, a NaN shall be returned.
- log1pf.08
If x is ?0, or +Inf, x shall be returned.
- log1pf.09
If x is subnormal, a range error may occur and x should be returned.
- log1pf.10
These functions shall fail if:
- log1pf.10.01
Domain Error The finite value of x is less than -1, [MX] or x is -Inf.
- log1pf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log1pf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log1pf.10.02
Pole Error The value of x is -1.
- log1pf.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1pf.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- log1pf.11
These functions may fail if:
- log1pf.11.01
Range Error [MX] The value of x is subnormal.
- log1pf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1pf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]log1pl (15 / 6 / 2)
- log1pl.01
These functions shall compute loge(1.0 + x).
- log1pl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log1pl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log1pl.04
Upon successful completion, these functions shall return the natural logarithm of 1.0 + x.
- log1pl.05
If x is -1, a pole error shall occur and log1p(), log1pf(), and log1pl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log1pl.06
For finite values of x that are less than -1, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log1pl.07
[MX] If x is NaN, a NaN shall be returned.
- log1pl.08
If x is ?0, or +Inf, x shall be returned.
- log1pl.09
If x is subnormal, a range error may occur and x should be returned.
- log1pl.10
These functions shall fail if:
- log1pl.10.01
Domain Error The finite value of x is less than -1, [MX] or x is -Inf.
- log1pl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log1pl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log1pl.10.02
Pole Error The value of x is -1.
- log1pl.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1pl.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- log1pl.11
These functions may fail if:
- log1pl.11.01
Range Error [MX] The value of x is subnormal.
- log1pl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log1pl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]log2 (13 / 8 / 0)
- log2.01
These functions shall compute the base 2 logarithm of their argument x, log2(x).
- log2.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log2.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log2.04
Upon successful completion, these functions shall return the base 2 logarithm of x.
- log2.05
If x is ?0, a pole error shall occur and log2(), log2f(), and log2l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log2.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log2.07
[MX] If x is NaN, a NaN shall be returned.
- log2.08
If x is 1, +0 shall be returned.
- log2.09
If x is +Inf, x shall be returned.
- log2.10
These functions shall fail if:
- log2.10.01
Domain Error The finite value of x is less than zero, [MX] or x is -Inf.
- log2.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log2.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log2.10.02
Pole Error The value of x is zero.
- log2.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log2.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log2f (13 / 8 / 0)
- log2f.01
These functions shall compute the base 2 logarithm of their argument x, log2(x).
- log2f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log2f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log2f.04
Upon successful completion, these functions shall return the base 2 logarithm of x.
- log2f.05
If x is ?0, a pole error shall occur and log2(), log2f(), and log2l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log2f.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log2f.07
[MX] If x is NaN, a NaN shall be returned.
- log2f.08
If x is 1, +0 shall be returned.
- log2f.09
If x is +Inf, x shall be returned.
- log2f.10
These functions shall fail if:
- log2f.10.01
Domain Error The finite value of x is less than zero, [MX] or x is -Inf.
- log2f.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log2f.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log2f.10.02
Pole Error The value of x is zero.
- log2f.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log2f.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]log2l (13 / 8 / 0)
- log2l.01
These functions shall compute the base 2 logarithm of their argument x, log2(x).
- log2l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- log2l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- log2l.04
Upon successful completion, these functions shall return the base 2 logarithm of x.
- log2l.05
If x is ?0, a pole error shall occur and log2(), log2f(), and log2l() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- log2l.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- log2l.07
[MX] If x is NaN, a NaN shall be returned.
- log2l.08
If x is 1, +0 shall be returned.
- log2l.09
If x is +Inf, x shall be returned.
- log2l.10
These functions shall fail if:
- log2l.10.01
Domain Error The finite value of x is less than zero, [MX] or x is -Inf.
- log2l.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- log2l.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- log2l.10.02
Pole Error The value of x is zero.
- log2l.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- log2l.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]logf (13 / 8 / 0)
- logf.01
These functions shall compute the natural logarithm of their argument x, loge(x).
- logf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- logf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- logf.04
Upon successful completion, these functions shall return the natural logarithm of x.
- logf.05
If x is ?0, a pole error shall occur and log(), logf(), and logl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- logf.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- logf.07
[MX] If x is NaN, a NaN shall be returned.
- logf.08
If x is 1, +0 shall be returned.
- logf.09
If x is +Inf, x shall be returned.
- logf.10
These functions shall fail if:
- logf.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- logf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- logf.10.01.02
If theinteger expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- logf.10.02
Pole Error The value of x is zero.
- logf.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- logf.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]logl (13 / 8 / 0)
- logl.01
These functions shall compute the natural logarithm of their argument x, loge(x).
- logl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- logl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- logl.04
Upon successful completion, these functions shall return the natural logarithm of x.
- logl.05
If x is ?0, a pole error shall occur and log(), logf(), and logl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- logl.06
For finite values of x that are less than 0, [MX] or if x is -Inf, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- logl.07
[MX] If x is NaN, a NaN shall be returned.
- logl.08
If x is 1, +0 shall be returned.
- logl.09
If x is +Inf, x shall be returned.
- logl.10
These functions shall fail if:
- logl.10.01
Domain Error The finite value of x is negative, [MX] or x is -Inf.
- logl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- logl.10.01.02
If theinteger expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- logl.10.02
Pole Error The value of x is zero.
- logl.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- logl.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]pow (34 / 27 / 0)
- pow.01
These functions shall compute the value of x raised to the power y, xy. If x is negative, the application shall ensure that y is an integer value.
Generalizes:
- pow.02
- pow.03
- pow.04
- pow.05
- pow.06
- pow.07
- pow.08
- pow.09
- pow.10
- pow.11
- pow.12
- pow.13
- pow.14
- pow.15
- pow.16
- pow.17
- pow.18
- pow.19
- pow.20
- pow.21
- pow.22
- pow.23
- pow.24
- pow.25
- pow.26
- pow.27.01.01
- pow.27.01.02
- pow.27.02.01
- pow.27.02.02
- pow.27.03.01
- pow.27.03.02
- pow.28.01.01
- pow.28.01.02
- pow.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- pow.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- pow.04
Upon successful completion, these functions shall return the value of x raised to the power y.
- pow.05
For finite values of x < 0, and finite non-integer values of y, a domain error shall occur and [MX] either a NaN (if representable), or an implementation-defined value shall be returned.
- pow.06
If the correct value would cause overflow, a range error shall occur and pow(), powf(), and powl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- pow.07
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- pow.08
[MX] If x or y is a NaN, a NaN shall be returned (unless specified elsewhere in this description).
- pow.09
For any value of y (including NaN), if x is +1, 1.0 shall be returned.
- pow.10
For any value of x (including NaN), if y is ?0, 1.0 shall be returned.
- pow.11
For any odd integer value of y > 0, if x is ?0, ?0 shall be returned.
- pow.12
For y > 0 and not an odd integer, if x is ?0, +0 shall be returned.
- pow.13
If x is -1, and y is ?Inf, 1.0 shall be returned.
- pow.14
For |x| < 1, if y is -Inf, +Inf shall be returned.
- pow.15
For |x| > 1, if y is -Inf, +0 shall be returned.
- pow.16
For |x| < 1, if y is +Inf, +0 shall be returned.
- pow.17
For |x| > 1, if y is +Inf, +Inf shall be returned.
- pow.18
For y an odd integer < 0, if x is -Inf, -0 shall be returned.
- pow.19
For y < 0 and not an odd integer, if x is -Inf, +0 shall be returned.
- pow.20
For y an odd integer > 0, if x is -Inf, -Inf shall be returned.
- pow.21
For y > 0 and not an odd integer, if x is -Inf, +Inf shall be returned.
- pow.22
For y < 0, if x is +Inf, +0 shall be returned.
- pow.23
For y > 0, if x is +Inf, +Inf shall be returned.
- pow.24
For y an odd integer < 0, if x is ?0, a pole error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- pow.25
For y < 0 and not an odd integer, if x is ?0, a pole error shall occur and HUGE_VAL, HUGE_VALF, and HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- pow.26
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- pow.27
These functions shall fail if:
- pow.27.01
Domain Error The value of x is negative and y is a finite non-integer.
- pow.27.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- pow.27.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- pow.27.02
Pole Error [MX] The value of x is zero and y is negative.
- pow.27.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow.27.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- pow.27.03
Range Error The result overflows.
- pow.27.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow.27.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- pow.28
These functions may fail if:
- pow.28.01
Range Error The result underflows.
- pow.28.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow.28.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]pow10 (16 / 0 / 0)
- pow10.14
pow10() have the same specifications as exp2() in ISO POSIX (2003) except that the exponential base is equal to10.
- pow10.exp2.01
These functions shall compute the base-2 exponential of x.
- pow10.exp2.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- pow10.exp2.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- pow10.exp2.04
Upon successful completion, these functions shall return 2x.
- pow10.exp2.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- pow10.exp2.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- pow10.exp2.07
[MX] If x is NaN, a NaN shall be returned.
- pow10.exp2.08
If x is ?0, 1 shall be returned.
- pow10.exp2.09
If x is -Inf, +0 shall be returned.
- pow10.exp2.10
If x is +Inf, x shall be returned.
- pow10.exp2.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- pow10.exp2.12
These functions shall fail if:
- pow10.exp2.12.01
Range Error The result overflows.
- pow10.exp2.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10.exp2.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- pow10.exp2.13
These functions may fail if:
- pow10.exp2.13.01
Range Error The result underflows.
- pow10.exp2.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10.exp2.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]pow10f (16 / 0 / 0)
- pow10f.14
pow10f() have the same specifications as exp2f() in ISO POSIX (2003) except that the exponential base is equal to 10.
- pow10f.exp2f.01
These functions shall compute the base-2 exponential of x.
- pow10f.exp2f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- pow10f.exp2f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- pow10f.exp2f.04
Upon successful completion, these functions shall return 2x.
- pow10f.exp2f.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- pow10f.exp2f.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- pow10f.exp2f.07
[MX] If x is NaN, a NaN shall be returned.
- pow10f.exp2f.08
If x is ?0, 1 shall be returned.
- pow10f.exp2f.09
If x is -Inf, +0 shall be returned.
- pow10f.exp2f.10
If x is +Inf, x shall be returned.
- pow10f.exp2f.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- pow10f.exp2f.12
These functions shall fail if:
- pow10f.exp2f.12.01
Range Error The result overflows.
- pow10f.exp2f.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10f.exp2f.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- pow10f.exp2f.13
These functions may fail if:
- pow10f.exp2f.13.01
Range Error The result underflows.
- pow10f.exp2f.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10f.exp2f.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]pow10l (16 / 0 / 0)
- pow10l.14
pow10l() have the same specifications as exp2l() in ISO POSIX (2003) except that the exponential base is equal to 10.
- pow10l.exp2l.01
These functions shall compute the base-2 exponential of x.
- pow10l.exp2l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- pow10l.exp2l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- pow10l.exp2l.04
Upon successful completion, these functions shall return 2x.
- pow10l.exp2l.05
If the correct value would cause overflow, a range error shall occur and exp2(), exp2f(), and exp2l() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- pow10l.exp2l.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- pow10l.exp2l.07
[MX] If x is NaN, a NaN shall be returned.
- pow10l.exp2l.08
If x is ?0, 1 shall be returned.
- pow10l.exp2l.09
If x is -Inf, +0 shall be returned.
- pow10l.exp2l.10
If x is +Inf, x shall be returned.
- pow10l.exp2l.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- pow10l.exp2l.12
These functions shall fail if:
- pow10l.exp2l.12.01
Range Error The result overflows.
- pow10l.exp2l.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10l.exp2l.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- pow10l.exp2l.13
These functions may fail if:
- pow10l.exp2l.13.01
Range Error The result underflows.
- pow10l.exp2l.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- pow10l.exp2l.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]powf (34 / 27 / 0)
- powf.01
These functions shall compute the value of x raised to the power y, xy. If x is negative, the application shall ensure that y is an integer value.
Generalizes:
- powf.02
- powf.03
- powf.04
- powf.05
- powf.06
- powf.07
- powf.08
- powf.09
- powf.10
- powf.11
- powf.12
- powf.13
- powf.14
- powf.15
- powf.16
- powf.17
- powf.18
- powf.19
- powf.20
- powf.21
- powf.22
- powf.23
- powf.24
- powf.25
- powf.26
- powf.27.01.01
- powf.27.01.02
- powf.27.02.01
- powf.27.02.02
- powf.27.03.01
- powf.27.03.02
- powf.28.01.01
- powf.28.01.02
- powf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- powf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- powf.04
Upon successful completion, these functions shall return the value of x raised to the power y.
- powf.05
For finite values of x < 0, and finite non-integer values of y, a domain error shall occur and [MX] either a NaN (if representable), or an implementation-defined value shall be returned.
- powf.06
If the correct value would cause overflow, a range error shall occur and pow(), powf(), and powl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- powf.07
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- powf.08
[MX] If x or y is a NaN, a NaN shall be returned (unless specified elsewhere in this description).
- powf.09
For any value of y (including NaN), if x is +1, 1.0 shall be returned.
- powf.10
For any value of x (including NaN), if y is ?0, 1.0 shall be returned.
- powf.11
For any odd integer value of y > 0, if x is ?0, ?0 shall be returned.
- powf.12
For y > 0 and not an odd integer, if x is ?0, +0 shall be returned.
- powf.13
If x is -1, and y is ?Inf, 1.0 shall be returned.
- powf.14
For |x| < 1, if y is -Inf, +Inf shall be returned.
- powf.15
For |x| > 1, if y is -Inf, +0 shall be returned.
- powf.16
For |x| < 1, if y is +Inf, +0 shall be returned.
- powf.17
For |x| > 1, if y is +Inf, +Inf shall be returned.
- powf.18
For y an odd integer < 0, if x is -Inf, -0 shall be returned.
- powf.19
For y < 0 and not an odd integer, if x is -Inf, +0 shall be returned.
- powf.20
For y an odd integer > 0, if x is -Inf, -Inf shall be returned.
- powf.21
For y > 0 and not an odd integer, if x is -Inf, +Inf shall be returned.
- powf.22
For y < 0, if x is +Inf, +0 shall be returned.
- powf.23
For y > 0, if x is +Inf, +Inf shall be returned.
- powf.24
For y an odd integer < 0, if x is ?0, a pole error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- powf.25
For y < 0 and not an odd integer, if x is ?0, a pole error shall occur and HUGE_VAL, HUGE_VALF, and HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- powf.26
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- powf.27
These functions shall fail if:
- powf.27.01
Domain Error The value of x is negative and y is a finite non-integer.
- powf.27.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- powf.27.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- powf.27.02
Pole Error [MX] The value of x is zero and y is negative.
- powf.27.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powf.27.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- powf.27.03
Range Error The result overflows.
- powf.27.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powf.27.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- powf.28
These functions may fail if:
- powf.28.01
Range Error The result underflows.
- powf.28.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powf.28.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]powl (34 / 27 / 0)
- powl.01
These functions shall compute the value of x raised to the power y, xy. If x is negative, the application shall ensure that y is an integer value.
Generalizes:
- powl.02
- powl.03
- powl.04
- powl.05
- powl.06
- powl.07
- powl.08
- powl.09
- powl.10
- powl.11
- powl.12
- powl.13
- powl.14
- powl.15
- powl.16
- powl.17
- powl.18
- powl.19
- powl.20
- powl.21
- powl.22
- powl.23
- powl.24
- powl.25
- powl.26
- powl.27.01.01
- powl.27.01.02
- powl.27.02.01
- powl.27.02.02
- powl.27.03.01
- powl.27.03.02
- powl.28.01.01
- powl.28.01.02
- powl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- powl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- powl.04
Upon successful completion, these functions shall return the value of x raised to the power y.
- powl.05
For finite values of x < 0, and finite non-integer values of y, a domain error shall occur and [MX] either a NaN (if representable), or an implementation-defined value shall be returned.
- powl.06
If the correct value would cause overflow, a range error shall occur and pow(), powf(), and powl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- powl.07
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- powl.08
[MX] If x or y is a NaN, a NaN shall be returned (unless specified elsewhere in this description).
- powl.09
For any value of y (including NaN), if x is +1, 1.0 shall be returned.
- powl.10
For any value of x (including NaN), if y is ?0, 1.0 shall be returned.
- powl.11
For any odd integer value of y > 0, if x is ?0, ?0 shall be returned.
- powl.12
For y > 0 and not an odd integer, if x is ?0, +0 shall be returned.
- powl.13
If x is -1, and y is ?Inf, 1.0 shall be returned.
- powl.14
For |x| < 1, if y is -Inf, +Inf shall be returned.
- powl.15
For |x| > 1, if y is -Inf, +0 shall be returned.
- powl.16
For |x| < 1, if y is +Inf, +0 shall be returned.
- powl.17
For |x| > 1, if y is +Inf, +Inf shall be returned.
- powl.18
For y an odd integer < 0, if x is -Inf, -0 shall be returned.
- powl.19
For y < 0 and not an odd integer, if x is -Inf, +0 shall be returned.
- powl.20
For y an odd integer > 0, if x is -Inf, -Inf shall be returned.
- powl.21
For y > 0 and not an odd integer, if x is -Inf, +Inf shall be returned.
- powl.22
For y < 0, if x is +Inf, +0 shall be returned.
- powl.23
For y > 0, if x is +Inf, +Inf shall be returned.
- powl.24
For y an odd integer < 0, if x is ?0, a pole error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- powl.25
For y < 0 and not an odd integer, if x is ?0, a pole error shall occur and HUGE_VAL, HUGE_VALF, and HUGE_VALL shall be returned for pow(), powf(), and powl(), respectively.
- powl.26
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- powl.27
These functions shall fail if:
- powl.27.01
Domain Error The value of x is negative and y is a finite non-integer.
- powl.27.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- powl.27.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- powl.27.02
Pole Error [MX] The value of x is zero and y is negative.
- powl.27.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powl.27.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- powl.27.03
Range Error The result overflows.
- powl.27.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powl.27.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- powl.28
These functions may fail if:
- powl.28.01
Range Error The result underflows.
- powl.28.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- powl.28.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]sqrt (10 / 6 / 0)
- sqrt.01
These functions shall compute the square root of their argument x,
- sqrt.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sqrt.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sqrt.04
Upon successful completion, these functions shall return the square root of x.
- sqrt.05
For finite values of x < -0, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrt.06
[MX] If x is NaN, a NaN shall be returned.
- sqrt.07
If x is ?0 or +Inf, x shall be returned.
- sqrt.08
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrt.09
These functions shall fail if:
- sqrt.09.01
Domain Error The finite value of x is < -0, [MX] or x is -Inf.
- sqrt.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sqrt.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]sqrtf (10 / 6 / 0)
- sqrtf.01
These functions shall compute the square root of their argument x,
- sqrtf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sqrtf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sqrtf.04
Upon successful completion, these functions shall return the square root of x.
- sqrtf.05
For finite values of x < -0, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrtf.06
[MX] If x is NaN, a NaN shall be returned.
- sqrtf.07
If x is ?0 or +Inf, x shall be returned.
- sqrtf.08
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrtf.09
These functions shall fail if:
- sqrtf.09.01
Domain Error The finite value of x is < -0, [MX] or x is -Inf.
- sqrtf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sqrtf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]sqrtl (10 / 6 / 0)
- sqrtl.01
These functions shall compute the square root of their argument x,
- sqrtl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sqrtl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sqrtl.04
Upon successful completion, these functions shall return the square root of x.
- sqrtl.05
For finite values of x < -0, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrtl.06
[MX] If x is NaN, a NaN shall be returned.
- sqrtl.07
If x is ?0 or +Inf, x shall be returned.
- sqrtl.08
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sqrtl.09
These functions shall fail if:
- sqrtl.09.01
Domain Error The finite value of x is < -0, [MX] or x is -Inf.
- sqrtl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sqrtl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]math.gamma (179 / 99 / 12)
- [+]gamma (11 / 5 / 1)
- gamma.01
The gamma() function performs identically to lgamma(), including the use of signgam.
Generalizes:
- gamma.lgamma.03
- gamma.lgamma.04
- gamma.lgamma.05
- gamma.lgamma.06
- gamma.lgamma.07
- gamma.lgamma.08
- gamma.lgamma.09
- gamma.lgamma.10
- gamma.lgamma.11
- gamma.lgamma.12
- gamma.lgamma.13
- gamma.02 (struct)
This interface need not be reentrant.
- gamma.lgamma.03
The lgamma() function computes
Generalizes:
- gamma.lgamma.04
- gamma.lgamma.05
- gamma.lgamma.06
- gamma.lgamma.07
- gamma.lgamma.08
- gamma.lgamma.09
- gamma.lgamma.10
- gamma.lgamma.11
- gamma.lgamma.12
- gamma.lgamma.13
- gamma.lgamma.04
The sign of is returned in the external integer signgam.
- gamma.lgamma.05 (struct)
The argument x need not be a non-positive integer, ( is defined over the reals, except the non-positive integers).
- gamma.lgamma.06
An application wishing to check for error situations should set errno to 0 before calling lgamma().
- gamma.lgamma.07
If errno is non-zero on return, or the return value is NaN, an error has occurred.
- gamma.lgamma.08
This interface need not be reentrant.
- gamma.lgamma.09
Upon successful completion, lgamma() returns the logarithmic gamma of x.
- gamma.lgamma.10
If x is NaN, NaN is returned and errno may be set to [EDOM].
- gamma.lgamma.11 (failed)
If x is a non-positive integer, either HUGE_VAL or NaN is returned and errno may be set to [EDOM].
- gamma.lgamma.12
If the correct value would cause overflow, lgamma() returns HUGE_VAL and may set errno to [ERANGE].
- gamma.lgamma.13
If the correct value would cause underflow, lgamma() returns 0 and may set errno to [ERANGE].
- [+]gammaf (12 / 5 / 1)
- gammaf.14
gammaf() has the same specification as gamma() in SUSv2, except that the argument type for gammaf() is known to be float
Generalizes:
- gammaf.lgamma.03
- gammaf.lgamma.04
- gammaf.lgamma.05
- gammaf.lgamma.06
- gammaf.lgamma.07
- gammaf.lgamma.08
- gammaf.lgamma.09
- gammaf.lgamma.10
- gammaf.lgamma.11
- gammaf.lgamma.12
- gammaf.lgamma.13
- gammaf.gamma.01
The gamma() function performs identically to lgamma(), including the use of signgam.
Generalizes:
- gammaf.lgamma.03
- gammaf.lgamma.04
- gammaf.lgamma.05
- gammaf.lgamma.06
- gammaf.lgamma.07
- gammaf.lgamma.08
- gammaf.lgamma.09
- gammaf.lgamma.10
- gammaf.lgamma.11
- gammaf.lgamma.12
- gammaf.lgamma.13
- gammaf.gamma.02 (struct)
This interface need not be reentrant.
- gammaf.lgamma.03
The lgamma() function computes
Generalizes:
- gammaf.lgamma.04
- gammaf.lgamma.05
- gammaf.lgamma.06
- gammaf.lgamma.07
- gammaf.lgamma.08
- gammaf.lgamma.09
- gammaf.lgamma.10
- gammaf.lgamma.11
- gammaf.lgamma.12
- gammaf.lgamma.13
- gammaf.lgamma.04
The sign of is returned in the external integer signgam.
- gammaf.lgamma.05 (struct)
The argument x need not be a non-positive integer, ( is defined over the reals, except the non-positive integers).
- gammaf.lgamma.06
An application wishing to check for error situations should set errno to 0 before calling lgamma().
- gammaf.lgamma.07
If errno is non-zero on return, or the return value is NaN, an error has occurred.
- gammaf.lgamma.08
This interface need not be reentrant.
- gammaf.lgamma.09
Upon successful completion, lgamma() returns the logarithmic gamma of x.
- gammaf.lgamma.10
If x is NaN, NaN is returned and errno may be set to [EDOM].
- gammaf.lgamma.11 (failed)
If x is a non-positive integer, either HUGE_VAL or NaN is returned and errno may be set to [EDOM].
- gammaf.lgamma.12
If the correct value would cause overflow, lgamma() returns HUGE_VAL and may set errno to [ERANGE].
- gammaf.lgamma.13
If the correct value would cause underflow, lgamma() returns 0 and may set errno to [ERANGE].
- [+]gammal (12 / 5 / 1)
- gammal.14
gammal() has the same specification as gamma() in SUSv2, except that the argument type for gammal() is known to be long double.
Generalizes:
- gammal.lgamma.03
- gammal.lgamma.04
- gammal.lgamma.05
- gammal.lgamma.06
- gammal.lgamma.07
- gammal.lgamma.08
- gammal.lgamma.09
- gammal.lgamma.10
- gammal.lgamma.11
- gammal.lgamma.12
- gammal.lgamma.13
- gammal.gamma.01
The gamma() function performs identically to lgamma(), including the use of signgam.
Generalizes:
- gammal.lgamma.03
- gammal.lgamma.04
- gammal.lgamma.05
- gammal.lgamma.06
- gammal.lgamma.07
- gammal.lgamma.08
- gammal.lgamma.09
- gammal.lgamma.10
- gammal.lgamma.11
- gammal.lgamma.12
- gammal.lgamma.13
- gammal.gamma.02 (struct)
This interface need not be reentrant.
- gammal.lgamma.03
The lgamma() function computes
Generalizes:
- gammal.lgamma.04
- gammal.lgamma.05
- gammal.lgamma.06
- gammal.lgamma.07
- gammal.lgamma.08
- gammal.lgamma.09
- gammal.lgamma.10
- gammal.lgamma.11
- gammal.lgamma.12
- gammal.lgamma.13
- gammal.lgamma.04
The sign of is returned in the external integer signgam.
- gammal.lgamma.05 (struct)
The argument x need not be a non-positive integer, ( is defined over the reals, except the non-positive integers).
- gammal.lgamma.06
An application wishing to check for error situations should set errno to 0 before calling lgamma().
- gammal.lgamma.07
If errno is non-zero on return, or the return value is NaN, an error has occurred.
- gammal.lgamma.08
This interface need not be reentrant.
- gammal.lgamma.09
Upon successful completion, lgamma() returns the logarithmic gamma of x.
- gammal.lgamma.10
If x is NaN, NaN is returned and errno may be set to [EDOM].
- gammal.lgamma.11 (failed)
If x is a non-positive integer, either HUGE_VAL or NaN is returned and errno may be set to [EDOM].
- gammal.lgamma.12
If the correct value would cause overflow, lgamma() returns HUGE_VAL and may set errno to [ERANGE].
- gammal.lgamma.13
If the correct value would cause underflow, lgamma() returns 0 and may set errno to [ERANGE].
- [+]lgamma (16 / 9 / 1)
- lgamma.01
These functions shall compute
Generalizes:
- lgamma.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgamma.03
[XSI] The sign of is returned in the external integer signgam.
- lgamma.04
[CX] These functions need not be reentrant.
- lgamma.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgamma.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgamma.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgamma.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma(), lgammaf(), and lgammal() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgamma.09
If the correct value would cause overflow, a range error shall occur and lgamma(), lgammaf(), and lgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgamma.10
[MX] If x is NaN, a NaN shall be returned.
- lgamma.11
If x is 1 or 2, +0 shall be returned.
- lgamma.12
If x is ?Inf, +Inf shall be returned.
- lgamma.13
These functions shall fail if:
- lgamma.13.01
Pole Error The x argument is a negative integer or zero.
- lgamma.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgamma.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgamma.13.02
Range Error The result overflows.
- lgamma.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgamma.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]lgamma_r (16 / 9 / 1)
- lgamma_r.01
These functions shall compute
Generalizes:
- lgamma_r.02
- lgamma_r.03
- lgamma_r.04
- lgamma_r.05
- lgamma_r.06
- lgamma_r.07
- lgamma_r.08
- lgamma_r.09
- lgamma_r.10
- lgamma_r.11
- lgamma_r.12
- lgamma_r.13.01.01
- lgamma_r.13.01.02
- lgamma_r.13.02.01
- lgamma_r.13.02.02
- lgamma_r.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgamma_r.03
The sign of is returned in the integer signp.
- lgamma_r.04
These functions need not be reentrant.
- lgamma_r.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgamma_r.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgamma_r.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgamma_r.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgamma_r.09
If the correct value would cause overflow, a range error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgamma_r.10
If x is NaN, a NaN shall be returned.
- lgamma_r.11
If x is 1 or 2, +0 shall be returned.
- lgamma_r.12
If x is ?Inf, +Inf shall be returned.
- lgamma_r.13
These functions shall fail if:
- lgamma_r.13.01
Pole Error The x argument is a negative integer or zero.
- lgamma_r.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgamma_r.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgamma_r.13.02
Range Error The result overflows.
- lgamma_r.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgamma_r.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]lgammaf (16 / 9 / 1)
- lgammaf.01
These functions shall compute
Generalizes:
- lgammaf.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgammaf.03
[XSI] The sign of is returned in the external integer signgam.
- lgammaf.04
[CX] These functions need not be reentrant.
- lgammaf.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgammaf.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgammaf.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgammaf.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma(), lgammaf(), and lgammal() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgammaf.09
If the correct value would cause overflow, a range error shall occur and lgamma(), lgammaf(), and lgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgammaf.10
[MX] If x is NaN, a NaN shall be returned.
- lgammaf.11
If x is 1 or 2, +0 shall be returned.
- lgammaf.12
If x is ?Inf, +Inf shall be returned.
- lgammaf.13
These functions shall fail if:
- lgammaf.13.01
Pole Error The x argument is a negative integer or zero.
- lgammaf.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammaf.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgammaf.13.02
Range Error The result overflows.
- lgammaf.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammaf.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]lgammaf_r (16 / 9 / 1)
- lgammaf_r.01
These functions shall compute
Generalizes:
- lgammaf_r.02
- lgammaf_r.03
- lgammaf_r.04
- lgammaf_r.05
- lgammaf_r.06
- lgammaf_r.07
- lgammaf_r.08
- lgammaf_r.09
- lgammaf_r.10
- lgammaf_r.11
- lgammaf_r.12
- lgammaf_r.13.01.01
- lgammaf_r.13.01.02
- lgammaf_r.13.02.01
- lgammaf_r.13.02.02
- lgammaf_r.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgammaf_r.03
The sign of is returned in the integer signp.
- lgammaf_r.04
These functions need not be reentrant.
- lgammaf_r.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgammaf_r.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgammaf_r.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgammaf_r.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgammaf_r.09
If the correct value would cause overflow, a range error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgammaf_r.10
If x is NaN, a NaN shall be returned.
- lgammaf_r.11
If x is 1 or 2, +0 shall be returned.
- lgammaf_r.12
If x is ?Inf, +Inf shall be returned.
- lgammaf_r.13
These functions shall fail if:
- lgammaf_r.13.01
Pole Error The x argument is a negative integer or zero.
- lgammaf_r.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammaf_r.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgammaf_r.13.02
Range Error The result overflows.
- lgammaf_r.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammaf_r.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]lgammal (16 / 9 / 1)
- lgammal.01
These functions shall compute
Generalizes:
- lgammal.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgammal.03
[XSI] The sign of is returned in the external integer signgam.
- lgammal.04
[CX] These functions need not be reentrant.
- lgammal.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgammal.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgammal.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgammal.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma(), lgammaf(), and lgammal() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgammal.09
If the correct value would cause overflow, a range error shall occur and lgamma(), lgammaf(), and lgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgammal.10
[MX] If x is NaN, a NaN shall be returned.
- lgammal.11
If x is 1 or 2, +0 shall be returned.
- lgammal.12
If x is ?Inf, +Inf shall be returned.
- lgammal.13
These functions shall fail if:
- lgammal.13.01
Pole Error The x argument is a negative integer or zero.
- lgammal.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammal.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgammal.13.02
Range Error The result overflows.
- lgammal.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammal.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]lgammal_r (16 / 9 / 1)
- lgammal_r.01
These functions shall compute
Generalizes:
- lgammal_r.02
- lgammal_r.03
- lgammal_r.04
- lgammal_r.05
- lgammal_r.06
- lgammal_r.07
- lgammal_r.08
- lgammal_r.09
- lgammal_r.10
- lgammal_r.11
- lgammal_r.12
- lgammal_r.13.01.01
- lgammal_r.13.01.02
- lgammal_r.13.02.01
- lgammal_r.13.02.02
- lgammal_r.02
The argument x need not be a non-positive integer ( is defined over the reals, except the non-positive integers).
- lgammal_r.03
The sign of is returned in the integer signp.
- lgammal_r.04
These functions need not be reentrant.
- lgammal_r.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lgammal_r.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lgammal_r.07
Upon successful completion, these functions shall return the logarithmic gamma of x.
- lgammal_r.08 (failed)
If x is a non-positive integer, a pole error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.
- lgammal_r.09
If the correct value would cause overflow, a range error shall occur and lgamma_r(), lgammaf_r(), and lgammal_r() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (having the same sign as the correct value), respectively.
- lgammal_r.10
If x is NaN, a NaN shall be returned.
- lgammal_r.11
If x is 1 or 2, +0 shall be returned.
- lgammal_r.12
If x is ?Inf, +Inf shall be returned.
- lgammal_r.13
These functions shall fail if:
- lgammal_r.13.01
Pole Error The x argument is a negative integer or zero.
- lgammal_r.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammal_r.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- lgammal_r.13.02
Range Error The result overflows.
- lgammal_r.13.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- lgammal_r.13.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]tgamma (16 / 10 / 1)
- tgamma.01
These functions shall compute the gamma() function of x.
Generalizes:
- tgamma.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tgamma.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tgamma.04
Upon successful completion, these functions shall return Gamma( x).
- tgamma.05 (failed)
If x is a negative integer, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgamma.06
If the correct value would cause overflow, a range error shall occur and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tgamma.07
[MX] If x is NaN, a NaN shall be returned.
- tgamma.08
If x is +Inf, x shall be returned.
- tgamma.09
If x is ?0, a pole error shall occur, and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively.
- tgamma.10
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgamma.11
These functions shall fail if:
- tgamma.11.01
Domain Error The value of x is a negative integer, [MX] or x is -Inf.
- tgamma.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tgamma.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tgamma.11.02
Pole Error [MX] The value of x is zero.
- tgamma.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgamma.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- tgamma.11.03
Range Error The value overflows.
- tgamma.11.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgamma.11.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]tgammaf (16 / 10 / 1)
- tgammaf.01
These functions shall compute the gamma() function of x.
Generalizes:
- tgammaf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tgammaf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tgammaf.04
Upon successful completion, these functions shall return Gamma( x).
- tgammaf.05 (failed)
If x is a negative integer, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgammaf.06
If the correct value would cause overflow, a range error shall occur and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tgammaf.07
[MX] If x is NaN, a NaN shall be returned.
- tgammaf.08
If x is +Inf, x shall be returned.
- tgammaf.09
If x is ?0, a pole error shall occur, and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively.
- tgammaf.10
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgammaf.11
These functions shall fail if:
- tgammaf.11.01
Domain Error The value of x is a negative integer, [MX] or x is -Inf.
- tgammaf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tgammaf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tgammaf.11.02
Pole Error [MX] The value of x is zero.
- tgammaf.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgammaf.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- tgammaf.11.03
Range Error The value overflows.
- tgammaf.11.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgammaf.11.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]tgammal (16 / 10 / 1)
- tgammal.01
These functions shall compute the gamma() function of x.
Generalizes:
- tgammal.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tgammal.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tgammal.04
Upon successful completion, these functions shall return Gamma( x).
- tgammal.05 (failed)
If x is a negative integer, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgammal.06
If the correct value would cause overflow, a range error shall occur and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tgammal.07
[MX] If x is NaN, a NaN shall be returned.
- tgammal.08
If x is +Inf, x shall be returned.
- tgammal.09
If x is ?0, a pole error shall occur, and tgamma(), tgammaf(), and tgammal() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively.
- tgammal.10
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tgammal.11
These functions shall fail if:
- tgammal.11.01
Domain Error The value of x is a negative integer, [MX] or x is -Inf.
- tgammal.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tgammal.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tgammal.11.02
Pole Error [MX] The value of x is zero.
- tgammal.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgammal.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- tgammal.11.03
Range Error The value overflows.
- tgammal.11.03.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tgammal.11.03.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]math.hyper (204 / 111 / 0)
- [+]acosh (11 / 7 / 0)
- acosh.01
These functions shall compute the inverse hyperbolic cosine of their argument x.
- acosh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acosh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acosh.04
Upon successful completion, these functions shall return the inverse hyperbolic cosine of their argument.
- acosh.05
For finite values of x < 1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acosh.06
[MX] If x is NaN, a NaN shall be returned.
- acosh.07
If x is +1, +0 shall be returned.
- acosh.08
If x is +Inf, +Inf shall be returned.
- acosh.09
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acosh.10
These functions shall fail if:
- acosh.10.01
Domain Error The x argument is finite and less than +1.0, [MX] or is -Inf.
- acosh.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acosh.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]acoshf (11 / 7 / 0)
- acoshf.01
These functions shall compute the inverse hyperbolic cosine of their argument x.
- acoshf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acoshf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acoshf.04
Upon successful completion, these functions shall return the inverse hyperbolic cosine of their argument.
- acoshf.05
For finite values of x < 1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acoshf.06
[MX] If x is NaN, a NaN shall be returned.
- acoshf.07
If x is +1, +0 shall be returned.
- acoshf.08
If x is +Inf, +Inf shall be returned.
- acoshf.09
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acoshf.10
These functions shall fail if:
- acoshf.10.01
Domain Error The x argument is finite and less than +1.0, [MX] or is -Inf.
- acoshf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acoshf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]acoshl (11 / 7 / 0)
- acoshl.01
These functions shall compute the inverse hyperbolic cosine of their argument x.
- acoshl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acoshl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acoshl.04
Upon successful completion, these functions shall return the inverse hyperbolic cosine of their argument.
- acoshl.05
For finite values of x < 1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acoshl.06
[MX] If x is NaN, a NaN shall be returned.
- acoshl.07
If x is +1, +0 shall be returned.
- acoshl.08
If x is +Inf, +Inf shall be returned.
- acoshl.09
If x is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acoshl.10
These functions shall fail if:
- acoshl.10.01
Domain Error The x argument is finite and less than +1.0, [MX] or is -Inf.
- acoshl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acoshl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]asinh (9 / 4 / 0)
- asinh.01
These functions shall compute the inverse hyperbolic sine of their argument x.
- asinh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asinh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asinh.04
Upon successful completion, these functions shall return the inverse hyperbolic sine of their argument.
- asinh.05
[MX] If x is NaN, a NaN shall be returned.
- asinh.06
If x is ?0, or ?Inf, x shall be returned.
- asinh.07
If x is subnormal, a range error may occur and x should be returned.
- asinh.08
These functions may fail if:
- asinh.08.01
Range Error [MX] The value of x is subnormal.
- asinh.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asinh.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]asinhf (9 / 4 / 0)
- asinhf.01
These functions shall compute the inverse hyperbolic sine of their argument x.
- asinhf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asinhf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asinhf.04
Upon successful completion, these functions shall return the inverse hyperbolic sine of their argument.
- asinhf.05
[MX] If x is NaN, a NaN shall be returned.
- asinhf.06
If x is ?0, or ?Inf, x shall be returned.
- asinhf.07
If x is subnormal, a range error may occur and x should be returned.
- asinhf.08
These functions may fail if:
- asinhf.08.01
Range Error [MX] The value of x is subnormal.
- asinhf.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asinhf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]asinhl (9 / 4 / 0)
- asinhl.01
These functions shall compute the inverse hyperbolic sine of their argument x.
- asinhl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asinhl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asinhl.04
Upon successful completion, these functions shall return the inverse hyperbolic sine of their argument.
- asinhl.05
[MX] If x is NaN, a NaN shall be returned.
- asinhl.06
If x is ?0, or ?Inf, x shall be returned.
- asinhl.07
If x is subnormal, a range error may occur and x should be returned.
- asinhl.08
These functions may fail if:
- asinhl.08.01
Range Error [MX] The value of x is subnormal.
- asinhl.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asinhl.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atanh (16 / 9 / 0)
- atanh.01
These functions shall compute the inverse hyperbolic tangent of their argument x.
- atanh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atanh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atanh.04
Upon successful completion, these functions shall return the inverse hyperbolic tangent of their argument.
- atanh.05
If x is ?1, a pole error shall occur, and atanh(), atanhf(), and atanhl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively, with the same sign as the correct value of the function.
- atanh.06
For finite |x|>1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- atanh.07
[MX] If x is NaN, a NaN shall be returned.
- atanh.08
If x is ?0, x shall be returned.
- atanh.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- atanh.10
If x is subnormal, a range error may occur and x should be returned.
- atanh.11
These functions shall fail if:
- atanh.11.01
Domain Error The x argument is finite and not in the range [-1,1], [MX] or is ?Inf.
- atanh.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- atanh.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- atanh.11.02
Pole Error The x argument is ?1.
- atanh.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanh.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- atanh.12
These functions may fail if:
- atanh.12.01
Range Error [MX] The value of x is subnormal.
- atanh.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanh.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atanhf (16 / 9 / 0)
- atanhf.01
These functions shall compute the inverse hyperbolic tangent of their argument x.
- atanhf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atanhf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atanhf.04
Upon successful completion, these functions shall return the inverse hyperbolic tangent of their argument.
- atanhf.05
If x is ?1, a pole error shall occur, and atanh(), atanhf(), and atanhl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively, with the same sign as the correct value of the function.
- atanhf.06
For finite |x|>1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- atanhf.07
[MX] If x is NaN, a NaN shall be returned.
- atanhf.08
If x is ?0, x shall be returned.
- atanhf.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- atanhf.10
If x is subnormal, a range error may occur and x should be returned.
- atanhf.11
These functions shall fail if:
- atanhf.11.01
Domain Error The x argument is finite and not in the range [-1,1], [MX] or is ?Inf.
- atanhf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- atanhf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- atanhf.11.02
Pole Error The x argument is ?1.
- atanhf.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanhf.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- atanhf.12
These functions may fail if:
- atanhf.12.01
Range Error [MX] The value of x is subnormal.
- atanhf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanhf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atanhl (16 / 9 / 0)
- atanhl.01
These functions shall compute the inverse hyperbolic tangent of their argument x.
- atanhl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atanhl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atanhl.04
Upon successful completion, these functions shall return the inverse hyperbolic tangent of their argument.
- atanhl.05
If x is ?1, a pole error shall occur, and atanh(), atanhf(), and atanhl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively, with the same sign as the correct value of the function.
- atanhl.06
For finite |x|>1, a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- atanhl.07
[MX] If x is NaN, a NaN shall be returned.
- atanhl.08
If x is ?0, x shall be returned.
- atanhl.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- atanhl.10
If x is subnormal, a range error may occur and x should be returned.
- atanhl.11
These functions shall fail if:
- atanhl.11.01
Domain Error The x argument is finite and not in the range [-1,1], [MX] or is ?Inf.
- atanhl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- atanhl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- atanhl.11.02
Pole Error The x argument is ?1.
- atanhl.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanhl.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- atanhl.12
These functions may fail if:
- atanhl.12.01
Range Error [MX] The value of x is subnormal.
- atanhl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanhl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]cosh (10 / 6 / 0)
- cosh.01
These functions shall compute the hyperbolic cosine of their argument x.
- cosh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- cosh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- cosh.04
Upon successful completion, these functions shall return the hyperbolic cosine of x.
- cosh.05
If the correct value would cause overflow, a range error shall occur and cosh(), coshf(), and coshl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- cosh.06
[MX] If x is NaN, a NaN shall be returned.
- cosh.07
If x is ?0, the value 1.0 shall be returned.
- cosh.08
If x is ?Inf, +Inf shall be returned.
- cosh.09
These functions shall fail if:
- cosh.09.01
Range Error The result would cause an overflow.
- cosh.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- cosh.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]coshf (10 / 6 / 0)
- coshf.01
These functions shall compute the hyperbolic cosine of their argument x.
- coshf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- coshf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- coshf.04
Upon successful completion, these functions shall return the hyperbolic cosine of x.
- coshf.05
If the correct value would cause overflow, a range error shall occur and cosh(), coshf(), and coshl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- coshf.06
[MX] If x is NaN, a NaN shall be returned.
- coshf.07
If x is ?0, the value 1.0 shall be returned.
- coshf.08
If x is ?Inf, +Inf shall be returned.
- coshf.09
These functions shall fail if:
- coshf.09.01
Range Error The result would cause an overflow.
- coshf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- coshf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]coshl (10 / 6 / 0)
- coshl.01
These functions shall compute the hyperbolic cosine of their argument x.
- coshl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- coshl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- coshl.04
Upon successful completion, these functions shall return the hyperbolic cosine of x.
- coshl.05
If the correct value would cause overflow, a range error shall occur and cosh(), coshf(), and coshl() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- coshl.06
[MX] If x is NaN, a NaN shall be returned.
- coshl.07
If x is ?0, the value 1.0 shall be returned.
- coshl.08
If x is ?Inf, +Inf shall be returned.
- coshl.09
These functions shall fail if:
- coshl.09.01
Range Error The result would cause an overflow.
- coshl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- coshl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]sinh (12 / 6 / 0)
- sinh.01
These functions shall compute the hyperbolic sine of their argument x.
- sinh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sinh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sinh.04
Upon successful completion, these functions shall return the hyperbolic sine of x.
- sinh.05
If the result would cause an overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the type of the function.
- sinh.06
[MX] If x is NaN, a NaN shall be returned.
- sinh.07
If x is ?0 or ?Inf, x shall be returned.
- sinh.08
If x is subnormal, a range error may occur and x should be returned.
- sinh.09
These functions shall fail if:
- sinh.09.01
Range Error The result would cause an overflow.
- sinh.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinh.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- sinh.10
These functions may fail if:
- sinh.10.01
Range Error [MX] The value x is subnormal.
- sinh.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinh.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]sinhf (12 / 6 / 0)
- sinhf.01
These functions shall compute the hyperbolic sine of their argument x.
- sinhf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sinhf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sinhf.04
Upon successful completion, these functions shall return the hyperbolic sine of x.
- sinhf.05
If the result would cause an overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the type of the function.
- sinhf.06
[MX] If x is NaN, a NaN shall be returned.
- sinhf.07
If x is ?0 or ?Inf, x shall be returned.
- sinhf.08
If x is subnormal, a range error may occur and x should be returned.
- sinhf.09
These functions shall fail if:
- sinhf.09.01
Range Error The result would cause an overflow.
- sinhf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinhf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- sinhf.10
These functions may fail if:
- sinhf.10.01
Range Error [MX] The value x is subnormal.
- sinhf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinhf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]sinhl (12 / 6 / 0)
- sinhl.01
These functions shall compute the hyperbolic sine of their argument x.
- sinhl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sinhl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sinhl.04
Upon successful completion, these functions shall return the hyperbolic sine of x.
- sinhl.05
If the result would cause an overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the type of the function.
- sinhl.06
[MX] If x is NaN, a NaN shall be returned.
- sinhl.07
If x is ?0 or ?Inf, x shall be returned.
- sinhl.08
If x is subnormal, a range error may occur and x should be returned.
- sinhl.09
These functions shall fail if:
- sinhl.09.01
Range Error The result would cause an overflow.
- sinhl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinhl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- sinhl.10
These functions may fail if:
- sinhl.10.01
Range Error [MX] The value x is subnormal.
- sinhl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinhl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tanh (10 / 5 / 0)
- tanh.01
These functions shall compute the hyperbolic tangent of their argument x.
- tanh.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tanh.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tanh.04
Upon successful completion, these functions shall return the hyperbolic tangent of x.
- tanh.05
[MX] If x is NaN, a NaN shall be returned.
- tanh.06
If x is ?0, x shall be returned.
- tanh.07
If x is ?Inf, ?1 shall be returned.
- tanh.08
If x is subnormal, a range error may occur and x should be returned.
- tanh.09
These functions may fail if:
- tanh.09.01
Range Error [MX] The value of x is subnormal.
- tanh.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanh.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tanhf (10 / 5 / 0)
- tanhf.01
These functions shall compute the hyperbolic tangent of their argument x.
- tanhf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tanhf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tanhf.04
Upon successful completion, these functions shall return the hyperbolic tangent of x.
- tanhf.05
[MX] If x is NaN, a NaN shall be returned.
- tanhf.06
If x is ?0, x shall be returned.
- tanhf.07
If x is ?Inf, ?1 shall be returned.
- tanhf.08
If x is subnormal, a range error may occur and x should be returned.
- tanhf.09
These functions may fail if:
- tanhf.09.01
Range Error [MX] The value of x is subnormal.
- tanhf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanhf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tanhl (10 / 5 / 0)
- tanhl.01
These functions shall compute the hyperbolic tangent of their argument x.
- tanhl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tanhl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tanhl.04
Upon successful completion, these functions shall return the hyperbolic tangent of x.
- tanhl.05
[MX] If x is NaN, a NaN shall be returned.
- tanhl.06
If x is ?0, x shall be returned.
- tanhl.07
If x is ?Inf, ?1 shall be returned.
- tanhl.08
If x is subnormal, a range error may occur and x should be returned.
- tanhl.09
These functions may fail if:
- tanhl.09.01
Range Error [MX] The value of x is subnormal.
- tanhl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanhl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]math.integer (15 / 14 / 0)
- [+]abs (1 / 1 / 0)
- abs.01
The abs() function shall compute the absolute value of its integer operand, i.
The abs() function shall return the absolute value of its integer operand.
- app.abs.02
If the result cannot be represented, the behavior is undefined.
- [+]div (4 / 3 / 0)
- div.01
The div() function shall compute the quotient and remainder of the division of the numerator numer by the denominator denom.
- app.div.02
If the result cannot be represented, the behavior is undefined;
- div.03
otherwise, quot* denom+ rem shall equal numer.
- div.04
The div() function shall return a structure of type div_t, comprising both the quotient and the remainder.
- div.05
If the division is inexact, the resulting quotient is the integer of lesser magnitude that is the nearest to the algebraic quotient.
- [+]imaxabs (1 / 1 / 0)
- imaxabs.01
The imaxabs() function shall compute the absolute value of an integer j.
The imaxabs() function shall return the absolute value.
- app.imaxabs.02
If the result cannot be represented, the behavior is undefined.
- [+]imaxdiv (1 / 1 / 0)
- imaxdiv.01
The imaxdiv() function shall compute numer / denom and numer % denom in a single operation.
- app.imaxdiv.03
If either part of the result cannot be represented, the behavior is undefined.
- [+]labs (1 / 1 / 0)
- labs.01
The labs() function shall compute the absolute value of the long integer operand i
The labs() function shall return the absolute value of the long integer operand.
- app.labs.03
If the result cannot be represented, the behavior is undefined.
- [+]ldiv (3 / 3 / 0)
- ldiv.01
These functions shall compute the quotient and remainder of the division of the numerator numer by the denominator denom.
- ldiv.02
If the division is inexact, the resulting quotient is the long integer (for the ldiv() function) or long long integer (for the lldiv() function) of lesser magnitude that is the nearest to the algebraic quotient.
- app.ldiv.03
If the result cannot be represented, the behavior is undefined;
- ldiv.04
otherwise, quot * denom+rem shall equal numer.
- [+]llabs (1 / 1 / 0)
- llabs.01
The llabs() function shall compute the absolute value of the long long integer operand i.
The llabs() function shall return the absolute value of the long long integer operand.
- app.llabs.03
If the result cannot be represented, the behavior is undefined.
- [+]lldiv (3 / 3 / 0)
- lldiv.01
These functions shall compute the quotient and remainder of the division of the numerator numer by the denominator denom.
- lldiv.02
If the division is inexact, the resulting quotient is the long integer (for the ldiv() function) or long long integer (for the lldiv() function) of lesser magnitude that is the nearest to the algebraic quotient.
- app.lldiv.03
If the result cannot be represented, the behavior is undefined;
- lldiv.04
otherwise, quot * denom+rem shall equal numer.
- [+]math.rand (86 / 52 / 1)
- [+]drand48 (7 / 5 / 0)
- drand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- drand48.02
The drand48() and erand48() functions shall return non-negative, double-precision, floating-point values, uniformly distributed over the interval [0.0,1.0).
- drand48.03 (struct)
constant default initializer values shall be supplied automatically if drand48(), lrand48(), or mrand48() is called without a prior call to an initialization entry point.
- drand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- drand48.05
The parameter m = 248;
- drand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- drand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- drand48.08 (struct)
The drand48(), lrand48(), and mrand48() functions store the last 48-bit Xi generated in an internal buffer; that is why the application shall ensure that these are initialized prior to being invoked.
- drand48.09
The drand48(), lrand48(), and mrand48() functions need not be reentrant.
- [+]erand48 (8 / 7 / 0)
- erand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- erand48.02
The drand48() and erand48() functions shall return non-negative, double-precision, floating-point values, uniformly distributed over the interval [0.0,1.0).
- erand48.03 (struct)
The erand48(), nrand48(), and jrand48() functions do not require an initialization entry point to be called first.
- erand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- erand48.05
The parameter m = 248;
- erand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- erand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- erand48.08
The erand48(), nrand48(), and jrand48() functions require the calling program to provide storage for the successive Xi values in the array specified as an argument when the functions are invoked.
- erand48.09
the calling program merely has to place the desired initial value of Xi into the array and pass it as an argument.
- [+]initstate (10 / 3 / 1)
- initstate.01
The initstate() and setstate() functions handle restarting and changing random-number generators.
- initstate.02
The initstate() function allows a state array, pointed to by the state argument, to be initialized for future use.
- initstate.03
The size argument, which specifies the size in bytes of the state array, shall be used by initstate() to decide what type of random-number generator to use;
- initstate.04
Values for the amount of state information are 8, 32, 64, 128, and 256 bytes. Other values greater than 8 bytes are rounded down to the nearest one of these values.
- initstate.05
If initstate() is called with 8<=size<32, then random() shall use a simple linear congruential random number generator.
- initstate.06
The seed argument specifies a starting point for the random-number sequence and provides for restarting at the same point.
- initstate.07 (failed)
The initstate() functioen shall return a pointer to the previous state information array.
- initstate.08
If initstate() has not been called, then random() shall behave as though initstate() had been called with seed=1 and size=128.
- initstate.11
If initstate() is called with size less than 8, it shall return NULL.
- initstate.12
Upon successful completion, initstate() and setstate() shall return a pointer to the previous state array; otherwise, a null pointer shall be returned.
- [+]jrand48 (8 / 7 / 0)
- jrand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- jrand48.02
The mrand48() and jrand48() functions shall return signed long integers uniformly distributed over the interval [-231,231).
- jrand48.03 (struct)
The erand48(), nrand48(), and jrand48() functions do not require an initialization entry point to be called first.
- jrand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- jrand48.05
The parameter m = 248;
- jrand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- jrand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- jrand48.08
The erand48(), nrand48(), and jrand48() functions require the calling program to provide storage for the successive Xi values in the array specified as an argument when the functions are invoked.
- jrand48.09
the calling program merely has to place the desired initial value of Xi into the array and pass it as an argument.
- [+]lcong48 (1 / 1 / 0)
- lcong48.01 (struct)
The srand48(), seed48(), and lcong48() functions are initialization entry points, one of which should be invoked before either drand48(), lrand48(), or mrand48() is called.
- lcong48.02 (struct)
Unless lcong48() is invoked, the multiplier value a and the addend value c are given by: a = 5DEECE66D16 = 2736731631558 c = B16 = 138
- lcong48.03
The initializer function lcong48() allows the user to specify the initial Xi , the multiplier value a, and the addend value c. Argument array elements param[0-2] specify Xi , param[3-5] specify the multiplier a, and param[6] specifies the 16-bit addend c.
- [+]lrand48 (7 / 5 / 0)
- lrand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- lrand48.02
The lrand48() and nrand48() functions shall return non-negative, long integers, uniformly distributed over the interval [0,231).
- lrand48.03 (struct)
constant default initializer values shall be supplied automatically if drand48(), lrand48(), or mrand48() is called without a prior call to an initialization entry point.
- lrand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- lrand48.05
The parameter m = 248;
- lrand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- lrand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- lrand48.08 (struct)
The drand48(), lrand48(), and mrand48() functions store the last 48-bit Xi generated in an internal buffer; that is why the application shall ensure that these are initialized prior to being invoked.
- lrand48.09
The drand48(), lrand48(), and mrand48() functions need not be reentrant.
- [+]mrand48 (7 / 5 / 0)
- mrand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- mrand48.02
The mrand48() and jrand48() functions shall return signed long integers uniformly distributed over the interval [-231,231).
- mrand48.03 (struct)
constant default initializer values shall be supplied automatically if drand48(), lrand48(), or mrand48() is called without a prior call to an initialization entry point.
- mrand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- mrand48.05
The parameter m = 248;
- mrand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- mrand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- mrand48.08 (struct)
The drand48(), lrand48(), and mrand48() functions store the last 48-bit Xi generated in an internal buffer; that is why the application shall ensure that these are initialized prior to being invoked.
- mrand48.09
The drand48(), lrand48(), and mrand48() functions need not be reentrant.
- [+]nrand48 (8 / 7 / 0)
- nrand48.01
This family of functions shall generate pseudo-random numbers using a linear congruential algorithm and 48-bit integer arithmetic.
- nrand48.02
The lrand48() and nrand48() functions shall return non-negative, long integers, uniformly distributed over the interval [0,231).
- nrand48.03 (struct)
The erand48(), nrand48(), and jrand48() functions do not require an initialization entry point to be called first.
- nrand48.04
All the routines work by generating a sequence of 48-bit integer values, Xi , according to the linear congruential formula: Xn+1 = (aXn + c)mod m n>= 0
- nrand48.05
The parameter m = 248;
- nrand48.06
The value returned by any of the drand48(), erand48(), jrand48(), lrand48(), mrand48(), or nrand48() functions is computed by first generating the next 48-bit Xi in the sequence.
- nrand48.07
Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of Xi and transformed into the returned value.
- nrand48.08
The erand48(), nrand48(), and jrand48() functions require the calling program to provide storage for the successive Xi values in the array specified as an argument when the functions are invoked.
- nrand48.09
the calling program merely has to place the desired initial value of Xi into the array and pass it as an argument.
- [+]rand (4 / 2 / 0)
- rand.01
The rand() function shall compute a sequence of pseudo-random integers in the range [0, {RAND_MAX}] [XSI] with a period of at least 232.
- rand.02
[CX] The rand() function need not be reentrant.
- rand.03
(The value of the {RAND_MAX} macro shall be at least 32767.)
- rand.04
The rand() function shall return the next pseudo-random number in the sequence.
- [+]rand_r (4 / 2 / 0)
- rand_r.01
[TSF] The rand_r() function shall compute a sequence of pseudo-random integers in the range [0, {RAND_MAX}].
- rand_r.02
(The value of the {RAND_MAX} macro shall be at least 32767.)
- rand_r.03
If rand_r() is called with the same initial value for the object pointed to by seed and that object is not modified between successive returns and calls to rand_r(), the same sequence shall be generated.
- rand_r.04
[TSF] The rand_r() function shall return a pseudo-random integer.
- [+]random (8 / 1 / 0)
- random.01
The random() function shall use a non-linear additive feedback random-number generator employing a default state array size of 31 long integers to return successive pseudo-random numbers in the range from 0 to 231-1.
- random.02
The period of this random-number generator is approximately 16 x (231-1).
- random.03
The size of the state array determines the period of the random-number generator.
- random.04
Increasing the state array size shall increase the period.
- random.05
With 256 bytes of state information, the period of the random-number generator shall be greater than 269.
- random.06
Like rand(), random() shall produce by default a sequence of numbers that can be duplicated by calling srandom() with 1 as the seed.
- random.07
the larger the state array, the more random the numbers.
- random.08
The random() function shall return the generated pseudo-random number.
Generalizes:
- random.01
- random.02
- random.03
- random.04
- random.05
- random.06
- random.07
- [+]seed48 (3 / 2 / 0)
- seed48.01 (struct)
The srand48(), seed48(), and lcong48() functions are initialization entry points, one of which should be invoked before either drand48(), lrand48(), or mrand48() is called.
- seed48.02
The initializer function seed48() sets the value of Xi to the 48-bit value specified in the argument array. The low-order 16 bits of Xi are set to the low-order 16 bits of seed16v[0]. The mid-order 16 bits of Xi are set to the low-order 16 bits of seed16v[1]. The high-order 16 bits of Xi are set to the low-order 16 bits of seed16v[2].
- seed48.03
In addition, the previous value of Xi is copied into a 48-bit internal buffer, used only by seed48(), and a pointer to this buffer is the value returned by seed48().
- seed48.04
After lcong48() is called, a subsequent call to either srand48() or seed48() shall restore the standard multiplier and addend values, a and c, specified above.
- [+]setstate (4 / 3 / 0)
- setstate.01
The initstate() and setstate() functions handle restarting and changing random-number generators.
Generalizes:
- setstate.02
- setstate.03
- setstate.04
- setstate.05
- setstate.02
Once a state has been initialized, setstate() allows switching between state arrays.
- setstate.03 (struct)
The array defined by the state argument shall be used for further random-number generation until initstate() is called or setstate() is called again.
- setstate.04
The setstate() function shall return a pointer to the previous state array.
- setstate.05
Upon successful completion, initstate() and setstate() shall return a pointer to the previous state array; otherwise, a null pointer shall be returned.
- [+]srand (3 / 0 / 0)
- srand.01
The srand() function uses the argument as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to rand().
- srand.02
If srand() is then called with the same seed value, the sequence of pseudo-random numbers shall be repeated.
- srand.03
If rand() is called before any calls to srand() are made, the same sequence shall be generated as when srand() is first called with a seed value of 1.
- srand.04 (struct)
The srand() function shall not return a value.
- [+]srand48 (2 / 2 / 0)
- srand48.01 (struct)
The srand48(), seed48(), and lcong48() functions are initialization entry points, one of which should be invoked before either drand48(), lrand48(), or mrand48() is called.
- srand48.02
The initializer function srand48() sets the high-order 32 bits of Xi to the low-order 32 bits contained in its argument. The low-order 16 bits of Xi are set to the arbitrary value 330E16.
- srand48.03
After lcong48() is called, a subsequent call to either srand48() or seed48() shall restore the standard multiplier and addend values, a and c, specified above.
- [+]srandom (2 / 0 / 0)
- srandom.01
The srandom() function shall initialize the current state array using the value of seed.
- srandom.04
The srandom() function shall not return a value.
- [+]math.real (562 / 282 / 63)
- [+]ceil (9 / 4 / 0)
- ceil.01
These functions shall compute the smallest integral value not less than x.
Generalizes:
- ceil.02
- ceil.03
- ceil.04
- ceil.05
- ceil.06
- ceil.07
- ceil.08.01.01
- ceil.08.01.02
- ceil.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ceil.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ceil.04
Upon successful completion, ceil(), ceilf(), and ceill() shall return the smallest integral value not less than x, expressed as a type double, float, or long double, respectively.
- ceil.05
[MX] If x is NaN, a NaN shall be returned.
- ceil.06
If x is ?0 or ?Inf, x shall be returned.
- ceil.07
If the correct value would cause overflow, a range error shall occur and ceil(), ceilf(), and ceill() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- ceil.08
These functions shall fail if:
- ceil.08.01
Range Error [XSI] The result overflows.
- ceil.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ceil.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]ceilf (9 / 4 / 0)
- ceilf.01
These functions shall compute the smallest integral value not less than x.
Generalizes:
- ceilf.02
- ceilf.03
- ceilf.04
- ceilf.05
- ceilf.06
- ceilf.07
- ceilf.08.01.01
- ceilf.08.01.02
- ceilf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ceilf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ceilf.04
Upon successful completion, ceil(), ceilf(), and ceill() shall return the smallest integral value not less than x, expressed as a type double, float, or long double, respectively.
- ceilf.05
[MX] If x is NaN, a NaN shall be returned.
- ceilf.06
If x is ?0 or ?Inf, x shall be returned.
- ceilf.07
If the correct value would cause overflow, a range error shall occur and ceil(), ceilf(), and ceill() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- ceilf.08
These functions shall fail if:
- ceilf.08.01
Range Error [XSI] The result overflows.
- ceilf.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ceilf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]ceill (9 / 4 / 0)
- ceill.01
These functions shall compute the smallest integral value not less than x.
Generalizes:
- ceill.02
- ceill.03
- ceill.04
- ceill.05
- ceill.06
- ceill.07
- ceill.08.01.01
- ceill.08.01.02
- ceill.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ceill.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ceill.04
Upon successful completion, ceil(), ceilf(), and ceill() shall return the smallest integral value not less than x, expressed as a type double, float, or long double, respectively.
- ceill.05
[MX] If x is NaN, a NaN shall be returned.
- ceill.06
If x is ?0 or ?Inf, x shall be returned.
- ceill.07
If the correct value would cause overflow, a range error shall occur and ceil(), ceilf(), and ceill() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- ceill.08
These functions shall fail if:
- ceill.08.01
Range Error [XSI] The result overflows.
- ceill.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ceill.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]copysign (2 / 1 / 0)
- copysign.01
These functions shall produce a value with the magnitude of x and the sign of y.
Generalizes:
- copysign.02 (struct)
On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, these functions regard the sign of zero as positive.
- copysign.03
Upon successful completion, these functions shall return a value with the magnitude of x and the sign of y.
- [+]copysignf (2 / 1 / 0)
- copysignf.01
These functions shall produce a value with the magnitude of x and the sign of y.
Generalizes:
- copysignf.02
- copysignf.03
- copysignf.02 (struct)
On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, these functions regard the sign of zero as positive.
- copysignf.03
Upon successful completion, these functions shall return a value with the magnitude of x and the sign of y.
- [+]copysignl (2 / 1 / 0)
- copysignl.01
These functions shall produce a value with the magnitude of x and the sign of y.
Generalizes:
- copysignl.02
- copysignl.03
- copysignl.02 (struct)
On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, these functions regard the sign of zero as positive.
- copysignl.03
Upon successful completion, these functions shall return a value with the magnitude of x and the sign of y.
- [+]dremf (8 / 0 / 0)
- dremf.07
dremf() has the same specification as remainderf() in ISO POSIX (2003)
Generalizes:
- dremf.remainderf.01
- dremf.remainderf.02
- dremf.remainderf.03
- dremf.remainderf.04
- dremf.remainderf.05
- dremf.remainderf.06.01.01
- dremf.remainderf.06.01.02
- dremf.remainderf.01
These functions shall return the floating-point remainder r= x- ny when y is non-zero. The value n is the integral value nearest the exact value x/ y. When |n-x/y|=?, the value n is chosen to be even.
Generalizes:
- dremf.remainderf.02
- dremf.remainderf.03
- dremf.remainderf.04
- dremf.remainderf.05
- dremf.remainderf.06.01.01
- dremf.remainderf.06.01.02
- dremf.remainderf.02
The behavior of remainder() shall be independent of the rounding mode.
- dremf.remainderf.03
Upon successful completion, these functions shall return the floating-point remainder r= x- ny when y is non-zero.
- dremf.remainderf.04
[MX] If x or y is NaN, a NaN shall be returned.
- dremf.remainderf.05
If x is infinite or y is 0 and the other is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- dremf.remainderf.06
These functions shall fail if:
- dremf.remainderf.06.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- dremf.remainderf.06.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- dremf.remainderf.06.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]dreml (8 / 0 / 0)
- dreml.07
dreml() has the same specification as remainderl() in ISO POSIX (2003)
Generalizes:
- dreml.remainderl.01
- dreml.remainderl.02
- dreml.remainderl.03
- dreml.remainderl.04
- dreml.remainderl.05
- dreml.remainderl.06.01.01
- dreml.remainderl.06.01.02
- dreml.remainderl.01
These functions shall return the floating-point remainder r= x- ny when y is non-zero. The value n is the integral value nearest the exact value x/ y. When |n-x/y|=?, the value n is chosen to be even.
Generalizes:
- dreml.remainderl.02
- dreml.remainderl.03
- dreml.remainderl.04
- dreml.remainderl.05
- dreml.remainderl.06.01.01
- dreml.remainderl.06.01.02
- dreml.remainderl.02
The behavior of remainder() shall be independent of the rounding mode.
- dreml.remainderl.03
Upon successful completion, these functions shall return the floating-point remainder r= x- ny when y is non-zero.
- dreml.remainderl.04
[MX] If x or y is NaN, a NaN shall be returned.
- dreml.remainderl.05
If x is infinite or y is 0 and the other is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- dreml.remainderl.06
These functions shall fail if:
- dreml.remainderl.06.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- dreml.remainderl.06.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- dreml.remainderl.06.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]fabs (5 / 4 / 0)
- fabs.01
These functions shall compute the absolute value of their argument x,| x|.
- fabs.02
Upon successful completion, these functions shall return the absolute value of x.
- fabs.03
If x is NaN, a NaN shall be returned.
- fabs.04
If x is ?0, +0 shall be returned.
- fabs.05
If x is ?Inf, +Inf shall be returned.
Generalizes:
- fabs.01
- fabs.02
- fabs.03
- fabs.04
- [+]fabsf (5 / 4 / 0)
- fabsf.01
These functions shall compute the absolute value of their argument x,| x|.
- fabsf.02
Upon successful completion, these functions shall return the absolute value of x.
- fabsf.03
If x is NaN, a NaN shall be returned.
- fabsf.04
If x is ?0, +0 shall be returned.
- fabsf.05
If x is ?Inf, +Inf shall be returned.
Generalizes:
- fabsf.01
- fabsf.02
- fabsf.03
- fabsf.04
- [+]fabsl (5 / 4 / 0)
- fabsl.01
These functions shall compute the absolute value of their argument x,| x|.
- fabsl.02
Upon successful completion, these functions shall return the absolute value of x.
- fabsl.03
If x is NaN, a NaN shall be returned.
- fabsl.04
If x is ?0, +0 shall be returned.
- fabsl.05
If x is ?Inf, +Inf shall be returned.
Generalizes:
- fabsl.01
- fabsl.02
- fabsl.03
- fabsl.04
- [+]fdim (11 / 6 / 1)
- fdim.01
These functions shall determine the positive difference between their arguments. If x is greater than y, x- y is returned. If x is less than or equal to y, +0 is returned.
- fdim.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fdim.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fdim.04
Upon successful completion, these functions shall return the positive difference value.
- fdim.05
If x- y is positive and overflows, a range error shall occur and fdim(), fdimf(), and fdiml() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- fdim.06
If x- y is positive and underflows, a range error may occur, and either ( x- y) (if representable), [XSI] or 0.0 (if supported), or an implementation-defined value shall be returned.
- fdim.07
If x or y is NaN, a NaN shall be returned.
Generalizes:
- fdim.01
- fdim.02
- fdim.03
- fdim.04
- fdim.05
- fdim.06
- fdim.08.01.01
- fdim.08.01.02
- fdim.09.01.01
- fdim.09.01.02
- fdim.08
The fdim() function shall fail if:
- fdim.08.01
Range Error The result overflows.
- fdim.08.01.01 (failed)
">If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdim.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fdim.09
The fdim() function may fail if:
- fdim.09.01
Range Error The result underflows.
- fdim.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdim.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fdimf (11 / 6 / 1)
- fdimf.01
These functions shall determine the positive difference between their arguments. If x is greater than y, x- y is returned. If x is less than or equal to y, +0 is returned.
- fdimf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fdimf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fdimf.04
Upon successful completion, these functions shall return the positive difference value.
- fdimf.05
If x- y is positive and overflows, a range error shall occur and fdim(), fdimf(), and fdiml() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- fdimf.06
If x- y is positive and underflows, a range error may occur, and either ( x- y) (if representable), [XSI] or 0.0 (if supported), or an implementation-defined value shall be returned.
- fdimf.07
If x or y is NaN, a NaN shall be returned.
Generalizes:
- fdimf.01
- fdimf.02
- fdimf.03
- fdimf.04
- fdimf.05
- fdimf.06
- fdimf.08.01.01
- fdimf.08.01.02
- fdimf.09.01.01
- fdimf.09.01.02
- fdimf.08
The fdim() function shall fail if:
- fdimf.08.01
Range Error The result overflows.
- fdimf.08.01.01 (failed)
">If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdimf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fdimf.09
The fdim() function may fail if:
- fdimf.09.01
Range Error The result underflows.
- fdimf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdimf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fdiml (11 / 6 / 1)
- fdiml.01
These functions shall determine the positive difference between their arguments. If x is greater than y, x- y is returned. If x is less than or equal to y, +0 is returned.
- fdiml.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fdiml.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fdiml.04
Upon successful completion, these functions shall return the positive difference value.
- fdiml.05
If x- y is positive and overflows, a range error shall occur and fdim(), fdimf(), and fdiml() shall return the value of the macro HUGE_VAL, HUGE_VALF, and HUGE_VALL, respectively.
- fdiml.06
If x- y is positive and underflows, a range error may occur, and either ( x- y) (if representable), [XSI] or 0.0 (if supported), or an implementation-defined value shall be returned.
- fdiml.07
If x or y is NaN, a NaN shall be returned.
Generalizes:
- fdiml.01
- fdiml.02
- fdiml.03
- fdiml.04
- fdiml.05
- fdiml.06
- fdiml.08.01.01
- fdiml.08.01.02
- fdiml.09.01.01
- fdiml.09.01.02
- fdiml.08
The fdim() function shall fail if:
- fdiml.08.01
Range Error The result overflows.
- fdiml.08.01.01 (failed)
">If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdiml.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fdiml.09
The fdim() function may fail if:
- fdiml.09.01
Range Error The result underflows.
- fdiml.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fdiml.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]floor (9 / 4 / 0)
- floor.01
These functions shall compute the largest integral value not greater than x.
Generalizes:
- floor.02
- floor.03
- floor.04
- floor.05
- floor.06
- floor.07
- floor.08.01.01
- floor.08.01.02
- floor.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- floor.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- floor.04
Upon successful completion, these functions shall return the largest integral value not greater than x, expressed as a double, float, or long double, as appropriate for the return type of the function.
- floor.05
[MX] If x is NaN, a NaN shall be returned.
- floor.06
If x is ?0 or ?Inf, x shall be returned.
- floor.07
[XSI] If the correct value would cause overflow, a range error shall occur and floor(), floorf(), and floorl() shall return the value of the macro -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- floor.08
These functions shall fail if:
- floor.08.01
Range Error [XSI] The result would cause an overflow.
- floor.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- floor.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]floorf (9 / 4 / 0)
- floorf.01
These functions shall compute the largest integral value not greater than x.
Generalizes:
- floorf.02
- floorf.03
- floorf.04
- floorf.05
- floorf.06
- floorf.07
- floorf.08.01.01
- floorf.08.01.02
- floorf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- floorf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- floorf.04
Upon successful completion, these functions shall return the largest integral value not greater than x, expressed as a double, float, or long double, as appropriate for the return type of the function.
- floorf.05
[MX] If x is NaN, a NaN shall be returned.
- floorf.06
If x is ?0 or ?Inf, x shall be returned.
- floorf.07
[XSI] If the correct value would cause overflow, a range error shall occur and floor(), floorf(), and floorl() shall return the value of the macro -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- floorf.08
These functions shall fail if:
- floorf.08.01
Range Error [XSI] The result would cause an overflow.
- floorf.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- floorf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]floorl (9 / 4 / 0)
- floorl.01
These functions shall compute the largest integral value not greater than x.
Generalizes:
- floorl.02
- floorl.03
- floorl.04
- floorl.05
- floorl.06
- floorl.07
- floorl.08.01.01
- floorl.08.01.02
- floorl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- floorl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- floorl.04
Upon successful completion, these functions shall return the largest integral value not greater than x, expressed as a double, float, or long double, as appropriate for the return type of the function.
- floorl.05
[MX] If x is NaN, a NaN shall be returned.
- floorl.06
If x is ?0 or ?Inf, x shall be returned.
- floorl.07
[XSI] If the correct value would cause overflow, a range error shall occur and floor(), floorf(), and floorl() shall return the value of the macro -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- floorl.08
These functions shall fail if:
- floorl.08.01
Range Error [XSI] The result would cause an overflow.
- floorl.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- floorl.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]fma (17 / 7 / 0)
- fma.01
These functions shall compute (x * y) + z, rounded as one ternary operation: they shall compute the value (as if) to infinite precision and round once to the result format, according to the rounding mode characterized by the value of FLT_ROUNDS.
Generalizes:
- fma.02
- fma.03
- fma.04
- fma.05
- fma.06
- fma.07
- fma.08
- fma.09
- fma.10.01.01
- fma.10.01.02
- fma.10.02.01
- fma.10.02.02
- fma.11.01.01
- fma.11.01.02
- fma.11.02.01
- fma.11.02.02
- fma.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fma.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fma.04
Upon successful completion, these functions shall return (x * y) + z, rounded as one ternary operation.
- fma.05
[MX] If x or y are NaN, a NaN shall be returned.
- fma.06
If x multiplied by y is an exact infinity and z is also an infinity but with the opposite sign, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fma.07
If one of x and y is infinite, the other is zero, and z is not a NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fma.08
If one of x and y is infinite, the other is zero, and z is a NaN, a NaN shall be returned and a domain error may occur.
- fma.09
If x* y is not 0*Inf nor Inf*0 and z is a NaN, a NaN shall be returned.
- fma.10
These functions shall fail if:
- fma.10.01
Domain Error [MX] The value of x* y+ z is invalid, or the value x* y is invalid and z is not a NaN.
- fma.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fma.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fma.10.02
Range Error [MX] The result overflows.
- fma.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fma.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fma.11
These functions may fail if:
- fma.11.01
Domain Error [MX] The value x* y is invalid and z is a NaN.
- fma.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fma.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fma.11.02
Range Error [MX] The result underflows.
- fma.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fma.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fmaf (17 / 7 / 0)
- fmaf.01
These functions shall compute (x * y) + z, rounded as one ternary operation: they shall compute the value (as if) to infinite precision and round once to the result format, according to the rounding mode characterized by the value of FLT_ROUNDS.
Generalizes:
- fmaf.02
- fmaf.03
- fmaf.04
- fmaf.05
- fmaf.06
- fmaf.07
- fmaf.08
- fmaf.09
- fmaf.10.01.01
- fmaf.10.01.02
- fmaf.10.02.01
- fmaf.10.02.02
- fmaf.11.01.01
- fmaf.11.01.02
- fmaf.11.02.01
- fmaf.11.02.02
- fmaf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fmaf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fmaf.04
Upon successful completion, these functions shall return (x * y) + z, rounded as one ternary operation.
- fmaf.05
[MX] If x or y are NaN, a NaN shall be returned.
- fmaf.06
If x multiplied by y is an exact infinity and z is also an infinity but with the opposite sign, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmaf.07
If one of x and y is infinite, the other is zero, and z is not a NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmaf.08
If one of x and y is infinite, the other is zero, and z is a NaN, a NaN shall be returned and a domain error may occur.
- fmaf.09
If x* y is not 0*Inf nor Inf*0 and z is a NaN, a NaN shall be returned.
- fmaf.10
These functions shall fail if:
- fmaf.10.01
Domain Error [MX] The value of x* y+ z is invalid, or the value x* y is invalid and z is not a NaN.
- fmaf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmaf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmaf.10.02
Range Error [MX] The result overflows.
- fmaf.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmaf.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fmaf.11
These functions may fail if:
- fmaf.11.01
Domain Error [MX] The value x* y is invalid and z is a NaN.
- fmaf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmaf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmaf.11.02
Range Error [MX] The result underflows.
- fmaf.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmaf.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fmal (17 / 7 / 0)
- fmal.01
These functions shall compute (x * y) + z, rounded as one ternary operation: they shall compute the value (as if) to infinite precision and round once to the result format, according to the rounding mode characterized by the value of FLT_ROUNDS.
Generalizes:
- fmal.02
- fmal.03
- fmal.04
- fmal.05
- fmal.06
- fmal.07
- fmal.08
- fmal.09
- fmal.10.01.01
- fmal.10.01.02
- fmal.10.02.01
- fmal.10.02.02
- fmal.11.01.01
- fmal.11.01.02
- fmal.11.02.01
- fmal.11.02.02
- fmal.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fmal.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fmal.04
Upon successful completion, these functions shall return (x * y) + z, rounded as one ternary operation.
- fmal.05
[MX] If x or y are NaN, a NaN shall be returned.
- fmal.06
If x multiplied by y is an exact infinity and z is also an infinity but with the opposite sign, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmal.07
If one of x and y is infinite, the other is zero, and z is not a NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmal.08
If one of x and y is infinite, the other is zero, and z is a NaN, a NaN shall be returned and a domain error may occur.
- fmal.09
If x* y is not 0*Inf nor Inf*0 and z is a NaN, a NaN shall be returned.
- fmal.10
These functions shall fail if:
- fmal.10.01
Domain Error [MX] The value of x* y+ z is invalid, or the value x* y is invalid and z is not a NaN.
- fmal.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmal.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmal.10.02
Range Error [MX] The result overflows.
- fmal.10.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmal.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- fmal.11
These functions may fail if:
- fmal.11.01
Domain Error [MX] The value x* y is invalid and z is a NaN.
- fmal.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmal.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmal.11.02
Range Error [MX] The result underflows.
- fmal.11.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmal.11.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fmax (5 / 4 / 0)
- fmax.01
These functions shall determine the maximum numeric value of their arguments.
Generalizes:
- fmax.02
- fmax.03
- fmax.04
- fmax.05
- fmax.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fmax.03
Upon successful completion, these functions shall return the maximum numeric value of their arguments.
- fmax.04
If just one argument is a NaN, the other argument shall be returned.
- fmax.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fmaxf (5 / 4 / 0)
- fmaxf.01
These functions shall determine the maximum numeric value of their arguments.
Generalizes:
- fmaxf.02
- fmaxf.03
- fmaxf.04
- fmaxf.05
- fmaxf.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fmaxf.03
Upon successful completion, these functions shall return the maximum numeric value of their arguments.
- fmaxf.04
If just one argument is a NaN, the other argument shall be returned.
- fmaxf.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fmaxl (5 / 4 / 0)
- fmaxl.01
These functions shall determine the maximum numeric value of their arguments.
Generalizes:
- fmaxl.02
- fmaxl.03
- fmaxl.04
- fmaxl.05
- fmaxl.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fmaxl.03
Upon successful completion, these functions shall return the maximum numeric value of their arguments.
- fmaxl.04
If just one argument is a NaN, the other argument shall be returned.
- fmaxl.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fmin (5 / 4 / 0)
- fmin.01
These functions shall determine the minimum numeric value of their arguments.
Generalizes:
- fmin.02
- fmin.03
- fmin.04
- fmin.05
- fmin.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fmin.03
Upon successful completion, these functions shall return the minimum numeric value of their arguments.
- fmin.04
If just one argument is a NaN, the other argument shall be returned.
- fmin.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fminf (5 / 4 / 0)
- fminf.01
These functions shall determine the minimum numeric value of their arguments.
Generalizes:
- fminf.02
- fminf.03
- fminf.04
- fminf.05
- fminf.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fminf.03
Upon successful completion, these functions shall return the minimum numeric value of their arguments.
- fminf.04
If just one argument is a NaN, the other argument shall be returned.
- fminf.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fminl (5 / 4 / 0)
- fminl.01
These functions shall determine the minimum numeric value of their arguments.
Generalizes:
- fminl.02
- fminl.03
- fminl.04
- fminl.05
- fminl.02
NaN arguments shall be treated as missing data: if one argument is a NaN and the other numeric, then these functions shall choose the numeric value.
- fminl.03
Upon successful completion, these functions shall return the minimum numeric value of their arguments.
- fminl.04
If just one argument is a NaN, the other argument shall be returned.
- fminl.05
[MX] If x and y are NaN, a NaN shall be returned.
- [+]fmod (15 / 8 / 0)
- fmod.01
These functions shall return the floating-point remainder of the division of x by y.
Generalizes:
- fmod.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fmod.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fmod.04
These functions shall return the value x- i* y, for some integer i such that, if y is non-zero, the result has the same sign as x and magnitude less than the magnitude of y.
- fmod.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- fmod.06
[MX] If x or y is NaN, a NaN shall be returned.
- fmod.07
If y is zero, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmod.08
If x is infinite, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmod.09
If x is ?0 and y is not zero, ?0 shall be returned.
- fmod.10
If x is not infinite and y is ?Inf, x shall be returned.
- fmod.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- fmod.12
These functions shall fail if:
- fmod.12.01
Domain Error [MX] The x argument is infinite or y is zero.
- fmod.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmod.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmod.13
These functions may fail if:
- fmod.13.01
Range Error The result underflows.
- fmod.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmod.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fmodf (15 / 8 / 0)
- fmodf.01
These functions shall return the floating-point remainder of the division of x by y.
Generalizes:
- fmodf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fmodf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fmodf.04
These functions shall return the value x- i* y, for some integer i such that, if y is non-zero, the result has the same sign as x and magnitude less than the magnitude of y.
- fmodf.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- fmodf.06
[MX] If x or y is NaN, a NaN shall be returned.
- fmodf.07
If y is zero, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmodf.08
If x is infinite, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmodf.09
If x is ?0 and y is not zero, ?0 shall be returned.
- fmodf.10
If x is not infinite and y is ?Inf, x shall be returned.
- fmodf.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- fmodf.12
These functions shall fail if:
- fmodf.12.01
Domain Error [MX] The x argument is infinite or y is zero.
- fmodf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmodf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmodf.13
These functions may fail if:
- fmodf.13.01
Range Error The result underflows.
- fmodf.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmodf.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]fmodl (15 / 8 / 0)
- fmodl.01
These functions shall return the floating-point remainder of the division of x by y.
Generalizes:
- fmodl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- fmodl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- fmodl.04
These functions shall return the value x- i* y, for some integer i such that, if y is non-zero, the result has the same sign as x and magnitude less than the magnitude of y.
- fmodl.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- fmodl.06
[MX] If x or y is NaN, a NaN shall be returned.
- fmodl.07
If y is zero, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmodl.08
If x is infinite, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- fmodl.09
If x is ?0 and y is not zero, ?0 shall be returned.
- fmodl.10
If x is not infinite and y is ?Inf, x shall be returned.
- fmodl.11
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- fmodl.12
These functions shall fail if:
- fmodl.12.01
Domain Error [MX] The x argument is infinite or y is zero.
- fmodl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- fmodl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- fmodl.13
These functions may fail if:
- fmodl.13.01
Range Error The result underflows.
- fmodl.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- fmodl.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]llrint (11 / 3 / 6)
- llrint.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- llrint.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llrint.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llrint.04
Upon successful completion, these functions shall return the rounded integer value.
- llrint.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llrint.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llrint.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llrint.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrint.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrint.10
These functions shall fail if:
- llrint.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llrint.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llrint.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]llrintf (11 / 3 / 6)
- llrintf.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- llrintf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llrintf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llrintf.04
Upon successful completion, these functions shall return the rounded integer value.
- llrintf.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llrintf.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llrintf.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llrintf.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrintf.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrintf.10
These functions shall fail if:
- llrintf.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llrintf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llrintf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]llrintl (11 / 3 / 6)
- llrintl.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- llrintl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llrintl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llrintl.04
Upon successful completion, these functions shall return the rounded integer value.
- llrintl.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llrintl.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llrintl.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llrintl.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrintl.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llrintl.10
These functions shall fail if:
- llrintl.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llrintl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llrintl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]llround (11 / 3 / 6)
- llround.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- llround.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llround.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llround.04
Upon successful completion, these functions shall return the rounded integer value.
- llround.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llround.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llround.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llround.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llround.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llround.10
These functions shall fail if:
- llround.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llround.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llround.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]llroundf (11 / 3 / 6)
- llroundf.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- llroundf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llroundf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llroundf.04
Upon successful completion, these functions shall return the rounded integer value.
- llroundf.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llroundf.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llroundf.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llroundf.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llroundf.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llroundf.10
These functions shall fail if:
- llroundf.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llroundf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llroundf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]llroundl (11 / 3 / 6)
- llroundl.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- llroundl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- llroundl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- llroundl.04
Upon successful completion, these functions shall return the rounded integer value.
- llroundl.05 (failed)
[MX] If x is NaN, a domain error shall occur, and an unspecified value is returned.
- llroundl.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- llroundl.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- llroundl.08 (failed)
If the correct value is positive and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llroundl.09 (failed)
If the correct value is negative and too large to represent as a long long, a domain error shall occur and an unspecified value is returned.
- llroundl.10
These functions shall fail if:
- llroundl.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- llroundl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- llroundl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lrint (11 / 8 / 1)
- lrint.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- lrint.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lrint.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lrint.04
Upon successful completion, these functions shall return the rounded integer value.
- lrint.05
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lrint.06
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lrint.07
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lrint.08
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrint.09
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrint.10
These functions shall fail if:
- lrint.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lrint.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- lrint.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lrintf (11 / 8 / 1)
- lrintf.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- lrintf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lrintf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lrintf.04
Upon successful completion, these functions shall return the rounded integer value.
- lrintf.05
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lrintf.06
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lrintf.07
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lrintf.08
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrintf.09
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrintf.10
These functions shall fail if:
- lrintf.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lrintf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- lrintf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lrintl (11 / 8 / 1)
- lrintl.01
These functions shall round their argument to the nearest integer value, rounding according to the current rounding direction.
- lrintl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lrintl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lrintl.04
Upon successful completion, these functions shall return the rounded integer value.
- lrintl.05
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lrintl.06
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lrintl.07
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lrintl.08
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrintl.09
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lrintl.10
These functions shall fail if:
- lrintl.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lrintl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- lrintl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lround (11 / 3 / 6)
- lround.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- lround.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lround.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lround.04
Upon successful completion, these functions shall return the rounded integer value.
- lround.05 (failed)
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lround.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lround.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lround.08 (failed)
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lround.09 (failed)
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lround.10
These functions shall fail if:
- lround.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lround.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- lround.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lroundf (11 / 3 / 6)
- lroundf.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- lroundf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lroundf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lroundf.04
Upon successful completion, these functions shall return the rounded integer value.
- lroundf.05 (failed)
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lroundf.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lroundf.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lroundf.08 (failed)
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lroundf.09 (failed)
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lroundf.10
These functions shall fail if:
- lroundf.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lroundf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- lroundf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]lroundl (11 / 3 / 6)
- lroundl.01
These functions shall round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction.
- lroundl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- lroundl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- lroundl.04
Upon successful completion, these functions shall return the rounded integer value.
- lroundl.05 (failed)
[MX] If x is NaN, a domain error shall occur and an unspecified value is returned.
- lroundl.06 (failed)
If x is +Inf, a domain error shall occur and an unspecified value is returned.
- lroundl.07 (failed)
If x is -Inf, a domain error shall occur and an unspecified value is returned.
- lroundl.08 (failed)
If the correct value is positive and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lroundl.09 (failed)
If the correct value is negative and too large to represent as a long, a domain error shall occur and an unspecified value is returned.
- lroundl.10
These functions shall fail if:
- lroundl.10.01
Domain Error [MX] The x argument is NaN or ?Inf, or the correct value is not representable as an integer.
- lroundl.10.01. 02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- lroundl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- [+]modf (5 / 4 / 0)
- modf.01
These functions shall break the argument x into integral and fractional parts, each of which has the same sign as the argument.
Generalizes:
- modf.02
- modf.03
- modf.04
- modf.05
- modf.02
It stores the integral part as a double (for the modf() function), a float (for the modff() function), or a long double (for the modfl() function), in the object pointed to by iptr.
- modf.03
Upon successful completion, these functions shall return the signed fractional part of x.
- modf.04
[MX] If x is NaN, a NaN shall be returned, and *iptr shall be set to a NaN.
- modf.05
If x is ?Inf, ?0 shall be returned, and *iptr shall be set to ?Inf.
- [+]modff (5 / 4 / 0)
- modff.01
These functions shall break the argument x into integral and fractional parts, each of which has the same sign as the argument.
Generalizes:
- modff.02
- modff.03
- modff.04
- modff.05
- modff.02
It stores the integral part as a double (for the modf() function), a float (for the modff() function), or a long double (for the modfl() function), in the object pointed to by iptr.
- modff.03
Upon successful completion, these functions shall return the signed fractional part of x.
- modff.04
[MX] If x is NaN, a NaN shall be returned, and *iptr shall be set to a NaN.
- modff.05
If x is ?Inf, ?0 shall be returned, and *iptr shall be set to ?Inf.
- [+]modfl (5 / 4 / 0)
- modfl.01
These functions shall break the argument x into integral and fractional parts, each of which has the same sign as the argument.
Generalizes:
- modfl.02
- modfl.03
- modfl.04
- modfl.05
- modfl.02
It stores the integral part as a double (for the modf() function), a float (for the modff() function), or a long double (for the modfl() function), in the object pointed to by iptr.
- modfl.03
Upon successful completion, these functions shall return the signed fractional part of x.
- modfl.04
[MX] If x is NaN, a NaN shall be returned, and *iptr shall be set to a NaN.
- modfl.05
If x is ?Inf, ?0 shall be returned, and *iptr shall be set to ?Inf.
- [+]nan (6 / 5 / 0)
- nan.01
The function call nan("n-char-sequence") shall be equivalent to: strtod("NAN(n-char-sequence)", (char **) NULL);
- nan.02
The function call nan("") shall be equivalent to: strtod("NAN()", (char **) NULL)
- nan.03
If tagp does not point to an n- char sequence or an empty string, the function call shall be equivalent to: strtod("NAN", (char **) NULL)
- nan.04
Function calls to nanf() and nanl() are equivalent to the corresponding function calls to strtof() and strtold().
- nan.05
These functions shall return a quiet NaN, if available, with content indicated through tagp.
- nan.06
If the implementation does not support quiet NaNs, these functions shall return zero.
- [+]nanf (6 / 5 / 0)
- nanf.01
The function call nan("n-char-sequence") shall be equivalent to: strtod("NAN(n-char-sequence)", (char **) NULL);
- nanf.02
The function call nan("") shall be equivalent to: strtod("NAN()", (char **) NULL)
- nanf.03
If tagp does not point to an n- char sequence or an empty string, the function call shall be equivalent to: strtod("NAN", (char **) NULL)
- nanf.04
Function calls to nanf() and nanl() are equivalent to the corresponding function calls to strtof() and strtold().
- nanf.05
These functions shall return a quiet NaN, if available, with content indicated through tagp.
- nanf.06
If the implementation does not support quiet NaNs, these functions shall return zero.
- [+]nanl (6 / 5 / 0)
- nanl.01
The function call nan("n-char-sequence") shall be equivalent to: strtod("NAN(n-char-sequence)", (char **) NULL);
- nanl.02
The function call nan("") shall be equivalent to: strtod("NAN()", (char **) NULL)
- nanl.03
If tagp does not point to an n- char sequence or an empty string, the function call shall be equivalent to: strtod("NAN", (char **) NULL)
- nanl.04
Function calls to nanf() and nanl() are equivalent to the corresponding function calls to strtof() and strtold().
- nanl.05
These functions shall return a quiet NaN, if available, with content indicated through tagp.
- nanl.06
If the implementation does not support quiet NaNs, these functions shall return zero.
- [+]nearbyint (10 / 4 / 0)
- nearbyint.01
These functions shall round their argument to an integer value in floating-point format, using the current rounding direction and without raising the inexact floating-point exception.
Generalizes:
- nearbyint.02
- nearbyint.03
- nearbyint.04
- nearbyint.05
- nearbyint.06
- nearbyint.07
- nearbyint.08
- nearbyint.09.01.01
- nearbyint.09.01.02
- nearbyint.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nearbyint.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nearbyint.04
Upon successful completion, these functions shall return the rounded integer value.
- nearbyint.05
[MX] If x is NaN, a NaN shall be returned.
- nearbyint.06
If x is ?0, ?0 shall be returned.
- nearbyint.07
If x is ?Inf, x shall be returned.
- nearbyint.08
[XSI] If the correct value would cause overflow, a range error shall occur and nearbyint(), nearbyintf(), and nearbyintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- nearbyint.09
These functions shall fail if:
- nearbyint.09.01
Range Error [XSI] The result would cause an overflow.
- nearbyint.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nearbyint.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]nearbyintf (10 / 4 / 0)
- nearbyintf.01
These functions shall round their argument to an integer value in floating-point format, using the current rounding direction and without raising the inexact floating-point exception.
Generalizes:
- nearbyintf.02
- nearbyintf.03
- nearbyintf.04
- nearbyintf.05
- nearbyintf.06
- nearbyintf.07
- nearbyintf.08
- nearbyintf.09.01.01
- nearbyintf.09.01.02
- nearbyintf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nearbyintf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nearbyintf.04
Upon successful completion, these functions shall return the rounded integer value.
- nearbyintf.05
[MX] If x is NaN, a NaN shall be returned.
- nearbyintf.06
If x is ?0, ?0 shall be returned.
- nearbyintf.07
If x is ?Inf, x shall be returned.
- nearbyintf.08
[XSI] If the correct value would cause overflow, a range error shall occur and nearbyint(), nearbyintf(), and nearbyintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- nearbyintf.09
These functions shall fail if:
- nearbyintf.09.01
Range Error [XSI] The result would cause an overflow.
- nearbyintf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nearbyintf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]nearbyintl (10 / 4 / 0)
- nearbyintl.01
These functions shall round their argument to an integer value in floating-point format, using the current rounding direction and without raising the inexact floating-point exception.
Generalizes:
- nearbyintl.02
- nearbyintl.03
- nearbyintl.04
- nearbyintl.05
- nearbyintl.06
- nearbyintl.07
- nearbyintl.08
- nearbyintl.09.01.01
- nearbyintl.09.01.02
- nearbyintl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nearbyintl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nearbyintl.04
Upon successful completion, these functions shall return the rounded integer value.
- nearbyintl.05
[MX] If x is NaN, a NaN shall be returned.
- nearbyintl.06
If x is ?0, ?0 shall be returned.
- nearbyintl.07
If x is ?Inf, x shall be returned.
- nearbyintl.08
[XSI] If the correct value would cause overflow, a range error shall occur and nearbyint(), nearbyintf(), and nearbyintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- nearbyintl.09
These functions shall fail if:
- nearbyintl.09.01
Range Error [XSI] The result would cause an overflow.
- nearbyintl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nearbyintl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]remainder (7 / 4 / 0)
- remainder.01
These functions shall return the floating-point remainder r= x- ny when y is non-zero. The value n is the integral value nearest the exact value x/ y. When |n-x/y|=?, the value n is chosen to be even.
Generalizes:
- remainder.02
- remainder.03
- remainder.04
- remainder.05
- remainder.06.01.01
- remainder.06.01.02
- remainder.02
The behavior of remainder() shall be independent of the rounding mode.
- remainder.03
Upon successful completion, these functions shall return the floating-point remainder r= x- ny when y is non-zero.
- remainder.04
[MX] If x or y is NaN, a NaN shall be returned.
- remainder.05
If x is infinite or y is 0 and the other is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remainder.06
These functions shall fail if:
- remainder.06.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remainder.06.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remainder.06.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]remainderf (7 / 4 / 0)
- remainderf.01
These functions shall return the floating-point remainder r= x- ny when y is non-zero. The value n is the integral value nearest the exact value x/ y. When |n-x/y|=?, the value n is chosen to be even.
Generalizes:
- remainderf.02
- remainderf.03
- remainderf.04
- remainderf.05
- remainderf.06.01.01
- remainderf.06.01.02
- remainderf.02
The behavior of remainder() shall be independent of the rounding mode.
- remainderf.03
Upon successful completion, these functions shall return the floating-point remainder r= x- ny when y is non-zero.
- remainderf.04
[MX] If x or y is NaN, a NaN shall be returned.
- remainderf.05
If x is infinite or y is 0 and the other is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remainderf.06
These functions shall fail if:
- remainderf.06.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remainderf.06.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remainderf.06.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]remainderl (7 / 4 / 0)
- remainderl.01
These functions shall return the floating-point remainder r= x- ny when y is non-zero. The value n is the integral value nearest the exact value x/ y. When |n-x/y|=?, the value n is chosen to be even.
Generalizes:
- remainderl.02
- remainderl.03
- remainderl.04
- remainderl.05
- remainderl.06.01.01
- remainderl.06.01.02
- remainderl.02
The behavior of remainder() shall be independent of the rounding mode.
- remainderl.03
Upon successful completion, these functions shall return the floating-point remainder r= x- ny when y is non-zero.
- remainderl.04
[MX] If x or y is NaN, a NaN shall be returned.
- remainderl.05
If x is infinite or y is 0 and the other is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remainderl.06
These functions shall fail if:
- remainderl.06.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remainderl.06.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remainderl.06.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]remquo (8 / 5 / 1)
- remquo.01
The remquo(), remquof(), and remquol() functions shall compute the same remainder as the remainder(), remainderf(), and remainderl() functions, respectively. In the object pointed to by quo, they store a value whose sign is the sign of x/ y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/ y, where n is an implementation-defined integer greater than or equal to 3.
- remquo.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- remquo.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- remquo.04
These functions shall return x REM y.
- remquo.05
[MX] If x or y is NaN, a NaN shall be returned.
- remquo.06
If x is ?Inf or y is zero and the other argument is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remquo.07
These functions shall fail if:
- remquo.07.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remquo.07.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remquo.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]remquof (8 / 5 / 1)
- remquof.01
The remquo(), remquof(), and remquol() functions shall compute the same remainder as the remainder(), remainderf(), and remainderl() functions, respectively. In the object pointed to by quo, they store a value whose sign is the sign of x/ y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/ y, where n is an implementation-defined integer greater than or equal to 3.
- remquof.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- remquof.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- remquof.04
These functions shall return x REM y.
- remquof.05
[MX] If x or y is NaN, a NaN shall be returned.
- remquof.06
If x is ?Inf or y is zero and the other argument is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remquof.07
These functions shall fail if:
- remquof.07.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remquof.07.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remquof.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]remquol (8 / 5 / 1)
- remquol.01
The remquo(), remquof(), and remquol() functions shall compute the same remainder as the remainder(), remainderf(), and remainderl() functions, respectively. In the object pointed to by quo, they store a value whose sign is the sign of x/ y and whose magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/ y, where n is an implementation-defined integer greater than or equal to 3.
- remquol.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- remquol.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- remquol.04
These functions shall return x REM y.
- remquol.05
[MX] If x or y is NaN, a NaN shall be returned.
- remquol.06
If x is ?Inf or y is zero and the other argument is non-NaN, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- remquol.07
These functions shall fail if:
- remquol.07.01
Domain Error [MX] The x argument is ?Inf, or the y argument is ?0 and the other argument is non-NaN.
- remquol.07.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- remquol.07.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]rint (11 / 6 / 0)
- rint.01
These functions shall return the integral value (represented as a double) nearest x in the direction of the current rounding mode. The current rounding mode is implementation-defined.
Generalizes:
- rint.02
- rint.03
- rint.04
- rint.05
- rint.06
- rint.07
- rint.08
- rint.09
- rint.10
- rint.11.01.01
- rint.11.01.02
- rint.02
If the current rounding mode rounds toward negative infinity, then rint() shall be equivalent to floor().
- rint.03
If the current rounding mode rounds toward positive infinity, then rint() shall be equivalent to ceil().
- rint.04 (struct)
These functions differ from the nearbyint(), nearbyintf(), and nearbyintl() functions only in that they may raise the inexact floating-point exception if the result differs in value from the argument.
- rint.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- rint.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- rint.07
Upon successful completion, these functions shall return the integer (represented as a double precision number) nearest x in the direction of the current rounding mode.
- rint.08
[MX] If x is NaN, a NaN shall be returned.
- rint.09
If x is ?0 or ?Inf, x shall be returned.
- rint.10
[XSI] If the correct value would cause overflow, a range error shall occur and rint(), rintf(), and rintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- rint.11
These functions shall fail if:
- rint.11.01
Range Error [XSI] The result would cause an overflow.
- rint.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- rint.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]rintf (11 / 6 / 0)
- rintf.01
These functions shall return the integral value (represented as a double) nearest x in the direction of the current rounding mode. The current rounding mode is implementation-defined.
Generalizes:
- rintf.02
- rintf.03
- rintf.04
- rintf.05
- rintf.06
- rintf.07
- rintf.08
- rintf.09
- rintf.10
- rintf.11.01.01
- rintf.11.01.02
- rintf.02
If the current rounding mode rounds toward negative infinity, then rint() shall be equivalent to floor().
- rintf.03
If the current rounding mode rounds toward positive infinity, then rint() shall be equivalent to ceil().
- rintf.04 (struct)
These functions differ from the nearbyint(), nearbyintf(), and nearbyintl() functions only in that they may raise the inexact floating-point exception if the result differs in value from the argument.
- rintf.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- rintf.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- rintf.07
Upon successful completion, these functions shall return the integer (represented as a double precision number) nearest x in the direction of the current rounding mode.
- rintf.08
[MX] If x is NaN, a NaN shall be returned.
- rintf.09
If x is ?0 or ?Inf, x shall be returned.
- rintf.10
[XSI] If the correct value would cause overflow, a range error shall occur and rint(), rintf(), and rintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- rintf.11
These functions shall fail if:
- rintf.11.01
Range Error [XSI] The result would cause an overflow.
- rintf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- rintf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]rintl (11 / 6 / 0)
- rintl.01
These functions shall return the integral value (represented as a double) nearest x in the direction of the current rounding mode. The current rounding mode is implementation-defined.
Generalizes:
- rintl.02
- rintl.03
- rintl.04
- rintl.05
- rintl.06
- rintl.07
- rintl.08
- rintl.09
- rintl.10
- rintl.11.01.01
- rintl.11.01.02
- rintl.02
If the current rounding mode rounds toward negative infinity, then rint() shall be equivalent to floor().
- rintl.03
If the current rounding mode rounds toward positive infinity, then rint() shall be equivalent to ceil().
- rintl.04 (struct)
These functions differ from the nearbyint(), nearbyintf(), and nearbyintl() functions only in that they may raise the inexact floating-point exception if the result differs in value from the argument.
- rintl.05
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- rintl.06
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- rintl.07
Upon successful completion, these functions shall return the integer (represented as a double precision number) nearest x in the direction of the current rounding mode.
- rintl.08
[MX] If x is NaN, a NaN shall be returned.
- rintl.09
If x is ?0 or ?Inf, x shall be returned.
- rintl.10
[XSI] If the correct value would cause overflow, a range error shall occur and rint(), rintf(), and rintl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- rintl.11
These functions shall fail if:
- rintl.11.01
Range Error [XSI] The result would cause an overflow.
- rintl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- rintl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]round (9 / 4 / 0)
- round.01
These functions shall round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.
Generalizes:
- round.02
- round.03
- round.04
- round.05
- round.06
- round.07
- round.08.01.01
- round.08.01.02
- round.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- round.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- round.04
Upon successful completion, these functions shall return the rounded integer value.
- round.05
[MX] If x is NaN, a NaN shall be returned.
- round.06
If x is ?0 or ?Inf, x shall be returned.
- round.07
[XSI] If the correct value would cause overflow, a range error shall occur and round(), roundf(), and roundl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- round.08
These functions may fail if:
- round.08.01
Range Error [XSI] The result overflows.
- round.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- round.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]roundf (9 / 4 / 0)
- roundf.01
These functions shall round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.
Generalizes:
- roundf.02
- roundf.03
- roundf.04
- roundf.05
- roundf.06
- roundf.07
- roundf.08.01.01
- roundf.08.01.02
- roundf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- roundf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- roundf.04
Upon successful completion, these functions shall return the rounded integer value.
- roundf.05
[MX] If x is NaN, a NaN shall be returned.
- roundf.06
If x is ?0 or ?Inf, x shall be returned.
- roundf.07
[XSI] If the correct value would cause overflow, a range error shall occur and round(), roundf(), and roundl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- roundf.08
These functions may fail if:
- roundf.08.01
Range Error [XSI] The result overflows.
- roundf.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- roundf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]roundl (9 / 4 / 0)
- roundl.01
These functions shall round their argument to the nearest integer value in floating-point format, rounding halfway cases away from zero, regardless of the current rounding direction.
Generalizes:
- roundl.02
- roundl.03
- roundl.04
- roundl.05
- roundl.06
- roundl.07
- roundl.08.01.01
- roundl.08.01.02
- roundl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- roundl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- roundl.04
Upon successful completion, these functions shall return the rounded integer value.
- roundl.05
[MX] If x is NaN, a NaN shall be returned.
- roundl.06
If x is ?0 or ?Inf, x shall be returned.
- roundl.07
[XSI] If the correct value would cause overflow, a range error shall occur and round(), roundf(), and roundl() shall return the value of the macro ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x), respectively.
- roundl.08
These functions may fail if:
- roundl.08.01
Range Error [XSI] The result overflows.
- roundl.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- roundl.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- [+]trunc (4 / 3 / 0)
- trunc.01
These functions shall round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.
- trunc.02
Upon successful completion, these functions shall return the truncated integer value.
- trunc.03
[MX] If x is NaN, a NaN shall be returned.
- trunc.04
If x is ?0 or ?Inf, x shall be returned.
Generalizes:
- trunc.01
- trunc.02
- trunc.03
- [+]truncf (4 / 3 / 0)
- truncf.01
These functions shall round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.
- truncf.02
Upon successful completion, these functions shall return the truncated integer value.
- truncf.03
[MX] If x is NaN, a NaN shall be returned.
- truncf.04
If x is ?0 or ?Inf, x shall be returned.
Generalizes:
- truncf.01
- truncf.02
- truncf.03
- [+]truncl (4 / 3 / 0)
- truncl.01
These functions shall round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.
- truncl.02
Upon successful completion, these functions shall return the truncated integer value.
- truncl.03
[MX] If x is NaN, a NaN shall be returned.
- truncl.04
If x is ?0 or ?Inf, x shall be returned.
Generalizes:
- truncl.01
- truncl.02
- truncl.03
- [+]math.trig (282 / 156 / 0)
- [+]acos (10 / 5 / 0)
- acos.01
These functions shall compute the principal value of the arc cosine of their argument x.
Generalizes:
- acos.02
- acos.03
- acos.04
- acos.05
- acos.06
- acos.07
- acos.08
- acos.09.01.01
- acos.09.01.02
- acos.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acos.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acos.04
Upon successful completion, these functions shall return the arc cosine of x, in the range [0,] radians.
- acos.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acos.06
[MX] If x is NaN, a NaN shall be returned.
- acos.07
If x is +1, +0 shall be returned.
- acos.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acos.09
These functions shall fail if:
- acos.09.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- acos.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acos.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]acosf (10 / 5 / 0)
- acosf.01
These functions shall compute the principal value of the arc cosine of their argument x.
Generalizes:
- acosf.02
- acosf.03
- acosf.04
- acosf.05
- acosf.06
- acosf.07
- acosf.08
- acosf.09.01.01
- acosf.09.01.02
- acosf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acosf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acosf.04
Upon successful completion, these functions shall return the arc cosine of x, in the range [0,] radians.
- acosf.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acosf.06
[MX] If x is NaN, a NaN shall be returned.
- acosf.07
If x is +1, +0 shall be returned.
- acosf.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acosf.09
These functions shall fail if:
- acosf.09.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- acosf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acosf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]acosl (10 / 5 / 0)
- acosl.01
These functions shall compute the principal value of the arc cosine of their argument x.
Generalizes:
- acosl.02
- acosl.03
- acosl.04
- acosl.05
- acosl.06
- acosl.07
- acosl.08
- acosl.09.01.01
- acosl.09.01.02
- acosl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- acosl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- acosl.04
Upon successful completion, these functions shall return the arc cosine of x, in the range [0,] radians.
- acosl.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- acosl.06
[MX] If x is NaN, a NaN shall be returned.
- acosl.07
If x is +1, +0 shall be returned.
- acosl.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- acosl.09
These functions shall fail if:
- acosl.09.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- acosl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- acosl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]asin (13 / 7 / 0)
- asin.01
These functions shall compute the principal value of the arc sine of their argument x.
Generalizes:
- asin.02
- asin.03
- asin.04
- asin.05
- asin.06
- asin.07
- asin.08
- asin.09
- asin.10.01.01
- asin.10.01.02
- asin.11.01.01
- asin.11.01.02
- asin.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asin.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asin.04
Upon successful completion, these functions shall return the arc sine of x, in the range [-/2,/2] radians.
- asin.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- asin.06
[MX] If x is NaN, a NaN shall be returned.
- asin.07
If x is ?0, x shall be returned.
- asin.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- asin.09
If x is subnormal, a range error may occur and x should be returned.
- asin.10
These functions shall fail if:
- asin.10.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- asin.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- asin.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- asin.11
These functions may fail if:
- asin.11.01
Range Error [MX] The value of x is subnormal.
- asin.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asin.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]asinf (13 / 7 / 0)
- asinf.01
These functions shall compute the principal value of the arc sine of their argument x.
Generalizes:
- asinf.02
- asinf.03
- asinf.04
- asinf.05
- asinf.06
- asinf.07
- asinf.08
- asinf.09
- asinf.10.01.01
- asinf.10.01.02
- asinf.11.01.01
- asinf.11.01.02
- asinf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asinf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asinf.04
Upon successful completion, these functions shall return the arc sine of x, in the range [-/2,/2] radians.
- asinf.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- asinf.06
[MX] If x is NaN, a NaN shall be returned.
- asinf.07
If x is ?0, x shall be returned.
- asinf.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- asinf.09
If x is subnormal, a range error may occur and x should be returned.
- asinf.10
These functions shall fail if:
- asinf.10.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- asinf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- asinf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- asinf.11
These functions may fail if:
- asinf.11.01
Range Error [MX] The value of x is subnormal.
- asinf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asinf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]asinl (13 / 7 / 0)
- asinl.01
These functions shall compute the principal value of the arc sine of their argument x.
Generalizes:
- asinl.02
- asinl.03
- asinl.04
- asinl.05
- asinl.06
- asinl.07
- asinl.08
- asinl.09
- asinl.10.01.01
- asinl.10.01.02
- asinl.11.01.01
- asinl.11.01.02
- asinl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- asinl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- asinl.04
Upon successful completion, these functions shall return the arc sine of x, in the range [-/2,/2] radians.
- asinl.05
For finite values of x not in the range [-1,1], a domain error shall occur, and [MX] either a NaN (if supported), or an implementation-defined value shall be returned.
- asinl.06
[MX] If x is NaN, a NaN shall be returned.
- asinl.07
If x is ?0, x shall be returned.
- asinl.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- asinl.09
If x is subnormal, a range error may occur and x should be returned.
- asinl.10
These functions shall fail if:
- asinl.10.01
Domain Error The x argument is finite and is not in the range [-1,1], [MX] or is ?Inf.
- asinl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- asinl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- asinl.11
These functions may fail if:
- asinl.11.01
Range Error [MX] The value of x is subnormal.
- asinl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- asinl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atan (10 / 5 / 0)
- atan.01
These functions shall compute the principal value of the arc tangent of their argument x.
Generalizes:
- atan.02
- atan.03
- atan.04
- atan.05
- atan.06
- atan.07
- atan.08
- atan.09.01.01
- atan.09.01.02
- atan.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atan.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atan.04
Upon successful completion, these functions shall return the arc tangent of x in the range [-/2,/2] radians.
- atan.05
[MX] If x is NaN, a NaN shall be returned.
- atan.06
If x is ?0, x shall be returned.
- atan.07
If x is ?Inf, ?/2 shall be returned.
- atan.08
If x is subnormal, a range error may occur and x should be returned.
- atan.09
These functions may fail if:
- atan.09.01
Range Error [MX] The value of x is subnormal.
- atan.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atan.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atan2 (21 / 16 / 0)
- atan2.01
These functions shall compute the principal value of the arc tangent of y/ x, using the signs of both arguments to determine the quadrant of the return value.
Generalizes:
- atan2.02
- atan2.03
- atan2.04
- atan2.05
- atan2.06
- atan2.07
- atan2.08
- atan2.09
- atan2.10
- atan2.11
- atan2.12
- atan2.13
- atan2.14
- atan2.15
- atan2.16
- atan2.17
- atan2.18
- atan2.19
- atan2.20.01.01
- atan2.20.01.02
- atan2.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atan2.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atan2.04
Upon successful completion, these functions shall return the arc tangent of y/ x in the range [-,] radians.
- atan2.05
If y is ?0 and x is < 0, ? shall be returned.
- atan2.06
If y is ?0 and x is > 0, ?0 shall be returned.
- atan2.07
If y is < 0 and x is ?0, -/2 shall be returned.
- atan2.08
If y is > 0 and x is ?0, /2 shall be returned.
- atan2.09
If x is 0, a pole error shall not occur.
- atan2.10
[MX] If either x or y is NaN, a NaN shall be returned.
- atan2.11
If the result underflows, a range error may occur and y/ x should be returned.
- atan2.12
If y is ?0 and x is -0, ? shall be returned.
- atan2.13
If y is ?0 and x is +0, ?0 shall be returned.
- atan2.14
For finite values of ? y > 0, if x is -Inf, ? shall be returned.
- atan2.15
For finite values of ? y > 0, if x is +Inf, ?0 shall be returned.
- atan2.16
For finite values of x, if y is ?Inf, ?/2 shall be returned.
- atan2.17
If y is ?Inf and x is -Inf, ?3/4 shall be returned.
- atan2.18
If y is ?Inf and x is +Inf, ?/4 shall be returned.
- atan2.19
If both arguments are 0, a domain error shall not occur.
- atan2.20
These functions may fail if:
- atan2.20.01
Range Error [MX] The result underflows.
- atan2.20.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atan2.20.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atan2f (21 / 16 / 0)
- atan2f.01
These functions shall compute the principal value of the arc tangent of y/ x, using the signs of both arguments to determine the quadrant of the return value.
Generalizes:
- atan2f.02
- atan2f.03
- atan2f.04
- atan2f.05
- atan2f.06
- atan2f.07
- atan2f.08
- atan2f.09
- atan2f.10
- atan2f.11
- atan2f.12
- atan2f.13
- atan2f.14
- atan2f.15
- atan2f.16
- atan2f.17
- atan2f.18
- atan2f.19
- atan2f.20.01.01
- atan2f.20.01.02
- atan2f.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atan2f.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atan2f.04
Upon successful completion, these functions shall return the arc tangent of y/ x in the range [-,] radians.
- atan2f.05
If y is ?0 and x is < 0, ? shall be returned.
- atan2f.06
If y is ?0 and x is > 0, ?0 shall be returned.
- atan2f.07
If y is < 0 and x is ?0, -/2 shall be returned.
- atan2f.08
If y is > 0 and x is ?0, /2 shall be returned.
- atan2f.09
If x is 0, a pole error shall not occur.
- atan2f.10
[MX] If either x or y is NaN, a NaN shall be returned.
- atan2f.11
If the result underflows, a range error may occur and y/ x should be returned.
- atan2f.12
If y is ?0 and x is -0, ? shall be returned.
- atan2f.13
If y is ?0 and x is +0, ?0 shall be returned.
- atan2f.14
For finite values of ? y > 0, if x is -Inf, ? shall be returned.
- atan2f.15
For finite values of ? y > 0, if x is +Inf, ?0 shall be returned.
- atan2f.16
For finite values of x, if y is ?Inf, ?/2 shall be returned.
- atan2f.17
If y is ?Inf and x is -Inf, ?3/4 shall be returned.
- atan2f.18
If y is ?Inf and x is +Inf, ?/4 shall be returned.
- atan2f.19
If both arguments are 0, a domain error shall not occur.
- atan2f.20
These functions may fail if:
- atan2f.20.01
Range Error [MX] The result underflows.
- atan2f.20.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atan2f.20.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atan2l (21 / 16 / 0)
- atan2l.01
These functions shall compute the principal value of the arc tangent of y/ x, using the signs of both arguments to determine the quadrant of the return value.
Generalizes:
- atan2l.02
- atan2l.03
- atan2l.04
- atan2l.05
- atan2l.06
- atan2l.07
- atan2l.08
- atan2l.09
- atan2l.10
- atan2l.11
- atan2l.12
- atan2l.13
- atan2l.14
- atan2l.15
- atan2l.16
- atan2l.17
- atan2l.18
- atan2l.19
- atan2l.20.01.01
- atan2l.20.01.02
- atan2l.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atan2l.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atan2l.04
Upon successful completion, these functions shall return the arc tangent of y/ x in the range [-,] radians.
- atan2l.05
If y is ?0 and x is < 0, ? shall be returned.
- atan2l.06
If y is ?0 and x is > 0, ?0 shall be returned.
- atan2l.07
If y is < 0 and x is ?0, -/2 shall be returned.
- atan2l.08
If y is > 0 and x is ?0, /2 shall be returned.
- atan2l.09
If x is 0, a pole error shall not occur.
- atan2l.10
[MX] If either x or y is NaN, a NaN shall be returned.
- atan2l.11
If the result underflows, a range error may occur and y/ x should be returned.
- atan2l.12
If y is ?0 and x is -0, ? shall be returned.
- atan2l.13
If y is ?0 and x is +0, ?0 shall be returned.
- atan2l.14
For finite values of ? y > 0, if x is -Inf, ? shall be returned.
- atan2l.15
For finite values of ? y > 0, if x is +Inf, ?0 shall be returned.
- atan2l.16
For finite values of x, if y is ?Inf, ?/2 shall be returned.
- atan2l.17
If y is ?Inf and x is -Inf, ?3/4 shall be returned.
- atan2l.18
If y is ?Inf and x is +Inf, ?/4 shall be returned.
- atan2l.19
If both arguments are 0, a domain error shall not occur.
- atan2l.20
These functions may fail if:
- atan2l.20.01
Range Error [MX] The result underflows.
- atan2l.20.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atan2l.20.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atanf (10 / 5 / 0)
- atanf.01
These functions shall compute the principal value of the arc tangent of their argument x.
Generalizes:
- atanf.02
- atanf.03
- atanf.04
- atanf.05
- atanf.06
- atanf.07
- atanf.08
- atanf.09.01.01
- atanf.09.01.02
- atanf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atanf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atanf.04
Upon successful completion, these functions shall return the arc tangent of x in the range [-/2,/2] radians.
- atanf.05
[MX] If x is NaN, a NaN shall be returned.
- atanf.06
If x is ?0, x shall be returned.
- atanf.07
If x is ?Inf, ?/2 shall be returned.
- atanf.08
If x is subnormal, a range error may occur and x should be returned.
- atanf.09
These functions may fail if:
- atanf.09.01
Range Error [MX] The value of x is subnormal.
- atanf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]atanl (10 / 5 / 0)
- atanl.01
These functions shall compute the principal value of the arc tangent of their argument x.
Generalizes:
- atanl.02
- atanl.03
- atanl.04
- atanl.05
- atanl.06
- atanl.07
- atanl.08
- atanl.09.01.01
- atanl.09.01.02
- atanl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- atanl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- atanl.04
Upon successful completion, these functions shall return the arc tangent of x in the range [-/2,/2] radians.
- atanl.05
[MX] If x is NaN, a NaN shall be returned.
- atanl.06
If x is ?0, x shall be returned.
- atanl.07
If x is ?Inf, ?/2 shall be returned.
- atanl.08
If x is subnormal, a range error may occur and x should be returned.
- atanl.09
These functions may fail if:
- atanl.09.01
Range Error [MX] The value of x is subnormal.
- atanl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- atanl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]cos (9 / 5 / 0)
- cos.01
These functions shall compute the cosine of their argument x, measured in radians.
Generalizes:
- cos.02
- cos.03
- cos.04
- cos.05
- cos.06
- cos.07
- cos.08.01.01
- cos.08.01.02
- cos.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- cos.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- cos.04
Upon successful completion, these functions shall return the cosine of x.
- cos.05
If x is NaN, a NaN shall be returned.
- cos.06
If x is ?0, the value 1.0 shall be returned.
- cos.07
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- cos.08
These functions shall fail if:
- cos.08.01
Domain Error [MX] The x argument is ?Inf.
- cos.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- cos.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]cosf (9 / 5 / 0)
- cosf.01
These functions shall compute the cosine of their argument x, measured in radians.
Generalizes:
- cosf.02
- cosf.03
- cosf.04
- cosf.05
- cosf.06
- cosf.07
- cosf.08.01.01
- cosf.08.01.02
- cosf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- cosf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- cosf.04
Upon successful completion, these functions shall return the cosine of x.
- cosf.05
If x is NaN, a NaN shall be returned.
- cosf.06
If x is ?0, the value 1.0 shall be returned.
- cosf.07
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- cosf.08
These functions shall fail if:
- cosf.08.01
Domain Error [MX] The x argument is ?Inf.
- cosf.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- cosf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]cosl (9 / 5 / 0)
- cosl.01
These functions shall compute the cosine of their argument x, measured in radians.
Generalizes:
- cosl.02
- cosl.03
- cosl.04
- cosl.05
- cosl.06
- cosl.07
- cosl.08.01.01
- cosl.08.01.02
- cosl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- cosl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- cosl.04
Upon successful completion, these functions shall return the cosine of x.
- cosl.05
If x is NaN, a NaN shall be returned.
- cosl.06
If x is ?0, the value 1.0 shall be returned.
- cosl.07
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- cosl.08
These functions shall fail if:
- cosl.08.01
Domain Error [MX] The x argument is ?Inf.
- cosl.08.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- cosl.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]sin (12 / 6 / 0)
- sin.01
These functions shall compute the sine of their argument x, measured in radians.
Generalizes:
- sin.02
- sin.03
- sin.04
- sin.05
- sin.06
- sin.07
- sin.08
- sin.09.01.01
- sin.09.01.02
- sin.10.01.01
- sin.10.01.02
- sin.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sin.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sin.04
Upon successful completion, these functions shall return the sine of x.
- sin.05
[MX] If x is NaN, a NaN shall be returned.
- sin.06
If x is ?0, x shall be returned.
- sin.07
If x is subnormal, a range error may occur and x should be returned.
- sin.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sin.09
These functions shall fail if:
- sin.09.01
Domain Error [MX] The x argument is ?Inf.
- sin.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sin.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- sin.10
These functions may fail if:
- sin.10.01
Range Error [MX] The value of x is subnormal
- sin.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sin.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]sincos (2 / 2 / 0)
- sincos.01
This functions compute both sine and cosine at the same time, and store the results via the given pointers.
- sincos.02
This functions shall return sine and cosine of x.
- [+]sincosf (2 / 2 / 0)
- sincosf.01
This functions compute both sine and cosine at the same time, and store the results via the given pointers.
- sincosf.02
This functions shall return sine and cosine of x.
- [+]sincosl (2 / 2 / 0)
- sincosl.01
This functions compute both sine and cosine at the same time, and store the results via the given pointers.
- sincosl.02
This functions shall return sine and cosine of x.
- [+]sinf (12 / 6 / 0)
- sinf.01
These functions shall compute the sine of their argument x, measured in radians.
Generalizes:
- sinf.02
- sinf.03
- sinf.04
- sinf.05
- sinf.06
- sinf.07
- sinf.08
- sinf.09.01.01
- sinf.09.01.02
- sinf.10.01.01
- sinf.10.01.02
- sinf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sinf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sinf.04
Upon successful completion, these functions shall return the sine of x.
- sinf.05
[MX] If x is NaN, a NaN shall be returned.
- sinf.06
If x is ?0, x shall be returned.
- sinf.07
If x is subnormal, a range error may occur and x should be returned.
- sinf.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sinf.09
These functions shall fail if:
- sinf.09.01
Domain Error [MX] The x argument is ?Inf.
- sinf.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sinf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- sinf.10
These functions may fail if:
- sinf.10.01
Range Error [MX] The value of x is subnormal
- sinf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]sinl (12 / 6 / 0)
- sinl.01
These functions shall compute the sine of their argument x, measured in radians.
Generalizes:
- sinl.02
- sinl.03
- sinl.04
- sinl.05
- sinl.06
- sinl.07
- sinl.08
- sinl.09.01.01
- sinl.09.01.02
- sinl.10.01.01
- sinl.10.01.02
- sinl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- sinl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- sinl.04
Upon successful completion, these functions shall return the sine of x.
- sinl.05
[MX] If x is NaN, a NaN shall be returned.
- sinl.06
If x is ?0, x shall be returned.
- sinl.07
If x is subnormal, a range error may occur and x should be returned.
- sinl.08
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- sinl.09
These functions shall fail if:
- sinl.09.01
Domain Error [MX] The x argument is ?Inf.
- sinl.09.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- sinl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- sinl.10
These functions may fail if:
- sinl.10.01
Range Error [MX] The value of x is subnormal
- sinl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- sinl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tan (17 / 6 / 0)
- tan.01
These functions shall compute the tangent of their argument x, measured in radians.
Generalizes:
- tan.02
- tan.03
- tan.04
- tan.05
- tan.06
- tan.07
- tan.08
- tan.09
- tan.10
- tan.11
- tan.12.01.01
- tan.12.01.02
- tan.12.02.01
- tan.12.02.02
- tan.13.01.01
- tan.13.01.02
- tan.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tan.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tan.04
Upon successful completion, these functions shall return the tangent of x.
- tan.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- tan.06
[MX] If x is NaN, a NaN shall be returned.
- tan.07
If x is ?0, x shall be returned.
- tan.08
If x is subnormal, a range error may occur and x should be returned.
- tan.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tan.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- tan.11
[XSI] If the correct value would cause overflow, a range error shall occur and tan(), tanf(), and tanl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tan.12
These functions shall fail if:
- tan.12.01
Domain Error [MX] The value of x is ?Inf.
- tan.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tan.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tan.12.02
Range Error [XSI] The result overflows
- tan.12.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tan.12.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- tan.13
These functions may fail if:
- tan.13.01
Range Error The result underflows, [MX] or the value of x is subnormal.
- tan.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tan.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tanf (17 / 6 / 0)
- tanf.01
These functions shall compute the tangent of their argument x, measured in radians.
Generalizes:
- tanf.02
- tanf.03
- tanf.04
- tanf.05
- tanf.06
- tanf.07
- tanf.08
- tanf.09
- tanf.10
- tanf.11
- tanf.12.01.01
- tanf.12.01.02
- tanf.12.02.01
- tanf.12.02.02
- tanf.13.01.01
- tanf.13.01.02
- tanf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tanf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tanf.04
Upon successful completion, these functions shall return the tangent of x.
- tanf.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- tanf.06
[MX] If x is NaN, a NaN shall be returned.
- tanf.07
If x is ?0, x shall be returned.
- tanf.08
If x is subnormal, a range error may occur and x should be returned.
- tanf.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tanf.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- tanf.11
[XSI] If the correct value would cause overflow, a range error shall occur and tan(), tanf(), and tanl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tanf.12
These functions shall fail if:
- tanf.12.01
Domain Error [MX] The value of x is ?Inf.
- tanf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tanf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tanf.12.02
Range Error [XSI] The result overflows
- tanf.12.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanf.12.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- tanf.13
These functions may fail if:
- tanf.13.01
Range Error The result underflows, [MX] or the value of x is subnormal.
- tanf.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanf.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]tanl (17 / 6 / 0)
- tanl.01
These functions shall compute the tangent of their argument x, measured in radians.
Generalizes:
- tanl.02
- tanl.03
- tanl.04
- tanl.05
- tanl.06
- tanl.07
- tanl.08
- tanl.09
- tanl.10
- tanl.11
- tanl.12.01.01
- tanl.12.01.02
- tanl.12.02.01
- tanl.12.02.02
- tanl.13.01.01
- tanl.13.01.02
- tanl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- tanl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- tanl.04
Upon successful completion, these functions shall return the tangent of x.
- tanl.05
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- tanl.06
[MX] If x is NaN, a NaN shall be returned.
- tanl.07
If x is ?0, x shall be returned.
- tanl.08
If x is subnormal, a range error may occur and x should be returned.
- tanl.09
If x is ?Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- tanl.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- tanl.11
[XSI] If the correct value would cause overflow, a range error shall occur and tan(), tanf(), and tanl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL, respectively, with the same sign as the correct value of the function.
- tanl.12
These functions shall fail if:
- tanl.12.01
Domain Error [MX] The value of x is ?Inf.
- tanl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- tanl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- tanl.12.02
Range Error [XSI] The result overflows
- tanl.12.02.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanl.12.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- tanl.13
These functions may fail if:
- tanl.13.01
Range Error The result underflows, [MX] or the value of x is subnormal.
- tanl.13.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- tanl.13.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]memory.break (16 / 8 / 0)
- [+]brk (8 / 4 / 0)
- brk.01
The brk() and sbrk() functions are used to change the amount of space allocated for the calling process.
Generalizes:
- brk.02
- brk.03
- brk.06
- brk.07
- brk.08.01
- brk.09.02
- brk.02
The newly-allocated space is set to 0. However, if the application first decrements and then increments the break value, the contents of the reallocated space are unspecified.
- brk.03
The brk() function sets the break value to addr and changes the allocated space accordingly.
- app.brk.04
The behaviour of brk() and sbrk() is unspecified if an application also uses any other memory functions (such as malloc(), mmap(), free()). Other functions may use these other memory functions silently.
- app.brk.05
These interfaces need not be reentrant.
- brk.06
Upon successful completion, brk() returns 0.
- brk.07
Otherwise, it returns -1 and sets errno to indicate the error.
- brk.08
The brk() and sbrk() functions will fail if:
- brk.08.01
[ENOMEM]The requested change would allocate more space than allowed.
- brk.09
The brk() and sbrk() functions may fail if:
- brk.09.01
[EAGAIN]The total amount of system memory available for allocation to this process is temporarily insufficient. This may occur even though the space requested was less than the maximum data segment size.
- brk.09.02
[ENOMEM]The requested change would be impossible as there is insufficient swap space available, or would cause a memory allocation conflict.
- [+]sbrk (8 / 4 / 0)
- sbrk.01
The brk() and sbrk() functions are used to change the amount of space allocated for the calling process.
Generalizes:
- sbrk.02
- sbrk.03
- sbrk.07
- sbrk.08
- sbrk.09.01
- sbrk.10.01
- sbrk.10.02
- sbrk.02
The newly-allocated space is set to 0. However, if the application first decrements and then increments the break value, the contents of the reallocated space are unspecified.
- sbrk.03
The sbrk() function adds incr bytes to the break value and changes the allocated space accordingly. If incr is negative, the amount of allocated space is decreased by incr bytes.
- app.sbrk.04
The behaviour of brk() and sbrk() is unspecified if an application also uses any other memory functions (such as malloc(), mmap(), free()). Other functions may use these other memory functions silently.
- app.sbrk.05 (struct)
It is unspecified whether the pointer returned by sbrk() is aligned suitably for any purpose.
- app.sbrk.06
These interfaces need not be reentrant.
- sbrk.07
Upon successful completion, sbrk() returns the prior break value.
- sbrk.08
Otherwise, it returns (void *)-1 and sets errno to indicate the error.
- sbrk.09
The brk() and sbrk() functions will fail if:
- sbrk.09.01
[ENOMEM]The requested change would allocate more space than allowed.
- sbrk.10
The brk() and sbrk() functions may fail if:
- sbrk.10.01
[EAGAIN]The total amount of system memory available for allocation to this process is temporarily insufficient. This may occur even though the space requested was less than the maximum data segment size.
- sbrk.10.02
[ENOMEM]The requested change would be impossible as there is insufficient swap space available, or would cause a memory allocation conflict.
- [+]memory.heap (36 / 27 / 0)
- [+]calloc (8 / 6 / 0)
- calloc.01
The calloc() function shall allocate unused space for an array of nelem elements each of whose size in bytes is elsize.
Generalizes:
- calloc.02
- calloc.03
- calloc.04
- calloc.05
- calloc.06.01
- calloc.07.01
- calloc.08
- calloc.09.01
- calloc.02
The space shall be initialized to all bits 0.
- calloc.03
The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly freed or reallocated).
- calloc.04
Each such allocation shall yield a pointer to an object disjoint from any other object.
- calloc.05 (struct)
The pointer returned shall point to the start (lowest byte address) of the allocated space.
- calloc.06
If the space cannot be allocated, a null pointer shall be returned.
- calloc.06.01
Otherwise, it shall return a null pointer [CX] and set errno to indicate the error.
- calloc.07
If the size of the space requested is 0, the behavior is implementation-defined: the value returned shall be either a null pointer or a unique pointer.
- calloc.07.01
If either nelem or elsize is 0, then either a null pointer or a unique pointer value that can be successfully passed to free() shall be returned.
- calloc.08
with both nelem and elsize non-zero, calloc() shall return a pointer to the allocated space
- calloc.09
The calloc() function shall fail if:
- calloc.09.01
[ENOMEM] [CX] Insufficient memory is available.
- [+]free (2 / 2 / 0)
- free.01
The free() function shall cause the space pointed to by ptr to be deallocated; that is, made available for further allocation.
- free.02
If ptr is a null pointer, no action shall occur.
- app.free.03
Otherwise, if the argument does not match a pointer earlier returned by the calloc(), malloc(), [ADV] posix_memalign(), realloc(), or [XSI] strdup() function, or if the space has been deallocated by a call to free() or realloc(), the behavior is undefined.
- free.04 (struct)
The free() function shall not return a value.
- [+]malloc (7 / 5 / 0)
- malloc.01
The malloc() function shall allocate unused space for an object whose size in bytes is specified by size and whose value is unspecified.
Generalizes:
- malloc.02
- malloc.03
- malloc.04
- malloc.05.01
- malloc.06.01
- malloc.07
- malloc.08.01
- malloc.02
The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated).
- malloc.03
Each such allocation shall yield a pointer to an object disjoint from any other object.
- malloc.04 (struct)
The pointer returned points to the start (lowest byte address) of the allocated space.
- malloc.05
If the space cannot be allocated, a null pointer shall be returned.
- malloc.05.01
Otherwise, it shall return a null pointer [CX] and set errno to indicate the error.
- malloc.06
If the size of the space requested is 0, the behavior is implementation-defined: the value returned shall be either a null pointer or a unique pointer.
- malloc.06.01
If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned.
- malloc.07
Upon successful completion with size not equal to 0, malloc() shall return a pointer to the allocated space.
- malloc.08
The malloc() function shall fail if:
- malloc.08.01
[ENOMEM] [CX] Insufficient storage space is available.
- [+]posix_memalign (7 / 5 / 0)
- posix_memalign.01
The posix_memalign() function shall allocate size bytes aligned on a boundary specified by alignment, and shall return a pointer to the allocated memory in memptr.
Generalizes:
- posix_memalign.02
- posix_memalign.03
- posix_memalign.04
- posix_memalign.05
- posix_memalign.06.01
- posix_memalign.06.02
- posix_memalign.02
The value of alignment shall be a multiple of sizeof( void *), that is also a power of two.
- posix_memalign.03
Upon successful completion, the value pointed to by memptr shall be a multiple of alignment.
- posix_memalign.04
Upon successful completion, posix_memalign() shall return zero;
- posix_memalign.05
otherwise, an error number shall be returned to indicate the error.
- posix_memalign.06
The posix_memalign() function shall fail if:
- posix_memalign.06.01
[EINVAL] The value of the alignment parameter is not a power of two multiple of sizeof( void *).
- posix_memalign.06.02
[ENOMEM] There is insufficient memory available with the requested alignment.
- [+]realloc (12 / 9 / 0)
- realloc.01
The realloc() function shall change the size of the memory object pointed to by ptr to the size specified by size.
Generalizes:
- realloc.02
- realloc.03
- realloc.04
- realloc.05
- realloc.06
- realloc.07
- realloc.08
- realloc.09
- realloc.10
- realloc.11.01
- realloc.12
- realloc.13
- realloc.14.01
- realloc.02
The contents of the object shall remain unchanged up to the lesser of the new and old sizes.
- realloc.03
If the new size of the memory object would require movement of the object, the space for the previous instantiation of the object is freed.
- realloc.04 (struct)
If the new size is larger, the contents of the newly allocated portion of the object are unspecified.
- realloc.05
If size is 0 and ptr is not a null pointer, the object pointed to is freed.
- realloc.06
If the space cannot be allocated, the object shall remain unchanged.
- realloc.07
If ptr is a null pointer, realloc() shall be equivalent to malloc() for the specified size.
- realloc.08
The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated).
- app.realloc.08
If ptr does not match a pointer returned earlier by calloc(), malloc(), or realloc() or if the space has previously been deallocated by a call to free() or realloc(), the behavior is undefined.
- realloc.09
Each such allocation shall yield a pointer to an object disjoint from any other object.
- realloc.10 (struct)
The pointer returned shall point to the start (lowest byte address) of the allocated space.
- realloc.11
If the space cannot be allocated, a null pointer shall be returned.
- realloc.11.01
If there is not enough available memory, realloc() shall return a null pointer [CX] and set errno to [ENOMEM].
- realloc.12
with a size not equal to 0, realloc() shall return a pointer to the (possibly moved) allocated space.
- realloc.13
If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned.
- realloc.14
The realloc() function shall fail if:
- realloc.14.01
[ENOMEM] [CX] Insufficient memory is available.
- [+]memory.mman (279 / 42 / 0)
- [+]mlock (12 / 3 / 0)
- mlock.01
The mlock() function shall cause those whole pages containing any part of the address space of the process starting at address addr and continuing for len bytes to be memory-resident until unlocked or until the process exits or execs another process image.
- mlock.02
The implementation may require that addr be a multiple of {PAGESIZE}.
- mlock.03
Upon successful return from mlock(), pages in the specified range shall be locked and memory-resident.
- mlock.04
The appropriate privilege is required to lock process memory with mlock().
- mlock.05
Upon successful completion, the mlock() and munlock() functions shall return a value of zero.
- mlock.06
Otherwise,
- mlock.06.01
no change is made to any locks in the address space of the process,
- mlock.06.02
and the function shall return a value of -1 and set errno to indicate the error.
- mlock.07
The mlock() and munlock() functions shall fail if:
- mlock.07.01
[ENOMEM] Some or all of the address range specified by the addr and len arguments does not correspond to valid mapped pages in the address space of the process.
- mlock.08
The mlock() function shall fail if:
- mlock.08.01
[EAGAIN] Some or all of the memory identified by the operation could not be locked when the call was made.
- mlock.09
The mlock() and munlock() functions may fail if:
- mlock.09.01
[EINVAL] The addr argument is not a multiple of {PAGESIZE}.
- mlock.10
The mlock() function may fail if:
- mlock.10.01
[ENOMEM] Locking the pages mapped by the specified range would exceed an implementation-defined limit on the amount of memory that the process may lock.
- mlock.10.02
[EPERM] The calling process does not have the appropriate privilege to perform the requested operation.
- [+]mlockall (15 / 3 / 0)
- mlockall.01
The mlockall() function shall cause all of the pages mapped by the address space of a process to be memory-resident until unlocked or until the process exits or execs another process image.
- mlockall.02
The flags argument determines whether the pages to be locked are those currently mapped by the address space of the process, those that are mapped in the future, or both.
- mlockall.03
The flags argument is constructed from the bitwise-inclusive OR of one or more of the following symbolic constants, defined in <sys/mman.h>:
- mlockall.03.01
MCL_CURRENT Lock all of the pages currently mapped into the address space of the process.
- mlockall.03.02
MCL_FUTURE Lock all of the pages that become mapped into the address space of the process in the future, when those mappings are established.
- mlockall.04
If MCL_FUTURE is specified, and the automatic locking of future mappings eventually causes the amount of locked memory to exceed the amount of available physical memory or any other implementation-defined limit, the behavior is implementation-defined.
- mlockall.05
The manner in which the implementation informs the application of these situations is also implementation-defined.
- mlockall.06
Upon successful return from the mlockall() function that specifies MCL_CURRENT, all currently mapped pages of the process' address space shall be memory-resident and locked.
- mlockall.07
The appropriate privilege is required to lock process memory with mlockall().
- mlockall.08
Upon successful completion, the mlockall() function shall return a value of zero.
- mlockall.09
Otherwise,
- mlockall.09.01
no additional memory shall be locked,
- mlockall.09.02
and the function shall return a value of -1 and set errno to indicate the error.
- mlockall.10
The mlockall() function shall fail if:
- mlockall.10.01
[EAGAIN] Some or all of the memory identified by the operation could not be locked when the call was made.
- mlockall.10.02
[EINVAL] The flags argument is zero, or includes unimplemented flags.
- mlockall.11
The mlockall() function may fail if:
- mlockall.11.01
[ENOMEM] Locking all of the pages currently mapped into the address space of the process would exceed an implementation-defined limit on the amount of memory that the process may lock.
- mlockall.11.02
[EPERM] The calling process does not have the appropriate privilege to perform the requested operation.
- [+]mmap (73 / 18 / 0)
- mmap.01
The mmap() function shall establish a mapping between a process' address space and a file, shared memory object, or [TYM] typed memory object.
- mmap.02
The mmap() function shall establish a mapping between the address space of the process at an address pa for len bytes to the memory object represented by the file descriptor fildes at offset off for len bytes
- mmap.03
A successful mmap() call shall return pa as its result.
- mmap.04
The address range starting at pa and continuing for len bytes shall be legitimate for the possible (not necessarily current) address space of the process.
- mmap.05
The range of bytes starting at off and continuing for len bytes shall be legitimate for the possible (not necessarily current) offsets in the file, shared memory object, or [TYM] typed memory object represented by fildes.
- mmap.06
If fildes represents a typed memory object opened with either the POSIX_TYPED_MEM_ALLOCATE flag or the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, the memory object to be mapped shall be that portion of the typed memory object allocated by the implementation as specified below.
- mmap.06.01
In this case, if off is non-zero, the behavior of mmap() is undefined.
- mmap.06.02
If fildes refers to a valid typed memory object that is not accessible from the calling process, mmap() shall fail.
- mmap.07
The mapping established by mmap() shall replace any previous mappings for those whole pages containing any part of the address space of the process starting at pa and continuing for len bytes.
- mmap.08
If the size of the mapped file changes after the call to mmap() as a result of some other operation on the mapped file, the effect of references to portions of the mapped region that correspond to added or removed portions of the file is unspecified.
- mmap.09
The mmap() function shall be supported for regular files, shared memory objects, and [TYM] typed memory objects.
- mmap.10
If len is zero, mmap() shall fail and no mapping shall be established.
- mmap.11
The parameter prot determines whether read, write, execute, or some combination of accesses are permitted to the data being mapped.
- mmap.12
The prot shall be either PROT_NONE or the bitwise-inclusive OR of one or more of the other flags in the following table, defined in the <sys/mman.h> header.
- mmap.13
If an implementation cannot support the combination of access types specified by prot, the call to mmap() shall fail.
- mmap.14
An implementation may permit accesses other than those specified by prot; [MPR]
- mmap.15
however, if the Memory Protection option is supported, the implementation shall not permit a write to succeed where PROT_WRITE has not been set or shall not permit any access where PROT_NONE alone has been set.
- mmap.16
The implementation shall support at least the following values of prot: PROT_NONE, PROT_READ, PROT_WRITE, and the bitwise-inclusive OR of PROT_READ and PROT_WRITE.
- mmap.17
If the Memory Protection option is not supported, the result of any access that conflicts with the specified protection is undefined.
- mmap.18
The file descriptor fildes shall have been opened with read permission, regardless of the protection options specified.
- mmap.19
If PROT_WRITE is specified, the application shall ensure that it has opened the file descriptor fildes with write permission unless MAP_PRIVATE is specified in the flags parameter as described below.
- mmap.19.01
The value of flags is the bitwise-inclusive OR of these options, defined in <sys/mman.h>:
- mmap.20
Implementations that do not support the Memory Mapped Files option are not required to support MAP_PRIVATE.
- mmap.21
It is implementation-defined whether MAP_FIXED shall be supported. [XSI] MAP_FIXED shall be supported on XSI-conformant systems.
- mmap.22
MAP_SHARED and MAP_PRIVATE describe the disposition of write references to the memory object.
- mmap.22.01
If MAP_SHARED is specified, write references shall change the underlying object.
- mmap.22.02
If MAP_PRIVATE is specified, modifications to the mapped data by the calling process shall be visible only to the calling process and shall not change the underlying object.
- mmap.23
Either MAP_SHARED or MAP_PRIVATE can be specified, but not both.
- mmap.24
The mapping type is retained across fork().
- mmap.25
When fildes represents a typed memory object opened with either the POSIX_TYPED_MEM_ALLOCATE flag or the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, mmap() shall, if there are enough resources available, map len bytes allocated from the corresponding typed memory object which were not previously allocated to any process in any processor that may access that typed memory object.
- mmap.26
If there are not enough resources available, the function shall fail.
- mmap.27
If fildes represents a typed memory object opened with the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, these allocated bytes shall be contiguous within the typed memory object.
- mmap.28
If fildes represents a typed memory object opened with the POSIX_TYPED_MEM_ALLOCATE flag, these allocated bytes may be composed of non-contiguous fragments within the typed memory object.
- mmap.29
If fildes represents a typed memory object opened with neither the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag nor the POSIX_TYPED_MEM_ALLOCATE flag, len bytes starting at offset off within the typed memory object are mapped, exactly as when mapping a file or shared memory object. In this case, if two processes map an area of typed memory using the same off and len values and using file descriptors that refer to the same memory pool (either from the same port or from a different port), both processes shall map the same region of storage.
- mmap.30
When MAP_FIXED is set in the flags argument, the implementation is informed that the value of pa shall be addr, exactly.
- mmap.31
If MAP_FIXED is set, mmap() may return MAP_FAILED and set errno to [EINVAL].
- mmap.32
If a MAP_FIXED request is successful, the mapping established by mmap() replaces any previous mappings for the process' pages in the range [pa,pa+len).
- mmap.33
When MAP_FIXED is not set, the implementation uses addr in an implementation-defined manner to arrive at pa. The pa so chosen shall be an area of the address space that the implementation deems suitable for a mapping of len bytes to the file.
- mmap.34
All implementations interpret an addr value of 0 as granting the implementation complete freedom in selecting pa
- mmap.35
A non-zero value of addr is taken to be a suggestion of a process address near which the mapping should be placed.
- mmap.36
When the implementation selects a value for pa, it never places a mapping at address 0, nor does it replace any extant mapping.
- mmap.37.01
The off argument is constrained to be aligned and sized according to the value returned by sysconf() when passed _SC_PAGESIZE or _SC_PAGE_SIZE.
- mmap.37.02
When MAP_FIXED is specified, the application shall ensure that the argument addr also meets these constraints.
- mmap.38
The implementation performs mapping operations over whole pages.
- mmap.38.01
Thus, while the argument len need not meet a size or alignment constraint, the implementation shall include, in any mapping operation, any partial page specified by the range [pa,pa+len).
- mmap.39
The system shall always zero-fill any partial page at the end of an object.
- mmap.40
Further, the system shall never write out any modified portions of the last page of an object which are beyond its end.
- mmap.41
References within the address range starting at pa and continuing for len bytes to whole pages following the end of an object shall result in delivery of a SIGBUS signal.
- mmap.42
An implementation may generate SIGBUS signals when a reference would cause an error in the mapped object, such as out-of-space condition.
- mmap.43
The mmap() function shall add an extra reference to the file associated with the file descriptor fildes which is not removed by a subsequent close() on that file descriptor.
- mmap.44
This reference shall be removed when there are no more mappings to the file.
- mmap.45
The st_atime field of the mapped file may be marked for update at any time between the mmap() call and the corresponding munmap() call.
- mmap.46
The initial read or write reference to a mapped region shall cause the file's st_atime field to be marked for update if it has not already been marked for update.
- mmap.47
The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and PROT_WRITE shall be marked for update at some point in the interval between a write reference to the mapped region and the next call to msync() with MS_ASYNC or MS_SYNC for that portion of the file by any process
- mmap.48
If there is no such call and if the underlying file is modified as a result of a write reference, then these fields shall be marked for update at some time after the write reference.
- mmap.49
There may be implementation-defined limits on the number of memory regions that can be mapped (per process or per system).[XSI] If such a limit is imposed, whether the number of memory regions that can be mapped by a process is decreased by the use of shmat() is implementation-defined.
- mmap.50
If mmap() fails for reasons other than [EBADF], [EINVAL], or [ENOTSUP], some of the mappings in the address range starting at addr and continuing for len bytes may have been unmapped.
- mmap.51.01
Upon successful completion, the mmap() function shall return the address at which the mapping was placed ( pa)
- mmap.51.02
otherwise, it shall return a value of MAP_FAILED and set errno to indicate the error.
- mmap.52
No successful return from mmap() shall return the value MAP_FAILED.
- mmap.53
The mmap() function shall fail if:
- mmap.53.01
[EACCES] The fildes argument is not open for read, regardless of the protection specified, or fildes is not open for write and PROT_WRITE was specified for a MAP_SHARED type mapping.
- mmap.53.02
[EAGAIN] [ML] The mapping could not be locked in memory, if required by mlockall(), due to a lack of resources.
- mmap.53.03
[EBADF] The fildes argument is not a valid open file descriptor.
- mmap.53.04
[EINVAL] The value of len is zero.
- mmap.53.05
[EINVAL] The addr argument (if MAP_FIXED was specified) or off is not a multiple of the page size as returned by sysconf(), or is considered invalid by the implementation.
- mmap.53.06
[EINVAL] The value of flags is invalid (neither MAP_PRIVATE nor MAP_SHARED is set).
- mmap.53.07
[EMFILE] The number of mapped regions would exceed an implementation-defined limit (per process or per system).
- mmap.53.08
[ENODEV] The fildes argument refers to a file whose type is not supported by mmap().
- mmap.53.09
[ENOMEM] MAP_FIXED was specified, and the range [addr,addr+len) exceeds that allowed for the address space of a process; or, if MAP_FIXED was not specified and there is insufficient room in the address space to effect the mapping.
- mmap.53.10
[ENOMEM] [ML] The mapping could not be locked in memory, if required by mlockall(), because it would require more space than the system is able to supply.
- mmap.53.11
[ENOMEM] [TYM] Not enough unallocated memory resources remain in the typed memory object designated by fildes to allocate len bytes.
- mmap.53.12
[ENOTSUP]
- mmap.53.12.01
MAP_FIXED or MAP_PRIVATE was specified in the flags argument and the implementation does not support this functionality.
- mmap.53.12.02
The implementation does not support the combination of accesses requested in the prot argument.
- mmap.53.13
[ENXIO] Addresses in the range [off,off+len) are invalid for the object specified by fildes.
- mmap.53.14
[ENXIO] MAP_FIXED was specified in flags and the combination of addr, len, and off is invalid for the object specified by fildes.
- mmap.53.15
[ENXIO] [TYM] The fildes argument refers to a typed memory object that is not accessible from the calling process.
- mmap.53.16
[EOVERFLOW] The file is a regular file and the value of off plus len exceeds the offset maximum established in the open file description associated with fildes.
- [+]mmap64 (73 / 0 / 0)
- mmap64.mmap.01
The mmap() function shall establish a mapping between a process' address space and a file, shared memory object, or [TYM] typed memory object.
- mmap64.mmap.02
The mmap() function shall establish a mapping between the address space of the process at an address pa for len bytes to the memory object represented by the file descriptor fildes at offset off for len bytes
- mmap64.mmap.03
A successful mmap() call shall return pa as its result.
- mmap64.mmap.04
The address range starting at pa and continuing for len bytes shall be legitimate for the possible (not necessarily current) address space of the process.
- mmap64.mmap.05
The range of bytes starting at off and continuing for len bytes shall be legitimate for the possible (not necessarily current) offsets in the file, shared memory object, or [TYM] typed memory object represented by fildes.
- mmap64.mmap.06
If fildes represents a typed memory object opened with either the POSIX_TYPED_MEM_ALLOCATE flag or the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, the memory object to be mapped shall be that portion of the typed memory object allocated by the implementation as specified below.
- mmap64.mmap.06.01
In this case, if off is non-zero, the behavior of mmap() is undefined.
- mmap64.mmap.06.02
If fildes refers to a valid typed memory object that is not accessible from the calling process, mmap() shall fail.
- mmap64.mmap.07
The mapping established by mmap() shall replace any previous mappings for those whole pages containing any part of the address space of the process starting at pa and continuing for len bytes.
- mmap64.mmap.08
If the size of the mapped file changes after the call to mmap() as a result of some other operation on the mapped file, the effect of references to portions of the mapped region that correspond to added or removed portions of the file is unspecified.
- mmap64.mmap.09
The mmap() function shall be supported for regular files, shared memory objects, and [TYM] typed memory objects.
- mmap64.mmap.10
If len is zero, mmap() shall fail and no mapping shall be established.
- mmap64.mmap.11
The parameter prot determines whether read, write, execute, or some combination of accesses are permitted to the data being mapped.
- mmap64.mmap.12
The prot shall be either PROT_NONE or the bitwise-inclusive OR of one or more of the other flags in the following table, defined in the <sys/mman.h> header.
- mmap64.mmap.13
If an implementation cannot support the combination of access types specified by prot, the call to mmap() shall fail.
- mmap64.mmap.14
An implementation may permit accesses other than those specified by prot; [MPR]
- mmap64.mmap.15
however, if the Memory Protection option is supported, the implementation shall not permit a write to succeed where PROT_WRITE has not been set or shall not permit any access where PROT_NONE alone has been set.
- mmap64.mmap.16
The implementation shall support at least the following values of prot: PROT_NONE, PROT_READ, PROT_WRITE, and the bitwise-inclusive OR of PROT_READ and PROT_WRITE.
- mmap64.mmap.17
If the Memory Protection option is not supported, the result of any access that conflicts with the specified protection is undefined.
- mmap64.mmap.18
The file descriptor fildes shall have been opened with read permission, regardless of the protection options specified.
- mmap64.mmap.19
If PROT_WRITE is specified, the application shall ensure that it has opened the file descriptor fildes with write permission unless MAP_PRIVATE is specified in the flags parameter as described below.
- mmap64.mmap.19.01
The value of flags is the bitwise-inclusive OR of these options, defined in <sys/mman.h>:
- mmap64.mmap.20
Implementations that do not support the Memory Mapped Files option are not required to support MAP_PRIVATE.
- mmap64.mmap.21
It is implementation-defined whether MAP_FIXED shall be supported. [XSI] MAP_FIXED shall be supported on XSI-conformant systems.
- mmap64.mmap.22
MAP_SHARED and MAP_PRIVATE describe the disposition of write references to the memory object.
- mmap64.mmap.22.01
If MAP_SHARED is specified, write references shall change the underlying object.
- mmap64.mmap.22.02
If MAP_PRIVATE is specified, modifications to the mapped data by the calling process shall be visible only to the calling process and shall not change the underlying object.
- mmap64.mmap.23
Either MAP_SHARED or MAP_PRIVATE can be specified, but not both.
- mmap64.mmap.24
The mapping type is retained across fork().
- mmap64.mmap.25
When fildes represents a typed memory object opened with either the POSIX_TYPED_MEM_ALLOCATE flag or the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, mmap() shall, if there are enough resources available, map len bytes allocated from the corresponding typed memory object which were not previously allocated to any process in any processor that may access that typed memory object.
- mmap64.mmap.26
If there are not enough resources available, the function shall fail.
- mmap64.mmap.27
If fildes represents a typed memory object opened with the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, these allocated bytes shall be contiguous within the typed memory object.
- mmap64.mmap.28
If fildes represents a typed memory object opened with the POSIX_TYPED_MEM_ALLOCATE flag, these allocated bytes may be composed of non-contiguous fragments within the typed memory object.
- mmap64.mmap.29
If fildes represents a typed memory object opened with neither the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag nor the POSIX_TYPED_MEM_ALLOCATE flag, len bytes starting at offset off within the typed memory object are mapped, exactly as when mapping a file or shared memory object. In this case, if two processes map an area of typed memory using the same off and len values and using file descriptors that refer to the same memory pool (either from the same port or from a different port), both processes shall map the same region of storage.
- mmap64.mmap.30
When MAP_FIXED is set in the flags argument, the implementation is informed that the value of pa shall be addr, exactly.
- mmap64.mmap.31
If MAP_FIXED is set, mmap() may return MAP_FAILED and set errno to [EINVAL].
- mmap64.mmap.32
If a MAP_FIXED request is successful, the mapping established by mmap() replaces any previous mappings for the process' pages in the range [pa,pa+len).
- mmap64.mmap.33
When MAP_FIXED is not set, the implementation uses addr in an implementation-defined manner to arrive at pa. The pa so chosen shall be an area of the address space that the implementation deems suitable for a mapping of len bytes to the file.
- mmap64.mmap.34
All implementations interpret an addr value of 0 as granting the implementation complete freedom in selecting pa
- mmap64.mmap.35
A non-zero value of addr is taken to be a suggestion of a process address near which the mapping should be placed.
- mmap64.mmap.36
When the implementation selects a value for pa, it never places a mapping at address 0, nor does it replace any extant mapping.
- mmap64.mmap.37.01
The off argument is constrained to be aligned and sized according to the value returned by sysconf() when passed _SC_PAGESIZE or _SC_PAGE_SIZE.
- mmap64.mmap.37.02
When MAP_FIXED is specified, the application shall ensure that the argument addr also meets these constraints.
- mmap64.mmap.38
The implementation performs mapping operations over whole pages.
- mmap64.mmap.38.01
Thus, while the argument len need not meet a size or alignment constraint, the implementation shall include, in any mapping operation, any partial page specified by the range [pa,pa+len).
- mmap64.mmap.39
The system shall always zero-fill any partial page at the end of an object.
- mmap64.mmap.40
Further, the system shall never write out any modified portions of the last page of an object which are beyond its end.
- mmap64.mmap.41
References within the address range starting at pa and continuing for len bytes to whole pages following the end of an object shall result in delivery of a SIGBUS signal.
- mmap64.mmap.42
An implementation may generate SIGBUS signals when a reference would cause an error in the mapped object, such as out-of-space condition.
- mmap64.mmap.43
The mmap() function shall add an extra reference to the file associated with the file descriptor fildes which is not removed by a subsequent close() on that file descriptor.
- mmap64.mmap.44
This reference shall be removed when there are no more mappings to the file.
- mmap64.mmap.45
The st_atime field of the mapped file may be marked for update at any time between the mmap() call and the corresponding munmap() call.
- mmap64.mmap.46
The initial read or write reference to a mapped region shall cause the file's st_atime field to be marked for update if it has not already been marked for update.
- mmap64.mmap.47
The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and PROT_WRITE shall be marked for update at some point in the interval between a write reference to the mapped region and the next call to msync() with MS_ASYNC or MS_SYNC for that portion of the file by any process
- mmap64.mmap.48
If there is no such call and if the underlying file is modified as a result of a write reference, then these fields shall be marked for update at some time after the write reference.
- mmap64.mmap.49
There may be implementation-defined limits on the number of memory regions that can be mapped (per process or per system).[XSI] If such a limit is imposed, whether the number of memory regions that can be mapped by a process is decreased by the use of shmat() is implementation-defined.
- mmap64.mmap.50
If mmap() fails for reasons other than [EBADF], [EINVAL], or [ENOTSUP], some of the mappings in the address range starting at addr and continuing for len bytes may have been unmapped.
- mmap64.mmap.51.01
Upon successful completion, the mmap() function shall return the address at which the mapping was placed ( pa)
- mmap64.mmap.51.02
otherwise, it shall return a value of MAP_FAILED and set errno to indicate the error.
- mmap64.mmap.52
No successful return from mmap() shall return the value MAP_FAILED.
- mmap64.mmap.53
The mmap() function shall fail if:
- mmap64.mmap.53.01
[EACCES] The fildes argument is not open for read, regardless of the protection specified, or fildes is not open for write and PROT_WRITE was specified for a MAP_SHARED type mapping.
- mmap64.mmap.53.02
[EAGAIN] [ML] The mapping could not be locked in memory, if required by mlockall(), due to a lack of resources.
- mmap64.mmap.53.03
[EBADF] The fildes argument is not a valid open file descriptor.
- mmap64.mmap.53.04
[EINVAL] The value of len is zero.
- mmap64.mmap.53.05
[EINVAL] The addr argument (if MAP_FIXED was specified) or off is not a multiple of the page size as returned by sysconf(), or is considered invalid by the implementation.
- mmap64.mmap.53.06
[EINVAL] The value of flags is invalid (neither MAP_PRIVATE nor MAP_SHARED is set).
- mmap64.mmap.53.07
[EMFILE] The number of mapped regions would exceed an implementation-defined limit (per process or per system).
- mmap64.mmap.53.08
[ENODEV] The fildes argument refers to a file whose type is not supported by mmap().
- mmap64.mmap.53.09
[ENOMEM] MAP_FIXED was specified, and the range [addr,addr+len) exceeds that allowed for the address space of a process; or, if MAP_FIXED was not specified and there is insufficient room in the address space to effect the mapping.
- mmap64.mmap.53.10
[ENOMEM] [ML] The mapping could not be locked in memory, if required by mlockall(), because it would require more space than the system is able to supply.
- mmap64.mmap.53.11
[ENOMEM] [TYM] Not enough unallocated memory resources remain in the typed memory object designated by fildes to allocate len bytes.
- mmap64.mmap.53.12
[ENOTSUP]
- mmap64.mmap.53.12.01
MAP_FIXED or MAP_PRIVATE was specified in the flags argument and the implementation does not support this functionality.
- mmap64.mmap.53.12.02
The implementation does not support the combination of accesses requested in the prot argument.
- mmap64.mmap.53.13
[ENXIO] Addresses in the range [off,off+len) are invalid for the object specified by fildes.
- mmap64.mmap.53.14
[ENXIO] MAP_FIXED was specified in flags and the combination of addr, len, and off is invalid for the object specified by fildes.
- mmap64.mmap.53.15
[ENXIO] [TYM] The fildes argument refers to a typed memory object that is not accessible from the calling process.
- mmap64.mmap.53.16
[EOVERFLOW] The file is a regular file and the value of off plus len exceeds the offset maximum established in the open file description associated with fildes.
- [+]mprotect (16 / 5 / 0)
- mprotect.01
The mprotect() function shall change the access protections to be that specified by prot for those whole pages containing any part of the address space of the process starting at address addr and continuing for len bytes.
- mprotect.02
The parameter prot determines whether read, write, execute, or some combination of accesses are permitted to the data being mapped. The prot argument should be either PROT_NONE or the bitwise-inclusive OR of one or more of PROT_READ, PROT_WRITE, and PROT_EXEC.
- mprotect.03
If an implementation cannot support the combination of access types specified by prot, the call to mprotect() shall fail.
- mprotect.04
An implementation may permit accesses other than those specified by prot; however, no implementation shall permit a write to succeed where PROT_WRITE has not been set or shall permit any access where PROT_NONE alone has been set.
- mprotect.05
Implementations shall support at least the following values of prot: PROT_NONE, PROT_READ, PROT_WRITE, and the bitwise-inclusive OR of PROT_READ and PROT_WRITE.
- mprotect.06
If PROT_WRITE is specified, the application shall ensure that it has opened the mapped objects in the specified address range with write permission, unless MAP_PRIVATE was specified in the original mapping, regardless of whether the file descriptors used to map the objects have since been closed
- mprotect.07
The implementation shall require that addr be a multiple of the page size as returned by sysconf().
- app.mprotect.08
The behavior of this function is unspecified if the mapping was not established by a call to mmap().
- mprotect.09
When mprotect() fails for reasons other than [EINVAL], the protections on some of the pages in the range [addr,addr+len) may have been changed.
- mprotect.10.01
Upon successful completion, mprotect() shall return 0
- mprotect.10.02
otherwise, it shall return -1 and set errno to indicate the error.
- mprotect.11
The mprotect() function shall fail if:
- mprotect.11.01
[EACCES] The prot argument specifies a protection that violates the access permission the process has to the underlying memory object.
- mprotect.11.02
[EAGAIN] The prot argument specifies PROT_WRITE over a MAP_PRIVATE mapping and there are insufficient memory resources to reserve for locking the private page.
- mprotect.11.03
[EINVAL] The addr argument is not a multiple of the page size as returned by sysconf().
- mprotect.11.04
[ENOMEM] Addresses in the range [addr,addr+len) are invalid for the address space of a process, or specify one or more pages which are not mapped.
- mprotect.11.05
[ENOMEM] The prot argument specifies PROT_WRITE on a MAP_PRIVATE mapping, and it would require more space than the system is able to supply for locking the private pages, if required.
- mprotect.11.06
[ENOTSUP] The implementation does not support the combination of accesses requested in the prot argument.
- [+]msync (17 / 0 / 0)
- msync.01
The msync() function shall write all modified data to permanent storage locations, if any, in those whole pages containing any part of the address space of the process starting at address addr and continuing for len bytes.
- msync.02
If no such storage exists, msync() need not have any effect.
- msync.03
If requested, the msync() function shall then invalidate cached copies of data.
- msync.04
The implementation shall require that addr be a multiple of the page size as returned by sysconf().
- msync.05
For mappings to files, the msync() function shall ensure that all write operations are completed as defined for synchronized I/O data integrity completion.
- msync.06
When the msync() function is called on MAP_PRIVATE mappings, any modified data shall not be written to the underlying object and shall not cause such data to be made visible to other processes.
- app.msync.07
The behavior of this function is unspecified if the mapping was not established by a call to mmap()
- msync.08
The flags argument is constructed from the bitwise-inclusive OR of one or more of the following flags defined in the <sys/mman.h> header:
- msync.08.01
When MS_ASYNC is specified, msync() shall return immediately once all the write operations are initiated or queued for servicing;
- msync.08.02
when MS_SYNC is specified, msync() shall not return until all write operations are completed as defined for synchronized I/O data integrity completion.
- msync.08.03
Either MS_ASYNC or MS_SYNC is specified, but not both.
- msync.09
When MS_INVALIDATE is specified, msync() shall invalidate all cached copies of mapped data that are inconsistent with the permanent storage locations such that subsequent references shall obtain data that was consistent with the permanent storage locations sometime between the call to msync() and the first subsequent memory reference to the data.
- msync.10
If msync() causes any write to a file, the file's st_ctime and st_mtime fields shall be marked for update.
- msync.11.01
Upon successful completion, msync() shall return 0
- msync.11.02
otherwise, it shall return -1 and set errno to indicate the error
- msync.12
The msync() function shall fail if:
- msync.12.01
[EBUSY] Some or all of the addresses in the range starting at addr and continuing for len bytes are locked, and MS_INVALIDATE is specified.
- msync.12.02
[EINVAL] The value of flags is invalid.
- msync.12.03
[EINVAL] The value of addr is not a multiple of the page size {PAGESIZE}.
- msync.12.04
[ENOMEM] The addresses in the range starting at addr and continuing for len bytes are outside the range allowed for the address space of a process or specify one or more pages that are not mapped.
- [+]munlock (10 / 2 / 0)
- munlock.01
The munlock() function shall unlock those whole pages containing any part of the address space of the process starting at address addr and continuing for len bytes, regardless of how many times mlock() has been called by the process for any of the pages in the specified range
- munlock.02
The implementation may require that addr be a multiple of {PAGESIZE}.
- munlock.03
If any of the pages in the range specified to a call to munlock() are also mapped into the address spaces of other processes, any locks established on those pages by another process are unaffected by the call of this process to munlock()
- munlock.04
If any of the pages in the range specified by a call to munlock() are also mapped into other portions of the address space of the calling process outside the range specified, any locks established on those pages via the other mappings are also unaffected by this call.
- munlock.05
Upon successful return from munlock(), pages in the specified range shall be unlocked with respect to the address space of the process
- munlock.07
Upon successful completion, the mlock() and munlock() functions shall return a value of zero.
- munlock.08
Otherwise,
- munlock.08.01
no change is made to any locks in the address space of the process,
- munlock.08.02
and the function shall return a value of -1 and set errno to indicate the error.
- munlock.09
The mlock() and munlock() functions shall fail if:
- munlock.09.01
[ENOMEM] Some or all of the address range specified by the addr and len arguments does not correspond to valid mapped pages in the address space of the process.
- munlock.10
The mlock() and munlock() functions may fail if:
- munlock.10.01
[EINVAL] The addr argument is not a multiple of {PAGESIZE}.
- [+]munlockall (6 / 2 / 0)
- munlockall.01
The munlockall() function shall unlock all currently mapped pages of the address space of the process.
- munlockall.02
Any pages that become mapped into the address space of the process after a call to munlockall() shall not be locked, unless there is an intervening call to mlockall() specifying MCL_FUTURE or a subsequent call to mlockall() specifying MCL_CURRENT.
- munlockall.03
If pages mapped into the address space of the process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by a call by this process to munlockall().
- munlockall.04
Upon return from the munlockall() function, all currently mapped pages of the process' address space shall be unlocked with respect to the process' address space.
- munlockall.05
If it is supported by the implementation, the munlockall() function shall always return a value of zero.
- munlockall.06
Otherwise, the function shall return a value of -1 and set errno to indicate the error.
- [+]munmap (13 / 4 / 0)
- munmap.01
The munmap() function shall remove any mappings for those entire pages containing any part of the address space of the process starting at addr and continuing for len bytes
- munmap.02
Further references to these pages shall result in the generation of a SIGSEGV signal to the process.
- munmap.03
If there are no mappings in the specified address range, then munmap() has no effect.
- munmap.04
The implementation shall require that addr be a multiple of the page size {PAGESIZE}.
- munmap.05
If a mapping to be removed was private, any modifications made in this address range shall be discarded.
- munmap.06
[ML|MLR] Any memory locks (see mlock() and mlockall() ) associated with this address range shall be removed, as if by an appropriate call to munlock().
- munmap.07
If a mapping removed from a typed memory object causes the corresponding address range of the memory pool to be inaccessible by any process in the system except through allocatable mappings (that is, mappings of typed memory objects opened with the POSIX_TYPED_MEM_MAP_ALLOCATABLE flag), then that range of the memory pool shall become deallocated and may become available to satisfy future typed memory allocation requests.
- munmap.08
A mapping removed from a typed memory object opened with the POSIX_TYPED_MEM_MAP_ALLOCATABLE flag shall not affect in any way the availability of that typed memory for allocation.
- app.munmap.09
The behavior of this function is unspecified if the mapping was not established by a call to mmap().
- munmap.10
Upon successful completion, munmap() shall return 0
- munmap.11
otherwise, it shall return -1 and set errno to indicate the error.
- munmap.12
The munmap() function shall fail if:
- munmap.12.01
[EINVAL] Addresses in the range [addr,addr+len) are outside the valid range for the address space of a process.
- munmap.12.02
[EINVAL] The len argument is 0.
- munmap.12.03
[EINVAL] The addr argument is not a multiple of the page size as returned by sysconf().
- [+]shm_open (34 / 2 / 0)
- shm_open.01
The shm_open() function shall establish a connection between a shared memory object and a file descriptor. It shall create an open file description that refers to the shared memory object and a file descriptor that refers to that open file description.
- shm_open.02
The name argument points to a string naming a shared memory object
- shm_open.03
The name argument conforms to the construction rules for a pathname.
- shm_open.04
If name begins with the slash character, then processes calling shm_open() with the same value of name refer to the same shared memory object, as long as that name has not been removed.
- shm_open.05
If successful, shm_open() shall return a file descriptor for the shared memory object that is the lowest numbered file descriptor not currently open for that process.
- shm_open.06
The open file description is new, and therefore the file descriptor does not share it with any other processes.
- shm_open.07
The FD_CLOEXEC file descriptor flag associated with the new file descriptor is set.
- shm_open.08
The file status flags and file access modes of the open file description are according to the value of oflag. The oflag argument is the bitwise-inclusive OR of the following flags defined in the <fcntl.h> header.
- shm_open.09
Applications specify exactly one of the first two values (access modes) below in the value of oflag:
- shm_open.09.01
O_RDONLY Open for read access only.
- shm_open.09.02
O_RDWR Open for read or write access.
- shm_open.10
If the shared memory object exists, this flag has no effect, except as noted under O_EXCL below.
- shm_open.11.01
Otherwise, the shared memory object is created;
- shm_open.11.02
the user ID of the shared memory object shall be set to the effective user ID of the process;
- shm_open.11.03
the group ID of the shared memory object is set to a system default group ID or to the effective group ID of the process.
- shm_open.12
The permission bits of the shared memory object shall be set to the value of the mode argument except those set in the file mode creation mask of the process.
- shm_open.13
The mode argument does not affect whether the shared memory object is opened for reading, for writing, or for both.
- shm_open.14
The shared memory object has a size of zero.
- shm_open.15
If O_EXCL and O_CREAT are set, shm_open() fails if the shared memory object exists.
- shm_open.16
The check for the existence of the shared memory object and the creation of the object if it does not exist is atomic with respect to other processes executing shm_open() naming the same shared memory object with O_EXCL and O_CREAT set.
- shm_open.17
If the shared memory object exists, and it is successfully opened O_RDWR, the object shall be truncated to zero length
- shm_open.18
shall be unchanged by this function call.
- shm_open.18.01
the mode
- shm_open.18.02
owner
- shm_open.19
When a shared memory object is created, the state of the shared memory object, including all data associated with the shared memory object, persists until the shared memory object is unlinked and all other references are gone.
- shm_open.20.01
Upon successful completion, the shm_open() function shall return a non-negative integer representing the lowest numbered unused file descriptor.
- shm_open.20.02
Otherwise, it shall return -1 and set errno to indicate the error.
- shm_open.21
The shm_open() function shall fail if:
- shm_open.21.01
[EACCES] The shared memory object exists and the permissions specified by oflag are denied, or the shared memory object does not exist and permission to create the shared memory object is denied, or O_TRUNC is specified and write permission is denied.
- shm_open.21.02
[EEXIST] O_CREAT and O_EXCL are set and the named shared memory object already exists.
- shm_open.21.03
[EINTR] The shm_open() operation was interrupted by a signal.
- shm_open.21.04
[EINVAL] The shm_open() operation is not supported for the given name.
- shm_open.21.05
[EMFILE] Too many file descriptors are currently in use by this process.
- shm_open.21.06
[ENAMETOOLONG] The length of the name argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- shm_open.21.07
[ENFILE] Too many shared memory objects are currently open in the system.
- shm_open.21.08
[ENOENT] O_CREAT is not set and the named shared memory object does not exist.
- shm_open.21.09
[ENOSPC] There is insufficient space for the creation of the new shared memory object.
- [+]shm_unlink (10 / 3 / 0)
- shm_unlink.01
The shm_unlink() function shall remove the name of the shared memory object named by the string pointed to by name.
- shm_unlink.02
If one or more references to the shared memory object exist when the object is unlinked, the name shall be removed before shm_unlink() returns, but the removal of the memory object contents shall be postponed until all open and map references to the shared memory object have been removed.
- shm_unlink.03.01
Even if the object continues to exist after the last shm_unlink(), reuse of the name shall subsequently cause shm_open() to behave as if no shared memory object of this name exists (that is, shm_open() will fail if O_CREAT is not set
- shm_unlink.03.02
or will create a new shared memory object if O_CREAT is set).
- shm_unlink.04.01
Upon successful completion, a value of zero shall be returned.
- shm_unlink.04.02
Otherwise, a value of -1 shall be returned and errno set to indicate the error.
- shm_unlink.05
If -1 is returned, the named shared memory object shall not be changed by this function call.
- shm_unlink.06
The shm_unlink() function shall fail if:
- shm_unlink.06.01
[EACCES] Permission is denied to unlink the named shared memory object.
- shm_unlink.06.02
[ENAMETOOLONG] The length of the name argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- shm_unlink.06.03
[ENOENT] The named shared memory object does not exist.
- [+]ncurses.bkgd (23 / 0 / 0)
- [+]bkgd (7 / 0 / 0)
- bkgd.01.01
The bkgd() and wbkgd() functions turn off the previous background attributes,
- bkgd.01.02
logical OR the requested attributes into the window rendition,
- bkgd.01.03
and set the background property of the current or specified window
- bkgd.01.04
and then apply this setting to every character position in that window:
- bkgd.01.04.01
The rendition of every character on the screen is changed to the new window rendition.
- bkgd.01.04.02
Wherever the former background character appears, it is changed to the new background character.
- bkgd.02.01
Upon successful completion, bkgd() and wbkgd() return OK.
- bkgd.02.02
Otherwise, they return ERR.
- [+]bkgdset (3 / 0 / 0)
- bkgdset.01.01
The bkgdset() and wbkgdset() functions turn off the previous background attributes,
- bkgdset.01.02
logical OR the requested attributes into the window rendition,
- bkgdset.01.03
and set the background property of the current or specified window based on the information in ch.
- app.bkgdset.02
If ch refers to a multi-column character, the results are undefined.
- bkgdset.03 (struct)
The bkgdset() and wbkgdset() functions do not return a value.
- [+]getbkgd (3 / 0 / 0)
- getbkgd.01
The getbkgd() function extracts the specified window's background character and rendition.
- getbkgd.02.01
Upon successful completion, getbkgd() returns the specified window's background character and rendition.
- getbkgd.02.02
Otherwise, it returns (chtype)ERR.
- [+]wbkgd (7 / 0 / 0)
- wbkgd.01.01
The bkgd() and wbkgd() functions turn off the previous background attributes,
- wbkgd.01.02
logical OR the requested attributes into the window rendition,
- wbkgd.01.03
and set the background property of the current or specified window
- wbkgd.01.04
and then apply this setting to every character position in that window:
- wbkgd.01.04.01
The rendition of every character on the screen is changed to the new window rendition.
- wbkgd.01.04.02
Wherever the former background character appears, it is changed to the new background character.
- wbkgd.02.01
Upon successful completion, bkgd() and wbkgd() return OK.
- wbkgd.02.02
Otherwise, they return ERR.
- [+]wbkgdset (3 / 0 / 0)
- wbkgdset.01.01
The bkgdset() and wbkgdset() functions turn off the previous background attributes,
- wbkgdset.01.02
logical OR the requested attributes into the window rendition,
- wbkgdset.01.03
and set the background property of the current or specified window based on the information in ch.
- app.wbkgdset.02
If ch refers to a multi-column character, the results are undefined.
- wbkgdset.03 (struct)
The bkgdset() and wbkgdset() functions do not return a value.
- [+]ncurses.border (23 / 0 / 0)
- [+]border (8 / 0 / 0)
- border.01
The border() and wborder() functions draw a border around the edges of the current or specified window.
- border.02
These functions do not advance the cursor position.
- border.03
These functions do not perform special character processing.
- border.04
These functions do not perform wrapping.
- border.05
The arguments in the left-hand column of the following table contain single-byte characters with renditions, which have the following uses in drawing the border: Argument Default Name Usage Value ls Starting-column side ACS_VLINE rs Ending-column side ACS_VLINE ts First-line side ACS_HLINE bs Last-line side ACS_HLINE tl Corner of the first line and the starting column ACS_ULCORNER tr Corner of the first line and the ending column ACS_URCORNER bl Corner of the last line and the starting column ACS_LLCORNER br Corner of the last line and the ending column ACS_LRCORNER
- border.06.01
If the value of any argument in the left-hand column is 0, then the default value in the right-hand column is used.
- app.border.06.02
If the value of any argument in the left-hand column is a multi-column character, the results are undefined.
- border.07.01
Upon successful completion, these functions return OK.
- border.07.02
Otherwise, they return ERR.
- [+]box (7 / 0 / 0)
- box.01
The box() function draws a border around the edges of the specified window.
- box.02
This function does not advance the cursor position.
- box.03
This function does not perform special character processing.
- box.04
This function does not perform wrapping.
- box.05
The function box(win, verch, horch) has an effect equivalent to: wborder(win, verch, verch, horch, horch, 0, 0, 0, 0);
- box.06.01
Upon successful completion, box() returns OK.
- box.06.02
Otherwise, it returns ERR.
- [+]wborder (8 / 0 / 0)
- wborder.01
The border() and wborder() functions draw a border around the edges of the current or specified window.
- wborder.02
These functions do not advance the cursor position.
- wborder.03
These functions do not perform special character processing.
- wborder.04
These functions do not perform wrapping.
- wborder.05
The arguments in the left-hand column of the following table contain single-byte characters with renditions, which have the following uses in drawing the border: Argument Default Name Usage Value ls Starting-column side ACS_VLINE rs Ending-column side ACS_VLINE ts First-line side ACS_HLINE bs Last-line side ACS_HLINE tl Corner of the first line and the starting column ACS_ULCORNER tr Corner of the first line and the ending column ACS_URCORNER bl Corner of the last line and the starting column ACS_LLCORNER br Corner of the last line and the ending column ACS_LRCORNER
- app.wborder.06.02
If the value of any argument in the left-hand column is a multi-column character, the results are undefined.
- wborder.06.01
If the value of any argument in the left-hand column is 0, then the default value in the right-hand column is used.
- wborder.07.01
Upon successful completion, these functions return OK.
- wborder.07.02
Otherwise, they return ERR.
- [+]ncurses.char.add (26 / 0 / 0)
- [+]addch (5 / 0 / 0)
- addch.01
The addch(), mvaddch(), mvwaddch() and waddch() functions place ch into the current or specified window at the current or specified position, and then advance the window's cursor position.
- addch.02
These functions perform wrapping.
- addch.03
These functions perform special-character processing.
- addch.04.01
Upon successful completion, these functions return OK.
- addch.04.02
Otherwise they return ERR.
- [+]echochar (3 / 0 / 0)
- echochar.01
The echochar() function is equivalent to a call to addch() followed by a call to refresh().
- echochar.02.01
Upon successful completion, these functions return OK.
- echochar.02.02
Otherwise they return ERR.
- [+]mvaddch (5 / 0 / 0)
- mvaddch.01
The addch(), mvaddch(), mvwaddch() and waddch() functions place ch into the current or specified window at the current or specified position, and then advance the window's cursor position.
- mvaddch.02
These functions perform wrapping.
- mvaddch.03
These functions perform special-character processing.
- mvaddch.04.01
Upon successful completion, these functions return OK.
- mvaddch.04.02
Otherwise they return ERR.
- [+]mvwaddch (5 / 0 / 0)
- mvwaddch.01
The addch(), mvaddch(), mvwaddch() and waddch() functions place ch into the current or specified window at the current or specified position, and then advance the window's cursor position.
- mvwaddch.02
These functions perform wrapping.
- mvwaddch.03
These functions perform special-character processing.
- mvwaddch.04.01
Upon successful completion, these functions return OK.
- mvwaddch.04.02
Otherwise they return ERR.
- [+]waddch (5 / 0 / 0)
- waddch.01
The addch(), mvaddch(), mvwaddch() and waddch() functions place ch into the current or specified window at the current or specified position, and then advance the window's cursor position.
- waddch.02
These functions perform wrapping.
- waddch.03
These functions perform special-character processing.
- waddch.04.01
Upon successful completion, these functions return OK.
- waddch.04.02
Otherwise they return ERR.
- [+]wechochar (3 / 0 / 0)
- wechochar.01
The wechochar() function is equivalent to a call to waddch() followed by a call to wrefresh().
- wechochar.02.01
Upon successful completion, these functions return OK.
- wechochar.02.02
Otherwise they return ERR.
- [+]ncurses.char.input (12 / 0 / 0)
- [+]inch (3 / 0 / 0)
- inch.01
These functions return the character and rendition, of type chtype, at the current or specified position in the current or specified window.
- inch.02.01
Upon successful completion, the functions return the specified character and rendition.
- inch.02.02
Otherwise, they return (chtype)ERR.
- [+]mvinch (3 / 0 / 0)
- mvinch.01
These functions return the character and rendition, of type chtype, at the current or specified position in the current or specified window.
- mvinch.02.01
Upon successful completion, the functions return the specified character and rendition.
- mvinch.02.02
Otherwise, they return (chtype)ERR.
- [+]mvwinch (3 / 0 / 0)
- mvwinch.01
These functions return the character and rendition, of type chtype, at the current or specified position in the current or specified window.
- mvwinch.02.01
Upon successful completion, the functions return the specified character and rendition.
- mvwinch.02.02
Otherwise, they return (chtype)ERR.
- [+]winch (3 / 0 / 0)
- winch.01
These functions return the character and rendition, of type chtype, at the current or specified position in the current or specified window.
- winch.02.01
Upon successful completion, the functions return the specified character and rendition.
- winch.02.02
Otherwise, they return (chtype)ERR.
- [+]ncurses.char.insert (24 / 0 / 0)
- [+]insch (6 / 0 / 0)
- insch.01
These functions insert the character and rendition from ch into the current or specified window at the current or specified position.
- insch.02
These functions do not perform wrapping.
- insch.03
These functions do not advance the cursor position.
- insch.04
These functions perform special-character processing, with the exception that if a newline is inserted into the last line of a window and scrolling is not enabled, the behavior is unspecified.
- insch.05.01
Upon successful completion, these functions return OK.
- insch.05.02
Otherwise, they return ERR.
- [+]mvinsch (6 / 0 / 0)
- mvinsch.01
These functions insert the character and rendition from ch into the current or specified window at the current or specified position.
- mvinsch.02
These functions do not perform wrapping.
- mvinsch.03
These functions do not advance the cursor position.
- mvinsch.04
These functions perform special-character processing, with the exception that if a newline is inserted into the last line of a window and scrolling is not enabled, the behavior is unspecified.
- mvinsch.05.01
Upon successful completion, these functions return OK.
- mvinsch.05.02
Otherwise, they return ERR.
- [+]mvwinsch (6 / 0 / 0)
- mvwinsch.01
These functions insert the character and rendition from ch into the current or specified window at the current or specified position.
- mvwinsch.02
These functions do not perform wrapping.
- mvwinsch.03
These functions do not advance the cursor position.
- mvwinsch.04
These functions perform special-character processing, with the exception that if a newline is inserted into the last line of a window and scrolling is not enabled, the behavior is unspecified.
- mvwinsch.05.01
Upon successful completion, these functions return OK.
- mvwinsch.05.02
Otherwise, they return ERR.
- [+]winsch (6 / 0 / 0)
- winsch.01
These functions insert the character and rendition from ch into the current or specified window at the current or specified position.
- winsch.02
These functions do not perform wrapping.
- winsch.03
These functions do not advance the cursor position.
- winsch.04
These functions perform special-character processing, with the exception that if a newline is inserted into the last line of a window and scrolling is not enabled, the behavior is unspecified.
- winsch.05.01
Upon successful completion, these functions return OK.
- winsch.05.02
Otherwise, they return ERR.
- [+]ncurses.chgat (36 / 0 / 0)
- [+]chgat (9 / 0 / 0)
- chgat.01.01
These functions change the renditions of the next n characters in the current or specified window
- chgat.01.02
or of the remaining characters on the current or specified line, if n is -1
- chgat.01.03
starting at the current or specified cursor position.
- chgat.02
The attributes and colors are specified by attr and color as for setcchar().
- chgat.03
These functions do not update the cursor.
- chgat.04
These functions do not perform wrapping.
- chgat.05
A value of n that is greater than the remaining characters on a line is not an error.
- chgat.06 (struct)
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- chgat.07.01
Upon successful completion, these functions return OK.
- chgat.07.02
Otherwise, they return ERR.
- [+]mvchgat (9 / 0 / 0)
- mvchgat.01.01
These functions change the renditions of the next n characters in the current or specified window
- mvchgat.01.02
or of the remaining characters on the current or specified line, if n is -1
- mvchgat.01.03
starting at the current or specified cursor position.
- mvchgat.02
The attributes and colors are specified by attr and color as for setcchar().
- mvchgat.03
These functions do not update the cursor.
- mvchgat.04
These functions do not perform wrapping.
- mvchgat.05
A value of n that is greater than the remaining characters on a line is not an error.
- mvchgat.06 (struct)
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- mvchgat.07.01
Upon successful completion, these functions return OK.
- mvchgat.07.02
Otherwise, they return ERR.
- [+]mvwchgat (9 / 0 / 0)
- mvwchgat.01.01
These functions change the renditions of the next n characters in the current or specified window
- mvwchgat.01.02
or of the remaining characters on the current or specified line, if n is -1
- mvwchgat.01.03
starting at the current or specified cursor position.
- mvwchgat.02
The attributes and colors are specified by attr and color as for setcchar().
- mvwchgat.03
These functions do not update the cursor.
- mvwchgat.04
These functions do not perform wrapping.
- mvwchgat.05
A value of n that is greater than the remaining characters on a line is not an error.
- mvwchgat.06 (struct)
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- mvwchgat.07.01
Upon successful completion, these functions return OK.
- mvwchgat.07.02
Otherwise, they return ERR.
- [+]wchgat (9 / 0 / 0)
- wchgat.01.01
These functions change the renditions of the next n characters in the current or specified window
- wchgat.01.02
or of the remaining characters on the current or specified line, if n is -1
- wchgat.01.03
starting at the current or specified cursor position.
- wchgat.02
The attributes and colors are specified by attr and color as for setcchar().
- wchgat.03
These functions do not update the cursor.
- wchgat.04
These functions do not perform wrapping.
- wchgat.05
A value of n that is greater than the remaining characters on a line is not an error.
- wchgat.06 (struct)
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- wchgat.07.01
Upon successful completion, these functions return OK.
- wchgat.07.02
Otherwise, they return ERR.
- [+]ncurses.chstr.add (56 / 0 / 0)
- [+]addchnstr (8 / 0 / 0)
- addchnstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- addchnstr.02
These functions do not change the cursor position.
- addchnstr.03
These functions do not perform special-character processing.
- addchnstr.04
These functions do not perform wrapping.
- addchnstr.05
The addchnstr(), mvaddchnstr(), mvwaddchnstr() and waddchnstr() functions copy at most n items, but no more than will fit on the current or specified line.
- addchnstr.06
If n is -1 then the whole string is copied, to the maximum number that fit on the current or specified line.
- addchnstr.07.01
Upon successful completion, these functions return OK.
- addchnstr.07.02
Otherwise, they return ERR.
- [+]addchstr (6 / 0 / 0)
- addchstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- addchstr.02
These functions do not change the cursor position.
- addchstr.03
These functions do not perform special-character processing.
- addchstr.04
These functions do not perform wrapping.
- addchstr.07.01
Upon successful completion, these functions return OK.
- addchstr.07.02
Otherwise, they return ERR.
- [+]mvaddchnstr (8 / 0 / 0)
- mvaddchnstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- mvaddchnstr.02
These functions do not change the cursor position.
- mvaddchnstr.03
These functions do not perform special-character processing.
- mvaddchnstr.04
These functions do not perform wrapping.
- mvaddchnstr.05
The addchnstr(), mvaddchnstr(), mvwaddchnstr() and waddchnstr() functions copy at most n items, but no more than will fit on the current or specified line.
- mvaddchnstr.06
If n is -1 then the whole string is copied, to the maximum number that fit on the current or specified line.
- mvaddchnstr.07.01
Upon successful completion, these functions return OK.
- mvaddchnstr.07.02
Otherwise, they return ERR.
- [+]mvaddchstr (6 / 0 / 0)
- mvaddchstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- mvaddchstr.02
These functions do not change the cursor position.
- mvaddchstr.03
These functions do not perform special-character processing.
- mvaddchstr.04
These functions do not perform wrapping.
- mvaddchstr.07.01
Upon successful completion, these functions return OK.
- mvaddchstr.07.02
Otherwise, they return ERR.
- [+]mvwaddchnstr (8 / 0 / 0)
- mvwaddchnstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- mvwaddchnstr.02
These functions do not change the cursor position.
- mvwaddchnstr.03
These functions do not perform special-character processing.
- mvwaddchnstr.04
These functions do not perform wrapping.
- mvwaddchnstr.05
The addchnstr(), mvaddchnstr(), mvwaddchnstr() and waddchnstr() functions copy at most n items, but no more than will fit on the current or specified line.
- mvwaddchnstr.06
If n is -1 then the whole string is copied, to the maximum number that fit on the current or specified line.
- mvwaddchnstr.07.01
Upon successful completion, these functions return OK.
- mvwaddchnstr.07.02
Otherwise, they return ERR.
- [+]mvwaddchstr (6 / 0 / 0)
- mvwaddchstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- mvwaddchstr.02
These functions do not change the cursor position.
- mvwaddchstr.03
These functions do not perform special-character processing.
- mvwaddchstr.04
These functions do not perform wrapping.
- mvwaddchstr.07.01
Upon successful completion, these functions return OK.
- mvwaddchstr.07.02
Otherwise, they return ERR.
- [+]waddchnstr (8 / 0 / 0)
- waddchnstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- waddchnstr.02
These functions do not change the cursor position.
- waddchnstr.03
These functions do not perform special-character processing.
- waddchnstr.04
These functions do not perform wrapping.
- waddchnstr.05
The addchnstr(), mvaddchnstr(), mvwaddchnstr() and waddchnstr() functions copy at most n items, but no more than will fit on the current or specified line.
- waddchnstr.06
If n is -1 then the whole string is copied, to the maximum number that fit on the current or specified line.
- waddchnstr.07.01
Upon successful completion, these functions return OK.
- waddchnstr.07.02
Otherwise, they return ERR.
- [+]waddchstr (6 / 0 / 0)
- waddchstr.01
These functions overlay the contents of the current or specified window, starting at the current or specified position, with the contents of the array pointed to by chstr until a null chtype is encountered in the array pointed to by chstr.
- waddchstr.02
These functions do not change the cursor position.
- waddchstr.03
These functions do not perform special-character processing.
- waddchstr.04
These functions do not perform wrapping.
- waddchstr.07.01
Upon successful completion, these functions return OK.
- waddchstr.07.02
Otherwise, they return ERR.
- [+]ncurses.chstr.input (28 / 0 / 0)
- [+]inchnstr (4 / 0 / 0)
- inchnstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- inchnstr.02
The inchnstr(), mvinchnstr(), mvwinchnstr() and winchnstr() functions store at most n elements from the current or specified window into the array pointed to by chstr.
- inchnstr.03.01
Upon successful completion, these functions return OK.
- inchnstr.03.02
Otherwise, they return ERR.
- [+]inchstr (3 / 0 / 0)
- inchstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- inchstr.03.01
Upon successful completion, these functions return OK.
- inchstr.03.02
Otherwise, they return ERR.
- [+]mvinchnstr (4 / 0 / 0)
- mvinchnstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- mvinchnstr.02
The inchnstr(), mvinchnstr(), mvwinchnstr() and winchnstr() functions store at most n elements from the current or specified window into the array pointed to by chstr.
- mvinchnstr.03.01
Upon successful completion, these functions return OK.
- mvinchnstr.03.02
Otherwise, they return ERR.
- [+]mvinchstr (3 / 0 / 0)
- mvinchstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- mvinchstr.03.01
Upon successful completion, these functions return OK.
- mvinchstr.03.02
Otherwise, they return ERR.
- [+]mvwinchnstr (4 / 0 / 0)
- mvwinchnstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- mvwinchnstr.02
The inchnstr(), mvinchnstr(), mvwinchnstr() and winchnstr() functions store at most n elements from the current or specified window into the array pointed to by chstr.
- mvwinchnstr.03.01
Upon successful completion, these functions return OK.
- mvwinchnstr.03.02
Otherwise, they return ERR.
- [+]mvwinchstr (3 / 0 / 0)
- mvwinchstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- mvwinchstr.03.01
Upon successful completion, these functions return OK.
- mvwinchstr.03.02
Otherwise, they return ERR.
- [+]winchnstr (4 / 0 / 0)
- winchnstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- winchnstr.02
The inchnstr(), mvinchnstr(), mvwinchnstr() and winchnstr() functions store at most n elements from the current or specified window into the array pointed to by chstr.
- winchnstr.03.01
Upon successful completion, these functions return OK.
- winchnstr.03.02
Otherwise, they return ERR.
- [+]winchstr (3 / 0 / 0)
- winchstr.01
These functions place characters and renditions from the current or specified window into the array pointed to by chstr, starting at the current or specified position and ending at the end of the line.
- winchstr.03.01
Upon successful completion, these functions return OK.
- winchstr.03.02
Otherwise, they return ERR.
- [+]ncurses.clear (64 / 0 / 0)
- [+]clear (4 / 0 / 0)
- clear.01
The clear(), erase(), wclear() and werase() functions clear every position in the current or specified window.
- clear.02
The clear() and wclear() functions also achieve the same effect as calling clearok(), so that the window is cleared completely on the next call to wrefresh() for the window and is redrawn in its entirety.
- clear.03.01
Upon successful completion, these functions return OK.
- clear.03.02
Otherwise, they return ERR.
- [+]clrtobot (5 / 0 / 0)
- clrtobot.01.01
The clrtobot() and wclrtobot() functions erase all lines following the cursor in the current or specified window,
- clrtobot.01.02
and erase the current line from the cursor to the end of the line, inclusive.
- clrtobot.02
These functions do not update the cursor.
- clrtobot.03.01
Upon successful completion, these functions return OK.
- clrtobot.03.02
Otherwise, they return ERR.
- [+]clrtoeol (4 / 0 / 0)
- clrtoeol.01
The clrtoeol() and wclrtoeol() functions erase the current line from the cursor to the end of the line, inclusive, in the current or specified window.
- clrtoeol.02
These functions do not update the cursor.
- clrtoeol.03.01
Upon successful completion, these functions return OK.
- clrtoeol.03.02
Otherwise, they return ERR.
- [+]delch (4 / 0 / 0)
- delch.01
These functions delete the character at the current or specified position in the current or specified window.
- delch.02
This function does not change the cursor position.
- delch.03.01
Upon successful completion, these functions return OK.
- delch.03.02
Otherwise, they return ERR.
- [+]deleteln (5 / 0 / 0)
- deleteln.01
The deleteln() and wdeleteln() functions delete the line containing the cursor in the current or specified window and move all lines following the current line one line toward the cursor.
- deleteln.02
The last line of the window is cleared.
- deleteln.03
The cursor position does not change.
- deleteln.04.01
Upon successful completion, these functions return OK.
- deleteln.04.02
Otherwise, they return ERR.
- [+]erase (3 / 0 / 0)
- erase.01
The clear(), erase(), wclear() and werase() functions clear every position in the current or specified window.
- erase.03.01
Upon successful completion, these functions return OK.
- erase.03.02
Otherwise, they return ERR.
- [+]erasechar (3 / 0 / 0)
- erasechar.01
The erasechar() function returns the current erase character.
- erasechar.02
The erasechar() function returns the erase character and killchar() returns the line kill character.
- erasechar.03
The return value is unspecified when these characters are multi-byte characters.
- [+]killchar (3 / 0 / 0)
- killchar.01
The killchar() function returns the current line kill character.
- killchar.02
The erasechar() function returns the erase character and killchar() returns the line kill character.
- killchar.03
The return value is unspecified when these characters are multi-byte characters.
- [+]mvdelch (4 / 0 / 0)
- mvdelch.01
These functions delete the character at the current or specified position in the current or specified window.
- mvdelch.02
This function does not change the cursor position.
- mvdelch.03.01
Upon successful completion, these functions return OK.
- mvdelch.03.02
Otherwise, they return ERR.
- [+]mvwdelch (4 / 0 / 0)
- mvwdelch.01
These functions delete the character at the current or specified position in the current or specified window.
- mvwdelch.02
This function does not change the cursor position.
- mvwdelch.03.01
Upon successful completion, these functions return OK.
- mvwdelch.03.02
Otherwise, they return ERR.
- [+]wclear (4 / 0 / 0)
- wclear.01
The clear(), erase(), wclear() and werase() functions clear every position in the current or specified window.
- wclear.02
The clear() and wclear() functions also achieve the same effect as calling clearok(), so that the window is cleared completely on the next call to wrefresh() for the window and is redrawn in its entirety.
- wclear.03.01
Upon successful completion, these functions return OK.
- wclear.03.02
Otherwise, they return ERR.
- [+]wclrtobot (5 / 0 / 0)
- wclrtobot.01.01
The clrtobot() and wclrtobot() functions erase all lines following the cursor in the current or specified window,
- wclrtobot.01.02
and erase the current line from the cursor to the end of the line, inclusive.
- wclrtobot.02
These functions do not update the cursor.
- wclrtobot.03.01
Upon successful completion, these functions return OK.
- wclrtobot.03.02
Otherwise, they return ERR.
- [+]wclrtoeol (4 / 0 / 0)
- wclrtoeol.01
The clrtoeol() and wclrtoeol() functions erase the current line from the cursor to the end of the line, inclusive, in the current or specified window.
- wclrtoeol.02
These functions do not update the cursor.
- wclrtoeol.03.01
Upon successful completion, these functions return OK.
- wclrtoeol.03.02
Otherwise, they return ERR.
- [+]wdelch (4 / 0 / 0)
- wdelch.01
These functions delete the character at the current or specified position in the current or specified window.
- wdelch.02
This function does not change the cursor position.
- wdelch.03.01
Upon successful completion, these functions return OK.
- wdelch.03.02
Otherwise, they return ERR.
- [+]wdeleteln (5 / 0 / 0)
- wdeleteln.01
The deleteln() and wdeleteln() functions delete the line containing the cursor in the current or specified window and move all lines following the current line one line toward the cursor.
- wdeleteln.02
The last line of the window is cleared.
- wdeleteln.03
The cursor position does not change.
- wdeleteln.04.01
Upon successful completion, these functions return OK.
- wdeleteln.04.02
Otherwise, they return ERR.
- [+]werase (3 / 0 / 0)
- werase.01
The clear(), erase(), wclear() and werase() functions clear every position in the current or specified window.
- werase.03.01
Upon successful completion, these functions return OK.
- werase.03.02
Otherwise, they return ERR.
- [+]ncurses.color (52 / 0 / 0)
- [+]can_change_color (4 / 0 / 0)
- can_change_color.01
These functions manipulate colour on terminals that support colour.
- can_change_color.02
The can_change_color() function indicates whether the terminal is a colour terminal on which colours can be redefined.
- can_change_color.03.01
The can_change_color() function returns TRUE if the terminal supports colors and can change their definitions;
- can_change_color.03.02
otherwise, it returns FALSE.
- [+]color_content (7 / 0 / 0)
- color_content.01
These functions manipulate colour on terminals that support colour.
- color_content.02
The color_content() function identifies the intensity components of colour number color.
- color_content.03
It stores the red, green, and blue intensity components of this colour in the addresses pointed to by red, green, and blue, respectively.
- color_content.04
For both functions, the color argument must be in the range from 0 to and including COLORS-1.
- color_content.05
Valid intensity values range from 0 (no intensity component) up to and including 1000 (maximum intensity in that component).
- color_content.10.01
Upon successful completion, the other functions return OK;
- color_content.10.02
otherwise, they return ERR.
- [+]has_colors (4 / 0 / 0)
- has_colors.01
These functions manipulate colour on terminals that support colour.
- has_colors.02
The has_colors() function indicates whether the terminal is a colour terminal.
- has_colors.03.01
The has_colors() function returns TRUE if the terminal can manipulate colors;
- has_colors.03.02
otherwise, it returns FALSE.
- [+]init_color (7 / 0 / 0)
- init_color.01
These functions manipulate colour on terminals that support colour.
- init_color.02
The init_color() function redefines colour number color, on terminals that support the redefinition of colours, to have the red, green, and blue intensity components specified by red, green, and blue, respectively.
- init_color.03
Calling init_color() also changes all occurrences of the specified colour on the screen to the new definition.
- init_color.04
For both functions, the color argument must be in the range from 0 to and including COLORS-1.
- init_color.05
Valid intensity values range from 0 (no intensity component) up to and including 1000 (maximum intensity in that component).
- init_color.10.01
Upon successful completion, the other functions return OK;
- init_color.10.02
otherwise, they return ERR.
- [+]init_pair (11 / 0 / 0)
- init_pair.01
These functions manipulate colour on terminals that support colour.
- init_pair.02
Calling init_pair() defines or redefines colour-pair number pair to have foreground colour f and background colour b.
- init_pair.03
Calling init_pair() changes any characters that were displayed in the colour pair's old definition to the new definition and refreshes the screen.
- init_pair.04
After defining the colour pair, the macro COLOR_PAIR(n) returns the value of colour pair n.
- init_pair.05
This value is the colour attribute as it would be extracted from a chtype.
- init_pair.06
Conversely, the macro PAIR_NUMBER(value) returns the colour pair number associated with the colour attribute value.
- init_pair.07
With init_pair() and pair_content(), the value of pair must be in a range from 0 to and including COLOR_PAIRS-1.
- init_pair.08
There may be an implementation-specific upper limit on the valid value of pair, but any such limit is at least 63.
- init_pair.09
Valid values for f and b are the range from 0 to and including COLORS-1.
- init_pair.10.01
Upon successful completion, the other functions return OK;
- init_pair.10.02
otherwise, they return ERR.
- [+]pair_content (8 / 0 / 0)
- pair_content.01
These functions manipulate colour on terminals that support colour.
- pair_content.02
The pair_content() function retrieves the component colours of a colour-pair number pair.
- pair_content.03
It stores the foreground and background colour numbers in the variables pointed to by f and b, respectively.
- pair_content.07
With init_pair() and pair_content(), the value of pair must be in a range from 0 to and including COLOR_PAIRS-1.
- pair_content.08
There may be an implementation-specific upper limit on the valid value of pair, but any such limit is at least 63.
- pair_content.09
Valid values for f and b are the range from 0 to and including COLORS-1.
- pair_content.10.01
Upon successful completion, the other functions return OK;
- pair_content.10.02
otherwise, they return ERR.
- [+]start_color (11 / 0 / 0)
- start_color.01
These functions manipulate colour on terminals that support colour.
- start_color.02
The start_color() function must be called in order to enable use of colours and before any colour manipulation function is called.
- start_color.03
The function initialises eight basic colours (black, blue, green, cyan, red, magenta, yellow, and white) that can be specified by the colour macros (such as COLOR_BLACK) defined in <curses.h>.
- start_color.04
The initial appearance of these eight colours is not specified.
- start_color.05
The function also initialises two global external variables:
- start_color.05.01.01
COLORS defines the number of colours that the terminal supports. (See Colour Identification below.)
- start_color.05.01.02
If COLORS is 0, the terminal does not support redefinition of colours (and can_change_color() will return FALSE).
- start_color.05.02
COLOR_PAIRS defines the maximum number of colour-pairs that the terminal supports. (See User-defined Colour Pairs below.)
- start_color.06
The start_color() function also restores the colours on the terminal to terminal-specific initial values.
- start_color.07
The initial background colour is assumed to be black for all terminals.
- start_color.10.01
Upon successful completion, the other functions return OK;
- start_color.10.02
otherwise, they return ERR.
- [+]ncurses.input.char (31 / 0 / 0)
- [+]getch (7 / 0 / 0)
- getch.01
These functions read a single-byte character from the terminal associated with the current or specified window.
- getch.02
The results are unspecified if the input is not a single-byte character.
- getch.03
If keypad() is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h>.
- getch.04
If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(), except for the following characters: <backspace>, <left-arrow> and the current erase character: The input is interpreted as specified in and then the character at the resulting cursor position is deleted as though were called, except that if the cursor was originally in the first column of the line, then the user is alerted as though were called. Function keys The user is alerted as though were called. Information concerning the function keys is not returned to the caller.
- getch.05
If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read.
- getch.06.01
Upon successful completion getch(), mvgetch(), mvwgetch() and wgetch() return the single-byte character, KEY_ value, or ERR.
- getch.06.02
When in the nodelay mode and no data is available, ERR is returned.
- [+]mvgetch (7 / 0 / 0)
- mvgetch.01
These functions read a single-byte character from the terminal associated with the current or specified window.
- mvgetch.02
The results are unspecified if the input is not a single-byte character.
- mvgetch.03
If keypad() is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h>.
- mvgetch.04
If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(), except for the following characters: <backspace>, <left-arrow> and the current erase character: The input is interpreted as specified in and then the character at the resulting cursor position is deleted as though were called, except that if the cursor was originally in the first column of the line, then the user is alerted as though were called. Function keys The user is alerted as though were called. Information concerning the function keys is not returned to the caller.
- mvgetch.05
If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read.
- mvgetch.06.01
Upon successful completion getch(), mvgetch(), mvwgetch() and wgetch() return the single-byte character, KEY_ value, or ERR.
- mvgetch.06.02
When in the nodelay mode and no data is available, ERR is returned.
- [+]mvwgetch (7 / 0 / 0)
- mvwgetch.01
These functions read a single-byte character from the terminal associated with the current or specified window.
- mvwgetch.02
The results are unspecified if the input is not a single-byte character.
- mvwgetch.03
If keypad() is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h>.
- mvwgetch.04
If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(), except for the following characters: <backspace>, <left-arrow> and the current erase character: The input is interpreted as specified in and then the character at the resulting cursor position is deleted as though were called, except that if the cursor was originally in the first column of the line, then the user is alerted as though were called. Function keys The user is alerted as though were called. Information concerning the function keys is not returned to the caller.
- mvwgetch.05
If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read.
- mvwgetch.06.01
Upon successful completion getch(), mvgetch(), mvwgetch() and wgetch() return the single-byte character, KEY_ value, or ERR.
- mvwgetch.06.02
When in the nodelay mode and no data is available, ERR is returned.
- [+]ungetch (3 / 0 / 0)
- ungetch.01
The ungetch() function pushes the single-byte character ch onto the head of the input queue.
- app.ungetch.02
One character of push-back is guaranteed. The result of successive calls without an intervening call to getch() or get_wch() are unspecified.
- ungetch.03.01
Upon successful completion, these functions return OK.
- ungetch.03.02
Otherwise, they return ERR.
- [+]wgetch (7 / 0 / 0)
- wgetch.01
These functions read a single-byte character from the terminal associated with the current or specified window.
- wgetch.02
The results are unspecified if the input is not a single-byte character.
- wgetch.03
If keypad() is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h>.
- wgetch.04
If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(), except for the following characters: <backspace>, <left-arrow> and the current erase character: The input is interpreted as specified in and then the character at the resulting cursor position is deleted as though were called, except that if the cursor was originally in the first column of the line, then the user is alerted as though were called. Function keys The user is alerted as though were called. Information concerning the function keys is not returned to the caller.
- wgetch.05
If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read.
- wgetch.06.01
Upon successful completion getch(), mvgetch(), mvwgetch() and wgetch() return the single-byte character, KEY_ value, or ERR.
- wgetch.06.02
When in the nodelay mode and no data is available, ERR is returned.
- [+]ncurses.input.input (27 / 0 / 0)
- [+]cbreak (3 / 0 / 0)
- cbreak.01
The cbreak() function sets the input mode for the current terminal to cbreak mode and overrides a call to raw().
- cbreak.02.01
Upon successful completion, these functions return OK.
- cbreak.02.02
Otherwise, they return ERR.
- [+]flushinp (2 / 0 / 0)
- flushinp.01
The flushinp() function discards (flushes) any characters in the input buffer associated with the current screen.
- flushinp.02
The flushinp() function always returns OK.
- [+]halfdelay (5 / 0 / 0)
- halfdelay.01.01
The halfdelay() function sets the input mode for the current window to Half-Delay Mode
- halfdelay.01.02
and specifies tenths tenths of seconds as the half-delay interval.
- halfdelay.02
The tenths argument must be in a range from 1 up to and including 255.
- halfdelay.03.01
Upon successful completion, halfdelay() returns OK.
- halfdelay.03.02
Otherwise, it returns ERR.
- [+]nl (4 / 0 / 0)
- nl.01
The nl() function enables a mode in which carriage return is translated to newline on input.
- nl.02
Initially, the above translation is enabled.
- nl.03.01
Upon successful completion, these functions return OK.
- nl.03.02
Otherwise, they return ERR.
- [+]nocbreak (3 / 0 / 0)
- nocbreak.01
The nocbreak() function sets the input mode for the current terminal to Cooked Mode without changing the state of ISIG and IXON.
- nocbreak.02.01
Upon successful completion, these functions return OK.
- nocbreak.02.02
Otherwise, they return ERR.
- [+]nonl (4 / 0 / 0)
- nonl.01
The nonl() function disables the above translation.
- nonl.02
Initially, the above translation is enabled.
- nonl.03.01
Upon successful completion, these functions return OK.
- nonl.03.02
Otherwise, they return ERR.
- [+]noraw (3 / 0 / 0)
- noraw.01
The noraw() function sets the input mode for the current terminal to Cooked Mode and sets the ISIG and IXON flags.
- noraw.02.01
Upon successful completion, these functions return OK.
- noraw.02.02
Otherwise, they return ERR.
- [+]raw (3 / 0 / 0)
- raw.01
The raw() function sets the input mode for the current terminal to Raw Mode.
- raw.02.01
Upon successful completion, these functions return OK.
- raw.02.02
Otherwise, they return ERR.
- [+]ncurses.input.string (42 / 0 / 0)
- [+]getnstr (6 / 0 / 0)
- getnstr.01
The getnstr(), mvgetnstr(), mvwgetnstr() and wgetnstr() functions read at most n bytes, thus preventing a possible overflow of the input buffer.
- getnstr.03
The getnstr(), wgetnstr(), mvgetnstr() and mvwgetnstr() functions will only return the entire multi-byte sequence associated with a character.
- getnstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- getnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- getnstr.06.01
Upon successful completion, these functions return OK.
- getnstr.06.02
Otherwise, they return ERR.
- [+]getstr (4 / 0 / 0)
- getstr.01
The effect of getstr() is as though a series of calls to getch() were made, until a newline, carriage return or end-of-file is received.
- getstr.02 (struct)
The resulting value is placed in the area pointed to by str.
- getstr.03 (struct)
The string is then terminated with a null byte.
- getstr.04
The user's erase and kill characters are interpreted, as well as any special keys (such as function keys, home key, clear key, and so on).
- getstr.06.01
Upon successful completion, these functions return OK.
- getstr.06.02
Otherwise, they return ERR.
- [+]mvgetnstr (7 / 0 / 0)
- mvgetnstr.01
The getnstr(), mvgetnstr(), mvwgetnstr() and wgetnstr() functions read at most n bytes, thus preventing a possible overflow of the input buffer.
- mvgetnstr.02
The mvgetnstr() function is identical to getnstr() except that it is as though it is a call to move() and then a series of calls to getch().
- mvgetnstr.03
The getnstr(), wgetnstr(), mvgetnstr() and mvwgetnstr() functions will only return the entire multi-byte sequence associated with a character.
- mvgetnstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- mvgetnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- mvgetnstr.06.01
Upon successful completion, these functions return OK.
- mvgetnstr.06.02
Otherwise, they return ERR.
- [+]mvgetstr (4 / 0 / 0)
- mvgetstr.01
The mvgetstr() function is identical to getstr() except that it is as though it is a call to move() and then a series of calls to getch().
- mvgetstr.02 (struct)
The resulting value is placed in the area pointed to by str.
- mvgetstr.03 (struct)
The string is then terminated with a null byte.
- mvgetstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- mvgetstr.06.01
Upon successful completion, these functions return OK.
- mvgetstr.06.02
Otherwise, they return ERR.
- [+]mvwgetnstr (7 / 0 / 0)
- mvwgetnstr.01
The getnstr(), mvgetnstr(), mvwgetnstr() and wgetnstr() functions read at most n bytes, thus preventing a possible overflow of the input buffer.
- mvwgetnstr.02
The mvwgetnstr() function is identical to getnstr() except it is as though a call to wmove() is made and then a series of calls to wgetch().
- mvwgetnstr.03
The getnstr(), wgetnstr(), mvgetnstr() and mvwgetnstr() functions will only return the entire multi-byte sequence associated with a character.
- mvwgetnstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- mvwgetnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- mvwgetnstr.06.01
Upon successful completion, these functions return OK.
- mvwgetnstr.06.02
Otherwise, they return ERR.
- [+]mvwgetstr (4 / 0 / 0)
- mvwgetstr.01
The mvwgetstr() function is identical to getstr() except it is as though a call to wmove() is made and then a series of calls to wgetch().
- mvwgetstr.02 (struct)
The resulting value is placed in the area pointed to by str.
- mvwgetstr.03 (struct)
The string is then terminated with a null byte.
- mvwgetstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- mvwgetstr.06.01
Upon successful completion, these functions return OK.
- mvwgetstr.06.02
Otherwise, they return ERR.
- [+]wgetnstr (6 / 0 / 0)
- wgetnstr.01
The getnstr(), mvgetnstr(), mvwgetnstr() and wgetnstr() functions read at most n bytes, thus preventing a possible overflow of the input buffer.
- wgetnstr.03
The getnstr(), wgetnstr(), mvgetnstr() and mvwgetnstr() functions will only return the entire multi-byte sequence associated with a character.
- wgetnstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- wgetnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- wgetnstr.06.01
Upon successful completion, these functions return OK.
- wgetnstr.06.02
Otherwise, they return ERR.
- [+]wgetstr (4 / 0 / 0)
- wgetstr.01
The effect of getstr() is as though a series of calls to getch() were made, until a newline, carriage return or end-of-file is received.
- wgetstr.02 (struct)
The resulting value is placed in the area pointed to by str.
- wgetstr.03 (struct)
The string is then terminated with a null byte.
- wgetstr.04
If the array is large enough to contain at least one character, the functions fill the array with complete characters.
- wgetstr.06.01
Upon successful completion, these functions return OK.
- wgetstr.06.02
Otherwise, they return ERR.
- [+]ncurses.input.timeout (12 / 0 / 0)
- [+]notimeout (6 / 0 / 0)
- notimeout.01
The notimeout() function specifies whether Timeout Mode or No Timeout Mode is in effect for the screen associated with the specified window.
- notimeout.02.01
If bf is TRUE, this screen is set to No Timeout Mode.
- notimeout.02.02
If bf is FALSE, this screen is set to Timeout Mode.
- notimeout.03
The initial state is FALSE.
- notimeout.04.01
Upon successful completion, the notimeout() function returns OK.
- notimeout.04.02
Otherwise, it returns ERR.
- [+]timeout (3 / 0 / 0)
- timeout.01
The timeout() and wtimeout() functions set blocking or non-blocking read for the current or specified window based on the value of delay:
- timeout.01.01
The delay < 0One or more blocking reads (indefinite waits for input) are used.
- timeout.01.02
delay = 0One or more non-blocking reads are used. Any Curses input function will fail if every character of the requested string is not immediately available.
- timeout.01.03
delay > 0Any Curses input function blocks for delay milliseconds and fails if there is still no input.
- [+]wtimeout (3 / 0 / 0)
- wtimeout.01
The timeout() and wtimeout() functions set blocking or non-blocking read for the current or specified window based on the value of delay:
- wtimeout.01.01
The delay < 0One or more blocking reads (indefinite waits for input) are used.
- wtimeout.01.02
delay = 0One or more non-blocking reads are used. Any Curses input function will fail if every character of the requested string is not immediately available.
- wtimeout.01.03
delay > 0Any Curses input function blocks for delay milliseconds and fails if there is still no input.
- [+]ncurses.line (101 / 0 / 0)
- [+]hline (8 / 0 / 0)
- hline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- hline.02
The line is at most n positions long, or as many as fit into the window.
- hline.03
These functions do not advance the cursor position.
- hline.04
These functions do not perform special character processing.
- hline.05
These functions do not perform wrapping.
- hline.06
The hline(), mvhline(), mvwhline() and whline() functions draw a line proceeding toward the last column of the same line.
- hline.07.01
Upon successful completion, these functions return OK.
- hline.07.02
Otherwise, they return ERR.
- [+]insdelln (7 / 0 / 0)
- insdelln.01
The insdelln() and winsdelln() functions perform the following actions:
- insdelln.01.01
If n is positive, these functions insert n lines into the current or specified window before the current line.
- insdelln.01.02
The n last lines are no longer displayed.
- insdelln.02.01
If n is negative, these functions delete n lines from the current or specified window starting with the current line, and move the remaining lines toward the cursor.
- insdelln.02.02
The last n lines are cleared.
- insdelln.03
The current cursor position remains the same.
- insdelln.04.01
Upon successful completion, these functions return OK.
- insdelln.04.02
Otherwise, they return ERR.
- [+]insertln (5 / 0 / 0)
- insertln.01
The insertln() and winsertln() functions insert a blank line before the current line in the current or specified window.
- insertln.02
The bottom line is no longer displayed.
- insertln.03
The cursor position does not change.
- insertln.04.01
Upon successful completion, these functions return OK.
- insertln.04.02
Otherwise, they return ERR.
- [+]mvhline (8 / 0 / 0)
- mvhline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- mvhline.02
The line is at most n positions long, or as many as fit into the window.
- mvhline.03
These functions do not advance the cursor position.
- mvhline.04
These functions do not perform special character processing.
- mvhline.05
These functions do not perform wrapping.
- mvhline.06
The hline(), mvhline(), mvwhline() and whline() functions draw a line proceeding toward the last column of the same line.
- mvhline.07.01
Upon successful completion, these functions return OK.
- mvhline.07.02
Otherwise, they return ERR.
- [+]mvvline (8 / 0 / 0)
- mvvline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- mvvline.02
The line is at most n positions long, or as many as fit into the window.
- mvvline.03
These functions do not advance the cursor position.
- mvvline.04
These functions do not perform special character processing.
- mvvline.05
These functions do not perform wrapping.
- mvvline.06
The vline(), mvvline(), mvwvline() and wvline() functions draw a line proceeding toward the last line of the window.
- mvvline.07.01
Upon successful completion, these functions return OK.
- mvvline.07.02
Otherwise, they return ERR.
- [+]mvwhline (8 / 0 / 0)
- mvwhline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- mvwhline.02
The line is at most n positions long, or as many as fit into the window.
- mvwhline.03
These functions do not advance the cursor position.
- mvwhline.04
These functions do not perform special character processing.
- mvwhline.05
These functions do not perform wrapping.
- mvwhline.06
The hline(), mvhline(), mvwhline() and whline() functions draw a line proceeding toward the last column of the same line.
- mvwhline.07.01
Upon successful completion, these functions return OK.
- mvwhline.07.02
Otherwise, they return ERR.
- [+]mvwvline (8 / 0 / 0)
- mvwvline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- mvwvline.02
The line is at most n positions long, or as many as fit into the window.
- mvwvline.03
These functions do not advance the cursor position.
- mvwvline.04
These functions do not perform special character processing.
- mvwvline.05
These functions do not perform wrapping.
- mvwvline.06
The vline(), mvvline(), mvwvline() and wvline() functions draw a line proceeding toward the last line of the window.
- mvwvline.07.01
Upon successful completion, these functions return OK.
- mvwvline.07.02
Otherwise, they return ERR.
- [+]ripoffline (13 / 0 / 0)
- ripoffline.01
The ripoffline() function reserves a screen line for use by the application.
- app.ripoffline.02
Any call to ripoffline() must precede the call to initscr() or newterm().
- ripoffline.03.01
If line is positive, one line is removed from the beginning of stdscr;
- ripoffline.03.02
if line is negative, one line is removed from the end.
- ripoffline.04
Removal occurs during the subsequent call to initscr() or newterm().
- ripoffline.05.all_called
When the subsequent call is made, the function pointed to by init is called with two arguments: a WINDOW pointer to the one-line window that has been allocated and an integer with the number of columns in the window.
- ripoffline.05.columns
When the subsequent call is made, the function pointed to by init is called with two arguments: a WINDOW pointer to the one-line window that has been allocated and an integer with the number of columns in the window.
- ripoffline.05.init
When the subsequent call is made, the function pointed to by init is called with two arguments: a WINDOW pointer to the one-line window that has been allocated and an integer with the number of columns in the window.
- ripoffline.05.one_line
When the subsequent call is made, the function pointed to by init is called with two arguments: a WINDOW pointer to the one-line window that has been allocated and an integer with the number of columns in the window.
- ripoffline.05.window
When the subsequent call is made, the function pointed to by init is called with two arguments: a WINDOW pointer to the one-line window that has been allocated and an integer with the number of columns in the window.
- app.ripoffline.06
The initialisation function cannot use the LINES and COLS external variables and cannot call wrefresh() or doupdate(),
- ripoffline.07
Up to five lines can be ripped off.
- ripoffline.08
Calls to ripoffline() above this limit have no effect but report success.
- ripoffline.09
The ripoffline() function returns OK.
- ripoffline.10
but may call wnoutrefresh().
- [+]vline (8 / 0 / 0)
- vline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- vline.02
The line is at most n positions long, or as many as fit into the window.
- vline.03
These functions do not advance the cursor position.
- vline.04
These functions do not perform special character processing.
- vline.05
These functions do not perform wrapping.
- vline.06
The vline(), mvvline(), mvwvline() and wvline() functions draw a line proceeding toward the last line of the window.
- vline.07.01
Upon successful completion, these functions return OK.
- vline.07.02
Otherwise, they return ERR.
- [+]whline (8 / 0 / 0)
- whline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- whline.02
The line is at most n positions long, or as many as fit into the window.
- whline.03
These functions do not advance the cursor position.
- whline.04
These functions do not perform special character processing.
- whline.05
These functions do not perform wrapping.
- whline.06
The hline(), mvhline(), mvwhline() and whline() functions draw a line proceeding toward the last column of the same line.
- whline.07.01
Upon successful completion, these functions return OK.
- whline.07.02
Otherwise, they return ERR.
- [+]winsdelln (7 / 0 / 0)
- winsdelln.01
The insdelln() and winsdelln() functions perform the following actions:
- winsdelln.01.01
If n is positive, these functions insert n lines into the current or specified window before the current line.
- winsdelln.01.02
The n last lines are no longer displayed.
- winsdelln.02.01
If n is negative, these functions delete n lines from the current or specified window starting with the current line, and move the remaining lines toward the cursor.
- winsdelln.02.02
The last n lines are cleared.
- winsdelln.03
The current cursor position remains the same.
- winsdelln.04.01
Upon successful completion, these functions return OK.
- winsdelln.04.02
Otherwise, they return ERR.
- [+]winsertln (5 / 0 / 0)
- winsertln.01
The insertln() and winsertln() functions insert a blank line before the current line in the current or specified window.
- winsertln.02
The bottom line is no longer displayed.
- winsertln.03
The cursor position does not change.
- winsertln.04.01
Upon successful completion, these functions return OK.
- winsertln.04.02
Otherwise, they return ERR.
- [+]wvline (8 / 0 / 0)
- wvline.01
These functions draw a line in the current or specified window starting at the current or specified position, using ch.
- wvline.02
The line is at most n positions long, or as many as fit into the window.
- wvline.03
These functions do not advance the cursor position.
- wvline.04
These functions do not perform special character processing.
- wvline.05
These functions do not perform wrapping.
- wvline.06
The vline(), mvvline(), mvwvline() and wvline() functions draw a line proceeding toward the last line of the window.
- wvline.07.01
Upon successful completion, these functions return OK.
- wvline.07.02
Otherwise, they return ERR.
- [+]ncurses.misc (29 / 0 / 0)
- [+]baudrate (2 / 0 / 0)
- baudrate.01
The baudrate() function extracts the output speed of the terminal in bits per second.
- baudrate.02
The baudrate() function returns the output speed of the terminal.
- [+]beep (5 / 0 / 0)
- beep.01
The beep() function alerts the user.
Generalizes:
- beep.02.01
- beep.02.02
- beep.03
- beep.04
- beep.02.01
It sounds the audible alarm on the terminal,
- beep.02.02
or if that is not possible, it flashes the screen (visible bell).
- beep.03
If neither signal is possible, nothing happens.
- beep.04
The beep() function always returns OK.
- [+]flash (4 / 0 / 0)
- flash.01
The flash() function alerts the user.
Generalizes:
- flash.02
- flash.03
- flash.04
- flash.02
It flashes the screen, or if that is not possible, it sounds the audible alarm on the terminal.
- flash.03
If neither signal is possible, nothing happens.
- flash.04
The flash() function always returns OK.
- [+]keyname (6 / 0 / 0)
- keyname.01
The keyname() and key_name() functions generate a character string whose value describes the key c.
- keyname.02
The c argument of keyname() can be an 8-bit character or a key code.
- keyname.03
The string has a format according to the first applicable row in the following table: Input Format of Returned String Visible character The same character Control character ^X Meta-character (keyname() only) M-X Key value defined in <curses.h> (keyname() only) KEY_name None of the above UNKNOWN KEY
- keyname.04
The meta-character notation shown above is used only if meta-characters are enabled.
- keyname.05.01
Upon successful completion, keyname() returns a pointer to a string as described above.
- keyname.05.02
Otherwise, it returns a null pointer.
- [+]napms (2 / 0 / 0)
- napms.01
The napms() function takes at least ms milliseconds to return.
- napms.02
The napms() function returns OK.
- [+]typeahead (6 / 0 / 0)
- typeahead.01
The typeahead() function controls the detection of typeahead during a refresh, based on the value of fildes:
- typeahead.01.01.01
If fildes is a valid file descriptor, typeahead is enabled during refresh;
- typeahead.01.01.02
Curses periodically checks fildes for input and aborts the refresh if any character is available. (This is the initial setting, and the typeahead file descriptor corresponds to the input file associated with the screen created by initscr() or newterm().)
- typeahead.01.01.03
The value of fildes need not be the file descriptor on which the refresh is occurring.
- typeahead.01.02
If fildes is -1, Curses does not check for typeahead during refresh.
- typeahead.02.01
Upon successful completion, typeahead() returns OK.
- typeahead.02.02
Otherwise, it returns ERR.
- [+]unctrl (4 / 0 / 0)
- unctrl.01
The unctrl() function generates a character string that is a printable representation of c.
- unctrl.02.01
If c is a control character, it is converted to the ^X notation.
- app.unctrl.02.02
If c contains rendition information, the effect is undefined.
- unctrl.03.01
Upon successful completion, unctrl() returns the generated string.
- unctrl.03.02
Otherwise, it returns a null pointer.
- [+]ncurses.mode (22 / 0 / 0)
- [+]def_prog_mode (4 / 0 / 0)
- def_prog_mode.01
The def_prog_mode() function saves the current terminal modes as the "program" (in Curses) state for use by reset_prog_mode().
- def_prog_mode.02
These functions affect the mode of the terminal associated with the current screen.
- def_prog_mode.03.01
Upon successful completion, these functions return OK.
- def_prog_mode.03.02
Otherwise, they return ERR.
- [+]def_shell_mode (4 / 0 / 0)
- def_shell_mode.01
The def_shell_mode() function saves the current terminal modes as the "shell" (not in Curses) state for use by reset_shell_mode().
- def_shell_mode.02
These functions affect the mode of the terminal associated with the current screen.
- def_shell_mode.03.01
Upon successful completion, these functions return OK.
- def_shell_mode.03.02
Otherwise, they return ERR.
- [+]reset_prog_mode (4 / 0 / 0)
- reset_prog_mode.01
The reset_prog_mode() function restores the terminal to the "program" (in Curses) state.
- reset_prog_mode.02
These functions affect the mode of the terminal associated with the current screen.
- reset_prog_mode.03.01
Upon successful completion, these functions return OK.
- reset_prog_mode.03.02
Otherwise, they return ERR.
- [+]reset_shell_mode (4 / 0 / 0)
- reset_shell_mode.01
The reset_shell_mode() function restores the terminal to the "shell" (not in Curses) state.
- reset_shell_mode.02
These functions affect the mode of the terminal associated with the current screen.
- reset_shell_mode.03.01
Upon successful completion, these functions return OK.
- reset_shell_mode.03.02
Otherwise, they return ERR.
- [+]resetty (3 / 0 / 0)
- resetty.01
The resetty() function restores the program mode as of the most recent call to savetty().
- resetty.02.01
Upon successful completion, these functions return OK.
- resetty.02.02
Otherwise, they return ERR.
- [+]savetty (3 / 0 / 0)
- savetty.01
The savetty() function saves the state that would be put in place by a call to reset_prog_mode().
- savetty.02.01
Upon successful completion, these functions return OK.
- savetty.02.02
Otherwise, they return ERR.
- [+]ncurses.move (17 / 0 / 0)
- [+]move (4 / 0 / 0)
- move.01
The move() and wmove() functions move the cursor associated with the current or specified window to (y, x) relative to the window's origin.
- move.02
This function does not move the terminal's cursor until the next refresh operation.
- move.03.01
Upon successful completion, these functions return OK.
- move.03.02
Otherwise, they return ERR.
- [+]mvcur (9 / 0 / 0)
- mvcur.01
The mvcur() function outputs one or more commands to the terminal that move the terminal's cursor to (newrow, newcol), an absolute position on the terminal screen.
- mvcur.02
The (oldrow, oldcol) arguments specify the former cursor position.
- mvcur.03.01
Specifying the former position is necessary on terminals that do not provide coordinate-based movement commands
- mvcur.03.02
On terminals that provide these commands, Curses may select a more efficient way to move the cursor based on the former position.
- mvcur.04
If (newrow, newcol) is not a valid address for the terminal in use, mvcur() fails.
- mvcur.05
If (oldrow, oldcol) is the same as (newrow, newcol), then mvcur() succeeds without taking any action.
- mvcur.06
If mvcur() outputs a cursor movement command, it updates its information concerning the location of the cursor on the terminal.
- mvcur.07.01
Upon successful completion, mvcur() returns OK.
- mvcur.07.02
Otherwise, it returns ERR.
- [+]wmove (4 / 0 / 0)
- wmove.01
The move() and wmove() functions move the cursor associated with the current or specified window to (y, x) relative to the window's origin.
- wmove.02
This function does not move the terminal's cursor until the next refresh operation.
- wmove.03.01
Upon successful completion, these functions return OK.
- wmove.03.02
Otherwise, they return ERR.
- [+]ncurses.screen (16 / 0 / 0)
- [+]scr_dump (3 / 0 / 0)
- scr_dump.01
The scr_dump() function writes the current contents of the virtual screen to the file named by filename in an unspecified format.
- scr_dump.03.01
On successful completion, these functions return OK.
- scr_dump.03.02
Otherwise, they return ERR.
- [+]scr_init (5 / 0 / 0)
- scr_init.01
The scr_init() function reads the contents of the file named by filename and uses them to initialise the Curses data structures to what the terminal currently has on its screen.
- scr_init.02
The next refresh operation bases any updates on this information, unless either of the following conditions is true:
- scr_init.02.01
The terminal has been written to since the virtual screen was dumped to filename
- scr_init.02.02
The terminfo capabilities rmcup and nrrmc are defined for the current terminal.
- scr_init.03.01
On successful completion, these functions return OK.
- scr_init.03.02
Otherwise, they return ERR.
- [+]scr_restore (4 / 0 / 0)
- scr_restore.01
The scr_restore() function sets the virtual screen to the contents of the file named by filename, which must have been written using scr_dump().
- scr_restore.02
The next refresh operation restores the screen to the way it looked in the dump file.
- scr_restore.03.01
On successful completion, these functions return OK.
- scr_restore.03.02
Otherwise, they return ERR.
- [+]scr_set (4 / 0 / 0)
- scr_set.01
The scr_set() function is a combination of scr_restore() and scr_init().
- scr_set.02
It tells the program that the information in the file named by filename is what is currently on the screen, and also what the program wants on the screen. This can be thought of as a screen inheritance function.
- scr_set.03.01
On successful completion, these functions return OK.
- scr_set.03.02
Otherwise, they return ERR.
- [+]ncurses.slk (53 / 0 / 0)
- [+]slk_attr_set (3 / 0 / 0)
- slk_attr_set.04
The slk_attr_off(), slk_attr_on(), slk_attr_set(), and slk_color() functions correspond to slk_attroff(), slk_attron(), slk_attrset() and color_set() and thus support the attribute constants with the WA_ prefix and colour.
- app.slk_attr_set.05
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
- slk_attr_set.09.01
Upon successful completion, the other functions return OK.
- slk_attr_set.09.02
Otherwise, they return ERR.
- [+]slk_attroff (4 / 0 / 0)
- slk_attroff.04
The slk_attron(), slk_attrset() and slk_attroff() functions correspond to attron(), attrset(), and attroff().
- slk_attroff.05
They have an effect only if soft labels are simulated on the bottom line of the screen.
- slk_attroff.09.01
Upon successful completion, the other functions return OK.
- slk_attroff.09.02
Otherwise, they return ERR.
- [+]slk_attron (4 / 0 / 0)
- slk_attron.04
The slk_attron(), slk_attrset() and slk_attroff() functions correspond to attron(), attrset(), and attroff().
- slk_attron.05
They have an effect only if soft labels are simulated on the bottom line of the screen.
- slk_attron.09.01
Upon successful completion, the other functions return OK.
- slk_attron.09.02
Otherwise, they return ERR.
- [+]slk_attrset (4 / 0 / 0)
- slk_attrset.04
The slk_attron(), slk_attrset() and slk_attroff() functions correspond to attron(), attrset(), and attroff().
- slk_attrset.05
They have an effect only if soft labels are simulated on the bottom line of the screen.
- slk_attrset.09.01
Upon successful completion, the other functions return OK.
- slk_attrset.09.02
Otherwise, they return ERR.
- [+]slk_clear (3 / 0 / 0)
- slk_clear.04
The slk_clear() function immediately clears the soft labels from the screen.
- slk_clear.09.01
Upon successful completion, the other functions return OK.
- slk_clear.09.02
Otherwise, they return ERR.
- [+]slk_color (3 / 0 / 0)
- slk_color.04
The slk_attr_off(), slk_attr_on(), slk_attr_set(), and slk_color() functions correspond to slk_attroff(), slk_attron(), slk_attrset() and color_set() and thus support the attribute constants with the WA_ prefix and colour.
- slk_color.09.01
Upon successful completion, the other functions return OK.
- slk_color.09.02
Otherwise, they return ERR.
- [+]slk_init (6 / 0 / 0)
- app.slk_init.04
To use soft labels, slk_init() must be called before initscr(), newterm() or ripoffline() is called.
- slk_init.05
If initscr() eventually uses a line from stdscr to emulate the soft labels, then fmt determines how the labels are arranged on the screen.
- slk_init.06.01
Setting fmt to 0 indicates a 3-2-3 arrangement of the labels;
- slk_init.06.02
1 indicates a 4-4 arrangement.
- app.slk_init.07
Other values for fmt are unspecified.
- slk_init.08
The slk_init() function has the effect of calling ripoffline() to reserve one screen line to accommodate the requested format.
- slk_init.09.01
Upon successful completion, the other functions return OK.
- slk_init.09.02
Otherwise, they return ERR.
- [+]slk_label (4 / 0 / 0)
- slk_label.03
There can be up to eight labels of up to eight display columns each.
- slk_label.04
The slk_label() function obtains soft label number labnum.
- slk_label.05.01
Upon successful completion, slk_label() returns the requested label with leading and trailing blanks stripped.
- slk_label.05.02
Otherwise, it returns a null pointer.
- [+]slk_noutrefresh (3 / 0 / 0)
- slk_noutrefresh.04
The slk_refresh() and slk_noutrefresh() functions correspond to the wrefresh() and wnoutrefresh() functions.
- slk_noutrefresh.09.01
Upon successful completion, the other functions return OK.
- slk_noutrefresh.09.02
Otherwise, they return ERR.
- [+]slk_refresh (3 / 0 / 0)
- slk_refresh.04
The slk_refresh() and slk_noutrefresh() functions correspond to the wrefresh() and wnoutrefresh() functions.
- slk_refresh.09.01
Upon successful completion, the other functions return OK.
- slk_refresh.09.02
Otherwise, they return ERR.
- [+]slk_restore (3 / 0 / 0)
- slk_restore.04
The slk_restore() function immediately restores the soft labels to the screen after a call to slk_clear().
- slk_restore.09.01
Upon successful completion, the other functions return OK.
- slk_restore.09.02
Otherwise, they return ERR.
- [+]slk_set (10 / 0 / 0)
- slk_set.03
There can be up to eight labels of up to eight display columns each.
- slk_set.04
The slk_set() and slk_wset() functions specify the text of soft label number labnum, within the range from 1 to and including 8.
- slk_set.05
The label argument is the string to be put on the label.
- slk_set.06
With slk_set(), and slk_wset(), the width of the label is limited to eight column positions.
- slk_set.07
A null string or a null pointer specifies a blank label.
- slk_set.08
The justify argument can have the following values to indicate how to justify label within the space reserved for it:
- slk_set.08.01
0Align the start of label with the start of the space
- slk_set.08.02
1Center label within the space
- slk_set.08.03
2Align the end of label with the end of the space
- slk_set.09.01
Upon successful completion, the other functions return OK.
- slk_set.09.02
Otherwise, they return ERR.
- [+]slk_touch (3 / 0 / 0)
- slk_touch.04
The slk_touch() function forces all the soft labels to be output the next time slk_noutrefresh() or slk_refresh() is called.
- slk_touch.09.01
Upon successful completion, the other functions return OK.
- slk_touch.09.02
Otherwise, they return ERR.
- [+]ncurses.string.add (64 / 0 / 0)
- [+]addnstr (9 / 0 / 0)
- addnstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- addnstr.02
These functions advance the cursor position.
- addnstr.03
These functions perform special character processing.
- addnstr.04
These functions perform wrapping.
- addnstr.05
The addnstr(), mvaddnstr(), mvwaddnstr() and waddnstr() functions use at most n bytes from str.
- addnstr.06
These functions add the entire string when n is -1.
- addnstr.07
These functions are similar to calling mbstowcs() on the first n bytes of str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- addnstr.08.01
Upon successful completion, these functions return OK.
- addnstr.08.02
Otherwise, they return ERR.
- [+]addstr (7 / 0 / 0)
- addstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- addstr.02
These functions advance the cursor position.
- addstr.03
These functions perform special character processing.
- addstr.04
These functions perform wrapping.
- addstr.05
The addstr(), mvaddstr(), mvwaddstr() and waddstr() functions are similar to calling mbstowcs() on str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- addstr.08.01
Upon successful completion, these functions return OK.
- addstr.08.02
Otherwise, they return ERR.
- [+]mvaddnstr (9 / 0 / 0)
- mvaddnstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- mvaddnstr.02
These functions advance the cursor position.
- mvaddnstr.03
These functions perform special character processing.
- mvaddnstr.04
These functions perform wrapping.
- mvaddnstr.05
The addnstr(), mvaddnstr(), mvwaddnstr() and waddnstr() functions use at most n bytes from str.
- mvaddnstr.06
These functions add the entire string when n is -1.
- mvaddnstr.07
These functions are similar to calling mbstowcs() on the first n bytes of str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- mvaddnstr.08.01
Upon successful completion, these functions return OK.
- mvaddnstr.08.02
Otherwise, they return ERR.
- [+]mvaddstr (7 / 0 / 0)
- mvaddstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- mvaddstr.02
These functions advance the cursor position.
- mvaddstr.03
These functions perform special character processing.
- mvaddstr.04
These functions perform wrapping.
- mvaddstr.05
The addstr(), mvaddstr(), mvwaddstr() and waddstr() functions are similar to calling mbstowcs() on str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- mvaddstr.08.01
Upon successful completion, these functions return OK.
- mvaddstr.08.02
Otherwise, they return ERR.
- [+]mvwaddnstr (9 / 0 / 0)
- mvwaddnstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- mvwaddnstr.02
These functions advance the cursor position.
- mvwaddnstr.03
These functions perform special character processing.
- mvwaddnstr.04
These functions perform wrapping.
- mvwaddnstr.05
The addnstr(), mvaddnstr(), mvwaddnstr() and waddnstr() functions use at most n bytes from str.
- mvwaddnstr.06
These functions add the entire string when n is -1.
- mvwaddnstr.07
These functions are similar to calling mbstowcs() on the first n bytes of str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- mvwaddnstr.08.01
Upon successful completion, these functions return OK.
- mvwaddnstr.08.02
Otherwise, they return ERR.
- [+]mvwaddstr (7 / 0 / 0)
- mvwaddstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- mvwaddstr.02
These functions advance the cursor position.
- mvwaddstr.03
These functions perform special character processing.
- mvwaddstr.04
These functions perform wrapping.
- mvwaddstr.05
The addstr(), mvaddstr(), mvwaddstr() and waddstr() functions are similar to calling mbstowcs() on str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- mvwaddstr.08.01
Upon successful completion, these functions return OK.
- mvwaddstr.08.02
Otherwise, they return ERR.
- [+]waddnstr (9 / 0 / 0)
- waddnstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- waddnstr.02
These functions advance the cursor position.
- waddnstr.03
These functions perform special character processing.
- waddnstr.04
These functions perform wrapping.
- waddnstr.05
The addnstr(), mvaddnstr(), mvwaddnstr() and waddnstr() functions use at most n bytes from str.
- waddnstr.06
These functions add the entire string when n is -1.
- waddnstr.07
These functions are similar to calling mbstowcs() on the first n bytes of str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- waddnstr.08.01
Upon successful completion, these functions return OK.
- waddnstr.08.02
Otherwise, they return ERR.
- [+]waddstr (7 / 0 / 0)
- waddstr.01
These functions write the characters of the string str on the current or specified window starting at the current or specified position using the background rendition.
- waddstr.02
These functions advance the cursor position.
- waddstr.03
These functions perform special character processing.
- waddstr.04
These functions perform wrapping.
- waddstr.05
The addstr(), mvaddstr(), mvwaddstr() and waddstr() functions are similar to calling mbstowcs() on str, and then calling addwstr(), mvaddwstr(), mvwaddwstr() and waddwstr(), respectively.
- waddstr.08.01
Upon successful completion, these functions return OK.
- waddstr.08.02
Otherwise, they return ERR.
- [+]ncurses.string.input (40 / 0 / 0)
- [+]innstr (7 / 0 / 0)
- innstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- innstr.02
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions store at most n bytes in the string pointed to by str.
- innstr.03
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions will only store the entire multi-byte sequence associated with a character.
- innstr.04
If the array is large enough to contain at least one character the array is filled with complete characters.
- innstr.05
If the array is not large enough to contain any complete characters, the function fails.
- innstr.06.01
Upon successful completion, innstr(), mvinnstr(), mvwinnstr() and winnstr() return the number of characters actually read into the string.
- innstr.06.02
Otherwise, all these functions return ERR.
- [+]instr (3 / 0 / 0)
- instr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- instr.06.01
Upon successful completion, instr(), mvinstr(), mvwinstr() and winstr() return OK.
- instr.06.02
Otherwise, all these functions return ERR.
- [+]mvinnstr (7 / 0 / 0)
- mvinnstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- mvinnstr.02
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions store at most n bytes in the string pointed to by str.
- mvinnstr.03
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions will only store the entire multi-byte sequence associated with a character.
- mvinnstr.04
If the array is large enough to contain at least one character the array is filled with complete characters.
- mvinnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- mvinnstr.06.01
Upon successful completion, innstr(), mvinnstr(), mvwinnstr() and winnstr() return the number of characters actually read into the string.
- mvinnstr.06.02
Otherwise, all these functions return ERR.
- [+]mvinstr (3 / 0 / 0)
- mvinstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- mvinstr.06.01
Upon successful completion, instr(), mvinstr(), mvwinstr() and winstr() return OK.
- mvinstr.06.02
Otherwise, all these functions return ERR.
- [+]mvwinnstr (7 / 0 / 0)
- mvwinnstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- mvwinnstr.02
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions store at most n bytes in the string pointed to by str.
- mvwinnstr.03
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions will only store the entire multi-byte sequence associated with a character.
- mvwinnstr.04
If the array is large enough to contain at least one character the array is filled with complete characters.
- mvwinnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- mvwinnstr.06.01
Upon successful completion, innstr(), mvinnstr(), mvwinnstr() and winnstr() return the number of characters actually read into the string.
- mvwinnstr.06.02
Otherwise, all these functions return ERR.
- [+]mvwinstr (3 / 0 / 0)
- mvwinstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- mvwinstr.06.01
Upon successful completion, instr(), mvinstr(), mvwinstr() and winstr() return OK.
- mvwinstr.06.02
Otherwise, all these functions return ERR.
- [+]winnstr (7 / 0 / 0)
- winnstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- winnstr.02
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions store at most n bytes in the string pointed to by str.
- winnstr.03
The innstr(), mvinnstr(), mvwinnstr() and winnstr() functions will only store the entire multi-byte sequence associated with a character.
- winnstr.04
If the array is large enough to contain at least one character the array is filled with complete characters.
- winnstr.05
If the array is not large enough to contain any complete characters, the function fails.
- winnstr.06.01
Upon successful completion, innstr(), mvinnstr(), mvwinnstr() and winnstr() return the number of characters actually read into the string.
- winnstr.06.02
Otherwise, all these functions return ERR.
- [+]winstr (3 / 0 / 0)
- winstr.01
These functions place a string of characters from the current or specified window into the array pointed to by str, starting at the current or specified position and ending at the end of the line.
- winstr.06.01
Upon successful completion, instr(), mvinstr(), mvwinstr() and winstr() return OK.
- winstr.06.02
Otherwise, all these functions return ERR.
- [+]ncurses.string.insert (52 / 0 / 0)
- [+]insnstr (8 / 0 / 0)
- insnstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- insnstr.02
These functions do not advance the cursor position.
- insnstr.03
These functions perform special-character processing.
- insnstr.04
The insnstr() and winsnstr() functions perform wrapping.
- insnstr.05
The insnstr(), mvinsnstr(), mvwinsnstr() and winsnstr() functions insert at most n bytes.
- insnstr.06
If n is less than 1, the entire string is inserted.
- insnstr.07.01
Upon successful completion, these functions return OK.
- insnstr.07.02
Otherwise, they return ERR.
- [+]insstr (6 / 0 / 0)
- insstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- insstr.02
These functions do not advance the cursor position.
- insstr.03
These functions perform special-character processing.
- insstr.04
The insstr() and winsstr() functions do not perform wrapping.
- insstr.07.01
Upon successful completion, these functions return OK.
- insstr.07.02
Otherwise, they return ERR.
- [+]mvinsnstr (7 / 0 / 0)
- mvinsnstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- mvinsnstr.02
These functions do not advance the cursor position.
- mvinsnstr.03
These functions perform special-character processing.
- mvinsnstr.05
The insnstr(), mvinsnstr(), mvwinsnstr() and winsnstr() functions insert at most n bytes.
- mvinsnstr.06
If n is less than 1, the entire string is inserted.
- mvinsnstr.07.01
Upon successful completion, these functions return OK.
- mvinsnstr.07.02
Otherwise, they return ERR.
- [+]mvinsstr (5 / 0 / 0)
- mvinsstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- mvinsstr.02
These functions do not advance the cursor position.
- mvinsstr.03
These functions perform special-character processing.
- mvinsstr.07.01
Upon successful completion, these functions return OK.
- mvinsstr.07.02
Otherwise, they return ERR.
- [+]mvwinsnstr (7 / 0 / 0)
- mvwinsnstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- mvwinsnstr.02
These functions do not advance the cursor position.
- mvwinsnstr.03
These functions perform special-character processing.
- mvwinsnstr.05
The insnstr(), mvinsnstr(), mvwinsnstr() and winsnstr() functions insert at most n bytes.
- mvwinsnstr.06
If n is less than 1, the entire string is inserted.
- mvwinsnstr.07.01
Upon successful completion, these functions return OK.
- mvwinsnstr.07.02
Otherwise, they return ERR.
- [+]mvwinsstr (5 / 0 / 0)
- mvwinsstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- mvwinsstr.02
These functions do not advance the cursor position.
- mvwinsstr.03
These functions perform special-character processing.
- mvwinsstr.07.01
Upon successful completion, these functions return OK.
- mvwinsstr.07.02
Otherwise, they return ERR.
- [+]winsnstr (8 / 0 / 0)
- winsnstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- winsnstr.02
These functions do not advance the cursor position.
- winsnstr.03
These functions perform special-character processing.
- winsnstr.04
The insnstr() and winsnstr() functions perform wrapping.
- winsnstr.05
The insnstr(), mvinsnstr(), mvwinsnstr() and winsnstr() functions insert at most n bytes.
- winsnstr.06
If n is less than 1, the entire string is inserted.
- winsnstr.07.01
Upon successful completion, these functions return OK.
- winsnstr.07.02
Otherwise, they return ERR.
- [+]winsstr (6 / 0 / 0)
- winsstr.01
These functions insert a character string (as many characters as will fit on the line) before the current or specified position in the current or specified window.
- winsstr.02
These functions do not advance the cursor position.
- winsstr.03
These functions perform special-character processing.
- winsstr.04
The insstr() and winsstr() functions do not perform wrapping.
- winsstr.07.01
Upon successful completion, these functions return OK.
- winsstr.07.02
Otherwise, they return ERR.
- [+]ncurses.string.printf (24 / 0 / 0)
- [+]mvprintw (4 / 0 / 0)
- mvprintw.01
The mvprintw(), mvwprintw(), printw() and wprintw() functions are analogous to printf().
- mvprintw.02
The effect of these functions is as though sprintf() were used to format the string, and then waddstr() were used to add that multi-byte string to the current or specified window at the current or specified cursor position.
- mvprintw.03.01
Upon successful completion, these functions return OK.
- mvprintw.03.02
Otherwise, they return ERR.
- [+]mvwprintw (4 / 0 / 0)
- mvwprintw.01
The mvprintw(), mvwprintw(), printw() and wprintw() functions are analogous to printf().
- mvwprintw.02
The effect of these functions is as though sprintf() were used to format the string, and then waddstr() were used to add that multi-byte string to the current or specified window at the current or specified cursor position.
- mvwprintw.03.01
Upon successful completion, these functions return OK.
- mvwprintw.03.02
Otherwise, they return ERR.
- [+]printw (4 / 0 / 0)
- printw.01
The mvprintw(), mvwprintw(), printw() and wprintw() functions are analogous to printf().
- printw.02
The effect of these functions is as though sprintf() were used to format the string, and then waddstr() were used to add that multi-byte string to the current or specified window at the current or specified cursor position.
- printw.03.01
Upon successful completion, these functions return OK.
- printw.03.02
Otherwise, they return ERR.
- [+]vw_printw (4 / 0 / 0)
- vw_printw.01
The vw_printw() function achieves the same effect as wprintw() using a variable argument list.
- vw_printw.02
The third argument is a va_list, as defined in <stdarg.h>.
- vw_printw.03.01
Upon successful completion, vw_printw() returns OK.
- vw_printw.03.02
Otherwise, it returns ERR.
- [+]vwprintw (4 / 0 / 0)
- vwprintw.01
The vwprintw() function achieves the same effect as wprintw() using a variable argument list.
- vwprintw.02
The third argument is a va_list, as defined in <varargs.h>.
- vwprintw.03.01
Upon successful completion, vwprintw() returns OK.
- vwprintw.03.02
Otherwise, it returns ERR.
- [+]wprintw (4 / 0 / 0)
- wprintw.01
The mvprintw(), mvwprintw(), printw() and wprintw() functions are analogous to printf().
- wprintw.02
The effect of these functions is as though sprintf() were used to format the string, and then waddstr() were used to add that multi-byte string to the current or specified window at the current or specified cursor position.
- wprintw.03.01
Upon successful completion, these functions return OK.
- wprintw.03.02
Otherwise, they return ERR.
- [+]ncurses.string.scanf (24 / 0 / 0)
- [+]mvscanw (4 / 0 / 0)
- mvscanw.01
These functions are similar to scanf().
- mvscanw.02
Their effect is as though mvwgetstr() were called to get a multi-byte character string from the current or specified window at the current or specified cursor position, and then sscanf() were used to interpret and convert that string.
- mvscanw.03.01
Upon successful completion, these functions return OK.
- mvscanw.03.02
Otherwise, they return ERR.
- [+]mvwscanw (4 / 0 / 0)
- mvwscanw.01
These functions are similar to scanf().
- mvwscanw.02
Their effect is as though mvwgetstr() were called to get a multi-byte character string from the current or specified window at the current or specified cursor position, and then sscanf() were used to interpret and convert that string.
- mvwscanw.03.01
Upon successful completion, these functions return OK.
- mvwscanw.03.02
Otherwise, they return ERR.
- [+]scanw (4 / 0 / 0)
- scanw.01
These functions are similar to scanf().
- scanw.02
Their effect is as though mvwgetstr() were called to get a multi-byte character string from the current or specified window at the current or specified cursor position, and then sscanf() were used to interpret and convert that string.
- scanw.03.01
Upon successful completion, these functions return OK.
- scanw.03.02
Otherwise, they return ERR.
- [+]vw_scanw (4 / 0 / 0)
- vw_scanw.01
The vw_scanw() function achieves the same effect as wscanw() using a variable argument list.
- vw_scanw.02
The third argument is a va_list, as defined in <stdarg.h>.
- vw_scanw.03.01
Upon successful completion, vw_scanw() returns OK.
- vw_scanw.03.02
Otherwise, it returns ERR.
- [+]vwscanw (4 / 0 / 0)
- vwscanw.mvscanw.01
These functions are similar to scanf().
- vwscanw.mvscanw.02
Their effect is as though mvwgetstr() were called to get a multi-byte character string from the current or specified window at the current or specified cursor position, and then sscanf() were used to interpret and convert that string.
- vwscanw.mvscanw.03.01
Upon successful completion, these functions return OK.
- vwscanw.mvscanw.03.02
Otherwise, they return ERR.
- [+]wscanw (4 / 0 / 0)
- wscanw.01
These functions are similar to scanf().
- wscanw.02
Their effect is as though mvwgetstr() were called to get a multi-byte character string from the current or specified window at the current or specified cursor position, and then sscanf() were used to interpret and convert that string.
- wscanw.03.01
Upon successful completion, these functions return OK.
- wscanw.03.02
Otherwise, they return ERR.
- [+]ncurses.terminal.control (77 / 0 / 0)
- [+]clearok (7 / 0 / 0)
- clearok.01
These functions set options that deal with output within Curses.
- clearok.02
The clearok() function assigns the value of bf to an internal flag in the specified window that governs clearing of the screen during a refresh.
- clearok.03.01
If, during a refresh operation on the specified window, the flag in curscr is TRUE or the flag in the specified window is TRUE, then the implementation clears the screen,
- clearok.03.02
redraws it in its entirety,
- clearok.03.03
and sets the flag to FALSE in curscr and in the specified window.
- clearok.04
The initial state is unspecified.
- clearok.05
The other functions always return OK.
- [+]echo (6 / 0 / 0)
- echo.01
The echo() function enables Echo mode for the current screen.
- echo.02
Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled.
- echo.03
echo() and noecho() control software echo only.
- echo.04
Hardware echo must remain disabled for the duration of the application, else the behaviour is undefined.
- echo.05.01
Upon successful completion, these functions return OK.
- echo.05.02
Otherwise, they return ERR.
- [+]has_ic (3 / 0 / 0)
- has_ic.01
The has_ic() function indicates whether the terminal has insert- and delete-character capabilities.
- has_ic.02.01
The has_ic() function returns TRUE if the terminal has insert- and delete-character capabilities.
- has_ic.02.02
Otherwise, it returns FALSE.
- [+]has_il (3 / 0 / 0)
- has_il.01
The has_il() function indicates whether the terminal has insert- and delete-line capabilities, or can simulate them using scrolling regions.
- has_il.02.01
The has_il() function returns TRUE if the terminal has insert- and delete-line capabilities.
- has_il.02.02
Otherwise, it returns FALSE.
- [+]idcok (4 / 0 / 0)
- idcok.01
The idcok() function specifies whether the implementation may use hardware insert- and delete-character features in win if the terminal is so equipped.
- idcok.02
If bf is TRUE, use of these features in win is enabled.
- idcok.03
If bf is FALSE, use of these features in win is disabled.
- idcok.04
The initial state is TRUE.
- [+]idlok (6 / 0 / 0)
- idlok.01
These functions set options that deal with output within Curses.
- idlok.02
The idlok() function specifies whether the implementation may use the hardware insert-line, delete-line, and scroll features of terminals so equipped.
- idlok.03.01
If bf is TRUE, use of these features is enabled.
- idlok.03.02
If bf is FALSE, use of these features is disabled and lines are instead redrawn as required.
- idlok.04
The initial state is FALSE.
- idlok.05
The other functions always return OK.
- [+]immedok (4 / 0 / 0)
- immedok.01
The immedok() function specifies whether the screen is refreshed whenever the window pointed to by win is changed.
- immedok.02
If bf is TRUE, the window is implicitly refreshed on each such change.
- immedok.03
If bf is FALSE, the window is not implicitly refreshed.
- immedok.04
The initial state is FALSE.
- [+]leaveok (6 / 0 / 0)
- leaveok.01
These functions set options that deal with output within Curses.
- leaveok.02
The leaveok() function controls the cursor position after a refresh operation.
- leaveok.03.01
If bf is TRUE, refresh operations on the specified window may leave the terminal's cursor at an arbitrary position.
- leaveok.03.02
If bf is FALSE, then at the end of any refresh operation, the terminal's cursor is positioned at the cursor position contained in the specified window.
- leaveok.04
The initial state is FALSE.
- leaveok.05
The other functions always return OK.
- [+]noecho (6 / 0 / 0)
- noecho.01
The noecho() function disables Echo mode for the current screen.
- noecho.02
Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled.
- noecho.03
echo() and noecho() control software echo only.
- noecho.04
Hardware echo must remain disabled for the duration of the application, else the behaviour is undefined.
- noecho.05.01
Upon successful completion, these functions return OK.
- noecho.05.02
Otherwise, they return ERR.
- [+]noqiflush (2 / 0 / 0)
- noqiflush.01
The noqiflush() causes no such flushing to occur.
- noqiflush.02
The default for the option is inherited from the display driver settings.
- [+]qiflush (2 / 0 / 0)
- qiflush.01
The qiflush() function causes all output in the display driver queue to be flushed whenever an interrupt key (interrupt, suspend, or quit) is pressed.
- qiflush.02
The default for the option is inherited from the display driver settings.
- [+]scrollok (6 / 0 / 0)
- scrollok.01
These functions set options that deal with output within Curses.
- scrollok.02
The scrollok() function controls the use of scrolling.
- scrollok.03.01
If bf is TRUE, then scrolling is enabled for the specified window, with the consequences discussed in Truncation, Wrapping and Scrolling .
- scrollok.03.02
If bf is FALSE, scrolling is disabled for the specified window.
- scrollok.04
The initial state is FALSE.
- scrollok.05
The other functions always return OK.
- [+]setscrreg (9 / 0 / 0)
- setscrreg.01
These functions set options that deal with output within Curses.
- setscrreg.02
The setscrreg() and wsetscrreg() functions define a software scrolling region in the current or specified window.
- setscrreg.03
The top and bot arguments are the line numbers of the first and last line defining the scrolling region.
- setscrreg.04
Line 0 is the top line of the window.
- setscrreg.05
If this option and scrollok() are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line in the direction of the first line.
- setscrreg.06
Only characters in the window are scrolled.
- setscrreg.07
If a software scrolling region is set and scrollok() is not enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region.
- setscrreg.08.01
Upon successful completion, setscrreg() and wsetscrreg() return OK.
- setscrreg.08.02
Otherwise, they return ERR.
- [+]use_env (4 / 0 / 0)
- use_env.01
The use_env() function specifies the technique by which the implementation determines the size of the screen.
- use_env.02.01
If boolval is FALSE, the implementation uses the values of lines and columns specified in the terminfo database.
- use_env.02.02
If boolval is TRUE, the implementation uses the and environment variables.
- use_env.02.03
The initial value is TRUE.
- app.use_env.03
Any call to use_env() must precede calls to initscr(), newterm() or setupterm().
- [+]wsetscrreg (9 / 0 / 0)
- wsetscrreg.01
These functions set options that deal with output within Curses.
- wsetscrreg.02
The setscrreg() and wsetscrreg() functions define a software scrolling region in the current or specified window.
- wsetscrreg.03
The top and bot arguments are the line numbers of the first and last line defining the scrolling region.
- wsetscrreg.04
Line 0 is the top line of the window.
- wsetscrreg.05
If this option and scrollok() are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line in the direction of the first line.
- wsetscrreg.06
Only characters in the window are scrolled.
- wsetscrreg.07
If a software scrolling region is set and scrollok() is not enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region.
- wsetscrreg.08.01
Upon successful completion, setscrreg() and wsetscrreg() return OK.
- wsetscrreg.08.02
Otherwise, they return ERR.
- [+]ncurses.terminal.termcap (21 / 0 / 0)
- [+]tgetent (4 / 0 / 0)
- tgetent.01
The tgetent() function looks up the termcap entry for name.
- tgetent.02 (struct)
The emulation ignores the buffer pointer bp.
- tgetent.04
All of the information available in the terminfo database need not be available through these functions.
- tgetent.05.01
Upon successful completion, functions that return an integer return OK.
- tgetent.05.02
Otherwise, they return ERR.
- [+]tgetflag (4 / 0 / 0)
- tgetflag.01
The tgetflag() function gets the boolean entry for id.
- tgetflag.04
All of the information available in the terminfo database need not be available through these functions.
- tgetflag.05.01
Upon successful completion, functions that return an integer return OK.
- tgetflag.05.02
Otherwise, they return ERR.
- [+]tgetnum (4 / 0 / 0)
- tgetnum.01
The tgetnum() function gets the numeric entry for id.
- tgetnum.04
All of the information available in the terminfo database need not be available through these functions.
- tgetnum.05.01
Upon successful completion, functions that return an integer return OK.
- tgetnum.05.02
Otherwise, they return ERR.
- [+]tgetstr (5 / 0 / 0)
- tgetstr.01
The tgetstr() function gets the string entry for id.
- tgetstr.02.01
If area is not a null pointer and does not point to a null pointer, tgetstr() copies the string entry into the buffer pointed to by *area
- tgetstr.02.02
and advances the variable pointed to by area to the first byte after the copy of the string entry.
- tgetstr.04
All of the information available in the terminfo database need not be available through these functions.
- tgetstr.05
Functions that return pointers return a null pointer on error.
- [+]tgoto (4 / 0 / 0)
- tgoto.01.01
The tgoto() function instantiates the parameters col and row into the capability cap
- tgoto.01.02
and returns a pointer to the resulting string.
- tgoto.04
All of the information available in the terminfo database need not be available through these functions.
- tgoto.05
Functions that return pointers return a null pointer on error.
- [+]ncurses.terminal.terminal (44 / 0 / 0)
- [+]delay_output (4 / 0 / 0)
- delay_output.01.01
On terminals that support pad characters, delay_output() pauses the output for at least ms milliseconds.
- delay_output.01.02
Otherwise, the length of the delay is unspecified.
- delay_output.02.01
Upon successful completion, delay_output() returns OK.
- delay_output.02.02
Otherwise, it returns ERR.
- [+]delscreen (1 / 0 / 0)
- delscreen.01
The delscreen() function frees storage associated with the SCREEN pointed to by sp.
- [+]endwin (6 / 0 / 0)
- endwin.01.01
The endwin() function restores the terminal after Curses activity by at least restoring the saved shell terminal mode,
- endwin.01.02
flushing any output to the terminal
- endwin.01.03
and moving the cursor to the first column of the last line of the screen.
- endwin.02
Refreshing a window resumes program mode.
- endwin.03 (struct)
The application must call endwin() for each terminal being used before exiting.
- endwin.04 (struct)
If newterm() is called more than once for the same terminal, the first screen created must be the last one for which endwin() is called.
- endwin.05.01
Upon successful completion, endwin() returns OK.
- endwin.05.02
Otherwise, it returns ERR.
- [+]filter (4 / 0 / 0)
- filter.01
The filter() function changes the algorithm for initialising terminal capabilities that assume that the terminal has more than one line.
Generalizes:
- filter.02.01
- filter.02.02
- filter.02.03
- filter.02
A subsequent call to initscr() or newterm() performs the following additional actions:
- filter.02.01
Disable use of clear, cud, cud1, cup, cuu1 and vpa.
- filter.02.02
Set the value of the home string to the value of the cr. string
- filter.02.03
Set lines equal to 1.
- app.filter.03
Any call to filter() must precede the call to initscr() or newterm().
- [+]initscr (6 / 0 / 0)
- initscr.01
The initscr() function determines the terminal type and initialises all implementation data structures.
- initscr.02 (struct)
The environment variable specifies the terminal type.
- initscr.03
The initscr() function also causes the first refresh operation to clear the screen.
- initscr.04
If errors occur, initscr() writes an appropriate error message to standard error and exits.
- initscr.05 (struct)
The only functions that can be called before initscr() or newterm() are filter(), ripoffline(), slk_init(), use_env() and the functions whose prototypes are defined in <term.h>.
- app.initscr.06
Portable applications must not call initscr() twice.
- initscr.08
The initscr() and newterm() functions initialise the cur_term external variable.
- initscr.09.01
Upon successful completion, initscr() returns a pointer to stdscr.
- initscr.09.02
Otherwise, it does not return.
- [+]longname (4 / 0 / 0)
- longname.01
The longname() function generates a verbose description of the current terminal.
Generalizes:
- longname.02
- longname.04.01
- longname.04.02
- longname.02
The maximum length of a verbose description is 128 bytes.
- app.longname.03
It is defined only after the call to initscr() or newterm().
- longname.04.01
Upon successful completion, longname() returns a pointer to the description specified above.
- longname.04.02
Otherwise, it returns a null pointer on error.
- [+]newterm (7 / 0 / 0)
- newterm.01 (struct)
The newterm() function can be called as many times as desired to attach a terminal device.
- newterm.02
The type argument points to a string specifying the terminal type, except that if type is a null pointer, the environment variable is used.
- newterm.03 (struct)
The outfile and infile arguments are file pointers for output to the terminal and input from the terminal, respectively.
- newterm.04
It is unspecified whether Curses modifies the buffering mode of these file pointers.
- app.newterm.05
The newterm() function should be called once for each terminal.
- newterm.06
The initscr() function is equivalent to: newterm(getenv("TERM"), stdout, stdin);return stdscr;
- newterm.07
If the current disposition for the signals SIGINT, SIGQUIT or SIGTSTP is SIGDFL, then initscr() may also install a handler for the signal, which may remain in effect for the life of the process or until the process changes the disposition of the signal.
- newterm.08
The initscr() and newterm() functions initialise the cur_term external variable.
- newterm.09.01
Upon successful completion, newterm() returns a pointer to the specified terminal.
- newterm.09.02
Otherwise, it returns a null pointer.
- [+]set_term (3 / 0 / 0)
- set_term.01
The set_term() function switches between different screens.
- set_term.02 (struct)
The new argument specifies the new current screen.
- set_term.03.01
Upon successful completion, set_term() returns a pointer to the previous screen.
- set_term.03.02
Otherwise, it returns a null pointer.
- [+]termattrs (2 / 0 / 0)
- termattrs.01
The termattrs() function extracts the video attributes of the current terminal which is supported by the chtype data type.
- termattrs.02
The termattrs() function returns a logical OR of A_ values of all video attributes supported by the terminal.
- [+]vidattr (4 / 0 / 0)
- vidattr.01
These functions output commands to the terminal that change the terminal's attributes.
Generalizes:
- vidattr.02
- vidattr.03
- vidattr.04
- vidattr.06.01
- vidattr.06.02
- vidattr.02
If the terminfo database indicates that the terminal in use can display characters in the rendition specified by attr, then vidattr() outputs one or more commands to request that the terminal display subsequent characters in that rendition.
- vidattr.03 (struct)
The function outputs by calling putchar().
- vidattr.04 (struct)
The vidattr() function neither relies on nor updates the model which Curses maintains of the prior rendition mode.
- vidattr.06.01
Upon successful completion, these functions return OK.
- vidattr.06.02
Otherwise, they return ERR.
- [+]vidputs (3 / 0 / 0)
- vidputs.01
These functions output commands to the terminal that change the terminal's attributes.
Generalizes:
- vidputs.02
- vidputs.04
- vidputs.05
- vidputs.06.01
- vidputs.06.02
- vidputs.02 (struct)
The vidputs() function computes the same terminal output string that vidattr() does, based on attr, but vidputs() outputs by calling the user-supplied function putfunc.
- vidputs.04 (struct)
The user-supplied function putfunc (which can be specified as an argument to either vidputs() or vid_puts()) is either putchar() or some other function with the same prototype.
- vidputs.05 (struct)
Both the vidputs() and the vid_puts() function ignore the return value of putfunc.
- vidputs.06.01
Upon successful completion, these functions return OK.
- vidputs.06.02
Otherwise, they return ERR.
- [+]ncurses.terminal.terminfo (58 / 0 / 0)
- [+]del_curterm (5 / 0 / 0)
- del_curterm.01
These functions retrieve information from the terminfo database.
Generalizes:
- del_curterm.02
- del_curterm.03
- del_curterm.09.01
- del_curterm.09.02
- del_curterm.02
The del_curterm() function frees the space pointed to by oterm and makes it available for further use.
- del_curterm.03
If oterm is the same as cur_term, references to any of the terminfo boolean, numeric, and string variables thereafter may refer to invalid memory locations until setupterm() is called again.
- del_curterm.09.01
Upon successful completion, the other functions return OK.
- del_curterm.09.02
Otherwise, they return ERR.
- [+]putp (5 / 0 / 0)
- putp.01
These functions output commands contained in the terminfo database to the terminal.
Generalizes:
- putp.02
- putp.03
- putp.09.01
- putp.09.02
- putp.tputs.02
- putp.tputs.04
- putp.tputs.05
- putp.02
The putp() function is equivalent to tputs(str, 1, putchar).
Generalizes:
- putp.tputs.02
- putp.tputs.04
- putp.tputs.05
- putp.03 (struct)
The output of putp() always goes to stdout, not to the fildes specified in setupterm().
- putp.09.01
Upon successful completion, these functions return OK.
- putp.09.02
Otherwise, they return ERR.
- putp.tputs.02 (struct)
The tputs() function outputs str to the terminal.
- putp.tputs.04 (struct)
The affcnt argument is the number of lines affected, or 1 if not applicable.
- putp.tputs.05
If the terminfo database indicates that the terminal in use requires padding after any command in the generated string, tputs() inserts pad characters into the string that is sent to the terminal, at positions indicated by the terminfo database.
- app.putp.tputs.03
The str argument must be a terminfo string variable or the return value from tgetstr(), tgoto(), tigetstr() or tparm().
- [+]restartterm (13 / 0 / 0)
- restartterm.01
These functions retrieve information from the terminfo database.
Generalizes:
- restartterm.03.01
- restartterm.03.02
- restartterm.09.01
- restartterm.09.02
- restartterm.setupterm.03
- restartterm.setupterm.04
- restartterm.setupterm.05.01
- restartterm.setupterm.05.02
- restartterm.setupterm.06
- restartterm.setupterm.07.01
- restartterm.setupterm.07.02
- restartterm.setupterm.07.03
- restartterm.setupterm.08
- app.restartterm.02
The restartterm() function assumes a previous call to setupterm() (perhaps from initscr() or newterm()).
- restartterm.03.01
It lets the application specify a different terminal type in term and updates the information returned by baudrate() based on fildes,
- restartterm.03.02
but does not destroy other information created by initscr(), newterm() or setupterm().
- restartterm.09.01
Upon successful completion, the other functions return OK.
- restartterm.09.02
Otherwise, they return ERR.
- restartterm.setupterm.03
It is automatically called by initscr() and newterm(). The setupterm() function initialises the other functions to use the terminfo record for a specified terminal (which depends on whether use_env() was called).
Generalizes:
- restartterm.01
- restartterm.03.01
- restartterm.03.02
- restartterm.09.01
- restartterm.09.02
- restartterm.setupterm.04
- restartterm.setupterm.05.01
- restartterm.setupterm.05.02
- restartterm.setupterm.06
- restartterm.setupterm.07.01
- restartterm.setupterm.07.02
- restartterm.setupterm.07.03
- restartterm.setupterm.08
- restartterm.setupterm.04
It sets the cur_term external variable to a TERMINAL structure that contains the record from the terminfo database for the specified terminal.
- restartterm.setupterm.05.01
The terminal type is the character string term; if term is a null pointer, the environment variable TERM is used.
- restartterm.setupterm.05.02
If TERM is not set or if its value is an empty string, then "unknown" is used as the terminal type.
- restartterm.setupterm.06 (struct)
The application must set fildes to a file descriptor, open for output, to the terminal device, before calling setupterm().
- restartterm.setupterm.07
If errret is not null, the integer it points to is set to one of the following values to report the function outcome:
- restartterm.setupterm.07.01
-1The terminfo database was not found (function fails).
- restartterm.setupterm.07.02
0The entry for the terminal was not found in terminfo (function fails).
- restartterm.setupterm.07.03
1Success.
- restartterm.setupterm.08
If setupterm() detects an error and errret is a null pointer, setupterm() writes a diagnostic message and exits.
- app.restartterm.setupterm.02
To gain access to the terminfo database, setupterm() must be called first.
- [+]set_curterm (4 / 0 / 0)
- set_curterm.01
These functions retrieve information from the terminfo database.
Generalizes:
- set_curterm.02
- set_curterm.03.01
- set_curterm.03.02
- set_curterm.02
The set_curterm() function sets the variable cur_term to nterm, and makes all of the terminfo boolean, numeric, and string variables use the values from nterm.
- set_curterm.03.01
Upon successful completion, set_curterm() returns the previous value of cur_term.
- set_curterm.03.02
Otherwise, it returns a null pointer.
- [+]setupterm (11 / 0 / 0)
- setupterm.01
These functions retrieve information from the terminfo database.
Generalizes:
- setupterm.03
- setupterm.04
- setupterm.05.01
- setupterm.05.02
- setupterm.07.01
- setupterm.07.02
- setupterm.07.03
- setupterm.08
- setupterm.09.01
- setupterm.09.02
- app.setupterm.02
To gain access to the terminfo database, setupterm() must be called first.
- setupterm.03
It is automatically called by initscr() and newterm(). The setupterm() function initialises the other functions to use the terminfo record for a specified terminal (which depends on whether use_env() was called).
Generalizes:
- setupterm.01
- setupterm.04
- setupterm.05.01
- setupterm.05.02
- setupterm.07.01
- setupterm.07.02
- setupterm.07.03
- setupterm.08
- setupterm.09.01
- setupterm.09.02
- setupterm.04
It sets the cur_term external variable to a TERMINAL structure that contains the record from the terminfo database for the specified terminal.
- setupterm.05.01
The terminal type is the character string term; if term is a null pointer, the environment variable TERM is used.
- setupterm.05.02
If TERM is not set or if its value is an empty string, then "unknown" is used as the terminal type.
- app.setupterm.06 (struct)
The application must set fildes to a file descriptor, open for output, to the terminal device, before calling setupterm().
- setupterm.07
If errret is not null, the integer it points to is set to one of the following values to report the function outcome:
- setupterm.07.01
-1The terminfo database was not found (function fails).
- setupterm.07.02
0The entry for the terminal was not found in terminfo (function fails).
- setupterm.07.03
1Success.
- setupterm.08
If setupterm() detects an error and errret is a null pointer, setupterm() writes a diagnostic message and exits.
- setupterm.09.01
Upon successful completion, the other functions return OK.
- setupterm.09.02
Otherwise, they return ERR.
- [+]termname (2 / 0 / 0)
- termname.01
The termname() function obtains the terminal name as recorded by setupterm().
- termname.02
The termname() function returns a pointer to the terminal name.
- [+]tigetflag (3 / 0 / 0)
- tigetflag.01
The tigetflag(), tigetnum(), and tigetstr() functions obtain boolean, numeric and string capabilities, respectively, from the selected record of the terminfo database.
- app.tigetflag.02
For each capability, the value to use as capname appears in the Capname column in the table in Defined Capabilities .
- tigetflag.03.01
Upon successful completion, tigetflag(), tigetnum() and tigetstr() return the specified capability.
- tigetflag.03.02
The tigetflag() function returns -1 if capname is not a boolean capability.
- [+]tigetnum (3 / 0 / 0)
- tigetnum.01
The tigetflag(), tigetnum(), and tigetstr() functions obtain boolean, numeric and string capabilities, respectively, from the selected record of the terminfo database.
- app.tigetnum.02
For each capability, the value to use as capname appears in the Capname column in the table in Defined Capabilities .
- tigetnum.03.01
Upon successful completion, tigetflag(), tigetnum() and tigetstr() return the specified capability.
- tigetnum.03.02
The tigetnum() function returns -2 if capname is not a numeric capability.
- [+]tigetstr (3 / 0 / 0)
- tigetstr.01
The tigetflag(), tigetnum(), and tigetstr() functions obtain boolean, numeric and string capabilities, respectively, from the selected record of the terminfo database.
- app.tigetstr.02
For each capability, the value to use as capname appears in the Capname column in the table in Defined Capabilities .
- tigetstr.03.01
Upon successful completion, tigetflag(), tigetnum() and tigetstr() return the specified capability.
- tigetstr.03.02
The tigetstr() function returns (char *)-1 if capname is not a string capability.
- [+]tparm (5 / 0 / 0)
- tparm.01
The tparm() function takes as cap a string capability.
- tparm.02
If cap is parameterised (as described in ), tparm() resolves the parameterisation.
- tparm.03
If the parameterised string refers to parameters %p1 through %p9, then tparm() substitutes the values of p1 through p9, respectively.
- tparm.04.01
Upon successful completion, tparm() returns str with parameterisation resolved.
- tparm.04.02
Otherwise, it returns a null pointer.
- [+]tputs (4 / 0 / 0)
- tputs.01
These functions output commands contained in the terminfo database to the terminal.
Generalizes:
- tputs.02
- tputs.04
- tputs.05
- tputs.06
- tputs.07
- tputs.08
- tputs.09.01
- tputs.09.02
- tputs.02 (struct)
The tputs() function outputs str to the terminal.
- app.tputs.03
The str argument must be a terminfo string variable or the return value from tgetstr(), tgoto(), tigetstr() or tparm().
- tputs.04 (struct)
The affcnt argument is the number of lines affected, or 1 if not applicable.
- tputs.05
If the terminfo database indicates that the terminal in use requires padding after any command in the generated string, tputs() inserts pad characters into the string that is sent to the terminal, at positions indicated by the terminfo database.
- tputs.06 (struct)
The tputs() function outputs each character of the generated string by calling the user-supplied function putfunc (see below).
- tputs.07 (struct)
The user-supplied function putfunc (specified as an argument to tputs()) is either putchar() or some other function with the same prototype.
- tputs.08 (struct)
The tputs() function ignores the return value of putfunc.
- tputs.09.01
Upon successful completion, these functions return OK.
- tputs.09.02
Otherwise, they return ERR.
- [+]ncurses.window.attr (46 / 0 / 0)
- [+]attr_get (2 / 0 / 0)
- attr_get.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- attr_get.02
The attr_get() and wattr_get() functions obtain the current rendition of a window.
- attr_get.03 (struct)
If attrs or color_pair_number is a null pointer, no information will be obtained on the corresponding rendition information and this is not an error.
- attr_get.04 (struct)
These functions always return OK.
- [+]attr_off (2 / 0 / 0)
- attr_off.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- attr_off.02
The attr_off() and wattr_off() functions turn off attrs in the current or specified window without affecting any others.
- attr_off.04 (struct)
These functions always return OK.
- [+]attr_on (2 / 0 / 0)
- attr_on.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- attr_on.02
The attr_on() and wattr_on() functions turn on attrs in the current or specified window without affecting any others.
- attr_on.04 (struct)
These functions always return OK.
- [+]attr_set (2 / 0 / 0)
- attr_set.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- attr_set.02
The attr_set() and wattr_set() functions set the window rendition of the current or specified window to attrs and color_pair_number.
- attr_set.04 (struct)
These functions always return OK.
- [+]attroff (3 / 0 / 0)
- attroff.01
These functions manipulate the window attributes of the current or specified window.
- attroff.02
The attroff() and wattroff() functions turn off attrs in the current or specified window without affecting any others.
- app.attroff.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- attroff.04
These functions always return either OK or 1.
- [+]attron (3 / 0 / 0)
- attron.01
These functions manipulate the window attributes of the current or specified window.
Generalizes:
- attron.02
The attron() and wattron() functions turn on attrs in the current or specified window without affecting any others.
- app.attron.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- attron.04
These functions always return either OK or 1.
- [+]attrset (3 / 0 / 0)
- attrset.01
These functions manipulate the window attributes of the current or specified window.
Generalizes:
- attrset.02
The attrset() and wattrset() functions set the background attributes of the current or specified window to attrs.
- app.attrset.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- attrset.04
These functions always return either OK or 1.
- [+]color_set (2 / 0 / 0)
- color_set.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- color_set.02
The color_set() and wcolor_set() functions set the window colour of the current or specified window to color_pair_number.
- color_set.04 (struct)
These functions always return OK.
- [+]standend (2 / 0 / 0)
- standend.01
The standend() and wstandend() functions turn off all attributes of the current or specified window.
- standend.02
These functions always return 1.
- [+]standout (2 / 0 / 0)
- standout.01
The standout() and wstandout() functions turn on the standout attribute of the current or specified window.
- standout.02
These functions always return 1.
- [+]wattr_get (2 / 0 / 0)
- wattr_get.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- wattr_get.02
The attr_get() and wattr_get() functions obtain the current rendition of a window.
- wattr_get.03 (struct)
If attrs or color_pair_number is a null pointer, no information will be obtained on the corresponding rendition information and this is not an error.
- wattr_get.04 (struct)
These functions always return OK.
- [+]wattr_off (2 / 0 / 0)
- wattr_off.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- wattr_off.02
The attr_off() and wattr_off() functions turn off attrs in the current or specified window without affecting any others.
- wattr_off.04 (struct)
These functions always return OK.
- [+]wattr_on (2 / 0 / 0)
- wattr_on.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- wattr_on.02
The attr_on() and wattr_on() functions turn on attrs in the current or specified window without affecting any others.
- wattr_on.04 (struct)
These functions always return OK.
- [+]wattr_set (2 / 0 / 0)
- wattr_set.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- wattr_set.02
The attr_set() and wattr_set() functions set the window rendition of the current or specified window to attrs and color_pair_number.
- wattr_set.04 (struct)
These functions always return OK.
- [+]wattroff (3 / 0 / 0)
- wattroff.01
These functions manipulate the window attributes of the current or specified window.
- wattroff.02
The attroff() and wattroff() functions turn off attrs in the current or specified window without affecting any others.
- app.wattroff.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- wattroff.04
These functions always return either OK or 1.
- [+]wattron (3 / 0 / 0)
- wattron.01
These functions manipulate the window attributes of the current or specified window.
Generalizes:
- wattron.02
The attron() and wattron() functions turn on attrs in the current or specified window without affecting any others.
- app.wattron.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- wattron.04
These functions always return either OK or 1.
- [+]wattrset (3 / 0 / 0)
- wattrset.01
These functions manipulate the window attributes of the current or specified window.
Generalizes:
- wattrset.02
The attrset() and wattrset() functions set the background attributes of the current or specified window to attrs.
- app.wattrset.03 (struct)
It is unspecified whether these functions can be used to manipulate attributes other than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.
- wattrset.04
These functions always return either OK or 1.
- [+]wcolor_set (2 / 0 / 0)
- wcolor_set.01
These functions manipulate the attributes and colour of the window rendition of the current or specified window.
- wcolor_set.02
The color_set() and wcolor_set() functions set the window colour of the current or specified window to color_pair_number.
- wcolor_set.04 (struct)
These functions always return OK.
- [+]wstandend (2 / 0 / 0)
- wstandend.01
The standend() and wstandend() functions turn off all attributes of the current or specified window.
- wstandend.02
These functions always return 1.
- [+]wstandout (2 / 0 / 0)
- wstandout.01
The standout() and wstandout() functions turn on the standout attribute of the current or specified window.
- wstandout.02
These functions always return 1.
- [+]ncurses.window.pad (28 / 0 / 0)
- [+]newpad (4 / 0 / 0)
- newpad.01
The newpad() function creates a specialised window called a pad with nlines lines and ncols columns.
- newpad.02
A pad is like a window, except that it is not restricted by the screen size and is not necessarily associated with a particular part of the screen.
- newpad.03
Automatic refreshes of pads (e.g., from scrolling or echoing of input) do not occur.
- newpad.04.01 (struct)
Upon successful completion, the newpad() and subpad() functions return a pointer to the pad data structure.
- newpad.04.02
Otherwise, they return a null pointer.
- [+]pechochar (5 / 0 / 0)
- pechochar.01
The pechochar() and pecho_wchar() functions output one character to a pad and immediately refresh the pad.
- pechochar.02
They are equivalent to a call to waddch() or wadd_wch(), respectively, followed by a call to prefresh().
- pechochar.03
The last location of the pad on the screen is reused for the arguments to prefresh().
- pechochar.04.01
Upon successful completion, these functions return OK.
- pechochar.04.02
Otherwise, they return ERR.
- [+]pnoutrefresh (7 / 0 / 0)
- pnoutrefresh.01
The prefresh() and pnoutrefresh() functions are analogous to wrefresh() and wnoutrefresh() except that they relate to pads instead of windows.
- pnoutrefresh.02
The additional arguments indicate what part of the pad and screen are involved.
- pnoutrefresh.03
The pminrow and pmincol arguments specify the origin of the rectangle to be displayed in the pad.
- pnoutrefresh.04
The sminrow, smincol, smaxrow and smaxcol arguments specify the edges of the rectangle to be displayed on the screen.
- app.pnoutrefresh.05
The lower right-hand corner of the rectangle to be displayed in the pad is calculated from the screen coordinates, since the rectangles must be the same size.
- app.pnoutrefresh.06
Both rectangles must be entirely contained within their respective structures.
- pnoutrefresh.07
Negative values of pminrow, pmincol, sminrow or smincol are treated as if they were zero.
- pnoutrefresh.08.01
Upon successful completion, pnoutrefresh() and prefresh() return OK.
- pnoutrefresh.08.02
Otherwise, they return ERR.
- [+]prefresh (7 / 0 / 0)
- prefresh.01
The prefresh() and pnoutrefresh() functions are analogous to wrefresh() and wnoutrefresh() except that they relate to pads instead of windows.
- prefresh.02
The additional arguments indicate what part of the pad and screen are involved.
- prefresh.03
The pminrow and pmincol arguments specify the origin of the rectangle to be displayed in the pad.
- prefresh.04
The sminrow, smincol, smaxrow and smaxcol arguments specify the edges of the rectangle to be displayed on the screen.
- app.prefresh.05
The lower right-hand corner of the rectangle to be displayed in the pad is calculated from the screen coordinates, since the rectangles must be the same size.
- app.prefresh.06
Both rectangles must be entirely contained within their respective structures.
- prefresh.07
Negative values of pminrow, pmincol, sminrow or smincol are treated as if they were zero.
- prefresh.08.01
Upon successful completion, pnoutrefresh() and prefresh() return OK.
- prefresh.08.02
Otherwise, they return ERR.
- [+]subpad (5 / 0 / 0)
- subpad.01
The subpad() function creates a specialised window within a pad (called the parent pad) called a subpad with nlines lines and ncols columns.
- subpad.02
Unlike subwin() which uses screen coordinates, the subpad is created at position (begin_y, begin_x) within the parent pad.
- subpad.03
Changes made to either the parent pad or the subpad affect the other.
- subpad.04.01 (struct)
Upon successful completion, the newpad() and subpad() functions return a pointer to the pad data structure.
- subpad.04.02
Otherwise, they return a null pointer.
- subpad.05
The subpad must fit totally within the parent pad.
- [+]ncurses.window.refresh (55 / 0 / 0)
- [+]doupdate (3 / 0 / 0)
- doupdate.01
The doupdate() function sends to the terminal the commands to perform any required changes.
- doupdate.03.01
Upon successful completion, these functions return OK.
- doupdate.03.02
Otherwise they return ERR.
- [+]is_linetouched (3 / 0 / 0)
- is_linetouched.01
The is_linetouched() function determines whether line line of the specified window is touched.
Generalizes:
- is_linetouched.02.01
- is_linetouched.02.02
- is_linetouched.02.01
The is_linetouched() and is_wintouched() functions return TRUE if any of the specified lines, or the specified window, respectively, has been touched since the last refresh operation.
- is_linetouched.02.02
Otherwise, they return FALSE.
- [+]is_wintouched (3 / 0 / 0)
- is_wintouched.01
The is_wintouched() function determines whether the specified window is touched.
Generalizes:
- is_wintouched.02.01
- is_wintouched.02.02
- is_wintouched.02.01
The is_linetouched() and is_wintouched() functions return TRUE if any of the specified lines, or the specified window, respectively, has been touched since the last refresh operation.
- is_wintouched.02.02
Otherwise, they return FALSE.
- [+]isendwin (3 / 0 / 0)
- isendwin.01
The isendwin() function indicates whether the screen has been refreshed since the last call to endwin().
Generalizes:
- isendwin.02.01
- isendwin.02.02
- isendwin.02.01
The isendwin() function returns TRUE if endwin() has been called without any subsequent refresh.
- isendwin.02.02
Otherwise, it returns FALSE.
- [+]redrawwin (5 / 0 / 0)
- redrawwin.01
The redrawwin() and wredrawln() functions inform the implementation that some or all of the information physically displayed for the specified window may have been corrupted.
- redrawwin.02
The redrawwin() function marks the entire window;
- redrawwin.03
The functions prevent the next refresh operation on that window from performing any optimisation based on assumptions about what is physically displayed there.
- redrawwin.04.01
Upon successful completion, these functions return OK.
- redrawwin.04.02
Otherwise they return ERR.
- [+]refresh (4 / 0 / 0)
- refresh.01
The refresh() and wrefresh() functions refresh the current or specified window.
- refresh.02
The functions position the terminal's cursor at the cursor position of the window, except that if the leaveok() mode has been enabled, they may leave the cursor at an arbitrary position.
- refresh.03.01
Upon successful completion, these functions return OK.
- refresh.03.02
Otherwise they return ERR.
- [+]syncok (6 / 0 / 0)
- syncok.01
The syncok() function determines whether all ancestors of the specified window are implicitly touched whenever there is a change in the window.
- syncok.02.01
If bf is TRUE, such implicit touching occurs.
- syncok.02.02
If bf is FALSE, such implicit touching does not occur.
- syncok.03
The initial state is FALSE.
- syncok.04.01
Upon successful completion, syncok() returns OK.
- syncok.04.02
Otherwise, it returns ERR.
- [+]touchline (3 / 0 / 0)
- touchline.01
The touchline() function only touches count lines, beginning with line start.
- touchline.02.01
Upon successful completion, the other functions return OK.
- touchline.02.02
Otherwise, they return ERR.
- [+]touchwin (3 / 0 / 0)
- touchwin.01
The touchwin() function touches the specified window (that is, marks it as having changed more recently than the last refresh operation).
- touchwin.02.01
Upon successful completion, the other functions return OK.
- touchwin.02.02
Otherwise, they return ERR.
- [+]untouchwin (3 / 0 / 0)
- untouchwin.01
The untouchwin() function marks all lines in the window as unchanged since the last refresh operation.
- untouchwin.02.01
Upon successful completion, the other functions return OK.
- untouchwin.02.02
Otherwise, they return ERR.
- [+]wcursyncup (1 / 0 / 0)
- wcursyncup.01
The wcursyncup() function updates the current cursor position of the ancestors of win to reflect the current cursor position of win.
- [+]wnoutrefresh (3 / 0 / 0)
- wnoutrefresh.01
The wnoutrefresh() function determines which parts of the terminal may need updating.
- wnoutrefresh.03.01
Upon successful completion, these functions return OK.
- wnoutrefresh.03.02
Otherwise they return ERR.
- [+]wredrawln (5 / 0 / 0)
- wredrawln.01
The redrawwin() and wredrawln() functions inform the implementation that some or all of the information physically displayed for the specified window may have been corrupted.
- wredrawln.02
wredrawln() marks only num_lines lines starting at line number beg_line.
- wredrawln.03
The functions prevent the next refresh operation on that window from performing any optimisation based on assumptions about what is physically displayed there.
- wredrawln.04.01
Upon successful completion, these functions return OK.
- wredrawln.04.02
Otherwise they return ERR.
- [+]wrefresh (4 / 0 / 0)
- wrefresh.01
The refresh() and wrefresh() functions refresh the current or specified window.
- wrefresh.02
The functions position the terminal's cursor at the cursor position of the window, except that if the leaveok() mode has been enabled, they may leave the cursor at an arbitrary position.
- wrefresh.03.01
Upon successful completion, these functions return OK.
- wrefresh.03.02
Otherwise they return ERR.
- [+]wsyncdown (1 / 0 / 0)
- wsyncdown.01
The wsyncdown() function touches win if any ancestor window has been touched.
- [+]wsyncup (1 / 0 / 0)
- wsyncup.01
The wsyncup() function unconditionally touches all ancestors of win.
- [+]wtouchln (4 / 0 / 0)
- wtouchln.01.01
Calling wtouchln(), if changed is 1, touches n lines in the specified window, starting at line y.
- wtouchln.01.02
If changed is 0, wtouchln() marks such lines as unchanged since the last refresh operation.
- wtouchln.02.01
Upon successful completion, the other functions return OK.
- wtouchln.02.02
Otherwise, they return ERR.
- [+]ncurses.window.scroll (19 / 0 / 0)
- [+]scrl (7 / 0 / 0)
- scrl.01
The scrl() and wscrl() functions scroll the current or specified window.
- scrl.02.01
If n is positive, the window scrolls n lines toward the first line.
- scrl.02.02
Otherwise, the window scrolls -n lines toward the last line.
- scrl.03
These functions do not change the cursor position.
- scrl.04
If scrolling is disabled for the current or specified window, these functions have no effect.
- app.scrl.05
The interaction of these functions with setscrreg() is currently unspecified.
- scrl.06.01
Upon successful completion, these functions return OK.
- scrl.06.02
Otherwise, they return ERR.
- [+]scroll (5 / 0 / 0)
- scroll.01
The scroll() function scrolls win one line in the direction of the first line.
- scroll.03
These functions do not change the cursor position.
- scroll.04
If scrolling is disabled for the current or specified window, these functions have no effect.
- app.scroll.05
The interaction of these functions with setscrreg() is currently unspecified.
- scroll.06.01
Upon successful completion, these functions return OK.
- scroll.06.02
Otherwise, they return ERR.
- [+]wscrl (7 / 0 / 0)
- wscrl.01
The scrl() and wscrl() functions scroll the current or specified window.
- wscrl.02.01
If n is positive, the window scrolls n lines toward the first line.
- wscrl.02.02
Otherwise, the window scrolls -n lines toward the last line.
- wscrl.03
These functions do not change the cursor position.
- wscrl.04
If scrolling is disabled for the current or specified window, these functions have no effect.
- app.wscrl.05
The interaction of these functions with setscrreg() is currently unspecified.
- wscrl.06.01
Upon successful completion, these functions return OK.
- wscrl.06.02
Otherwise, they return ERR.
- [+]ncurses.window.window (88 / 0 / 0)
- [+]copywin (6 / 0 / 0)
- copywin.01
The copywin() function provides a finer granularity of control over the overlay() and overwrite() functions.
- copywin.02
As in the prefresh() function, a rectangle is specified in the destination window, (dminrow, dmincol) and (dmaxrow, dmaxcol), and the upper-left-corner coordinates of the source window, (sminrow, smincol).
- copywin.03.01
If overlay is TRUE, then copying is non-destructive, as in overlay().
- copywin.03.02
If overlay is FALSE, then copying is destructive, as in overwrite().
- copywin.04.01
Upon successful completion, copywin() returns OK.
- copywin.04.02
Otherwise, it returns ERR.
- [+]curs_set (4 / 0 / 0)
- curs_set.01
The curs_set() function sets the appearance of the cursor based on the value of visibility: Value of visibility Appearance of Cursor 0 Invisible 1 Terminal-specific normal mode 2 Terminal-specific high visibility mode
- curs_set.02
The terminal does not necessarily support all the above values.
- curs_set.03.01
If the terminal supports the cursor mode specified by visibility, then curs_set() returns the previous cursor state.
- curs_set.03.02
Otherwise, the function returns ERR.
- [+]delwin (4 / 0 / 0)
- delwin.01
The delwin() function deletes win, freeing all memory associated with it.
- delwin.02
The application must delete subwindows before deleting the main window.
- delwin.03.01
Upon successful completion, delwin() returns OK.
- delwin.03.02
Otherwise, it returns ERR.
- [+]derwin (2 / 0 / 0)
- derwin.01
The derwin() function is the same as subwin(), except that begin_y and begin_x are relative to the origin of the window orig rather than absolute screen positions.
- derwin.04.01 (struct)
Upon successful completion, these functions return a pointer to the new window.
- derwin.04.02
Otherwise, they return a null pointer.
- [+]dupwin (2 / 0 / 0)
- dupwin.01
The dupwin() function creates a duplicate of the window win.
- dupwin.02.01 (struct)
Upon successful completion, dupwin() returns a pointer to the new window.
- dupwin.02.02
Otherwise, it returns a null pointer.
- [+]getwin (3 / 0 / 0)
- getwin.01
The getwin() function reads window-related data stored in the file by putwin().
- getwin.02
The function then creates and initialises a new window using that data.
- getwin.03.01 (struct)
Upon successful completion, getwin() returns a pointer to the window it created.
- getwin.03.02
Otherwise, it returns a null pointer.
- [+]intrflush (6 / 0 / 0)
- intrflush.01
The intrflush() function specifies whether pressing an interrupt key (interrupt, suspend or quit) will flush the input buffer associated with the current screen.
- intrflush.02.01
If the value of bf is TRUE, then flushing of the output buffer associated with the current screen will occur when an interrupt key (interrupt, suspend, or quit) is pressed.
- intrflush.02.02
If the value of bf is FALSE then no flushing of the buffer will occur when an interrupt key is pressed
- intrflush.03
The default for the option is inherited from the display driver settings.
- intrflush.04 (struct)
The win argument is ignored.
- intrflush.05.01
Upon successful completion, intrflush() returns OK
- intrflush.05.02
Otherwise, it returns ERR.
- [+]keypad (8 / 0 / 0)
- keypad.01
The keypad() function controls keypad translation.
- keypad.02.01
If bf is TRUE, keypad translation is turned on.
- keypad.02.02
If bf is FALSE, keypad translation is turned off.
- keypad.03
The initial state is FALSE.
- keypad.04
This function affects the behaviour of any function that provides keyboard input.
- keypad.05
If the terminal in use requires a command to enable it to transmit distinctive codes when a function key is pressed, then after keypad translation is first enabled, the implementation transmits this command to the terminal before an affected input function tries to read any characters from that terminal.
- keypad.06.01
Upon successful completion, keypad() returns OK.
- keypad.06.02
Otherwise, it returns ERR.
- [+]meta (6 / 0 / 0)
- meta.01
Initially, whether the terminal returns 7 or 8 significant bits on input depends on the control mode of the display driver
- meta.02.01
To force 8 bits to be returned, invoke meta(win, TRUE).
- meta.02.02
To force 7 bits to be returned, invoke meta(win, FALSE).
- meta.03 (struct)
The win argument is always ignored.
- meta.04
If the terminfo capabilities smm (meta_on) and rmm (meta_off) are defined for the terminal, smm is sent to the terminal when meta(win, TRUE) is called and rmm is sent when meta(win, FALSE) is called.
- meta.05.01
Upon successful completion, meta() returns OK.
- meta.05.02
Otherwise, it returns ERR.
- [+]mvderwin (8 / 0 / 0)
- mvderwin.01
The mvderwin() function specifies a mapping of characters.
- mvderwin.02.01
The function identifies a mapped area of the parent of the specified window, whose size is the same as the size of the specified window
- mvderwin.02.02
and whose origin is at (par_y, par_x) of the parent window.
- mvderwin.03
During any refresh of the specified window, the characters displayed in that window's display area of the terminal are taken from the mapped area.
- mvderwin.04
Any references to characters in the specified window obtain or modify characters in the mapped area.
- mvderwin.05
That is, mvderwin() defines a coordinate transformation from each position in the mapped area to a corresponding position (same y, x offset from the origin) in the specified window.
- mvderwin.06.01
Upon successful completion, mvderwin() returns OK.
- mvderwin.06.02
Otherwise, it returns ERR.
- [+]mvwin (4 / 0 / 0)
- mvwin.01
The mvwin() function moves the specified window so that its origin is at position (y, x).
- mvwin.02
If the move would cause any portion of the window to extend past any edge of the screen, the function fails and the window is not moved.
- mvwin.03.01
Upon successful completion, mvwin() returns OK.
- mvwin.03.02
Otherwise, it returns ERR.
- [+]newwin (6 / 0 / 0)
- newwin.01.01
The newwin() function creates a new window with nlines lines and ncols columns,
- newwin.01.02
positioned so that the origin is (begin_y, begin_x).
- newwin.02.01
If nlines is zero, it defaults to LINES - begin_y;
- newwin.02.02
if ncols is zero, it defaults to COLS - begin_x.
- newwin.02.03
The size of a window cannot be greater than the physical size of the screen, or that defined using the environment variables LINES and COLUMNS. The behaviour of a window which extends outside the terminal screen is undefined.
- newwin.04.01 (struct)
Upon successful completion, these functions return a pointer to the new window.
- newwin.04.02
Otherwise, they return a null pointer.
- [+]nodelay (6 / 0 / 0)
- nodelay.01
The nodelay() function specifies whether Delay Mode or No Delay Mode is in effect for the screen associated with the specified window.
- nodelay.02.01
If bf is TRUE, this screen is set to No Delay Mode.
- nodelay.02.02
If bf is FALSE, this screen is set to Delay Mode.
- nodelay.03
The initial state is FALSE.
- nodelay.04.01
Upon successful completion, nodelay() returns OK.
- nodelay.04.02
Otherwise, it returns ERR.
- [+]overlay (7 / 0 / 0)
- overlay.01
The overlay() and overwrite() functions overlay srcwin on top of dstwin.
- app.overlay.02 (struct)
The scrwin and dstwin arguments need not be the same size;
- overlay.03
only text where the two windows overlap is copied.
- overlay.04
The overlay() function does the same thing, except that, whenever a character to be copied is the background character of the source window, overlay() does not copy the character but merely moves the destination cursor the width of the source background character.
- overlay.05
If any portion of the overlaying window border is not the first column of a multi-column character then all the column positions will be replaced with the background character and rendition before the overlay is done.
- overlay.06
If the default background character is a multi-column character when this occurs, then these functions fail.
- overlay.07.01
Upon successful completion, these functions return OK.
- overlay.07.02
Otherwise, they return ERR.
- [+]overwrite (7 / 0 / 0)
- overwrite.01
The overlay() and overwrite() functions overlay srcwin on top of dstwin.
- app.overwrite.02 (struct)
The scrwin and dstwin arguments need not be the same size;
- overwrite.03
only text where the two windows overlap is copied.
- overwrite.04
The overwrite() function copies characters as though a sequence of win_wch() and wadd_wch() were performed with the destination window's attributes and background attributes cleared.
- overwrite.05
If any portion of the overlaying window border is not the first column of a multi-column character then all the column positions will be replaced with the background character and rendition before the overlay is done.
- overwrite.06
If the default background character is a multi-column character when this occurs, then these functions fail.
- overwrite.07.01
Upon successful completion, these functions return OK.
- overwrite.07.02
Otherwise, they return ERR.
- [+]putwin (4 / 0 / 0)
- putwin.01
The putwin() function writes all data associated with win into the stdio stream to which filep points, using an unspecified format.
- putwin.02
This information can be retrieved later using getwin().
- putwin.03.01
Upon successful completion, putwin() returns OK.
- putwin.03.02
Otherwise, it returns ERR.
- [+]subwin (5 / 0 / 0)
- subwin.01.01
The subwin() function creates a new window with nlines lines and ncols columns,
- subwin.01.02
positioned so that the origin is at (begin_y, begin_x).
- subwin.02
This position is an absolute screen position, not a position relative to the window orig.
- subwin.03
If any part of the new window is outside orig, the function fails and the window is not created.
- subwin.04.01 (struct)
Upon successful completion, these functions return a pointer to the new window.
- subwin.04.02
Otherwise, they return a null pointer.
- [+]process.context (19 / 8 / 0)
- [+]getcontext (3 / 1 / 0)
- getcontext.01
The getcontext() function shall initialize the structure pointed to by ucp to the current user context of the calling thread.
- getcontext.07.01
Upon successful completion, setcontext() shall not return and getcontext() shall return 0
- getcontext.07.02
otherwise, a value of -1 shall be returned.
- [+]makecontext (3 / 0 / 0)
- makecontext.01
The makecontext() function shall modify the context specified by ucp, which has been initialized using getcontext().
- app.makecontext.01
Before a call is made to makecontext(), the application shall ensure that the context being modified has a stack allocated for it.
- app.makecontext.02
The application shall ensure that the value of argc matches the number of arguments of type int passed to func; otherwise, the behavior is undefined.
- makecontext.02
When this context is resumed using swapcontext() or setcontext(), program execution shall continue by calling func, passing it the arguments that follow argc in the makecontext() call.
- app.makecontext.03
The application shall ensure that the uc_link member is initialized prior to the call to makecontext().
- makecontext.03
The uc_link member is used to determine the context that shall be resumed when the context being modified by makecontext() returns.
- [+]setcontext (8 / 4 / 0)
- setcontext.01
The setcontext() function shall restore the user context pointed to by ucp.
- app.setcontext.01
The ucp argument should be created either by a prior call to getcontext() or makecontext(), or by being passed as an argument to a signal handler.
The effects of passing a ucp argument obtained from any other source are unspecified.
- setcontext.02
program execution resumes at the point specified by the ucp argument passed to setcontext().
- setcontext.03
If the ucp argument was created with getcontext(), program execution continues as if the corresponding call of getcontext() had just returned.
- setcontext.04
If the ucp argument was created with makecontext(), program execution continues with the function passed to makecontext().
- setcontext.05
When that function returns, the thread shall continue as if after a call to setcontext() with the ucp argument that was input to makecontext().
- setcontext.06
If the uc_link member of the ucontext_t structure pointed to by the ucp argument is equal to 0, then this context is the main context, and the thread shall exit when this context returns.
- setcontext.07.01
Upon successful completion, setcontext() shall not return and getcontext() shall return 0
A successful call to setcontext() shall not return;
- setcontext.07.02
otherwise, a value of -1 shall be returned.
- [+]swapcontext (5 / 3 / 0)
- swapcontext.01
The swapcontext() function
- swapcontext.01.01
shall save the current context in the context structure pointed to by oucp
- swapcontext.01.02
shall set the context to the context structure pointed to by ucp.
- swapcontext.02.01
Upon successful completion, swapcontext() shall return 0.
- swapcontext.02.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- swapcontext.03
The swapcontext() function shall fail if:
- swapcontext.03.01
[ENOMEM] The ucp argument does not have enough stack left to complete the operation.
- [+]process.environ (23 / 20 / 0)
- [+]getenv (2 / 2 / 0)
- getenv.01
The getenv() function shall search the environment of the calling process (see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables) for the environment variable name if it exists and return a pointer to the value of the environment variable.
Upon successful completion, getenv() shall return a pointer to a string containing the value for the specified name.
- app.getenv.01
The application shall ensure that it does not modify the string pointed to by the getenv() function.
- getenv.02
If the specified environment variable cannot be found, a null pointer shall be returned.
If the specified name cannot be found in the environment of the calling process, a null pointer shall be returned.
- app.getenv.02
The string pointed to may be overwritten by a subsequent call to getenv(), [CX] setenv(), or unsetenv(), but shall not be overwritten by a call to any other function in this volume of IEEE Std 1003.1-2001.
The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), [CX] setenv(), or unsetenv(). [XSI] On XSI-conformant systems, the return value from getenv() may point to static data which may also be overwritten by subsequent calls to putenv().
- app.getenv.03
[CX] If the application modifies environ or the pointers to which it points, the behavior of getenv() is undefined.
- app.getenv.04
The getenv() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]putenv (5 / 3 / 0)
- putenv.01
The putenv() function shall make the value of the environment variable name equal to value by altering an existing variable or creating a new one.
- app.putenv.01
The putenv() function shall use the string argument to set environment variable values. The string argument should point to a string of the form " name= value ".
- app.putenv.02
so altering the string shall change the environment.
- putenv.02.01
Upon successful completion, putenv() shall return 0
- putenv.02.02
otherwise, it shall return a non-zero value and set errno to indicate the error
- app.putenv.03
The putenv() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- putenv.03
The putenv() function may fail if:
- putenv.03.01
[ENOMEM] Insufficient memory was available.
- putenv.04
In either case, the string pointed to by string shall become part of the environment
- [+]setenv (9 / 8 / 0)
- app.setenv.01
If the application modifies environ or the pointers to which it points, the behavior of setenv() is undefined.
- setenv.01
The setenv() function shall update or add a variable in the environment of the calling process. The envname argument points to a string containing the name of an environment variable to be added or altered. The environment variable shall be set to the value to which envval points.
- setenv.01.01
If the environment variable named by envname already exists and the value of overwrite is non-zero, the function shall return success and the environment shall be updated.
- setenv.01.02
If the environment variable named by envname already exists and the value of overwrite is zero, the function shall return success and the environment shall remain unchanged.
- app.setenv.02
The setenv() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- setenv.02
The setenv() function shall update the list of pointers to which environ points.
- setenv.03
The strings described by envname and envval are copied by this function.
- setenv.04.01
Upon successful completion, zero shall be returned.
- setenv.04.02
Otherwise, -1 shall be returned, errno set to indicate the error
- setenv.04.03
the environment shall be unchanged
- setenv.05
The setenv() function shall fail if:
- setenv.05.01
[EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character.
The function shall fail if envname points to a string which contains an '=' character.
- setenv.05.02
[ENOMEM] Insufficient memory was available to add a variable or its value to the environment.
- [+]unsetenv (7 / 7 / 0)
- app.unsetenv.01
If the application modifies environ or the pointers to which it points, the behavior of unsetenv() is undefined.
- unsetenv.01
The unsetenv() function shall remove an environment variable from the environment of the calling process. The name argument points to a string, which is the name of the variable to be removed.
- app.unsetenv.02
The unsetenv() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- unsetenv.02
If the named variable does not exist in the current environment, the environment shall be unchanged and the function is considered to have completed successfully.
- unsetenv.03
The unsetenv() function shall update the list of pointers to which environ points.
- unsetenv.04.01
Upon successful completion, zero shall be returned.
- unsetenv.04.02
Otherwise, -1 shall be returned, errno set to indicate the error
- unsetenv.04.03
the environment shall be unchanged
- unsetenv.05
The unsetenv() function shall fail if:
- unsetenv.05.01
[EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character.
The named argument shall not contain an '=' character.
- [+]process.fenv (36 / 28 / 0)
- [+]feclearexcept (3 / 2 / 0)
- feclearexcept.01
The feclearexcept() function shall attempt to clear the supported floating-point exceptions represented by excepts.
- feclearexcept.02
If the argument is zero or if all the specified exceptions were successfully cleared, feclearexcept() shall return zero.
- feclearexcept.03
Otherwise, it shall return a non-zero value.
- [+]fegetenv (3 / 2 / 0)
- fegetenv.01
The fegetenv() function shall attempt to store the current floating-point environment in the object pointed to by envp.
- fegetenv.02
If the representation was successfully stored, fegetenv() shall return zero.
- fegetenv.03
Otherwise, it shall return a non-zero value.
- [+]fegetexceptflag (3 / 2 / 0)
- fegetexceptflag.01
The fegetexceptflag() function shall attempt to store an implementation-defined representation of the states of the floating-point status flags indicated by the argument excepts in the object pointed to by the argument flagp.
- fegetexceptflag.02
If the representation was successfully stored, fegetexceptflag() shall return zero.
- fegetexceptflag.03
Otherwise, it shall return a non-zero value.
- [+]fegetround (2 / 1 / 0)
- fegetround.01
The fegetround() function shall get the current rounding direction.
- fegetround.01.01
The fegetround() function shall return the value of the rounding direction macro representing the current rounding direction
- fegetround.01.02
or a negative value if there is no such rounding direction macro or the current rounding direction is not determinable.
- [+]feholdexcept (4 / 4 / 0)
- feholdexcept.01.01
The feholdexcept() function shall save the current floating-point environment in the object pointed to by envp
- feholdexcept.01.02
clear the floating-point status flags
- feholdexcept.01.03
and then install a non-stop (continue on floating-point exceptions) mode, if available, for all floating-point exceptions.
- feholdexcept.02
The feholdexcept() function shall return zero if and only if non-stop floating-point exception handling was successfully installed.
- [+]feraiseexcept (5 / 3 / 0)
- feraiseexcept.01
The feraiseexcept() function shall attempt to raise the supported floating-point exceptions represented by the argument excepts.
- feraiseexcept.02
The order in which these floating-point exceptions are raised is unspecified.
- feraiseexcept.03
Whether the feraiseexcept() function additionally raises the inexact floating-point exception whenever it raises the overflow or underflow floating-point exception is implementation-defined.
- feraiseexcept.04
If the argument is zero or if all the specified exceptions were successfully raised, feraiseexcept() shall return zero.
- feraiseexcept.05
Otherwise, it shall return a non-zero value.
- [+]fesetenv (4 / 3 / 0)
- app.fesetenv.01
The argument envp shall point to an object set by a call to fegetenv() or feholdexcept(), or equal a floating-point environment macro.
- fesetenv.01
The fesetenv() function shall attempt to establish the floating-point environment represented by the object pointed to by envp.
- fesetenv.02
The fesetenv() function does not raise floating-point exceptions, but only installs the state of the floating-point status flags represented through its argument.
- fesetenv.03
If the environment was successfully established, fesetenv() shall return zero.
- fesetenv.04
Otherwise, it shall return a non-zero value.
- [+]fesetexceptflag (4 / 3 / 0)
- app.fesetexceptflag.01
The value pointed to by flagp shall have been set by a previous call to fegetexceptflag() whose second argument represented at least those floating-point exceptions represented by the argument excepts.
- fesetexceptflag.01
The fesetexceptflag() function shall attempt to set the floating-point status flags indicated by the argument excepts to the states stored in the object pointed to by flagp.
- fesetexceptflag.02
This function does not raise floating-point exceptions, but only sets the state of the flags.
- fesetexceptflag.03
If the excepts argument is zero or if all the specified exceptions were successfully set, fesetexceptflag() shall return zero.
- fesetexceptflag.04
Otherwise, it shall return a non-zero value.
- [+]fesetround (3 / 3 / 0)
- fesetround.01
The fesetround() function shall establish the rounding direction represented by its argument round.
- fesetround.02
If the argument is not equal to the value of a rounding direction macro, the rounding direction is not changed.
- fesetround.03
The fesetround() function shall return a zero value if and only if the requested rounding direction was established.
- [+]fetestexcept (1 / 1 / 0)
- fetestexcept.01
The fetestexcept() function shall determine which of a specified subset of the floating-point exception flags are currently set. The excepts argument specifies the floating-point status flags to be queried.
- fetestexcept.01.01
The fetestexcept() function shall return the value of the bitwise-inclusive OR of the floating-point exception macros corresponding to the currently set floating-point exceptions included in excepts.
- [+]feupdateenv (4 / 4 / 0)
- app.feupdateenv.01
The argument envp shall point to an object set by a call to feholdexcept() or fegetenv(), or equal a floating-point environment macro.
- feupdateenv.01.01
The feupdateenv() function shall attempt to save the currently raised floating-point exceptions in its automatic storage
- feupdateenv.01.02
attempt to install the floating-point environment represented by the object pointed to by envp
- feupdateenv.01.03
and then attempt to raise the saved floating-point exceptions.
- feupdateenv.02
The feupdateenv() function shall return a zero value if and only if all the required actions were successfully carried out.
- [+]process.goto (31 / 13 / 0)
- [+]__sigsetjmp (4 / 2 / 0)
- __sigsetjmp.01
A call to setjmp() shall save the calling environment in its env argument for later use by longjmp().
References to setjmp() are equivalent to sigsetjmp().References to longjmp() are equivalent to siglongjmp().
- app.__sigsetjmp.02
An application shall ensure that an invocation of setjmp() appears in one of the following contexts only:
- app.__sigsetjmp.02.01
The entire controlling expression of a selection or iteration statement
- app.__sigsetjmp.02.02
One operand of a relational or equality operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- app.__sigsetjmp.02.03
The operand of a unary '!' operator with the resulting expression being the entire controlling expression of a selection or iteration
- app.__sigsetjmp.02.04
The entire expression of an expression statement (possibly cast to void)
- __sigsetjmp.04
If the return is from a successful direct invocation, sigsetjmp() shall return 0. If the return is from a call to siglongjmp(), sigsetjmp() shall return a non-zero value.
- __sigsetjmp.07
The sigsetjmp() function shall be equivalent to the setjmp() function, except as follows:
- __sigsetjmp.07.01
If the value of the savemask argument is not 0, sigsetjmp() shall also save the current signal mask of the calling thread as part of the calling environment.
- __sigsetjmp.30
__sigsetjmp() has the same behavior as sigsetjmp() as specified by ISO POSIX (2003).
Generalizes:
- &__sigsetjmp.01
- &app.__sigsetjmp.02
- __sigsetjmp.01
- __sigsetjmp.04
- __sigsetjmp.07.01
- [+]_longjmp (8 / 3 / 0)
- _longjmp.01
The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same thread, with the corresponding jmp_buf argument.
- app._longjmp.01
If _longjmp() is called even though env was never initialized by a call to _setjmp(), or when the last such call was in a function that has since returned, the results are undefined.
- _longjmp.02
All accessible objects have values, and all other components of the abstract machine have state (for example, floating-point status flags and open files), as of the time longjmp() was called, except that the values of objects of automatic storage duration are unspecified if they meet all the following conditions:
- _longjmp.02.01
They are local to the function containing the corresponding setjmp() invocation.
- _longjmp.02.02
They do not have volatile-qualified type.
- _longjmp.02.03
They are changed between the setjmp() invocation and longjmp() call.
- app._longjmp.02
However, if longjmp() is invoked from a nested signal handler (that is, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined.
- app._longjmp.03
The effect of a call to longjmp() where initialization of the jmp_buf structure was not performed in the calling thread is undefined.
- _longjmp.03
As it bypasses the usual function call and return mechanisms, longjmp() shall execute correctly in contexts of interrupts, signals, and any of their associated functions.
- _longjmp.04
After longjmp() is completed, program execution continues as if the corresponding invocation of setjmp() had just returned the value specified by val.
- _longjmp.05
The longjmp() function shall not cause setjmp() to return 0; if val is 0, setjmp() shall return 1.
If the return is from a call to longjmp(), setjmp() shall return a non-zero value.
- _longjmp.06
The _longjmp() and _setjmp() functions shall be equivalent to longjmp() and setjmp(), respectively, with the additional restriction that _longjmp() and _setjmp() shall not manipulate the signal mask.
- [+]_setjmp (3 / 2 / 0)
- _setjmp.01
A call to setjmp() shall save the calling environment in its env argument for later use by longjmp().
- app._setjmp.02
An application shall ensure that an invocation of setjmp() appears in one of the following contexts only:
- app._setjmp.02.01
The entire controlling expression of a selection or iteration statement
- app._setjmp.02.02
One operand of a relational or equality operator with the other operand an integral constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement
- app._setjmp.02.03
The operand of a unary '!' operator with the resulting expression being the entire controlling expression of a selection or iteration
- app._setjmp.02.04
The entire expression of an expression statement (possibly cast to void)
- _setjmp.04
If the return is from a direct invocation, setjmp() shall return 0. If the return is from a call to longjmp(), setjmp() shall return a non-zero value.
- _setjmp.06
The _longjmp() and _setjmp() functions shall be equivalent to longjmp() and setjmp(), respectively, with the additional restriction that _longjmp() and _setjmp() shall not manipulate the signal mask.
- [+]longjmp (8 / 3 / 0)
- app.longjmp.01
If there is no such invocation, or if the function containing the invocation of setjmp() has terminated execution in the interim, or if the invocation of setjmp() was within the scope of an identifier with variably modified type and execution has left that scope in the interim, the behavior is undefined.
- longjmp.01
The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same thread, with the corresponding jmp_buf argument.
The effect of calling longjmp() or siglongjmp() is undefined if there have been any calls to pthread_cleanup_push() or pthread_cleanup_pop() made without the matching call since the jump buffer was filled.
- longjmp.02
All accessible objects have values, and all other components of the abstract machine have state (for example, floating-point status flags and open files), as of the time longjmp() was called, except that the values of objects of automatic storage duration are unspecified if they meet all the following conditions:
- longjmp.02.01
They are local to the function containing the corresponding setjmp() invocation.
- longjmp.02.02
They do not have volatile-qualified type.
- longjmp.02.03
They are changed between the setjmp() invocation and longjmp() call.
- app.longjmp.02
However, if longjmp() is invoked from a nested signal handler (that is, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined.
- longjmp.03
As it bypasses the usual function call and return mechanisms, longjmp() shall execute correctly in contexts of interrupts, signals, and any of their associated functions.
- app.longjmp.03
The effect of a call to longjmp() where initialization of the jmp_buf structure was not performed in the calling thread is undefined.
- longjmp.04
After longjmp() is completed, program execution continues as if the corresponding invocation of setjmp() had just returned the value specified by val.
- longjmp.05
The longjmp() function shall not cause setjmp() to return 0; if val is 0, setjmp() shall return 1.
If the return is from a call to longjmp(), setjmp() shall return a non-zero value.
- longjmp.06
It is unspecified whether longjmp() restores the signal mask, leaves the signal mask unchanged, or restores it to its value at the time setjmp() was called.
- [+]siglongjmp (8 / 3 / 0)
- siglongjmp.01
The longjmp() function shall restore the environment saved by the most recent invocation of setjmp() in the same thread, with the corresponding jmp_buf argument.
- app.siglongjmp.01
If there is no such invocation, or if the function containing the invocation of setjmp() has terminated execution in the interim, or if the invocation of setjmp() was within the scope of an identifier with variably modified type and execution has left that scope in the interim, the behavior is undefined.
References to setjmp() shall be equivalent to sigsetjmp().
- siglongjmp.02
All accessible objects have values, and all other components of the abstract machine have state (for example, floating-point status flags and open files), as of the time longjmp() was called, except that the values of objects of automatic storage duration are unspecified if they meet all the following conditions:
- siglongjmp.02.01
They are local to the function containing the corresponding setjmp() invocation.
- siglongjmp.02.02
They do not have volatile-qualified type.
- siglongjmp.02.03
They are changed between the setjmp() invocation and longjmp() call.
- app.siglongjmp.02
However, if longjmp() is invoked from a nested signal handler (that is, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined.
- app.siglongjmp.03
The effect of a call to longjmp() where initialization of the jmp_buf structure was not performed in the calling thread is undefined.
- siglongjmp.03
As it bypasses the usual function call and return mechanisms, longjmp() shall execute correctly in contexts of interrupts, signals, and any of their associated functions.
- siglongjmp.04
After siglongjmp() is completed, program execution shall continue as if the corresponding invocation of sigsetjmp() had just returned the value specified by val.
- siglongjmp.05
The siglongjmp() function shall not cause sigsetjmp() to return 0; if val is 0, sigsetjmp() shall return the value 1.
If the return is from a call to siglongjmp(), sigsetjmp() shall return a non-zero value.
- siglongjmp.07
The siglongjmp() function shall be equivalent to the longjmp() function, except as follows:
- siglongjmp.07.01
The siglongjmp() function shall restore the saved signal mask if and only if the env argument was initialized by a call to sigsetjmp() with a non-zero savemask argument.
- [+]process.ipc.ipc (14 / 5 / 0)
- [+]ftok (14 / 5 / 0)
- ftok.01
The ftok() function shall return a key based on path and id that is usable in subsequent calls to msgget(), semget(), and shmget().
- app.ftok.02
The application shall ensure that the path argument is the pathname of an existing file that the process is able to stat().
- ftok.03.01
The ftok() function shall return the same key value for all paths that name the same file, when called with the same id value,
- ftok.03.02
and return different key values when called with different id values or with paths that name different files existing on the same file system at the same time.
- ftok.04
It is unspecified whether ftok() shall return the same key value when called again after the file named by path is removed and recreated with the same name.
- ftok.05
Only the low-order 8-bits of id are significant.
- app.ftok.06
The behavior of ftok() is unspecified if these bits are 0.
- ftok.07.01
Upon successful completion, ftok() shall return a key.
- ftok.07.02
Otherwise, ftok() shall return (key_t)-1 and set errno to indicate the error.
- ftok.08
The ftok() function shall fail if:
- ftok.08.01
[EACCES] Search permission is denied for a component of the path prefix.
- ftok.08.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- ftok.08.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- ftok.08.04
[ENOENT] A component of path does not name an existing file or path is an empty string.
- ftok.08.05
[ENOTDIR] A component of the path prefix is not a directory.
- ftok.09
The ftok() function may fail if:
- ftok.09.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- ftok.09.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- [+]process.ipc.msg (71 / 7 / 0)
- [+]msgctl (14 / 2 / 0)
- msgctl.01
The msgctl() function operates on XSI message queues
Generalizes:
- msgctl.02
- msgctl.03.01
- msgctl.03.02.01
- msgctl.03.02.02
- msgctl.03.02.03
- msgctl.03.03.01
- msgctl.03.03.02
- msgctl.04.01
- msgctl.04.02
- msgctl.05.01
- msgctl.05.02
- msgctl.05.03
- msgctl.05.04
- msgctl.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- msgctl.03
The msgctl() function shall provide message control operations as specified by cmd. The following values for cmd, and the message control operations they specify, are:
- msgctl.03.01
IPC_STAT Place the current value of each member of the msqid_ds data structure associated with msqid into the structure pointed to by buf. The contents of this structure are defined in <sys/msg.h>.
- msgctl.03.02
IPC_SET
- msgctl.03.02.01
Set the value of the following members of the msqid_ds data structure associated with msqid to the corresponding value found in the structure pointed to by buf: msg_perm.uidmsg_perm.gidmsg_perm.modemsg_qbytes
- msgctl.03.02.02
IPC_SET can only be executed by a process with appropriate privileges or that has an effective user ID equal to the value of msg_perm.cuid or msg_perm.uid in the msqid_ds data structure associated with msqid.
- msgctl.03.02.03
Only a process with appropriate privileges can raise the value of msg_qbytes.
- msgctl.03.03
IPC_RMID
- msgctl.03.03.01
Remove the message queue identifier specified by msqid from the system and destroy the message queue and msqid_ds data structure associated with it.
- msgctl.03.03.02
IPC_RMD can only be executed by a process with appropriate privileges or one that has an effective user ID equal to the value of msg_perm.cuid or msg_perm.uid in the msqid_ds data structure associated with msqid.
- msgctl.04.01
Upon successful completion, msgctl() shall return 0;
- msgctl.04.02
otherwise, it shall return -1 and set errno to indicate the error.
- msgctl.05
The msgctl() function shall fail if:
- msgctl.05.01
[EACCES] The argument cmd is IPC_STAT and the calling process does not have read permission; see XSI Interprocess Communication.
- msgctl.05.02
[EINVAL] The value of msqid is not a valid message queue identifier; or the value of cmd is not a valid command.
- msgctl.05.03
[EPERM] The argument cmd is IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of a process with appropriate privileges and it is not equal to the value of msg_perm.cuid or msg_perm.uid in the data structure associated with msqid.
- msgctl.05.04
[EPERM] The argument cmd is IPC_SET, an attempt is being made to increase to the value of msg_qbytes, and the effective user ID of the calling process does not have appropriate privileges.
- [+]msgget (15 / 3 / 0)
- msgget.01
The msgget() function operates on XSI message queues (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.224, Message Queue).
Generalizes:
- msgget.02
- msgget.03
- msgget.04.01
- msgget.04.02
- msgget.05.01
- msgget.05.02
- msgget.05.03
- msgget.05.04
- msgget.05.05
- msgget.06.01
- msgget.06.02
- msgget.07.01
- msgget.07.02
- msgget.07.03
- msgget.07.04
- msgget.02 (struct)
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- msgget.03
The msgget() function shall return the message queue identifier associated with the argument key.
- msgget.04
A message queue identifier, associated message queue, and data structure (see <sys/msg.h>), shall be created for the argument key if one of the following is true:
- msgget.04.01
The argument key is equal to IPC_PRIVATE.
- msgget.04.02
The argument key does not already have a message queue identifier associated with it, and (msgflg & IPC_CREAT) is non-zero.
- msgget.05
Upon creation, the data structure associated with the new message queue identifier shall be initialized as follows:
- msgget.05.01
msg_perm.cuid, msg_perm.uid, msg_perm.cgid, and msg_perm.gid shall be set equal to the effective user ID and effective group ID, respectively, of the calling process.
- msgget.05.02
The low-order 9 bits of msg_perm.mode shall be set equal to the low-order 9 bits of msgflg.
- msgget.05.03
msg_qnum, msg_lspid, msg_lrpid, msg_stime, and msg_rtime shall be set equal to 0.
- msgget.05.04
msg_ctime shall be set equal to the current time.
- msgget.05.05
msg_qbytes shall be set equal to the system limit.
- msgget.06.01
Upon successful completion, msgget() shall return a non-negative integer, namely a message queue identifier.
- msgget.06.02
Otherwise, it shall return -1 and set errno to indicate the error.
- msgget.07
The msgget() function shall fail if:
- msgget.07.01
[EACCES] A message queue identifier exists for the argument key, but operation permission as specified by the low-order 9 bits of msgflg would not be granted; see XSI Interprocess Communication.
- msgget.07.02
[EEXIST] A message queue identifier exists for the argument key but ((msgflg & IPC_CREAT) && (msgflg & IPC_EXCL)) is non-zero.
- msgget.07.03
[ENOENT] A message queue identifier does not exist for the argument key and (msgflg & IPC_CREAT) is 0.
- msgget.07.04
[ENOSPC] A message queue identifier is to be created but the system-imposed limit on the maximum number of allowed message queue identifiers system-wide would be exceeded.
- [+]msgrcv (23 / 1 / 0)
- msgrcv.01
The msgrcv() function operates on XSI message queues (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.224, Message Queue).
Generalizes:
- msgrcv.02
- msgrcv.03
- msgrcv.05
- msgrcv.06
- msgrcv.07
- msgrcv.09.01
- msgrcv.09.02
- msgrcv.09.03
- msgrcv.10.01
- msgrcv.10.02.01
- msgrcv.10.02.02
- msgrcv.10.02.03
- msgrcv.11.01
- msgrcv.11.02
- msgrcv.11.03
- msgrcv.12.01
- msgrcv.12.02
- msgrcv.13.01
- msgrcv.13.02
- msgrcv.13.03
- msgrcv.13.04
- msgrcv.13.05
- msgrcv.13.06
- msgrcv.02 (struct)
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- msgrcv.03
The msgrcv() function shall read a message from the queue associated with the message queue identifier specified by msqid and place it in the user-defined buffer pointed to by msgp.
- app.msgrcv.04
The application shall ensure that the argument msgp points to a user-defined buffer that contains first a field of type long specifying the type of the message, and then a data portion that holds the data bytes of the message.
- msgrcv.05
The argument msgsz specifies the size in bytes of mtext.
- msgrcv.06
The received message shall be truncated to msgsz bytes if it is larger than msgsz and (msgflg & MSG_NOERROR) is non-zero.
- msgrcv.07
The truncated part of the message shall be lost and no indication of the truncation shall be given to the calling process.
- app.msgrcv.08
If the value of msgsz is greater than {SSIZE_MAX}, the result is implementation-defined.
- msgrcv.09
The argument msgtyp specifies the type of message requested as follows:
- msgrcv.09.01
If msgtyp is 0, the first message on the queue shall be received.
- msgrcv.09.02
If msgtyp is greater than 0, the first message of type msgtyp shall be received.
- msgrcv.09.03
If msgtyp is less than 0, the first message of the lowest type that is less than or equal to the absolute value of msgtyp shall be received.
- msgrcv.10
The argument msgflg specifies the action to be taken if a message of the desired type is not on the queue. These are as follows:
- msgrcv.10.01
If (msgflg & IPC_NOWAIT) is non-zero, the calling thread shall return immediately with a return value of -1 and errno set to [ENOMSG].
- msgrcv.10.02
If (msgflg & IPC_NOWAIT) is 0, the calling thread shall suspend execution until one of the following occurs:
- msgrcv.10.02.01
A message of the desired type is placed on the queue.
- msgrcv.10.02.02
The message queue identifier msqid is removed from the system; when this occurs, errno shall be set equal to [EIDRM] and -1 shall be returned.
- msgrcv.10.02.03
The calling thread receives a signal that is to be caught; in this case a message is not received and the calling thread resumes execution in the manner prescribed in sigaction().
- msgrcv.11
Upon successful completion, the following actions are taken with respect to the data structure associated with msqid:
- msgrcv.11.01
msg_qnum shall be decremented by 1.
- msgrcv.11.02
msg_lrpid shall be set equal to the process ID of the calling process.
- msgrcv.11.03
msg_rtime shall be set equal to the current time.
- msgrcv.12.01
Upon successful completion, msgrcv() shall return a value equal to the number of bytes actually placed into the buffer mtext.
- msgrcv.12.02
Otherwise, no message shall be received, msgrcv() shall return (ssize_t)-1, and errno shall be set to indicate the error.
- msgrcv.13
The msgrcv() function shall fail if:
- msgrcv.13.01
[E2BIG] The value of mtext is greater than msgsz and (msgflg & MSG_NOERROR) is 0.
- msgrcv.13.02
[EACCES] Operation permission is denied to the calling process; see XSI Interprocess Communication.
- msgrcv.13.03
[EIDRM] The message queue identifier msqid is removed from the system.
- msgrcv.13.04
[EINTR] The msgrcv() function was interrupted by a signal.
- msgrcv.13.05
[EINVAL] msqid is not a valid message queue identifier.
- msgrcv.13.06
[ENOMSG] The queue does not contain a message of the desired type and (msgflg & IPC_NOWAIT) is non-zero.
- [+]msgsnd (19 / 1 / 0)
- msgsnd.01
The msgsnd() function operates on XSI message queues (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.224, Message Queue).
Generalizes:
- msgsnd.02
- msgsnd.03
- msgsnd.05
- msgsnd.06.01
- msgsnd.06.02
- msgsnd.07.01
- msgsnd.07.02.01
- msgsnd.07.02.02
- msgsnd.07.02.03
- msgsnd.08.01
- msgsnd.08.02
- msgsnd.08.03
- msgsnd.09.01
- msgsnd.09.02
- msgsnd.10.01
- msgsnd.10.02
- msgsnd.10.03
- msgsnd.10.04
- msgsnd.10.05
- msgsnd.02 (struct)
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- msgsnd.03
The msgsnd() function shall send a message to the queue associated with the message queue identifier specified by msqid.
- app.msgsnd.04
The application shall ensure that the argument msgp points to a user-defined buffer that contains first a field of type long specifying the type of the message, and then a data portion that holds the data bytes of the message.
- msgsnd.05
The argument msgsz can range from 0 to a system-imposed maximum.
- msgsnd.06
The argument msgflg specifies the action to be taken if one or more of the following is true:
- msgsnd.06.01
The number of bytes already on the queue is equal to msg_qbytes; see <sys/msg.h>.
- msgsnd.06.02
The total number of messages on all queues system-wide is equal to the system-imposed limit.
- msgsnd.07
These actions are as follows:
- msgsnd.07.01
If (msgflg & IPC_NOWAIT) is non-zero, the message shall not be sent and the calling thread shall return immediately.
- msgsnd.07.02
If (msgflg & IPC_NOWAIT) is 0, the calling thread shall suspend execution until one of the following occurs:
- msgsnd.07.02.01
The condition responsible for the suspension no longer exists, in which case the message is sent.
- msgsnd.07.02.02
The message queue identifier msqid is removed from the system; when this occurs, errno shall be set equal to [EIDRM] and -1 shall be returned.
- msgsnd.07.02.03
The calling thread receives a signal that is to be caught; in this case the message is not sent and the calling thread resumes execution in the manner prescribed in sigaction().
- msgsnd.08
Upon successful completion, the following actions are taken with respect to the data structure associated with msqid; see <sys/msg.h>:
- msgsnd.08.01
msg_qnum shall be incremented by 1.
- msgsnd.08.02
msg_lspid shall be set equal to the process ID of the calling process.
- msgsnd.08.03
msg_stime shall be set equal to the current time.
- msgsnd.09.01
Upon successful completion, msgsnd() shall return 0;
- msgsnd.09.02
otherwise, no message shall be sent, msgsnd() shall return -1, and errno shall be set to indicate the error.
- msgsnd.10
The msgsnd() function shall fail if:
- msgsnd.10.01
[EACCES] Operation permission is denied to the calling process; see XSI Interprocess Communication.
- msgsnd.10.02
[EAGAIN] The message cannot be sent for one of the reasons cited above and (msgflg & IPC_NOWAIT) is non-zero.
- msgsnd.10.03
[EIDRM] The message queue identifier msqid is removed from the system.
- msgsnd.10.04
[EINTR] The msgsnd() function was interrupted by a signal.
- msgsnd.10.05
[EINVAL] The value of msqid is not a valid message queue identifier, or the value of mtype is less than 1; or the value of msgsz is less than 0 or greater than the system-imposed limit.
- [+]process.ipc.sem (94 / 6 / 0)
- [+]semctl (36 / 2 / 0)
- semctl.01
The semctl() function operates on XSI semaphores (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.15, Semaphore).
Generalizes:
- semctl.02
- semctl.03
- semctl.04.01
- semctl.04.02
- semctl.05
- semctl.06
- semctl.07.01
- semctl.07.02.01
- semctl.07.02.02
- semctl.07.02.03
- semctl.07.03
- semctl.07.04
- semctl.07.05
- semctl.08.01.01
- semctl.08.02.01
- semctl.08.02.02
- semctl.08.02.03
- semctl.09.01.01
- semctl.09.01.02
- semctl.09.02.01
- semctl.09.02.02
- semctl.09.02.03
- semctl.09.02.04
- semctl.09.03.01
- semctl.09.03.02
- semctl.10.01
- semctl.10.02
- semctl.10.03
- semctl.10.04
- semctl.10.05
- semctl.11
- semctl.12.01
- semctl.12.02
- semctl.12.03
- semctl.12.04
- semctl.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- semctl.03
The semctl() function provides a variety of semaphore control operations as specified by cmd.
- semctl.04.01
The fourth argument is optional and depends upon the operation requested.
- semctl.04.02
If required, it is of type union semun, which the application shall explicitly declare:union semun { int val; struct semid_ds *buf; unsigned short *array;} arg;
- semctl.05
The following semaphore control operations as specified by cmd are executed with respect to the semaphore specified by semid and semnum.
- semctl.06
The level of permission required for each operation is shown with each command;
- semctl.07
The symbolic names for the values of cmd are defined in the <sys/sem.h> header:
- semctl.07.01
GETVAL Return the value of semval; see <sys/sem.h>. Requires read permission.
- semctl.07.02
SETVAL
- semctl.07.02.01
Set the value of semval to arg.val, where arg is the value of the fourth argument to semctl().
- semctl.07.02.02
When this command is successfully executed, the semadj value corresponding to the specified semaphore in all processes is cleared
- semctl.07.02.03
Requires alter permission;
- semctl.07.03
GETPID Return the value of sempid. Requires read permission.
- semctl.07.04
GETNCNT Return the value of semncnt. Requires read permission.
- semctl.07.05
GETZCNT Return the value of semzcnt. Requires read permission.
- semctl.08
The following values of cmd operate on each semval in the set of semaphores:
- semctl.08.01
GETALL
- semctl.08.01.01
Return the value of semval for each semaphore in the semaphore set and place into the array pointed to by arg.array, where arg is the fourth argument to semctl(). Requires read permission.
- semctl.08.02
SETALL
- semctl.08.02.01
Set the value of semval for each semaphore in the semaphore set according to the array pointed to by arg.array, where arg is the fourth argument to semctl().
- semctl.08.02.02
When this command is successfully executed, the semadj values corresponding to each specified semaphore in all processes are cleared.
- semctl.08.02.03
Requires alter permission.
- semctl.09
The following values of cmd are also available:
- semctl.09.01
IPC_STAT
- semctl.09.01.01
Place the current value of each member of the semid_ds data structure associated with semid into the structure pointed to by arg.buf, where arg is the fourth argument to semctl().
- semctl.09.01.02
Requires read permission.
- semctl.09.02
IPC_SET
- semctl.09.02.01
Set the value of the following members of the semid_ds data structure associated with semid to the corresponding value found in the structure pointed to by arg.buf, where arg is the fourth argument to semctl(): sem_perm.uidsem_perm.gidsem_perm.mode
- semctl.09.02.02
The mode bits specified in IPC General Description are copied into the corresponding bits of the sem_perm.mode associated with semid.
- semctl.09.02.03
The stored values of any other bits are unspecified.
- semctl.09.02.04
This command can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of sem_perm.cuid or sem_perm.uid in the semid_ds data structure associated with semid.
- semctl.09.03
IPC_RMID
- semctl.09.03.01
Remove the semaphore identifier specified by semid from the system and destroy the set of semaphores and semid_ds data structure associated with it.
- semctl.09.03.02
This command can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of sem_perm.cuid or sem_perm.uid in the semid_ds data structure associated with semid.
- semctl.10
If successful, the value returned by semctl() depends on cmd as follows:
- semctl.10.01
GETVAL The value of semval.
- semctl.10.02
GETPID The value of sempid.
- semctl.10.03
GETNCNT The value of semncnt.
- semctl.10.04
GETZCNT The value of semzcnt.
- semctl.10.05
All others 0.
- semctl.11
Otherwise, semctl() shall return -1 and set errno to indicate the error.
- semctl.12
The semctl() function shall fail if:
- semctl.12.01
[EACCES] Operation permission is denied to the calling process; see XSI Interprocess Communication.
- semctl.12.02
[EINVAL] The value of semid is not a valid semaphore identifier, or the value of semnum is less than 0 or greater than or equal to sem_nsems, or the value of cmd is not a valid command.
- semctl.12.03
[EPERM] The argument cmd is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of a process with appropriate privileges and it is not equal to the value of sem_perm.cuid or sem_perm.uid in the data structure associated with semid.
- semctl.12.04
[ERANGE] The argument cmd is equal to SETVAL or SETALL and the value to which semval is to be set is greater than the system-imposed maximum.
- [+]semget (16 / 2 / 0)
- semget.01
The semget() function operates on XSI semaphores (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.15, Semaphore).
Generalizes:
- semget.02
- semget.03
- semget.04.01
- semget.04.02
- semget.05.01
- semget.05.02
- semget.05.03
- semget.05.04
- semget.05.05
- semget.06.01
- semget.06.02
- semget.07.01
- semget.07.02
- semget.07.03
- semget.07.04
- semget.07.05
- semget.02 (struct)
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- semget.03
The semget() function shall return the semaphore identifier associated with key.
- semget.04
A semaphore identifier with its associated semid_ds data structure and its associated set of nsems semaphores (see <sys/sem.h>) is created for key if one of the following is true:
- semget.04.01
The argument key is equal to IPC_PRIVATE.
- semget.04.02
The argument key does not already have a semaphore identifier associated with it and (semflg &IPC_CREAT) is non-zero.
- semget.05
Upon creation, the semid_ds data structure associated with the new semaphore identifier is initialized as follows:
- semget.05.01
In the operation permissions structure sem_perm.cuid, sem_perm.uid, sem_perm.cgid, and sem_perm.gid shall be set equal to the effective user ID and effective group ID, respectively, of the calling process.
- semget.05.02
The low-order 9 bits of sem_perm.mode shall be set equal to the low-order 9 bits of semflg.
- semget.05.03
The variable sem_nsems shall be set equal to the value of nsems.
- semget.05.04
The variable sem_otime shall be set equal to 0 and sem_ctime shall be set equal to the current time.
- semget.05.05
The data structure associated with each semaphore in the set need not be initialized. The semctl() function with the command SETVAL or SETALL can be used to initialize each semaphore.
- semget.06.01
Upon successful completion, semget() shall return a non-negative integer, namely a semaphore identifier;
- semget.06.02
otherwise, it shall return -1 and set errno to indicate the error.
- semget.07
The semget() function shall fail if:
- semget.07.01
[EACCES] A semaphore identifier exists for key, but operation permission as specified by the low-order 9 bits of semflg would not be granted; see XSI Interprocess Communication.
- semget.07.02
[EEXIST] A semaphore identifier exists for the argument key but ((semflg &IPC_CREAT) &&(semflg &IPC_EXCL)) is non-zero.
- semget.07.03
[EINVAL] The value of nsems is either less than or equal to 0 or greater than the system-imposed limit, or a semaphore identifier exists for the argument key, but the number of semaphores in the set associated with it is less than nsems and nsems is not equal to 0.
- semget.07.04
[ENOENT] A semaphore identifier does not exist for the argument key and (semflg &IPC_CREAT) is equal to 0.
- semget.07.05
[ENOSPC] A semaphore identifier is to be created but the system-imposed limit on the maximum number of allowed semaphores system-wide would be exceeded.
- [+]semop (42 / 2 / 0)
- semop.01
The semop() function operates on XSI semaphores (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.15, Semaphore).
Generalizes:
- semop.02
- semop.03
- semop.04
- semop.05
- semop.06
- semop.07
- semop.08
- semop.09.01.01.01
- semop.09.01.01.02
- semop.09.01.02.01
- semop.09.01.03.01
- semop.09.01.03.02.01.01
- semop.09.01.03.02.01.02
- semop.09.01.03.02.01.03
- semop.09.01.03.02.01.04
- semop.09.01.03.02.02.01
- semop.09.01.03.02.02.02
- semop.09.01.03.02.03.01
- semop.09.01.03.02.03.02
- semop.09.02.01
- semop.09.02.02
- semop.09.03.01
- semop.09.03.02
- semop.09.03.03.01
- semop.09.03.03.02.01
- semop.09.03.03.02.02.01
- semop.09.03.03.02.02.02
- semop.09.03.03.02.03.01
- semop.09.03.03.02.03.02
- semop.10
- semop.11.01
- semop.11.02
- semop.12.01
- semop.12.02
- semop.12.03
- semop.12.04
- semop.12.05
- semop.12.06
- semop.12.07
- semop.12.08
- semop.12.09
- semop.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- semop.03
The semop() function shall perform atomically a user-defined array of semaphore operations on the set of semaphores associated with the semaphore identifier specified by the argument semid.
- semop.04
The argument sops is a pointer to a user-defined array of semaphore operation structures.
- semop.05
The implementation shall not modify elements of this array unless the application uses implementation-defined extensions.
- semop.06
The argument nsops is the number of such structures in the array.
- semop.07
Each structure, sembuf, includes the following members:Member TypeMember NameDescriptionshortsem_numSemaphore number.shortsem_opSemaphore operation.shortsem_flgOperation flags.
- semop.08
Each semaphore operation specified by sem_op is performed on the corresponding semaphore specified by semid and sem_num.
- semop.09
The variable sem_op specifies one of three semaphore operations:
- semop.09.01
If sem_op is a negative integer and the calling process has alter permission, one of the following shall occur:
- semop.09.01.01.01
If semval(see <sys/sem.h>) is greater than or equal to the absolute value of sem_op, the absolute value of sem_op is subtracted from semval.
- semop.09.01.01.02
Also, if (sem_flg &SEM_UNDO) is non-zero, the absolute value of sem_op shall be added to the calling process' semadj value for the specified semaphore.
- semop.09.01.02.01
If semval is less than the absolute value of sem_op and (sem_flg &IPC_NOWAIT) is non-zero, semop() shall return immediately.
- semop.09.01.03.01
If semval is less than the absolute value of sem_op and (sem_flg &IPC_NOWAIT) is 0, semop() shall increment the semncnt associated with the specified semaphore
- semop.09.01.03.02
and suspend execution of the calling thread until one of the following conditions occurs:
- semop.09.01.03.02.01.01
The value of semval becomes greater than or equal to the absolute value of sem_op.
- semop.09.01.03.02.01.02
When this occurs, the value of semncnt associated with the specified semaphore shall be decremented,
- semop.09.01.03.02.01.03
the absolute value of sem_op shall be subtracted from semval
- semop.09.01.03.02.01.04
and, if (sem_flg &SEM_UNDO) is non-zero, the absolute value of sem_op shall be added to the calling process' semadj value for the specified semaphore.
- semop.09.01.03.02.02.01
The semid for which the calling thread is awaiting action is removed from the system.
- semop.09.01.03.02.02.02
When this occurs, errno shall be set equal to [EIDRM] and -1 shall be returned.
- semop.09.01.03.02.03.01
The calling thread receives a signal that is to be caught.
- semop.09.01.03.02.03.02
When this occurs, the value of semncnt associated with the specified semaphore shall be decremented, and the calling thread shall resume execution in the manner prescribed in sigaction().
- semop.09.02.01
If sem_op is a positive integer and the calling process has alter permission, the value of sem_op shall be added to semval
- semop.09.02.02
and, if (sem_flg &SEM_UNDO) is non-zero, the value of sem_op shall be subtracted from the calling process' semadj value for the specified semaphore.
- semop.09.03
If sem_op is 0 and the calling process has read permission, one of the following shall occur:
- semop.09.03.01
If semval is 0, semop() shall return immediately.
- semop.09.03.02
If semval is non-zero and (sem_flg &IPC_NOWAIT) is non-zero, semop() shall return immediately.
- semop.09.03.03.01
If semval is non-zero and (sem_flg &IPC_NOWAIT) is 0, semop() shall increment the semzcnt associated with the specified semaphore
- semop.09.03.03.02
and suspend execution of the calling thread until one of the following occurs:
- semop.09.03.03.02.01
The value of semval becomes 0, at which time the value of semzcnt associated with the specified semaphore shall be decremented.
- semop.09.03.03.02.02.01
The semid for which the calling thread is awaiting action is removed from the system.
- semop.09.03.03.02.02.02
When this occurs, errno shall be set equal to [EIDRM] and -1 shall be returned.
- semop.09.03.03.02.03.01
The calling thread receives a signal that is to be caught.
- semop.09.03.03.02.03.02
When this occurs, the value of semzcnt associated with the specified semaphore shall be decremented, and the calling thread shall resume execution in the manner prescribed in sigaction().
- semop.10
Upon successful completion, the value of sempid for each semaphore specified in the array pointed to by sops shall be set equal to the process ID of the calling process.
- semop.11.01
Upon successful completion, semop() shall return 0;
- semop.11.02
otherwise, it shall return -1 and set errno to indicate the error.
- semop.12
The semop() function shall fail if:
- semop.12.01
[E2BIG] The value of nsops is greater than the system-imposed maximum.
- semop.12.02
[EACCES] Operation permission is denied to the calling process; see XSI Interprocess Communication.
- semop.12.03
[EAGAIN] The operation would result in suspension of the calling process but (sem_flg &IPC_NOWAIT) is non-zero.
- semop.12.04
[EFBIG] The value of sem_num is less than 0 or greater than or equal to the number of semaphores in the set associated with semid.
- semop.12.05
[EIDRM] The semaphore identifier semid is removed from the system.
- semop.12.06
[EINTR] The semop() function was interrupted by a signal.
- semop.12.07
[EINVAL] The value of semid is not a valid semaphore identifier, or the number of individual semaphores for which the calling process requests a SEM_UNDO would exceed the system-imposed limit.
- semop.12.08
[ENOSPC] The limit on the number of individual processes requesting a SEM_UNDO would be exceeded.
- semop.12.09
[ERANGE] An operation would cause a semval to overflow the system-imposed limit, or an operation would cause a semadj value to overflow the system-imposed limit.
- [+]process.ipc.shm (56 / 7 / 0)
- [+]shmat (16 / 1 / 0)
- shmat.01
The shmat() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object).
Generalizes:
- shmat.02
- shmat.03
- shmat.04.01
- shmat.04.02.01
- shmat.04.02.02
- shmat.04.03
- shmat.04.04.01
- shmat.04.04.02
- shmat.05.01.01
- shmat.05.01.02
- shmat.05.02
- shmat.06.01
- shmat.06.02
- shmat.06.03
- shmat.06.04
- shmat.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- shmat.03
The shmat() function attaches the shared memory segment associated with the shared memory identifier specified by shmid to the address space of the calling process.
- shmat.04
The segment is attached at the address specified by one of the following criteria:
- shmat.04.01
If shmaddr is a null pointer, the segment is attached at the first available address as selected by the system.
- shmat.04.02.01
If shmaddr is not a null pointer and (shmflg &SHM_RND) is non-zero, the segment is attached at the address given by (shmaddr -((uintptr_t)shmaddr %SHMLBA)).
- shmat.04.02.02
The character '%' is the C-language remainder operator.
- shmat.04.03
If shmaddr is not a null pointer and (shmflg &SHM_RND) is 0, the segment is attached at the address given by shmaddr.
- shmat.04.04.01
The segment is attached for reading if (shmflg &SHM_RDONLY) is non-zero and the calling process has read permission;
- shmat.04.04.02
otherwise, if it is 0 and the calling process has read and write permission, the segment is attached for reading and writing.
- shmat.05.01.01
Upon successful completion, shmat() shall increment the value of shm_nattch in the data structure associated with the shared memory ID of the attached shared memory segment
- shmat.05.01.02
and return the segment's start address.
- shmat.05.02
Otherwise, the shared memory segment shall not be attached, shmat() shall return -1, and errno shall be set to indicate the error.
- shmat.06
The shmat() function shall fail if:
- shmat.06.01
[EACCES] Operation permission is denied to the calling process; see XSI Interprocess Communication.
- shmat.06.02
[EINVAL] The value of shmid is not a valid shared memory identifier, the shmaddr is not a null pointer, and the value of (shmaddr -((uintptr_t)shmaddr %SHMLBA)) is an illegal address for attaching shared memory; or the shmaddr is not a null pointer, (shmflg &SHM_RND) is 0, and the value of shmaddr is an illegal address for attaching shared memory.
- shmat.06.03
[EMFILE] The number of shared memory segments attached to the calling process would exceed the system-imposed limit.
- shmat.06.04
[ENOMEM] The available data space is not large enough to accommodate the shared memory segment.
- [+]shmctl (13 / 2 / 0)
- shmctl.01
The shmctl() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object).
Generalizes:
- shmctl.02
- shmctl.03.01
- shmctl.03.02.01
- shmctl.03.02.02
- shmctl.03.03.01
- shmctl.03.03.02
- shmctl.04.01
- shmctl.04.02
- shmctl.05.01
- shmctl.05.02
- shmctl.05.03
- shmctl.06.01
- shmctl.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- shmctl.03
The shmctl() function provides a variety of shared memory control operations as specified by cmd. The following values for cmd are available:
- shmctl.03.01
IPC_STAT Place the current value of each member of the shmid_ds data structure associated with shmid into the structure pointed to by buf. The contents of the structure are defined in <sys/shm.h>.
- shmctl.03.02
IPC_SET
- shmctl.03.02.01
Set the value of the following members of the shmid_ds data structure associated with shmid to the corresponding value found in the structure pointed to by buf: shm_perm.uidshm_perm.gidshm_perm.mode Low-order nine bits.
- shmctl.03.02.02
IPC_SET can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.
- shmctl.03.03
IPC_RMID
- shmctl.03.03.01
Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it.
- shmctl.03.03.02
IPC_RMID can only be executed by a process that has an effective user ID equal to either that of a process with appropriate privileges or to the value of shm_perm.cuid or shm_perm.uid in the shmid_ds data structure associated with shmid.
- shmctl.04.01
Upon successful completion, shmctl() shall return 0;
- shmctl.04.02
otherwise, it shall return -1 and set errno to indicate the error.
- shmctl.05
The shmctl() function shall fail if:
- shmctl.05.01
[EACCES] The argument cmd is equal to IPC_STAT and the calling process does not have read permission; see XSI Interprocess Communication.
- shmctl.05.02
[EINVAL] The value of shmid is not a valid shared memory identifier, or the value of cmd is not a valid command.
- shmctl.05.03
[EPERM] The argument cmd is equal to IPC_RMID or IPC_SET and the effective user ID of the calling process is not equal to that of a process with appropriate privileges and it is not equal to the value of shm_perm.cuid or shm_perm.uid in the data structure associated with shmid.
- shmctl.06
The shmctl() function may fail if:
- shmctl.06.01
[EOVERFLOW] The cmd argument is IPC_STAT and the gid or uid value is too large to be stored in the structure pointed to by the buf argument.
- [+]shmdt (7 / 2 / 0)
- shmdt.01
The shmdt() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object).
Generalizes:
- shmdt.02
- shmdt.03
- shmdt.04.01.01
- shmdt.04.01.02
- shmdt.04.02
- shmdt.05.01
- shmdt.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- shmdt.03
The shmdt() function detaches the shared memory segment located at the address specified by shmaddr from the address space of the calling process.
- shmdt.04.01
Upon successful completion,
- shmdt.04.01.01
shmdt() shall decrement the value of shm_nattch in the data structure associated with the shared memory ID of the attached shared memory segment
- shmdt.04.01.02
and return 0.
- shmdt.04.02
Otherwise, the shared memory segment shall not be detached, shmdt() shall return -1, and errno shall be set to indicate the error.
- shmdt.05
The shmdt() function shall fail if:
- shmdt.05.01
[EINVAL] The value of shmaddr is not the data segment start address of a shared memory segment.
- [+]shmget (20 / 2 / 0)
- shmget.01
The shmget() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory Object).
Generalizes:
- shmget.02
- shmget.03
- shmget.04.01
- shmget.04.02
- shmget.05.01
- shmget.05.02
- shmget.05.03
- shmget.05.04
- shmget.05.05
- shmget.06
- shmget.07.01
- shmget.07.02
- shmget.08.01
- shmget.08.02
- shmget.08.03
- shmget.08.04
- shmget.08.05
- shmget.08.06
- shmget.08.07
- shmget.02
It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime.
- shmget.03
The shmget() function shall return the shared memory identifier associated with key.
- shmget.04
A shared memory identifier, associated data structure, and shared memory segment of at least size bytes (see <sys/shm.h>) are created for key if one of the following is true:
- shmget.04.01
The argument key is equal to IPC_PRIVATE.
- shmget.04.02
The argument key does not already have a shared memory identifier associated with it and (shmflg &IPC_CREAT) is non-zero.
- shmget.05
Upon creation, the data structure associated with the new shared memory identifier shall be initialized as follows:
- shmget.05.01
The values of shm_perm.cuid, shm_perm.uid, shm_perm.cgid, and shm_perm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process.
- shmget.05.02
The low-order nine bits of shm_perm.mode are set equal to the low-order nine bits of shmflg.
- shmget.05.03
The value of shm_segsz is set equal to the value of size.
- shmget.05.04
The values of shm_lpid, shm_nattch, shm_atime, and shm_dtime are set equal to 0.
- shmget.05.05
The value of shm_ctime is set equal to the current time.
- shmget.06
When the shared memory segment is created, it shall be initialized with all zero values.
- shmget.07.01
Upon successful completion, shmget() shall return a non-negative integer, namely a shared memory identifier;
- shmget.07.02
otherwise, it shall return -1 and set errno to indicate the error.
- shmget.08
The shmget() function shall fail if:
- shmget.08.01
[EACCES A shared memory identifier exists for key but operation permission as specified by the low-order nine bits of shmflg would not be granted; see XSI Interprocess Communication.
- shmget.08.02
[EEXIST] A shared memory identifier exists for the argument key but (shmflg &IPC_CREAT) &&(shmflg &IPC_EXCL) is non-zero.
- shmget.08.03
[EINVAL] A shared memory segment is to be created and the value of size is less than the system-imposed minimum or greater than the system-imposed maximum.
- shmget.08.04
[EINVAL] No shared memory segment is to be created and a shared memory segment exists for key but the size of the segment associated with it is less than size and size is not 0.
- shmget.08.05
[ENOENT] A shared memory identifier does not exist for the argument key and (shmflg &IPC_CREAT) is 0.
- shmget.08.06
[ENOMEM] A shared memory identifier and associated shared memory segment shall be created, but the amount of available physical memory is not sufficient to fill the request.
- shmget.08.07
[ENOSPC] A shared memory identifier is to be created, but the system-imposed limit on the maximum number of allowed shared memory identifiers system-wide would be exceeded.
- [+]process.meta.fs (42 / 17 / 0)
- [+]chdir (10 / 4 / 0)
- chdir.01
The chdir() function shall cause the directory named by the pathname pointed to by the path argument to become the current working directory; that is, the starting point for path searches for pathnames not beginning with '/'.
- chdir.02.01
Upon successful completion, 0 shall be returned.
- chdir.02.02
Otherwise, -1 shall be returned, the current working directory shall remain unchanged, and errno shall be set to indicate the error.
- chdir.03
The chdir() function shall fail if:
- chdir.03.01
[EACCES] Search permission is denied for any component of the pathname.
- chdir.03.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- chdir.03.03
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- chdir.03.04
[ENOENT] A component of path does not name an existing directory or path is an empty string.
- chdir.03.05
[ENOTDIR] A component of the pathname is not a directory.
- chdir.04
The chdir() function may fail if:
- chdir.04.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- chdir.04.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- [+]chroot (11 / 5 / 0)
- chroot.01
The chroot() function causes the named directory to become the root directory; that is, the starting point for path searches for pathnames beginning with /.
- chroot.02.01
Upon successful completion, 0 is returned.
- chroot.02.02
Otherwise, -1 is returned and errno is set to indicate the error.
- chroot.02.03
If -1 is returned, no change is made in the root directory.
- chroot.03
The chroot() function will fail if:
- chroot.03.01
[EACCES]Search permission is denied for a component of path.
- chroot.03.02
[ELOOP]Too many symbolic links were encountered in resolving path.
- chroot.03.03
[ENAMETOOLONG]The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- chroot.03.04
[ENOENT]A component of path does not name an existing directory or path is an empty string.
- chroot.03.05
[ENOTDIR]A component of the path name is not a directory.
The path argument points to a pathname naming a directory.
- chroot.03.06
[EPERM]The effective user ID does not have appropriate privileges.
The process must have appropriate privileges to change the root directory.
- chroot.04
The chroot() function may fail if:
- chroot.04.01
[ENAMETOOLONG]Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- [+]fchdir (8 / 1 / 0)
- app.fchdir.01
A conforming application can obtain a file descriptor for a file of type directory using open(), provided that the file status flags and access modes do not contain O_WRONLY or O_RDWR.
- fchdir.01
The fchdir() function shall be equivalent to chdir() except that the directory that is to be the new current working directory is specified by the file descriptor fildes.
On failure the current working directory shall remain unchanged.
- fchdir.02.01
Upon successful completion, fchdir() shall return 0.
- fchdir.02.02
Otherwise, it shall return -1 and set errno to indicate the error.
- fchdir.03
The fchdir() function shall fail if:
- fchdir.03.01
[EACCES] Search permission is denied for the directory referenced by fildes.
- fchdir.03.02
[EBADF] The fildes argument is not an open file descriptor.
- fchdir.03.03
[ENOTDIR] The open file descriptor fildes does not refer to a directory.
- fchdir.04
The fchdir() may fail if:
- fchdir.04.01
[EINTR] A signal was caught during the execution of fchdir().
- fchdir.04.02
[EIO] An I/O error occurred while reading from or writing to the file system.
- [+]getcwd (8 / 4 / 0)
- app.getcwd.01
The size argument is the size in bytes of the character array pointed to by the buf argument.
- getcwd.01
The getcwd() function shall place an absolute pathname of the current working directory in the array pointed to by buf
- app.getcwd.02
If buf is a null pointer, the behavior of getcwd() is unspecified.
- getcwd.03
The pathname copied to the array shall contain no components that are symbolic links.
- getcwd.04.01
Upon successful completion, getcwd() shall return the buf argument.
return buf
- getcwd.04.02
Otherwise, getcwd() shall return a null pointer and set errno to indicate the error.
- getcwd.05
The getcwd() function shall fail if:
- getcwd.05.01
[EINVAL] The size argument is 0.
- getcwd.05.02
[ERANGE] The size argument is greater than 0, but is smaller than the length of the pathname +1.
- getcwd.06
The getcwd() function may fail if:
- getcwd.06.01
[EACCES] Read or search permission was denied for a component of the pathname.
- getcwd.06.02
[ENOMEM] Insufficient storage space is available.
- [+]getwd (3 / 2 / 0)
- getwd.01
The getwd() function shall determine an absolute pathname of the current working directory of the calling process, and copy a string containing that pathname into the array pointed to by the path_name argument.
- getwd.02.01
Upon successful completion, a pointer to the string containing the absolute pathname of the current working directory shall be returned.
- getwd.02.02
Otherwise, getwd() shall return a null pointer
If the length of the pathname of the current working directory is greater than ({PATH_MAX}+1) including the null byte, getwd() shall fail and return a null pointer.
- [+]umask (2 / 1 / 0)
- umask.01
The umask() function shall
- umask.01.01
set the process' file mode creation mask to cmask
- umask.01.02
return the previous value of the mask
The file permission bits in the value returned by umask() shall be the previous value of the file mode creation mask.
- [+]process.meta.meta (2 / 2 / 0)
- [+]getpid (1 / 1 / 0)
- getpid.01
The getpid() function shall return the process ID of the calling process.
The getpid() function shall always be successful and no return value is reserved to indicate an error.
- [+]getppid (1 / 1 / 0)
- getppid.01
The getppid() function shall return the parent process ID of the calling process.
The getppid() function shall always be successful and no return value is reserved to indicate an error.
- [+]process.meta.nice (33 / 26 / 0)
- [+]getpriority (8 / 8 / 0)
- getpriority.01
The getpriority() function shall obtain the nice value of a process, process group, or user.
- app.getpriority.01
Since getpriority() can return the value -1 on successful completion, it is necessary to set errno to 0 prior to a call to getpriority().
- getpriority.02
Target processes are specified by the values of the which and who arguments.
- getpriority.02.01
The which argument may be one of the following values: PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, indicating that the who argument is to be interpreted as a process ID, a process group ID, or an effective user ID, respectively.
- getpriority.02.02
A 0 value for the who argument specifies the current process, process group, or user.
- getpriority.05
If more than one process is specified,
- getpriority.05.01
getpriority() shall return value {NZERO} less than the lowest nice value pertaining to any of the specified processes
- getpriority.08.01
Upon successful completion, getpriority() shall return an integer in the range -{NZERO} to {NZERO}-1.
- getpriority.08.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- getpriority.09
The getpriority() and setpriority() functions shall fail if:
- getpriority.09.01
[ESRCH] No process could be located using the which and who argument values specified.
- getpriority.09.02
[EINVAL] The value of the which argument was not recognized, or the value of the who argument is not a valid process ID, process group ID, or user ID.
- [+]nice (9 / 7 / 0)
- nice.01
The nice() function shall add the value of incr to the nice value of the calling process.
- app.nice.01
A maximum nice value of 2*{NZERO}-1 and a minimum nice value of 0 shall be imposed by the system.
- app.nice.02
As -1 is a permissible return value in a successful situation, an application wishing to check for error situations should set errno to 0, then call nice(), and if it returns -1, check to see whether errno is non-zero.
- nice.02
Requests for values above or below these limits shall result in the nice value being set to the corresponding limit.
- nice.03
[PS|TPS] Calling the nice() function has no effect on the priority of processes or threads with policy SCHED_FIFO or SCHED_RR. The effect on processes or threads with other scheduling policies is implementation-defined.
- nice.04
The nice value set with nice() shall be applied to the process.
- nice.05
If the process is multi-threaded, the nice value shall affect all system scope threads in the process.
- nice.06.01
Upon successful completion, nice() shall return the new nice value -{NZERO}.
- nice.06.02
Otherwise, -1 shall be returned, the process' nice value shall not be changed, and errno shall be set to indicate the error.
- nice.07
The nice() function shall fail if:
- nice.07.01
[EPERM] The incr argument is negative and the calling process does not have appropriate privileges.
- nice.08
Only a process with appropriate privileges can lower the nice value.
- [+]setpriority (16 / 11 / 0)
- setpriority.01
The setpriority() function shall set the nice value of a process, process group, or user to value+ {NZERO}.
- setpriority.02
Target processes are specified by the values of the which and who arguments.
- setpriority.02.01
The which argument may be one of the following values: PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, indicating that the who argument is to be interpreted as a process ID, a process group ID, or an effective user ID, respectively.
- setpriority.02.02
A 0 value for the who argument specifies the current process, process group, or user.
- setpriority.03
The nice value set with setpriority() shall be applied to the process.
- setpriority.04
If the process is multi-threaded, the nice value shall affect all system scope threads in the process.
- setpriority.05
If more than one process is specified,
- setpriority.05.01
setpriority() shall set the nice values of all of the specified processes to value+ {NZERO}
- setpriority.06.01
If value+ {NZERO} is less than the system's lowest supported nice value, setpriority() shall set the nice value to the lowest supported value
- setpriority.06.02
if value+ {NZERO} is greater than the system's highest supported nice value, setpriority() shall set the nice value to the highest supported value
- setpriority.07
[PS|TPS] Any processes or threads using SCHED_FIFO or SCHED_RR shall be unaffected by a call to setpriority(). This is not considered an error. A process which subsequently reverts to SCHED_OTHER need not have its priority affected by such a setpriority() call.
- setpriority.08.01
Upon successful completion, setpriority() shall return 0
- setpriority.08.02
otherwise, -1 shall be returned and errno set to indicate the error
- setpriority.09
The getpriority() and setpriority() functions shall fail if:
- setpriority.09.01
[ESRCH] No process could be located using the which and who argument values specified.
- setpriority.09.02
[EINVAL] The value of the which argument was not recognized, or the value of the who argument is not a valid process ID, process group ID, or user ID.
- setpriority.10
In addition, setpriority() may fail if:
- setpriority.10.01
[EPERM] A process was located, but neither the real nor effective user ID of the executing process match the effective user ID of the process whose nice value is being changed.
- setpriority.10.02
[EACCES] A request was made to change the nice value to a lower numeric value and the current process does not have appropriate privileges.
Only a process with appropriate privileges can lower its nice value.
- setpriority.11
While the range of valid nice values is [0,{NZERO}*2-1], implementations may enforce more restrictive limits.
- [+]process.meta.user (77 / 66 / 6)
- [+]cuserid (5 / 1 / 0)
- app.cuserid.01
If s is a null pointer, this representation is generated in an area that may be static (and thus overwritten by subsequent calls to cuserid()), the address of which is returned.
- cuserid.01
The cuserid() function generates a character representation of the name associated with the real or effective user ID of the process.
- cuserid.02
If s is not a null pointer, s is returned.
- app.cuserid.02
If s is not a null pointer, s is assumed to point to an array of at least {L_cuserid} bytes; the representation is deposited in this array.
- cuserid.03
If s is not a null pointer and the login name cannot be found, the null byte `\0' will be placed at *s.
- app.cuserid.03
If the application uses any of the _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS interfaces, the cuserid() function must be called with a non-NULL parameter.
- cuserid.04
If s is a null pointer and the login name cannot be found, cuserid() returns a null pointer.
- cuserid.05
If s is a null pointer and the login name can be found, the address of a buffer (possibly static) containing the login name is returned.
- [+]getegid (1 / 1 / 0)
- getegid.01
The getegid() function shall return the effective group ID of the calling process.
The getegid() function shall always be successful and no return value is reserved to indicate an error.
- [+]geteuid (1 / 1 / 0)
- geteuid.01
The geteuid() function shall return the effective user ID of the calling process.
The geteuid() function shall always be successful and no return value is reserved to indicate an error.
- [+]getgid (1 / 1 / 0)
- getgid.01
The getgid() function shall return the real group ID of the calling process.
The getgid() function shall always be successful and no return value is reserved to indicate an error.
- [+]getgroups (8 / 7 / 0)
- getgroups.01
The getgroups() function shall fill in the array grouplist with the current supplementary group IDs of the calling process.
- getgroups.02
It is implementation-defined whether getgroups() also returns the effective group ID in the grouplist array.
- getgroups.04
The values of array entries with indices greater than or equal to the value returned are undefined.
- getgroups.05
If gidsetsize is 0, getgroups() shall return the number of group IDs that it would otherwise return without modifying the array pointed to by grouplist.
- getgroups.06
If the effective group ID of the process is returned with the supplementary group IDs, the value returned shall always be greater than or equal to one and less than or equal to the value of {NGROUPS_MAX}+1.
- getgroups.07.01
Upon successful completion, the number of supplementary group IDs shall be returned.
The actual number of group IDs stored in the array shall be returned.
- getgroups.07.02
A return value of -1 indicates failure and errno shall be set to indicate the error.
- getgroups.08
The getgroups() function shall fail if:
- getgroups.08.01
[EINVAL] The gidsetsize argument is non-zero and less than the number of group IDs that would have been returned.
The gidsetsize argument specifies the number of elements in the array grouplist.
- [+]getuid (1 / 1 / 0)
- getuid.01
The getuid() function shall return the real user ID of the calling process.
The getuid() function shall always be successful and no return value is reserved to indicate the error.
- [+]initgroups (6 / 5 / 0)
- initgroups.01
If the process has appropriate privilege, the initgroups() function shall initialize the Supplementary Group IDs for the current process by reading the group database and using all groups of which user is a member.
- initgroups.02
The additional group group is also added to the list.
- initgroups.03.01
On success, 0 is returned.
- initgroups.03.02
On error, -1 is returned and the global variable errno is set appropriately.
- initgroups.04
Errors
- initgroups.04.01
[EPERM] The calling process does not have sufficient privileges.
- initgroups.04.02
[ENOMEM] Insufficient memory to allocate group information structure.
- [+]setegid (7 / 7 / 1)
- setegid.01
If gid is equal to the real group ID or the saved set-group-ID, or if the process has appropriate privileges, setegid() shall set the effective group ID of the calling process to gid
- setegid.02
the real group ID, saved set-group-ID, and any supplementary group IDs shall remain unchanged
- setegid.03
The setegid() function shall not affect the supplementary group list in any way.
- setegid.04.01
Upon successful completion, 0 shall be returned
- setegid.04.02
otherwise, -1 shall be returned and errno set to indicate the error
- setegid.05
The setegid() function shall fail if:
- setegid.05.01
[EINVAL] The value of the gid argument is invalid and is not supported by the implementation.
- setegid.05.02 (failed)
[EPERM] The process does not have appropriate privileges and gid does not match the real group ID or the saved set-group-ID.
- [+]seteuid (7 / 7 / 1)
- seteuid.01
If uid is equal to the real user ID or the saved set-user-ID, or if the process has appropriate privileges, seteuid() shall set the effective user ID of the calling process to uid
- seteuid.02
the real user ID and saved set-user-ID shall remain unchanged
- seteuid.03
The seteuid() function shall not affect the supplementary group list in any way.
- seteuid.04.01
Upon successful completion, 0 shall be returned
- seteuid.04.02
otherwise, -1 shall be returned and errno set to indicate the error
- seteuid.05
The seteuid() function shall fail if:
- seteuid.05.01
[EINVAL] The value of the uid argument is invalid and is not supported by the implementation.
- seteuid.05.02 (failed)
[EPERM] The process does not have appropriate privileges and uid does not match the real user ID or the saved set-user-ID.
- [+]setgid (7 / 7 / 1)
- setgid.01
If the process has appropriate privileges, setgid() shall set the real group ID, effective group ID, and the saved set-group-ID of the calling process to gid.
- setgid.02
If the process does not have appropriate privileges, but gid is equal to the real group ID or the saved set-group-ID, setgid() shall set the effective group ID to gid; the real group ID and saved set-group-ID shall remain unchanged.
- setgid.03
The setgid() function shall not affect the supplementary group list in any way.
Any supplementary group IDs of the calling process shall remain unchanged.
- setgid.05.01
Upon successful completion, 0 is returned.
- setgid.05.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- setgid.06
The setgid() function shall fail if:
- setgid.06.01
[EINVAL] The value of the gid argument is invalid and is not supported by the implementation.
- setgid.06.02 (failed)
[EPERM] The process does not have appropriate privileges and gid does not match the real group ID or the saved set-group-ID.
- [+]setgroups (6 / 4 / 0)
- setgroups.01
If the process has appropriate privilege, the setgroups() function shall set the supplementary group IDs for the current process.
- setgroups.02.01
On successful completion, 0 is returned.
- setgroups.02.02
On error, -1 is returned and the errno is set to indicate the error.
- setgroups.03
Errors
- setgroups.03.01
[EFAULT] list has an invalid address.
list shall reference an array of size group IDs.
- setgroups.03.02
[EPERM] The process does not have appropriate privileges.
- setgroups.03.03
[EINVAL] size is greater than NGROUPS_MAX.
A process may have at most NGROUPS_MAX supplementary group IDs.
- [+]setregid (11 / 10 / 1)
- setregid.01
The setregid() function shall set the real and effective group IDs of the calling process.
- setregid.01.01
If rgid is -1, the real group ID shall not be changed
- setregid.01.02
if egid is -1, the effective group ID shall not be changed
- setregid.02
The real and effective group IDs may be set to different values in the same call.
- setregid.03
Only a process with appropriate privileges can set the real group ID and the effective group ID to any valid value.
- setregid.04
A non-privileged process can set either the real group ID to the saved set-group-ID from one of the exec family of functions, or the effective group ID to the saved set-group-ID or the real group ID.
- setregid.05
Any supplementary group IDs of the calling process remain unchanged.
- setregid.06.01
Upon successful completion, 0 shall be returned.
- setregid.06.02
Otherwise, -1 shall be returned and errno set to indicate the error
- setregid.06.03
neither of the group IDs are changed
- setregid.07
The setregid() function shall fail if:
- setregid.07.01
[EINVAL] The value of the rgid or egid argument is invalid or out-of-range.
- setregid.07.02 (failed)
[EPERM] The process does not have appropriate privileges and a change other than changing the real group ID to the saved set-group-ID, or changing the effective group ID to the real group ID or the saved set-group-ID, was requested.
- [+]setreuid (9 / 7 / 1)
- setreuid.01
The setreuid() function shall set the real and effective user IDs of the current process to the values specified by the ruid and euid arguments.
- setreuid.02
A process with appropriate privileges can set either ID to any value.
- setreuid.03
An unprivileged process can only set the effective user ID if the euid argument is equal to either the real, effective, or saved user ID of the process.
- setreuid.04
It is unspecified whether a process without appropriate privileges is permitted to change the real user ID to match the current real, effective, or saved set-user-ID of the process.
- setreuid.05.01
Upon successful completion, 0 shall be returned.
- setreuid.05.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- setreuid.06
The setreuid() function shall fail if:
- setreuid.06.01
[EINVAL] The value of the ruid or euid argument is invalid or out-of-range.
- setreuid.06.02 (failed)
[EPERM] The current process does not have appropriate privileges, and either an attempt was made to change the effective user ID to a value other than the real user ID or the saved set-user-ID or an attempt was made to change the real user ID to a value not permitted by the implementation.
- setreuid.07
If ruid or euid is -1, the corresponding effective or real user ID of the current process shall be left unchanged.A process with appropriate privileges can set either ID to any value. An unprivileged process can only set the effective user ID if the euid argument is equal to either the real, effective, or saved user ID of the process.It is unspecified whether a process without appropriate privileges is permitted to change the real user ID to match the current real, effective, or saved set-user-ID of the process.RETURN VALUEUpon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error.ERRORSThe setreuid() function shall fail if:[EINVAL] The value of the ruid or euid argument is invalid or out-of-range. [EPERM] The current process does not have appropriate privileges, and either an attempt was made to change the effective user ID to a value other than the real user ID or the saved set-user-ID or an attempt was made to change the real user ID to a value not permitted by the implementation. The following sections are informative.EXAMPLESSetting the Effective User ID to the Real User IDThe following example sets the effective user ID of the calling process to the real user ID, so that files created later will be owned by the current user.#include <unistd.h>#include <sys/types.h>...setreuid(getuid(), getuid());...APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSOgetegid(), geteuid(), getgid(), getuid(), setegid(), seteuid(), setgid(), setregid(), setuid(), the Base Definitions volume of IEEE Std 1003.1-2001, <unistd.h>CHANGE HISTORYFirst released in Issue 4, Version 2.Issue 5Moved from X/OPEN UNIX extension to BASE.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- [+]setuid (7 / 7 / 1)
- setuid.01
If the process has appropriate privileges, setuid() shall set the real user ID, effective user ID, and the saved set-user-ID of the calling process to uid.
- setuid.02
If the process does not have appropriate privileges, but uid is equal to the real user ID or the saved set-user-ID, setuid() shall set the effective user ID to uid; the real user ID and saved set-user-ID shall remain unchanged.
- setuid.03
The setuid() function shall not affect the supplementary group list in any way.RETURN VALUEUpon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error.ERRORSThe setuid() function shall fail, return -1, and set errno to the corresponding value if one or more of the following are true:[EINVAL] The value of the uid argument is invalid and not supported by the implementation. [EPERM] The process does not have appropriate privileges and uid does not match the real user ID or the saved set-user-ID. The following sections are informative.EXAMPLESNone.APPLICATION USAGENone.RATIONALEThe various behaviors of the setuid() and setgid() functions when called by non-privileged processes reflect the behavior of different historical implementations. For portability, it is recommended that new non-privileged applications use the seteuid() and setegid() functions instead.The saved set-user-ID capability allows a program to regain the effective user ID established at the last exec call. Similarly, the saved set-group-ID capability allows a program to regain the effective group ID established at the last exec call. These capabilities are derived from System V. Without them, a program might have to run as superuser in order to perform the same functions, because superuser can write on the user's files. This is a problem because such a program can write on any user's files, and so must be carefully written to emulate the permissions of the calling process properly. In System V, these capabilities have traditionally been implemented only via the setuid() and setgid() functions for non-privileged processes. The fact that the behavior of those functions was different for privileged processes made them difficult to use. The POSIX.1-1990 standard defined the setuid() function to behave differently for privileged and unprivileged users. When the caller had the appropriate privilege, the function set the calling process' real user ID, effective user ID, and saved set-user ID on implementations that supported it. When the caller did not have the appropriate privilege, the function set only the effective user ID, subject to permission checks. The former use is generally needed for utilities like login and su, which are not conforming applications and thus outside the scope of IEEE Std 1003.1-2001. These utilities wish to change the user ID irrevocably to a new value, generally that of an unprivileged user. The latter use is needed for conforming applications that are installed with the set-user-ID bit and need to perform operations using the real user ID.IEEE Std 1003.1-2001 augments the latter functionality with a mandatory feature named _POSIX_SAVED_IDS. This feature permits a set-user-ID application to switch its effective user ID back and forth between the values of its exec-time real user ID and effective user ID. Unfortunately, the POSIX.1-1990 standard did not permit a conforming application using this feature to work properly when it happened to be executed with the (implementation-defined) appropriate privilege. Furthermore, the application did not even have a means to tell whether it had this privilege. Since the saved set-user-ID feature is quite desirable for applications, as evidenced by the fact that NIST required it in FIPS 151-2, it has been mandated by IEEE Std 1003.1-2001. However, there are implementors who have been reluctant to support it given the limitation described above.The 4.3BSD system handles the problem by supporting separate functions: setuid() (which always sets both the real and effective user IDs, like setuid() in IEEE Std 1003.1-2001 for privileged users), and seteuid() (which always sets just the effective user ID, like setuid() in IEEE Std 1003.1-2001 for non-privileged users). This separation of functionality into distinct functions seems desirable. 4.3BSD does not support the saved set-user-ID feature. It supports similar functionality of switching the effective user ID back and forth via setreuid(), which permits reversing the real and effective user IDs. This model seems less desirable than the saved set-user-ID because the real user ID changes as a side effect. The current 4.4BSD includes saved effective IDs and uses them for seteuid() and setegid() as described above. The setreuid() and setregid() functions will be deprecated or removed.The solution here is:Require that all implementations support the functionality of the saved set-user-ID, which is set by the exec functions and by privileged calls to setuid().Add the seteuid() and setegid() functions as portable alternatives to setuid() and setgid() for non-privileged and privileged processes.Historical systems have provided two mechanisms for a set-user-ID process to change its effective user ID to be the same as its real user ID in such a way that it could return to the original effective user ID: the use of the setuid() function in the presence of a saved set-user-ID, or the use of the BSD setreuid() function, which was able to swap the real and effective user IDs. The changes included in IEEE Std 1003.1-2001 provide a new mechanism using seteuid() in conjunction with a saved set-user-ID. Thus, all implementations with the new seteuid() mechanism will have a saved set-user-ID for each process, and most of the behavior controlled by _POSIX_SAVED_IDS has been changed to agree with the case where the option was defined. The kill() function is an exception. Implementors of the new seteuid() mechanism will generally be required to maintain compatibility with the older mechanisms previously supported by their systems. However, compatibility with this use of setreuid() and with the _POSIX_SAVED_IDS behavior of kill() is unfortunately complicated. If an implementation with a saved set-user-ID allows a process to use setreuid() to swap its real and effective user IDs, but were to leave the saved set-user-ID unmodified, the process would then have an effective user ID equal to the original real user ID, and both real and saved set-user-ID would be equal to the original effective user ID. In that state, the real user would be unable to kill the process, even though the effective user ID of the process matches that of the real user, if the kill() behavior of _POSIX_SAVED_IDS was used. This is obviously not acceptable. The alternative choice, which is used in at least one implementation, is to change the saved set-user-ID to the effective user ID during most calls to setreuid(). The standard developers considered that alternative to be less correct than the retention of the old behavior of kill() in such systems. Current conforming applications shall accommodate either behavior from kill(), and there appears to be no strong reason for kill() to check the saved set-user-ID rather than the effective user ID.FUTURE DIRECTIONSNone.SEE ALSOexec(), getegid(), geteuid(), getgid(), getuid(), setegid(), seteuid(), setgid(), setregid(), setreuid(), the Base Definitions volume of IEEE Std 1003.1-2001, <sys/types.h>, <unistd.h>CHANGE HISTORYFirst released in Issue 1. Derived from Issue 1 of the SVID.Issue 6In the SYNOPSIS, the optional include of the <sys/types.h> header is removed.The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:The requirement to include <sys/types.h> has been removed. Although <sys/types.h> was required for conforming implementations of previous POSIX specifications, it was not required for UNIX applications.The functionality associated with _POSIX_SAVED_IDS is now mandatory. This is a FIPS requirement.The following changes were made to align with the IEEE P1003.1a draft standard:The effects of setuid() in processes without appropriate privileges are changed.A requirement that the supplementary group list is not affected is added.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- setuid.04.01
Upon successful completion, 0 shall be returned.
- setuid.04.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- setuid.05
The setuid() function shall fail, return -1, and set errno to the corresponding value if one or more of the following are true:
- setuid.05.01
[EINVAL] The value of the uid argument is invalid and not supported by the implementation.
- setuid.05.02 (failed)
[EPERM] The process does not have appropriate privileges and uid does not match the real user ID or the saved set-user-ID.
- [+]process.pgroup (48 / 32 / 0)
- [+]__getpgid (8 / 5 / 0)
- __getpgid.01
The getpgid() function shall return the process group ID of the process whose process ID is equal to pid.
- __getpgid.02
If pid is equal to 0, getpgid() shall return the process group ID of the calling process.
- __getpgid.03.01
Upon successful completion, getpgid() shall return a process group ID.
- __getpgid.03.02
Otherwise, it shall return (pid_t)-1 and set errno to indicate the error.
- __getpgid.04
The getpgid() function shall fail if:
- __getpgid.04.01
[EPERM] The process whose process ID is equal to pid is not in the same session as the calling process, and the implementation does not allow access to the process group ID of that process from the calling process.
- __getpgid.04.02
[ESRCH] There is no process with a process ID equal to pid.
- __getpgid.05
The getpgid() function may fail if:
- __getpgid.05.01
[EINVAL] The value of the pid argument is invalid.
- __getpgid.30
__getpgid() has the same specification as getpgid().
Generalizes:
- __getpgid.01
- __getpgid.02
- __getpgid.03.01
- __getpgid.03.02
- __getpgid.04.01
- __getpgid.04.02
- __getpgid.05.01
- [+]getpgid (7 / 5 / 0)
- getpgid.01
The getpgid() function shall return the process group ID of the process whose process ID is equal to pid.
- getpgid.02
If pid is equal to 0, getpgid() shall return the process group ID of the calling process.
- getpgid.03.01
Upon successful completion, getpgid() shall return a process group ID.
- getpgid.03.02
Otherwise, it shall return (pid_t)-1 and set errno to indicate the error.
- getpgid.04
The getpgid() function shall fail if:
- getpgid.04.01
[EPERM] The process whose process ID is equal to pid is not in the same session as the calling process, and the implementation does not allow access to the process group ID of that process from the calling process.
- getpgid.04.02
[ESRCH] There is no process with a process ID equal to pid.
- getpgid.05
The getpgid() function may fail if:
- getpgid.05.01
[EINVAL] The value of the pid argument is invalid.
- [+]getpgrp (1 / 1 / 0)
- getpgrp.01
The getpgrp() function shall return the process group ID of the calling process.
The getpgrp() function shall always be successful and no return value is reserved to indicate an error.
- [+]getsid (6 / 5 / 0)
- getsid.01
The getsid() function shall obtain the process group ID of the process that is the session leader of the process specified by pid.
- getsid.02
If pid is (pid_t)0, it specifies the calling process.
- getsid.03.01
Upon successful completion, getsid() shall return the process group ID of the session leader of the specified process.
- getsid.03.02
Otherwise, it shall return (pid_t)-1 and set errno to indicate the error.
- getsid.04
The getsid() function shall fail if:
- getsid.04.01
[EPERM] The process specified by pid is not in the same session as the calling process, and the implementation does not allow access to the process group ID of the session leader of that process from the calling process.
- getsid.04.02
[ESRCH] There is no process with a process ID equal to pid.
- [+]setpgid (13 / 12 / 0)
- setpgid.01
The setpgid() function shall either join an existing process group or create a new process group within the session of the calling process.
- setpgid.02
The process group ID of a session leader shall not change.
- setpgid.03
Upon successful completion, the process group ID of the process with a process ID that matches pid shall be set to pgid.
- setpgid.04
As a special case, if pid is 0, the process ID of the calling process shall be used.
- setpgid.05
Also, if pgid is 0, the process ID of the indicated process shall be used.
- setpgid.06.01
Upon successful completion, setpgid() shall return 0
- setpgid.06.02
otherwise, -1 shall be returned and errno shall be set to indicate the error
- setpgid.07
The setpgid() function shall fail if:
- setpgid.07.01
[EACCES] The value of the pid argument matches the process ID of a child process of the calling process and the child process has successfully executed one of the exec functions.
- setpgid.07.02
[EINVAL] The value of the pgid argument is less than 0, or is not a value supported by the implementation.
- setpgid.07.03
[EPERM] The process indicated by the pid argument is a session leader.
- setpgid.07.04
[EPERM] The value of the pid argument matches the process ID of a child process of the calling process and the child process is not in the same session as the calling process.
- setpgid.07.05
[EPERM] The value of the pgid argument is valid but does not match the process ID of the process indicated by the pid argument and there is no process with a process group ID that matches the value of the pgid argument in the same session as the calling process.
- setpgid.07.06
[ESRCH] The value of the pid argument does not match the process ID of the calling process or of a child process of the calling process.
- [+]setpgrp (4 / 2 / 0)
- setpgrp.01
If the calling process is not already a session leader, setpgrp() sets the process group ID of the calling process to the process ID of the calling process.
- setpgrp.02
If setpgrp() creates a new session, then the new session has no controlling terminal.
- setpgrp.03
The setpgrp() function has no effect when the calling process is a session leader.
- setpgrp.04
Upon completion, setpgrp() shall return the process group ID.
- [+]setsid (9 / 2 / 0)
- setsid.01
The setsid() function shall create a new session, if the calling process is not a process group leader.
- setsid.02
Upon return the calling process
- setsid.02.01
shall be the session leader of this new session
- setsid.02.02
shall be the process group leader of a new process group
- setsid.02.03
shall have no controlling terminal
- setsid.03
The process group ID of the calling process shall be set equal to the process ID of the calling process.
- setsid.04
The calling process shall be the only process in the new process group and the only process in the new session.
- setsid.05.01
Upon successful completion, setsid() shall return the value of the new process group ID of the calling process.
- setsid.05.02
Otherwise, it shall return (pid_t)-1 and set errno to indicate the error.
- setsid.06
The setsid() function shall fail if:
- setsid.06.01
[EPERM] The calling process is already a process group leader, or the process group ID of a process other than the calling process matches the process ID of the calling process.
- [+]process.process (793 / 147 / 0)
- [+]_Exit (25 / 4 / 0)
- _Exit.01
The _Exit() [CX] and _exit() functions shall not call functions registered with atexit() nor any registered signal handlers.
- _Exit.04
These functions shall terminate the calling process [CX] with the following consequences:
- _Exit.04.01
All of the file descriptors, directory streams, [XSI] conversion descriptors, and message catalog descriptors open in the calling process shall be closed.
- _Exit.04.02
If the parent process of the calling process is executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, it shall be notified of the calling process' termination and the low-order eight bits (that is, bits 0377) of status shall be made available to it. If the parent is not waiting, the child's status shall be made available to it when the parent subsequently executes wait() or waitpid().
- _Exit.04.03
If the parent process of the calling process is not executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, the calling process shall be transformed into a zombie process. A zombie process is an inactive process and it shall be deleted at some later time when its parent process executes wait() or waitpid().
- _Exit.04.04
Termination of a process does not directly terminate its children. The sending of a SIGHUP signal as described below indirectly terminates children in some circumstances.
- _Exit.04.05
The parent process ID of all of the calling process' existing child processes and zombie processes shall be set to the process ID of an implementation-defined system process. That is, these processes shall be inherited by a special system process.
[XSI] If a parent process terminates without waiting for all of its child processes to terminate, the remaining child processes shall be assigned a new parent process ID corresponding to an implementation-defined system process.
- _Exit.04.06
[XSI] Each attached shared-memory segment is detached and the value of shm_nattch (see shmget()) in the data structure associated with its shared memory ID shall be decremented by 1.
- _Exit.04.07
[XSI] For each semaphore for which the calling process has set a semadj value (see semop() ), that value shall be added to the semval of the specified semaphore.
- _Exit.04.08
If the process is a controlling process, the SIGHUP signal shall be sent to each process in the foreground process group of the controlling terminal belonging to the calling process.
- _Exit.04.09
If the process is a controlling process, the controlling terminal associated with the session shall be disassociated from the session, allowing it to be acquired by a new controlling process.
- _Exit.04.10
If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal shall be sent to each process in the newly-orphaned process group.
- _Exit.04.11
[SEM] All open named semaphores in the calling process shall be closed as if by appropriate calls to sem_close().
- _Exit.04.12
[ML] Any memory locks established by the process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to _Exit() or _exit().
- _Exit.04.13
[MF|SHM] Memory mappings that were created in the process shall be unmapped before the process is destroyed.
- _Exit.04.14
[TYM] Any blocks of typed memory that were mapped in the calling process shall be unmapped, as if munmap() was implicitly called to unmap them.
- _Exit.04.15
[MSG] All open message queue descriptors in the calling process shall be closed as if by appropriate calls to mq_close().
- _Exit.04.16
[AIO] Any outstanding cancelable asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the _Exit() or _exit() operation had not yet occurred, but any associated signal notifications shall be suppressed. The _Exit() or _exit() operation may block awaiting such I/O completion. Whether any I/O is canceled, and which I/O may be canceled upon _Exit() or _exit(), is implementation-defined.
- _Exit.04.17
Threads terminated by a call to _Exit() or _exit() shall not invoke their cancellation cleanup handlers or per-thread data destructors.
- _Exit.04.18
[TRC] If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described by the posix_trace_shutdown() function, and any process' mapping of trace event names to trace event type identifiers built for these trace streams may be deallocated.
- _Exit.04.19.01
If the implementation supports the SIGCHLD signal, a SIGCHLD shall be sent to the parent process.
- _Exit.04.19.02
If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status shall be discarded, and the lifetime of the calling process shall end immediately.
- _Exit.04.19.03
If SA_NOCLDWAIT is set, it is implementation-defined whether a SIGCHLD signal is sent to the parent process.
- _Exit.05
These functions do not return.
- _Exit.06
The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process.
- _Exit.07
Whether open streams are flushed or closed, or temporary files are removed is implementation-defined.
- [+]__cxa_atexit (8 / 2 / 0)
- __cxa_atexit.01
As described in the Itanium C++ ABI, __cxa_atexit() registers a destructor function to be called by exit() or when a shared library is unloaded.
- __cxa_atexit.02
When a shared library is unloaded, any destructor function associated with that shared library, identified by dso_handle, shall be called with the single argument arg, and then that function shall be removed, or marked as complete, from the list of functions to run at exit().
- __cxa_atexit.03
On a call to exit(), any remaining functions registered shall be called with the single argument arg.
- __cxa_atexit.04
Destructor functions shall always be called in the reverse order to their registration (i.e. the most recently registered function shall be called first),
- __cxa_atexit.05
The __cxa_atexit() function is used to implement atexit(), as described in ISO POSIX (2003).
- __cxa_atexit.06
Calling atexit(func) from the statically linked part of an application shall be equivalent to __cxa_atexit(func, NULL, NULL).
- __cxa_atexit.07.01
Upon successful completion, atexit() shall return 0
- __cxa_atexit.07.02
otherwise, it shall return a non-zero value
- [+]__libc_start_main (4 / 0 / 0)
- __libc_start_main.01
The __libc_start_main() function shall
- __libc_start_main.01.01
perform any necessary initialization of the execution environment
- __libc_start_main.01.02
call the main function with appropriate arguments
- __libc_start_main.01.03
handle the return from main()
- __libc_start_main.02
If the main() function returns, the return value shall be passed to the exit() function.
- [+]__register_atfork (13 / 1 / 0)
- __register_atfork.01
__register_atfork() implements pthread_atfork() as specified in ISO POSIX (2003).
- __register_atfork.02
The additional parameter __dso_handle allows a shared object to pass in it's handle so that functions registered by __register_atfork() can be unregistered by the runtime when the shared object is unloaded.
- __register_atfork.03
The pthread_atfork() function shall declare fork handlers to be called before and after fork(), in the context of the thread that called fork().
- __register_atfork.04
The prepare fork handler shall be called before fork() processing commences.
- __register_atfork.05
The parent fork handle shall be called after fork() processing completes in the parent process.
- __register_atfork.06
The child fork handler shall be called after fork() processing completes in the child process.
- __register_atfork.07
If no handling is desired at one or more of these three points, the corresponding fork handler address(es) may be set to NULL.
- __register_atfork.08
The order of calls to pthread_atfork() is significant.
- __register_atfork.08.01
The parent and child fork handlers shall be called in the order in which they were established by calls to pthread_atfork().
- __register_atfork.08.02
The prepare fork handlers shall be called in the opposite order.
- __register_atfork.09.01
Upon successful completion, pthread_atfork() shall return a value of zero
- __register_atfork.09.02
otherwise, an error number shall be returned to indicate the error
- __register_atfork.10
The pthread_atfork() function shall fail if:
- __register_atfork.10.01
[ENOMEM] Insufficient table space exists to record the fork handler addresses.
- __register_atfork.11
The pthread_atfork() function shall not return an error code of [EINTR].
- [+]_exit (25 / 4 / 0)
- _exit.01
The _Exit() [CX] and _exit() functions shall not call functions registered with atexit() nor any registered signal handlers.
- _exit.04
These functions shall terminate the calling process [CX] with the following consequences:
- _exit.04.01
All of the file descriptors, directory streams, [XSI] conversion descriptors, and message catalog descriptors open in the calling process shall be closed.
- _exit.04.02
If the parent process of the calling process is executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, it shall be notified of the calling process' termination and the low-order eight bits (that is, bits 0377) of status shall be made available to it. If the parent is not waiting, the child's status shall be made available to it when the parent subsequently executes wait() or waitpid().
- _exit.04.03
If the parent process of the calling process is not executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, the calling process shall be transformed into a zombie process. A zombie process is an inactive process and it shall be deleted at some later time when its parent process executes wait() or waitpid().
- _exit.04.04
Termination of a process does not directly terminate its children. The sending of a SIGHUP signal as described below indirectly terminates children in some circumstances.
- _exit.04.05
The parent process ID of all of the calling process' existing child processes and zombie processes shall be set to the process ID of an implementation-defined system process. That is, these processes shall be inherited by a special system process.
[XSI] If a parent process terminates without waiting for all of its child processes to terminate, the remaining child processes shall be assigned a new parent process ID corresponding to an implementation-defined system process.
- _exit.04.06
[XSI] Each attached shared-memory segment is detached and the value of shm_nattch (see shmget()) in the data structure associated with its shared memory ID shall be decremented by 1.
- _exit.04.07
[XSI] For each semaphore for which the calling process has set a semadj value (see semop() ), that value shall be added to the semval of the specified semaphore.
- _exit.04.08
If the process is a controlling process, the SIGHUP signal shall be sent to each process in the foreground process group of the controlling terminal belonging to the calling process.
- _exit.04.09
If the process is a controlling process, the controlling terminal associated with the session shall be disassociated from the session, allowing it to be acquired by a new controlling process.
- _exit.04.10
If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal shall be sent to each process in the newly-orphaned process group.
- _exit.04.11
[SEM] All open named semaphores in the calling process shall be closed as if by appropriate calls to sem_close().
- _exit.04.12
[ML] Any memory locks established by the process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to _Exit() or _exit().
- _exit.04.13
[MF|SHM] Memory mappings that were created in the process shall be unmapped before the process is destroyed.
- _exit.04.14
[TYM] Any blocks of typed memory that were mapped in the calling process shall be unmapped, as if munmap() was implicitly called to unmap them.
- _exit.04.15
[MSG] All open message queue descriptors in the calling process shall be closed as if by appropriate calls to mq_close().
- _exit.04.16
[AIO] Any outstanding cancelable asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the _Exit() or _exit() operation had not yet occurred, but any associated signal notifications shall be suppressed. The _Exit() or _exit() operation may block awaiting such I/O completion. Whether any I/O is canceled, and which I/O may be canceled upon _Exit() or _exit(), is implementation-defined.
- _exit.04.17
Threads terminated by a call to _Exit() or _exit() shall not invoke their cancellation cleanup handlers or per-thread data destructors.
- _exit.04.18
[TRC] If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described by the posix_trace_shutdown() function, and any process' mapping of trace event names to trace event type identifiers built for these trace streams may be deallocated.
- _exit.04.19.01
If the implementation supports the SIGCHLD signal, a SIGCHLD shall be sent to the parent process.
- _exit.04.19.02
If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status shall be discarded, and the lifetime of the calling process shall end immediately.
- _exit.04.19.03
If SA_NOCLDWAIT is set, it is implementation-defined whether a SIGCHLD signal is sent to the parent process.
- _exit.05
These functions do not return.
- _exit.06
The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process.
- _exit.07
Whether open streams are flushed or closed, or temporary files are removed is implementation-defined.
- [+]abort (7 / 0 / 0)
- abort.01
The status made available to wait() or waitpid() by abort() shall be that of a process terminated by the SIGABRT signal.
- abort.02
The abort() function shall not return.
- abort.03
The abnormal termination processing shall include the default actions defined for SIGABRT
- abort.04
may include an attempt to effect fclose() on all open streams.
- abort.05
The SIGABRT signal shall be sent to the calling process as if by means of raise() with the argument SIGABRT.
- abort.06
The abort() function shall cause abnormal process termination to occur, unless the signal SIGABRT is being caught and the signal handler does not return.
- abort.07
The abort() function shall override blocking or ignoring the SIGABRT signal.
- [+]daemon (32 / 4 / 0)
- daemon.01
The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:
- daemon.01.01
The child process shall have a unique process ID.
- daemon.01.02
The child process ID also shall not match any active process group ID.
- daemon.01.03
The child process shall have a different parent process ID, which shall be the process ID of the calling process.
- daemon.01.04
The child process shall have its own copy of the parent's file descriptors. Each of the child's file descriptors shall refer to the same open file description with the corresponding file descriptor of the parent.
- daemon.01.05
The child process shall have its own copy of the parent's open directory streams. Each open directory stream in the child process may share directory stream positioning with the corresponding directory stream of the parent.
- daemon.01.06
The child process shall have its own copy of the parent's message catalog descriptors.
- daemon.01.07
The child process' values of tms_utime, tms_stime, tms_cutime, and tms_cstime shall be set to 0.
- daemon.01.08
The time left until an alarm clock signal shall be reset to zero, and the alarm, if any, shall be canceled; see alarm().
- daemon.01.09
All semadj values shall be cleared.
- daemon.01.10
File locks set by the parent process shall not be inherited by the child process.
- daemon.01.11
The set of signals pending for the child process shall be initialized to the empty set.
- daemon.01.12
Interval timers shall be reset in the child process.
- daemon.01.13
Any semaphores that are open in the parent process shall also be open in the child process.
- daemon.01.14
The child process shall not inherit any address space memory locks established by the parent process via calls to mlockall() or mlock().
- daemon.01.15
Memory mappings created in the parent shall be retained in the child process. MAP_PRIVATE mappings inherited from the parent shall also be MAP_PRIVATE mappings in the child, and any modifications to the data in these mappings made by the parent prior to calling fork() shall be visible to the child. Any modifications to the data in MAP_PRIVATE mappings made by the parent after fork() returns shall be visible only to the parent. Modifications to the data in MAP_PRIVATE mappings made by the child shall be visible only to the child.
- daemon.01.16
For the SCHED_FIFO and SCHED_RR scheduling policies, the child process shall inherit the policy and priority settings of the parent process during a fork() function. For other scheduling policies, the policy and priority settings on fork() are implementation-defined.
- daemon.01.17
Per-process timers created by the parent shall not be inherited by the child process.
- daemon.01.18
The child process shall have its own copy of the message queue descriptors of the parent. Each of the message descriptors of the child shall refer to the same open message queue description as the corresponding message descriptor of the parent.
- daemon.01.19
No asynchronous input or asynchronous output operations shall be inherited by the child process.
- daemon.01.20
A process shall be created with a single thread. If a multi-threaded process calls fork(), the new process shall contain a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal-safe operations until such time as one of the exec functions is called. [THR] Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls. When the application calls fork() from a signal handler and any of the fork handlers registered by pthread_atfork() calls a function that is not asynch-signal-safe, the behavior is undefined.
- daemon.01.21
[TRC TRI] If the Trace option and the Trace Inherit option are both supported:If the calling process was being traced in a trace stream that had its inheritance policy set to POSIX_TRACE_INHERITED, the child process shall be traced into that trace stream, and the child process shall inherit the parent's mapping of trace event names to trace event type identifiers. If the trace stream in which the calling process was being traced had its inheritance policy set to POSIX_TRACE_CLOSE_FOR_CHILD, the child process shall not be traced into that trace stream. The inheritance policy is set by a call to the posix_trace_attr_setinherited() function.
- daemon.01.22
[TRC] If the Trace option is supported, but the Trace Inherit option is not supported:The child process shall not be traced into any of the trace streams of its parent process.
- daemon.01.23
If the Trace option is supported, the child process of a trace controller process shall not control the trace streams controlled by its parent process.
- daemon.01.24
The initial value of the CPU-time clock of the child process shall be set to zero.
- daemon.01.25
The initial value of the CPU-time clock of the single thread of the child process shall be set to zero.
- daemon.02.01
Upon successful completion, fork() shall return 0 to the child process and shall return the process ID of the child process to the parent process. Both processes shall continue to execute from the fork() function.
- daemon.02.02
On error, -1 is returned, and the global variable errno is set to any of the errors specified for the library functions fork() and setsid().
- daemon.03
The fork() function shall fail if:
- daemon.03.01
[EAGAIN] The system lacked the necessary resources to create another process, or the system-imposed limit on the total number of processes under execution system-wide or by a single user {CHILD_MAX} would be exceeded.
- daemon.04
The fork() function may fail if:
- daemon.04.01
[ENOMEM] Insufficient storage space is available.
- daemon.05
All other process characteristics defined by IEEE Std 1003.1-2001 shall be the same in the parent and child processes.
- daemon.06
The inheritance of process characteristics not defined by IEEE Std 1003.1-2001 is unspecified by IEEE Std 1003.1-2001.
- daemon.07
After fork(), both the parent and the child processes shall be capable of executing independently before either one terminates.
- [+]execl (74 / 20 / 0)
- execl.01
These strings shall constitute the argument list available to the new process image.
- app.execl.01.01
The arguments represented by arg0,... are pointers to null-terminated character strings.
- app.execl.01.02
The list is terminated by a null pointer.
- app.execl.01.03
The argument arg0 should point to a filename that is associated with the process being started by one of the exec functions.
- execl.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execl.03
Directory streams open in the calling process image shall be closed in the new process image.
- execl.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execl.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execl.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execl.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execl.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execl.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execl.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execl.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execl.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execl.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execl.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execl.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execl.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execl.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execl.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execl.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execl.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execl.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execl.22
The new process shall inherit at least the following attributes from the calling process image:
- execl.22.01
[XSI] Nice value (see nice())
- execl.22.02
[XSI] semadj values (see semop())
- execl.22.03
Process ID
- execl.22.04
Parent process ID
- execl.22.05
Process group ID
- execl.22.06
Session membership
- execl.22.07
Real user ID
- execl.22.08
Real group ID
- execl.22.09
Supplementary group IDs
- execl.22.10
Time left until an alarm clock signal (see alarm())
- execl.22.11
Current working directory
- execl.22.12
Root directory
- execl.22.13
File mode creation mask (see umask())
- execl.22.14
[XSI] File size limit (see ulimit())
- execl.22.15
Process signal mask (see sigprocmask())
- execl.22.16
Pending signal (see sigpending())
- execl.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execl.22.18
[XSI] Resource limits
- execl.22.19
[XSI] Controlling terminal
- execl.22.20
[XSI] Interval timers
- execl.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execl.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execl.23.02
Pending signals (see sigpending())
- execl.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execl.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execl.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execl.27
The exec functions shall fail if:
- execl.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execl.27.02
[EACCES]
- execl.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execl.27.02.02
the new process image file denies execution permission
- execl.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execl.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execl.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execl.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execl.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execl.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execl.28
The exec functions, except for execlp() and execvp(), shall fail if:[ENOEXEC] The new process image file has the appropriate access permission but has an unrecognized format.
- execl.29
The exec functions may fail if:
- execl.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execl.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execl.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execl.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- execl.32
For those forms not containing an envp pointer ( execl(), execv(), execlp(), and execvp()), the environment for the new process image shall be taken from the external variable environ in the calling process.
- app.execl.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execl.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- execl.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- app.execl.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execl.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execl.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execl.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execl.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execl.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execl.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execl.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execl.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execl.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execl.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execl.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]execle (74 / 19 / 0)
- execle.01
These strings shall constitute the argument list available to the new process image.
- app.execle.01.01
The arguments represented by arg0,... are pointers to null-terminated character strings.
- app.execle.01.02
The list is terminated by a null pointer.
- app.execle.01.03
The argument arg0 should point to a filename that is associated with the process being started by one of the exec functions.
- execle.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execle.03
Directory streams open in the calling process image shall be closed in the new process image.
- execle.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execle.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execle.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execle.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execle.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execle.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execle.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execle.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execle.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execle.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execle.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execle.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execle.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execle.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execle.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execle.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execle.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execle.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execle.22
The new process shall inherit at least the following attributes from the calling process image:
- execle.22.01
[XSI] Nice value (see nice())
- execle.22.02
[XSI] semadj values (see semop())
- execle.22.03
Process ID
- execle.22.04
Parent process ID
- execle.22.05
Process group ID
- execle.22.06
Session membership
- execle.22.07
Real user ID
- execle.22.08
Real group ID
- execle.22.09
Supplementary group IDs
- execle.22.10
Time left until an alarm clock signal (see alarm())
- execle.22.11
Current working directory
- execle.22.12
Root directory
- execle.22.13
File mode creation mask (see umask())
- execle.22.14
[XSI] File size limit (see ulimit())
- execle.22.15
Process signal mask (see sigprocmask())
- execle.22.16
Pending signal (see sigpending())
- execle.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execle.22.18
[XSI] Resource limits
- execle.22.19
[XSI] Controlling terminal
- execle.22.20
[XSI] Interval timers
- execle.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execle.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execle.23.02
Pending signals (see sigpending())
- execle.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execle.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execle.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execle.27
The exec functions shall fail if:
- execle.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execle.27.02
[EACCES]
- execle.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execle.27.02.02
the new process image file denies execution permission
- execle.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execle.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execle.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execle.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execle.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execle.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execle.28
The exec functions, except for execlp() and execvp(), shall fail if:[ENOEXEC] The new process image file has the appropriate access permission but has an unrecognized format.
- execle.29
The exec functions may fail if:
- execle.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execle.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execle.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execle.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- app.execle.32.01
The argument envp is an array of character pointers to null-terminated strings.
- app.execle.32.02
The envp array is terminated by a null pointer.
- execle.32
These strings shall constitute the environment for the new process image.
- app.execle.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execle.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- execle.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- app.execle.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execle.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execle.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execle.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execle.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execle.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execle.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execle.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execle.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execle.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execle.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execle.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]execlp (76 / 20 / 0)
- execlp.01
These strings shall constitute the argument list available to the new process image.
- app.execlp.01.01
The arguments represented by arg0,... are pointers to null-terminated character strings.
- app.execlp.01.02
The list is terminated by a null pointer.
- app.execlp.01.03
The argument arg0 should point to a filename that is associated with the process being started by one of the exec functions.
- execlp.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execlp.03
Directory streams open in the calling process image shall be closed in the new process image.
- execlp.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execlp.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execlp.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execlp.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execlp.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execlp.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execlp.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execlp.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execlp.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execlp.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execlp.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execlp.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execlp.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execlp.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execlp.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execlp.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execlp.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execlp.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execlp.22
The new process shall inherit at least the following attributes from the calling process image:
- execlp.22.01
[XSI] Nice value (see nice())
- execlp.22.02
[XSI] semadj values (see semop())
- execlp.22.03
Process ID
- execlp.22.04
Parent process ID
- execlp.22.05
Process group ID
- execlp.22.06
Session membership
- execlp.22.07
Real user ID
- execlp.22.08
Real group ID
- execlp.22.09
Supplementary group IDs
- execlp.22.10
Time left until an alarm clock signal (see alarm())
- execlp.22.11
Current working directory
- execlp.22.12
Root directory
- execlp.22.13
File mode creation mask (see umask())
- execlp.22.14
[XSI] File size limit (see ulimit())
- execlp.22.15
Process signal mask (see sigprocmask())
- execlp.22.16
Pending signal (see sigpending())
- execlp.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execlp.22.18
[XSI] Resource limits
- execlp.22.19
[XSI] Controlling terminal
- execlp.22.20
[XSI] Interval timers
- execlp.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execlp.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execlp.23.02
Pending signals (see sigpending())
- execlp.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execlp.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execlp.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execlp.27
The exec functions shall fail if:
- execlp.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execlp.27.02
[EACCES]
- execlp.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execlp.27.02.02
the new process image file denies execution permission
- execlp.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execlp.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execlp.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execlp.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execlp.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execlp.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execlp.29
The exec functions may fail if:
- execlp.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execlp.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execlp.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execlp.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- app.execlp.30.03
If this environment variable is not present, the results of the search are implementation-defined.
- execlp.30
The argument file is used to construct a pathname that identifies the new process image file.
- execlp.30.01
If the file argument contains a slash character, the file argument shall be used as the pathname for this file.
- execlp.30.02
Otherwise, the path prefix for this file is obtained by a search of the directories passed as the environment variable PATH (see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables).
- execlp.31
There are two distinct ways in which the contents of the process image file may cause the execution to fail, distinguished by the setting of errno to either [ENOEXEC] or [EINVAL] (see the ERRORS section). In the cases where the other members of the exec family of functions would fail and set errno to [ENOEXEC], the execlp() and execvp() functions shall execute a command interpreter and the environment of the executed command shall be as if the process invoked the sh utility using execl() as follows:execl(<shell path>, arg0, file, arg1, ..., (char *)0);where <shell path> is an unspecified pathname for the sh utility, file is the process image file, and for execvp(), where arg0, arg1, and so on correspond to the values passed to execvp() in argv[0], argv[1], and so on.
- execlp.32
For those forms not containing an envp pointer ( execl(), execv(), execlp(), and execvp()), the environment for the new process image shall be taken from the external variable environ in the calling process.
- app.execlp.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execlp.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- app.execlp.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execlp.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- execlp.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execlp.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execlp.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execlp.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execlp.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execlp.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execlp.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execlp.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execlp.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execlp.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execlp.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]execv (74 / 19 / 0)
- execv.01
These strings shall constitute the argument list available to the new process image.
- app.execv.01.01
The argument argv is an array of character pointers to null-terminated strings.
- app.execv.01.02
The application shall ensure that the last member of this array is a null pointer.
- app.execv.01.03
The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions.
- execv.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execv.03
Directory streams open in the calling process image shall be closed in the new process image.
- execv.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execv.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execv.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execv.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execv.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execv.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execv.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execv.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execv.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execv.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execv.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execv.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execv.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execv.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execv.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execv.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execv.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execv.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execv.22
The new process shall inherit at least the following attributes from the calling process image:
- execv.22.01
[XSI] Nice value (see nice())
- execv.22.02
[XSI] semadj values (see semop())
- execv.22.03
Process ID
- execv.22.04
Parent process ID
- execv.22.05
Process group ID
- execv.22.06
Session membership
- execv.22.07
Real user ID
- execv.22.08
Real group ID
- execv.22.09
Supplementary group IDs
- execv.22.10
Time left until an alarm clock signal (see alarm())
- execv.22.11
Current working directory
- execv.22.12
Root directory
- execv.22.13
File mode creation mask (see umask())
- execv.22.14
[XSI] File size limit (see ulimit())
- execv.22.15
Process signal mask (see sigprocmask())
- execv.22.16
Pending signal (see sigpending())
- execv.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execv.22.18
[XSI] Resource limits
- execv.22.19
[XSI] Controlling terminal
- execv.22.20
[XSI] Interval timers
- execv.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execv.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execv.23.02
Pending signals (see sigpending())
- execv.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execv.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execv.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execv.27
The exec functions shall fail if:
- execv.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execv.27.02
[EACCES]
- execv.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execv.27.02.02
the new process image file denies execution permission
- execv.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execv.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execv.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execv.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execv.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execv.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execv.28
The exec functions, except for execlp() and execvp(), shall fail if:[ENOEXEC] The new process image file has the appropriate access permission but has an unrecognized format.
- execv.29
The exec functions may fail if:
- execv.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execv.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execv.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execv.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- execv.32
For those forms not containing an envp pointer ( execl(), execv(), execlp(), and execvp()), the environment for the new process image shall be taken from the external variable environ in the calling process.
- app.execv.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execv.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- execv.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- app.execv.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execv.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execv.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execv.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execv.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execv.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execv.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execv.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execv.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execv.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execv.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execv.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]execve (74 / 19 / 0)
- execve.01
These strings shall constitute the argument list available to the new process image.
- app.execve.01.01
The argument argv is an array of character pointers to null-terminated strings.
- app.execve.01.02
The application shall ensure that the last member of this array is a null pointer.
- app.execve.01.03
The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions.
- execve.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execve.03
Directory streams open in the calling process image shall be closed in the new process image.
- execve.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execve.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execve.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execve.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execve.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execve.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execve.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execve.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execve.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execve.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execve.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execve.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execve.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execve.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execve.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execve.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execve.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execve.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execve.22
The new process shall inherit at least the following attributes from the calling process image:
- execve.22.01
[XSI] Nice value (see nice())
- execve.22.02
[XSI] semadj values (see semop())
- execve.22.03
Process ID
- execve.22.04
Parent process ID
- execve.22.05
Process group ID
- execve.22.06
Session membership
- execve.22.07
Real user ID
- execve.22.08
Real group ID
- execve.22.09
Supplementary group IDs
- execve.22.10
Time left until an alarm clock signal (see alarm())
- execve.22.11
Current working directory
- execve.22.12
Root directory
- execve.22.13
File mode creation mask (see umask())
- execve.22.14
[XSI] File size limit (see ulimit())
- execve.22.15
Process signal mask (see sigprocmask())
- execve.22.16
Pending signal (see sigpending())
- execve.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execve.22.18
[XSI] Resource limits
- execve.22.19
[XSI] Controlling terminal
- execve.22.20
[XSI] Interval timers
- execve.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execve.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execve.23.02
Pending signals (see sigpending())
- execve.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execve.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execve.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execve.27
The exec functions shall fail if:
- execve.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execve.27.02
[EACCES]
- execve.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execve.27.02.02
the new process image file denies execution permission
- execve.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execve.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execve.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execve.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execve.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execve.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execve.28
The exec functions, except for execlp() and execvp(), shall fail if:[ENOEXEC] The new process image file has the appropriate access permission but has an unrecognized format.
- execve.29
The exec functions may fail if:
- execve.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execve.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execve.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execve.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- app.execve.32.01
The argument envp is an array of character pointers to null-terminated strings.
- app.execve.32.02
The envp array is terminated by a null pointer.
- execve.32
These strings shall constitute the environment for the new process image.
- app.execve.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execve.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- execve.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- app.execve.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execve.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execve.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execve.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execve.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execve.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execve.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execve.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execve.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execve.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execve.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execve.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]execvp (76 / 20 / 0)
- app.execvp.01.01
The argument argv is an array of character pointers to null-terminated strings.
- app.execvp.01.02
The application shall ensure that the last member of this array is a null pointer.
- app.execvp.01.03
The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions.
- execvp.01
These strings shall constitute the argument list available to the new process image.
- execvp.02
File descriptors open in the calling process image shall remain open in the new process image, except for those whose close-on- exec flag FD_CLOEXEC is set. For those file descriptors that remain open, all attributes of the open file description remain unchanged. For any file descriptor that is closed for this reason, file locks are removed as a result of the close as described in close(). Locks that are not removed by closing of file descriptors remain unchanged.
- execvp.03
Directory streams open in the calling process image shall be closed in the new process image.
- execvp.04
The state of the floating-point environment in the new process image [THR] or in the initial thread of the new process image shall be set to the default.
- execvp.05
Signals set to the default action (SIG_DFL) in the calling process image shall be set to the default action in the new process image. Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image. Signals set to be caught by the calling process image shall be set to the default action in the new process image (see <signal.h>). If the SIGCHLD signal is set to be ignored by the calling process image, it is unspecified whether the SIGCHLD signal is set to be ignored or to the default action in the new process image. [XSI] After a successful call to any of the exec functions, alternate signal stacks are not preserved and the SA_ONSTACK flag shall be cleared for all signals.
- execvp.06
After a successful call to any of the exec functions, any functions previously registered by atexit() [THR] or pthread_atfork() are no longer registered.
- execvp.07
[XSI] If the ST_NOSUID bit is set for the file system containing the new process image file, then the effective user ID, effective group ID, saved set-user-ID, and saved set-group-ID are unchanged in the new process image. Otherwise, if the set-user-ID mode bit of the new process image file is set, the effective user ID of the new process image shall be set to the user ID of the new process image file. Similarly, if the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image shall be set to the group ID of the new process image file. The real user ID, real group ID, and supplementary group IDs of the new process image shall remain the same as those of the calling process image. The effective user ID and effective group ID of the new process image shall be saved (as the saved set-user-ID and the saved set-group-ID) for use by setuid().
- execvp.08
[XSI] Any shared memory segments attached to the calling process image shall not be attached to the new process image.
- execvp.09
[SEM] Any named semaphores open in the calling process shall be closed as if by appropriate calls to sem_close().
- execvp.10
[TYM] Any blocks of typed memory that were mapped in the calling process are unmapped, as if munmap() was implicitly called to unmap them.
- execvp.11
[ML] Memory locks established by the calling process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to the exec function. If the exec function fails, the effect on memory locks is unspecified.
- execvp.12
[MF|SHM] Memory mappings created in the process are unmapped before the address space is rebuilt for the new process image.
- execvp.13
[PS] When the calling process image uses the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the process policy and scheduling parameter settings shall not be changed by a call to an exec function. [TPS] The initial thread in the new process image shall inherit the process scheduling policy and parameters. It shall have the default system contention scope, but shall inherit its allocation domain from the calling process image.
- execvp.14
[TMR] Per-process timers created by the calling process shall be deleted before replacing the current process image with the new process image.
- execvp.15
[MSG] All open message queue descriptors in the calling process shall be closed, as described in mq_close().
- execvp.16
[CPT] The new process image shall inherit the CPU-time clock of the calling process image. This inheritance means that the process CPU-time clock of the process being exec-ed shall not be reinitialized or altered as a result of the exec function other than to reflect the time spent by the process executing the exec function itself.
- execvp.17
[TCT] The initial value of the CPU-time clock of the initial thread of the new process image shall be set to zero.
- execvp.18
[TRC] If the calling process is being traced, the new process image shall continue to be traced into the same trace stream as the original process image, but the new process image shall not inherit the mapping of trace event names to trace event type identifiers that was defined by calls to the posix_trace_eventid_open() or the posix_trace_trid_eventid_open() functions in the calling process image.If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described in the posix_trace_shutdown() function.
- execvp.19
The initial thread in the new process image shall have its cancellation type set to PTHREAD_CANCEL_DEFERRED and its cancellation state set to PTHREAD_CANCEL_ENABLED.
- execvp.20
The initial thread in the new process image shall have all thread-specific data values set to NULL and all thread-specific data keys shall be removed by the call to exec without running destructors.
- execvp.21
The initial thread in the new process image shall be joinable, as if created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE.
- execvp.22
The new process shall inherit at least the following attributes from the calling process image:
- execvp.22.01
[XSI] Nice value (see nice())
- execvp.22.02
[XSI] semadj values (see semop())
- execvp.22.03
Process ID
- execvp.22.04
Parent process ID
- execvp.22.05
Process group ID
- execvp.22.06
Session membership
- execvp.22.07
Real user ID
- execvp.22.08
Real group ID
- execvp.22.09
Supplementary group IDs
- execvp.22.10
Time left until an alarm clock signal (see alarm())
- execvp.22.11
Current working directory
- execvp.22.12
Root directory
- execvp.22.13
File mode creation mask (see umask())
- execvp.22.14
[XSI] File size limit (see ulimit())
- execvp.22.15
Process signal mask (see sigprocmask())
- execvp.22.16
Pending signal (see sigpending())
- execvp.22.17
tms_utime, tms_stime, tms_cutime, and tms_cstime (see times())
- execvp.22.18
[XSI] Resource limits
- execvp.22.19
[XSI] Controlling terminal
- execvp.22.20
[XSI] Interval timers
- execvp.23
The initial thread of the new process shall inherit at least the following attributes from the calling thread:
- execvp.23.01
Signal mask (see sigprocmask() and pthread_sigmask())
- execvp.23.02
Pending signals (see sigpending())
- execvp.24
[THR] A call to any exec function from a process with more than one thread shall result in all threads being terminated and the new executable image being loaded and executed. No destructor functions or cleanup handlers shall be called.
- execvp.25
[XSI] The saved resource limits in the new process image are set to be a copy of the process' corresponding hard and soft limits.
- execvp.26
If one of the exec functions returns to the calling process image, an error has occurred; the return value shall be -1, and errno shall be set to indicate the error.
- execvp.27
The exec functions shall fail if:
- execvp.27.01
[E2BIG] The number of bytes used by the new process image's argument list and environment list is greater than the system-imposed limit of {ARG_MAX} bytes.
- execvp.27.02
[EACCES]
- execvp.27.02.01
Search permission is denied for a directory listed in the new process image file's path prefix
- execvp.27.02.02
the new process image file denies execution permission
- execvp.27.02.03
the new process image file is not a regular file and the implementation does not support execution of files of its type.
- execvp.27.03
[EINVAL] The new process image file has the appropriate permission and has a recognized executable binary format, but the system does not support execution of a file with this format.
- execvp.27.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the path or file argument.
- execvp.27.05
[ENAMETOOLONG] The length of the path or file arguments exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- execvp.27.06
[ENOENT] A component of path or file does not name an existing file or path or file is an empty string.
- execvp.27.07
[ENOTDIR] A component of the new process image file's path prefix is not a directory.
- execvp.29
The exec functions may fail if:
- execvp.29.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path or file argument.
- execvp.29.02
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- execvp.29.03
[ENOMEM] The new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints.
- execvp.29.04
[ETXTBSY] The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.
- execvp.30
The argument file is used to construct a pathname that identifies the new process image file.
- execvp.30.01
If the file argument contains a slash character, the file argument shall be used as the pathname for this file.
- execvp.30.02
Otherwise, the path prefix for this file is obtained by a search of the directories passed as the environment variable PATH (see the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables).
- app.execvp.30.03
If this environment variable is not present, the results of the search are implementation-defined.
- execvp.31
There are two distinct ways in which the contents of the process image file may cause the execution to fail, distinguished by the setting of errno to either [ENOEXEC] or [EINVAL] (see the ERRORS section). In the cases where the other members of the exec family of functions would fail and set errno to [ENOEXEC], the execlp() and execvp() functions shall execute a command interpreter and the environment of the executed command shall be as if the process invoked the sh utility using execl() as follows:execl(<shell path>, arg0, file, arg1, ..., (char *)0);where <shell path> is an unspecified pathname for the sh utility, file is the process image file, and for execvp(), where arg0, arg1, and so on correspond to the values passed to execvp() in argv[0], argv[1], and so on.
- execvp.32
For those forms not containing an envp pointer ( execl(), execv(), execlp(), and execvp()), the environment for the new process image shall be taken from the external variable environ in the calling process.
- app.execvp.33
The number of bytes available for the new process' combined argument and environment lists is {ARG_MAX}. It is implementation-defined whether null terminators, pointers, and/or any alignment bytes are included in this total.
- execvp.34
If file descriptors 0, 1, and 2 would otherwise be closed after a successful call to one of the exec family of functions, and the new process image file has the set-user-ID or set-group-ID file mode bits set, [XSI] and the ST_NOSUID bit is not set for the file system containing the new process image file, implementations may open an unspecified file for each of these file descriptors in the new process image.
- app.execvp.35
[XSI] The state of conversion descriptors and message catalog descriptors in the new process image is undefined.
- execvp.35
setlocale(LC_ALL, "C")shall be executed at start-up.
- execvp.36
When the calling process image does not use the SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC scheduling policies, the scheduling policy and parameters of the new process image and the initial thread in that new process image are implementation-defined.
- execvp.37
[AIO] Any outstanding asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the exec function had not yet occurred, but any associated signal notifications shall be suppressed. It is unspecified whether the exec function itself blocks awaiting such I/O completion. In no event, however, shall the new process image created by the exec function be affected by the presence of outstanding asynchronous I/O operations at the time the exec function is called. Whether any I/O is canceled, and which I/O may be canceled upon exec, is implementation-defined.
- execvp.38
[THR] The thread ID of the initial thread in the new process image is unspecified.
- execvp.39
The size and location of the stack on which the initial thread in the new process image runs is unspecified.
- execvp.40
All other process attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the new process image from the old process image.
- execvp.41
All other thread attributes defined in this volume of IEEE Std 1003.1-2001 shall be inherited in the initial thread in the new process image from the calling thread in the old process image.
- execvp.42
The inheritance of process or thread attributes not defined by this volume of IEEE Std 1003.1-2001 is implementation-defined.
- execvp.43
Upon successful completion, the exec functions shall mark for update the st_atime field of the file.
- execvp.44
If an exec function failed but was able to locate the process image file, whether the st_atime field is marked for update is unspecified.
- execvp.45
Should the exec function succeed, the process image file shall be considered to have been opened with open(). The corresponding close() shall be considered to occur at a time after this open, but before process termination or successful completion of a subsequent call to one of the exec functions, posix_spawn(), or posix_spawnp().
- execvp.46
The argv[] and envp[] arrays of pointers and the strings to which those arrays point shall not be modified by a call to one of the exec functions, except as a consequence of replacing the process image.
- [+]exit (25 / 3 / 0)
- app.exit.01
If, during the call to any such function, a call to the longjmp() function is made that would terminate the call to the registered function, the behavior is undefined.
- exit.01
The exit() function shall first call all functions registered by atexit(), in the reverse order of their registration, except that a function is called after any previously registered functions that had already been called at the time it was registered. Each function is called as many times as it was registered.
- exit.02
If a function registered by a call to atexit() fails to return, the remaining registered functions shall not be called and the rest of the exit() processing shall not be completed.
- app.exit.02
If exit() is called more than once, the behavior is undefined.
- exit.03
The exit() function shall then flush all open streams with unwritten buffered data, close all open streams, and remove all files created by tmpfile().
- exit.04
These functions shall terminate the calling process [CX] with the following consequences:
- exit.04.01
All of the file descriptors, directory streams, [XSI] conversion descriptors, and message catalog descriptors open in the calling process shall be closed.
- exit.04.02
If the parent process of the calling process is executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, it shall be notified of the calling process' termination and the low-order eight bits (that is, bits 0377) of status shall be made available to it. If the parent is not waiting, the child's status shall be made available to it when the parent subsequently executes wait() or waitpid().
- exit.04.03
If the parent process of the calling process is not executing a wait() or waitpid(), [XSI] and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, the calling process shall be transformed into a zombie process. A zombie process is an inactive process and it shall be deleted at some later time when its parent process executes wait() or waitpid().
- exit.04.04
Termination of a process does not directly terminate its children. The sending of a SIGHUP signal as described below indirectly terminates children in some circumstances.
- exit.04.05
The parent process ID of all of the calling process' existing child processes and zombie processes shall be set to the process ID of an implementation-defined system process. That is, these processes shall be inherited by a special system process.
[XSI] If a parent process terminates without waiting for all of its child processes to terminate, the remaining child processes shall be assigned a new parent process ID corresponding to an implementation-defined system process.
- exit.04.06
[XSI] Each attached shared-memory segment is detached and the value of shm_nattch (see shmget()) in the data structure associated with its shared memory ID shall be decremented by 1.
- exit.04.07
[XSI] For each semaphore for which the calling process has set a semadj value (see semop() ), that value shall be added to the semval of the specified semaphore.
- exit.04.08
If the process is a controlling process, the SIGHUP signal shall be sent to each process in the foreground process group of the controlling terminal belonging to the calling process.
- exit.04.09
If the process is a controlling process, the controlling terminal associated with the session shall be disassociated from the session, allowing it to be acquired by a new controlling process.
- exit.04.10
If the exit of the process causes a process group to become orphaned, and if any member of the newly-orphaned process group is stopped, then a SIGHUP signal followed by a SIGCONT signal shall be sent to each process in the newly-orphaned process group.
- exit.04.11
[SEM] All open named semaphores in the calling process shall be closed as if by appropriate calls to sem_close().
- exit.04.12
[ML] Any memory locks established by the process via calls to mlockall() or mlock() shall be removed. If locked pages in the address space of the calling process are also mapped into the address spaces of other processes and are locked by those processes, the locks established by the other processes shall be unaffected by the call by this process to _Exit() or _exit().
- exit.04.13
[MF|SHM] Memory mappings that were created in the process shall be unmapped before the process is destroyed.
- exit.04.14
[TYM] Any blocks of typed memory that were mapped in the calling process shall be unmapped, as if munmap() was implicitly called to unmap them.
- exit.04.15
[MSG] All open message queue descriptors in the calling process shall be closed as if by appropriate calls to mq_close().
- exit.04.16
[AIO] Any outstanding cancelable asynchronous I/O operations may be canceled. Those asynchronous I/O operations that are not canceled shall complete as if the _Exit() or _exit() operation had not yet occurred, but any associated signal notifications shall be suppressed. The _Exit() or _exit() operation may block awaiting such I/O completion. Whether any I/O is canceled, and which I/O may be canceled upon _Exit() or _exit(), is implementation-defined.
- exit.04.18
[TRC] If the calling process is a trace controller process, any trace streams that were created by the calling process shall be shut down as described by the posix_trace_shutdown() function, and any process' mapping of trace event names to trace event type identifiers built for these trace streams may be deallocated.
- exit.04.19.01
If the implementation supports the SIGCHLD signal, a SIGCHLD shall be sent to the parent process.
- exit.04.19.02
If the parent process has set its SA_NOCLDWAIT flag, or set SIGCHLD to SIG_IGN, the status shall be discarded, and the lifetime of the calling process shall end immediately.
- exit.04.19.03
If SA_NOCLDWAIT is set, it is implementation-defined whether a SIGCHLD signal is sent to the parent process.
- exit.05
These functions do not return.
- exit.06
The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process.
- [+]fork (32 / 4 / 0)
- fork.01
The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:
- fork.01.01
The child process shall have a unique process ID.
- fork.01.02
The child process ID also shall not match any active process group ID.
- fork.01.03
The child process shall have a different parent process ID, which shall be the process ID of the calling process.
- fork.01.04
The child process shall have its own copy of the parent's file descriptors. Each of the child's file descriptors shall refer to the same open file description with the corresponding file descriptor of the parent.
- fork.01.05
The child process shall have its own copy of the parent's open directory streams. Each open directory stream in the child process may share directory stream positioning with the corresponding directory stream of the parent.
- fork.01.06
The child process shall have its own copy of the parent's message catalog descriptors.
- fork.01.07
The child process' values of tms_utime, tms_stime, tms_cutime, and tms_cstime shall be set to 0.
- fork.01.08
The time left until an alarm clock signal shall be reset to zero, and the alarm, if any, shall be canceled; see alarm().
- fork.01.09
All semadj values shall be cleared.
- fork.01.10
File locks set by the parent process shall not be inherited by the child process.
- fork.01.11
The set of signals pending for the child process shall be initialized to the empty set.
- fork.01.12
Interval timers shall be reset in the child process.
- fork.01.13
Any semaphores that are open in the parent process shall also be open in the child process.
- fork.01.14
The child process shall not inherit any address space memory locks established by the parent process via calls to mlockall() or mlock().
- fork.01.15
Memory mappings created in the parent shall be retained in the child process. MAP_PRIVATE mappings inherited from the parent shall also be MAP_PRIVATE mappings in the child, and any modifications to the data in these mappings made by the parent prior to calling fork() shall be visible to the child. Any modifications to the data in MAP_PRIVATE mappings made by the parent after fork() returns shall be visible only to the parent. Modifications to the data in MAP_PRIVATE mappings made by the child shall be visible only to the child.
- fork.01.16
For the SCHED_FIFO and SCHED_RR scheduling policies, the child process shall inherit the policy and priority settings of the parent process during a fork() function. For other scheduling policies, the policy and priority settings on fork() are implementation-defined.
- fork.01.17
Per-process timers created by the parent shall not be inherited by the child process.
- fork.01.18
The child process shall have its own copy of the message queue descriptors of the parent. Each of the message descriptors of the child shall refer to the same open message queue description as the corresponding message descriptor of the parent.
- fork.01.19
No asynchronous input or asynchronous output operations shall be inherited by the child process.
- fork.01.20
A process shall be created with a single thread. If a multi-threaded process calls fork(), the new process shall contain a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal-safe operations until such time as one of the exec functions is called. [THR] Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls. When the application calls fork() from a signal handler and any of the fork handlers registered by pthread_atfork() calls a function that is not asynch-signal-safe, the behavior is undefined.
- fork.01.21
[TRC TRI] If the Trace option and the Trace Inherit option are both supported:If the calling process was being traced in a trace stream that had its inheritance policy set to POSIX_TRACE_INHERITED, the child process shall be traced into that trace stream, and the child process shall inherit the parent's mapping of trace event names to trace event type identifiers. If the trace stream in which the calling process was being traced had its inheritance policy set to POSIX_TRACE_CLOSE_FOR_CHILD, the child process shall not be traced into that trace stream. The inheritance policy is set by a call to the posix_trace_attr_setinherited() function.
- fork.01.22
[TRC] If the Trace option is supported, but the Trace Inherit option is not supported:The child process shall not be traced into any of the trace streams of its parent process.
- fork.01.23
If the Trace option is supported, the child process of a trace controller process shall not control the trace streams controlled by its parent process.
- fork.01.24
The initial value of the CPU-time clock of the child process shall be set to zero.
- fork.01.25
The initial value of the CPU-time clock of the single thread of the child process shall be set to zero.
- fork.02.01
Upon successful completion, fork() shall return 0 to the child process and shall return the process ID of the child process to the parent process. Both processes shall continue to execute from the fork() function.
- fork.02.02
Otherwise, -1 shall be returned to the parent process, no child process shall be created, and errno shall be set to indicate the error.
- fork.03
The fork() function shall fail if:
- fork.03.01
[EAGAIN] The system lacked the necessary resources to create another process, or the system-imposed limit on the total number of processes under execution system-wide or by a single user {CHILD_MAX} would be exceeded.
- fork.04
The fork() function may fail if:
- fork.04.01
[ENOMEM] Insufficient storage space is available.
- fork.05
All other process characteristics defined by IEEE Std 1003.1-2001 shall be the same in the parent and child processes.
- fork.06
The inheritance of process characteristics not defined by IEEE Std 1003.1-2001 is unspecified by IEEE Std 1003.1-2001.
- fork.07
After fork(), both the parent and the child processes shall be capable of executing independently before either one terminates.
- [+]forkpty (10 / 2 / 0)
- forkpty.01
The forkpty() function shall find and open a pseudo-terminal device pair in the same manner as the openpty() function.
- app.forkpty.01
If termp is not null, it shall refer to a termios structure that shall be used to initialize the characteristics of the slave device.
- app.forkpty.02
If winp is not null, it shall refer to a winsize structure used to initialize the window size of the slave device.
- forkpty.02.01
On success, the parent process shall return the process id of the child, and the child shall return 0.
- forkpty.02.02
On error, no new process shall be created, -1 shall be returned, and errno shall be set appropriately.
- forkpty.03
If a pseudo-terminal is available, forkpty() shall create a new process in the same manner as the fork() function
- forkpty.04
prepares the new process for login in the same manner as login_tty().
- forkpty.05
On success, the parent process shall receive
- forkpty.05.01
the file descriptor of the master side of the pseudo-terminal in the location referenced by amaster
- forkpty.05.02
if name is not NULL, the filename of the slave device in name
- forkpty.06
Errors
- forkpty.06.01
[EAGAIN] Unable to create a new process.
- forkpty.06.02
[ENOENT] There are no available pseudo-terminals.
- forkpty.06.03
[ENOMEM] Insufficient memory was available.
- [+]pclose (12 / 1 / 0)
- app.pclose.01
If the argument stream to pclose() is not a pointer to a stream created by popen(), the result of pclose() is undefined.
- pclose.01
The pclose() function shall
- pclose.01.01
close a stream that was opened by popen()
- pclose.01.02
wait for the command to terminate
- pclose.01.03
return the termination status of the process that was running the command language interpreter
- pclose.02
In any case, pclose() shall not return before the child process created by popen() has terminated.
- pclose.03
If the command language interpreter cannot be executed, the child termination status returned by pclose() shall be as if the command language interpreter terminated using exit(127) or _exit(127).
- pclose.04
The pclose() function shall not affect the termination status of any child of the calling process other than the one created by popen() for the associated stream.
- pclose.05.01
Upon successful return, pclose() shall return the termination status of the command language interpreter.
- pclose.05.02
Otherwise, pclose() shall return -1 and set errno to indicate the error.
- pclose.06
The pclose() function shall fail if:
- pclose.06.01
[ECHILD] The status of the child process could not be obtained, as described above.
- pclose.07
if a call caused the termination status to be unavailable to pclose(), then pclose() shall return -1 with errno set to [ECHILD] to report this situation. This can happen if the application calls one of the following functions:
- pclose.07.01
wait()
- pclose.07.02
waitpid() with a pid argument less than or equal to 0 or equal to the process ID of the command line interpreter
- pclose.07.03
Any other function not defined in this volume of IEEE Std 1003.1-2001 that could do one of the above
- [+]popen (14 / 1 / 0)
- popen.01
The popen() function shall
- popen.01.01
execute the command specified by the string command
- popen.01.02
create a pipe between the calling program and the executed command
- popen.01.03
return a pointer to a stream that can be used to either read from or write to the pipe
- popen.02
The environment of the executed command shall be as if a child process were created within the popen() call using the fork() function, and the child invoked the sh utility using the call:execl(shell path, "sh", "-c", command, (char *)0);where shell path is an unspecified pathname for the sh utility.
- popen.03
The popen() function shall ensure that any streams from previous popen() calls that remain open in the parent process are closed in the new child process.
- app.popen.04
The mode argument to popen() is a string that specifies I/O mode:
- app.popen.04.03
If mode is any other value, the result is undefined.
- popen.04
The mode argument to popen() is a string that specifies I/O mode:
- popen.04.01
If mode is r, when the child process is started, its file descriptor STDOUT_FILENO shall be the writable end of the pipe, and the file descriptor fileno(stream) in the calling process, where stream is the stream pointer returned by popen(), shall be the readable end of the pipe.
- popen.04.02
If mode is w, when the child process is started its file descriptor STDIN_FILENO shall be the readable end of the pipe, and the file descriptor fileno(stream) in the calling process, where stream is the stream pointer returned by popen(), shall be the writable end of the pipe.
- popen.05
After popen(), both the parent and the child process shall be capable of executing independently before either terminates.
- popen.06
Pipe streams are byte-oriented.
- popen.07.01
Upon successful completion, popen() shall return a pointer to an open stream that can be used to read or write to the pipe.
- popen.07.02
Otherwise, it shall return a null pointer and may set errno to indicate the error.
- popen.08
The popen() function may fail if:
- popen.08.01
[EMFILE] {FOPEN_MAX} or {STREAM_MAX} streams are currently open in the calling process.
- popen.08.02
[EINVAL] The mode argument is invalid.
- popen.09
The popen() function may also set errno values as described by fork() or pipe().
- [+]system (16 / 0 / 0)
- system.01
The system() function shall behave as described in ISO POSIX (2003).
- system.02
If command is a null pointer, the system() function shall determine whether the host environment has a command processor.
- system.03
If command is not a null pointer, the system() function shall pass the string pointed to by command to that command processor to be executed in an implementation-defined manner; this might then cause the program calling system() to behave in a non-conforming manner or to terminate.
- system.04
The environment of the executed command shall be as if a child process were created using fork(), and the child process invoked the sh utility using execl() as follows:execl(<shell path>, "sh", "-c", command, (char *)0);
where <shell path> is an unspecified pathname for the sh utility.
- system.05
The system() function shall ignore the SIGINT and SIGQUIT signals, and shall block the SIGCHLD signal, while waiting for the command to terminate.
- system.06
If this might cause the application to miss a signal that would have killed it, then the application should examine the return value from system() and take whatever action is appropriate to the application if the command terminated due to receipt of a signal.
- system.07
The system() function shall not affect the termination status of any child of the calling processes other than the process or processes it itself creates.
- system.08
The system() function shall not return until the child process has terminated.
- system.09
If command is a null pointer, system() shall return non-zero to indicate that a command processor is available, or zero if none is available.
- system.10
[CX] The system() function shall always return non-zero when command is NULL.
- system.11
[CX] If command is not a null pointer, system() shall return the termination status of the command language interpreter in the format specified by waitpid().
- system.12
The termination status shall be as defined for the sh utility; otherwise, the termination status is unspecified.
- system.13
If some error prevents the command language interpreter from executing after the child process is created, the return value from system() shall be as if the command language interpreter had terminated using exit(127) or _exit(127).
- system.14
If a child process cannot be created, or if the termination status for the command language interpreter cannot be obtained, system() shall return -1 and set errno to indicate the error.
- system.15
[CX] The system() function may set errno values as described by fork().
- system.16
In addition, system() may fail if:
- system.16.01
[ECHILD] [CX] The status of the child process created by system() is no longer available.
- [+]vfork (32 / 4 / 0)
- app.vfork.01
The vfork() function shall be equivalent to fork(), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit() or one of the exec family of functions.
- vfork.01
The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:
- vfork.01.01
The child process shall have a unique process ID.
- vfork.01.02
The child process ID also shall not match any active process group ID.
- vfork.01.03
The child process shall have a different parent process ID, which shall be the process ID of the calling process.
- vfork.01.04
The child process shall have its own copy of the parent's file descriptors. Each of the child's file descriptors shall refer to the same open file description with the corresponding file descriptor of the parent.
- vfork.01.05
The child process shall have its own copy of the parent's open directory streams. Each open directory stream in the child process may share directory stream positioning with the corresponding directory stream of the parent.
- vfork.01.06
The child process shall have its own copy of the parent's message catalog descriptors.
- vfork.01.07
The child process' values of tms_utime, tms_stime, tms_cutime, and tms_cstime shall be set to 0.
- vfork.01.08
The time left until an alarm clock signal shall be reset to zero, and the alarm, if any, shall be canceled; see alarm().
- vfork.01.09
All semadj values shall be cleared.
- vfork.01.10
File locks set by the parent process shall not be inherited by the child process.
- vfork.01.11
The set of signals pending for the child process shall be initialized to the empty set.
- vfork.01.12
Interval timers shall be reset in the child process.
- vfork.01.13
Any semaphores that are open in the parent process shall also be open in the child process.
- vfork.01.14
The child process shall not inherit any address space memory locks established by the parent process via calls to mlockall() or mlock().
- vfork.01.15
Memory mappings created in the parent shall be retained in the child process. MAP_PRIVATE mappings inherited from the parent shall also be MAP_PRIVATE mappings in the child, and any modifications to the data in these mappings made by the parent prior to calling fork() shall be visible to the child. Any modifications to the data in MAP_PRIVATE mappings made by the parent after fork() returns shall be visible only to the parent. Modifications to the data in MAP_PRIVATE mappings made by the child shall be visible only to the child.
- vfork.01.16
For the SCHED_FIFO and SCHED_RR scheduling policies, the child process shall inherit the policy and priority settings of the parent process during a fork() function. For other scheduling policies, the policy and priority settings on fork() are implementation-defined.
- vfork.01.17
Per-process timers created by the parent shall not be inherited by the child process.
- vfork.01.18
The child process shall have its own copy of the message queue descriptors of the parent. Each of the message descriptors of the child shall refer to the same open message queue description as the corresponding message descriptor of the parent.
- vfork.01.19
No asynchronous input or asynchronous output operations shall be inherited by the child process.
- vfork.01.20
A process shall be created with a single thread. If a multi-threaded process calls fork(), the new process shall contain a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal-safe operations until such time as one of the exec functions is called. [THR] Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls. When the application calls fork() from a signal handler and any of the fork handlers registered by pthread_atfork() calls a function that is not asynch-signal-safe, the behavior is undefined.
- vfork.01.21
[TRC TRI] If the Trace option and the Trace Inherit option are both supported:If the calling process was being traced in a trace stream that had its inheritance policy set to POSIX_TRACE_INHERITED, the child process shall be traced into that trace stream, and the child process shall inherit the parent's mapping of trace event names to trace event type identifiers. If the trace stream in which the calling process was being traced had its inheritance policy set to POSIX_TRACE_CLOSE_FOR_CHILD, the child process shall not be traced into that trace stream. The inheritance policy is set by a call to the posix_trace_attr_setinherited() function.
- vfork.01.22
[TRC] If the Trace option is supported, but the Trace Inherit option is not supported:The child process shall not be traced into any of the trace streams of its parent process.
- vfork.01.23
If the Trace option is supported, the child process of a trace controller process shall not control the trace streams controlled by its parent process.
- vfork.01.24
The initial value of the CPU-time clock of the child process shall be set to zero.
- vfork.01.25
The initial value of the CPU-time clock of the single thread of the child process shall be set to zero.
- vfork.02.01
Upon successful completion, vfork() shall return 0 to the child process and return the process ID of the child process to the parent process.
- vfork.02.02
Otherwise, -1 shall be returned to the parent, no child process shall be created, and errno shall be set to indicate the error.
- vfork.03
The vfork() function shall fail if:
- vfork.03.01
[EAGAIN] The system-wide limit on the total number of processes under execution would be exceeded, or the system-imposed limit on the total number of processes under execution by a single user would be exceeded.
- vfork.03.02
[ENOMEM] There is insufficient swap space for the new process.
- vfork.05
All other process characteristics defined by IEEE Std 1003.1-2001 shall be the same in the parent and child processes.
- vfork.06
The inheritance of process characteristics not defined by IEEE Std 1003.1-2001 is unspecified by IEEE Std 1003.1-2001.
- vfork.07
After fork(), both the parent and the child processes shall be capable of executing independently before either one terminates.
- [+]wait (30 / 0 / 0)
- wait.01
The wait() and waitpid() functions shall obtain status information pertaining to one of the caller's child processes. Various options permit status information to be obtained for child processes that have terminated or stopped.
- wait.02
If status information is available for two or more child processes, the order in which their status is reported is unspecified.
- wait.03.01
The wait() function shall suspend execution of the calling thread until status information for one of the terminated child processes of the calling process is available
- wait.03.02
until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process.
- wait.03.03
If more than one thread is suspended in wait() or waitpid() awaiting termination of the same process, exactly one thread shall return the process status at the time of the target process termination.
- wait.03.04
If status information is available prior to the call to wait(), return shall be immediate.
- wait.06
[XSI] If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread shall block until all of the children of the process containing the calling thread terminate, and wait() and waitpid() shall fail and set errno to [ECHILD].
- wait.07
If wait() or waitpid() return because the status of a child process is available, these functions shall return a value equal to the process ID of the child process.
- wait.08
In this case, if the value of the argument stat_loc is not a null pointer, information shall be stored in the location pointed to by stat_loc.
- wait.09
If _POSIX_REALTIME_SIGNALS is defined
- wait.09.01
and the implementation queues the SIGCHLD signal, then if wait() or waitpid() returns because the status of a child process is available, any pending SIGCHLD signal associated with the process ID of the child process shall be discarded. Any other pending SIGCHLD signals shall remain pending.
- wait.09.02
Otherwise, if SIGCHLD is blocked, if wait() or waitpid() return because the status of a child process is available, any pending SIGCHLD signal shall be cleared unless the status of another child process is available.
- wait.10
If wait() or waitpid() returns because the status of a child process is available, these functions shall return a value equal to the process ID of the child process for which status is reported.
- wait.11
The wait() function shall fail if:
- wait.11.01
[ECHILD] The calling process has no existing unwaited-for child processes.
- wait.11.02
[EINTR] The function was interrupted by a signal. The value of the location pointed to by stat_loc is undefined.
If wait() or waitpid() returns due to the delivery of a signal to the calling process, -1 shall be returned and errno set to [EINTR].
- wait.12
The value stored at the location pointed to by stat_loc shall be 0 if and only if the status returned is from a terminated child process that terminated by one of the following means:
- wait.12.01
The process returned 0 from main().
- wait.12.02
The process called _exit() or exit() with a status argument of 0.
- wait.12.03
The process was terminated because the last thread in the process terminated.
- wait.13
Regardless of its value, this information may be interpreted using the following macros, which are defined in <sys/wait.h> and evaluate to integral expressions; the stat_val argument is the integer value pointed to by stat_loc.
- wait.13.01
WIFEXITED(stat_val) Evaluates to a non-zero value if status was returned for a child process that terminated normally.
- wait.13.02
WEXITSTATUS(stat_val) If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to _exit() or exit(), or the value the child process returned from main().
- wait.13.03
WIFSIGNALED(stat_val) Evaluates to a non-zero value if status was returned for a child process that terminated due to the receipt of a signal that was not caught (see <signal.h>).
- wait.13.04
WTERMSIG(stat_val) If the value of WIFSIGNALED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
- wait.13.05
WIFSTOPPED(stat_val) Evaluates to a non-zero value if status was returned for a child process that is currently stopped.
- wait.13.06
WSTOPSIG(stat_val) If the value of WIFSTOPPED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
- wait.13.07
WIFCONTINUED(stat_val) [XSI]
Evaluates to a non-zero value if status was returned for a child process that has continued from a job control stop.
- wait.14
[SPN] It is unspecified whether the status value returned by calls to wait() or waitpid() for processes created by posix_spawn() or posix_spawnp() can indicate a WIFSTOPPED(stat_val) before subsequent calls to wait() or waitpid() indicate WIFEXITED(stat_val) as the result of an error detected before the new process image starts executing.
- wait.15
It is unspecified whether the status value returned by calls to wait() or waitpid() for processes created by posix_spawn() or posix_spawnp() can indicate a WIFSIGNALED(stat_val) if a signal is sent to the parent's process group after posix_spawn() or posix_spawnp() is called.
- wait.16
If the information pointed to by stat_loc was stored by a call to waitpid() that specified the WUNTRACED flag [XSI] and did not specify the WCONTINUED flag, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), and WIFSTOPPED(*stat_loc) shall evaluate to a non-zero value.
- wait.17
If the information pointed to by stat_loc was stored by a call to waitpid() that specified the WUNTRACED [XSI] and WCONTINUED flags, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), WIFSTOPPED(*stat_loc), [XSI] and WIFCONTINUED(*stat_loc) shall evaluate to a non-zero value.
- wait.18
If the information pointed to by stat_loc was stored by a call to waitpid() that did not specify the WUNTRACED [XSI] or WCONTINUED flags, or by a call to the wait() function, exactly one of the macros WIFEXITED(*stat_loc) and WIFSIGNALED(*stat_loc) shall evaluate to a non-zero value.
- wait.19
If the information pointed to by stat_loc was stored by a call to waitpid() that did not specify the WUNTRACED flag [XSI] and specified the WCONTINUED flag, or by a call to the wait() function, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), [XSI] and WIFCONTINUED(*stat_loc) shall evaluate to a non-zero value.
- [+]wait4 (20 / 0 / 0)
- wait4.03.01
wait4() suspends execution of the current process until a child (as specified by pid) has exited
- wait4.03.02
until a signal is delivered whose action is to terminate the current process or to call a signal handling function.
- wait4.03.04
If a child (as requested by pid) has already exited by the time of the call (a so-called "zombie" process), the function returns immediately.
- wait4.04
The value of pid can be one of:
- wait4.04.01
-1 wait for any child process; this is equivalent to calling wait3().
- wait4.04.02
> 0 wait for the child whose process ID is equal to the value of pid.
- wait4.04.03
0 wait for any child process whose process group ID is equal to that of the calling process.
- wait4.04.04
< -1 wait for any child process whose process group ID is equal to the absolute value of pid.
- wait4.05
The value of options is a bitwise or of zero or more of the following constants:
- wait4.05.02
WNOHANG return immediately if no child is there to be waited for.
- wait4.05.03
WUNTRACED return for children that are stopped, and whose status has not been reported.
- wait4.08
If status is not NULL, wait4() stores status information in the location status.
- wait4.10
On success, the process ID of the child that exited is returned.
- wait4.11
Errors
- wait4.11.01
[ECHILD] No unwaited-for child process as specified does exist.
- wait4.11.02
[ERESTARTSYS] A WNOHANG() was not set and an unblocked signal or a SIGCHILD was caught. This error is returned by the system call. The library interface is not allowed to return ERESTARTSYS, but will return EINTR.
- wait4.13
This status can be evaluated with the following macros:
- wait4.13.01
WIFEXITED(status) is nonzero if the child exited normally.
- wait4.13.02
WEXITSTATUS(status) evaluates to the least significant eight bits of the return code of the child that terminated, which may have been set as the argument to a call to exit() or as the argument for a return statement in the main program. This macro can only be evaluated if WIFEXITED() returned nonzero.
- wait4.13.03
WIFSIGNALED(status) returns true if the child process exited because of a signal that was not caught.
- wait4.13.04
WTERMSIG(status) returns the number of the signal that caused the child process to terminate. This macro can only be evaluated if WIFSIGNALED() returned nonzero.
- wait4.13.05
WIFSTOPPED(status) returns true if the child process that caused the return is currently stopped; this is only possible if the call was done using WUNTRACED().
- wait4.13.06
WSTOPSIG(status) returns the number of the signal that caused the child to stop. This macro can only be evaluated if WIFSTOPPED() returned nonzero.
- wait4.22
If rusage is not NULL, the struct rusage (as defined in sys/resource.h) that it points to will be filled with accounting information. See getrusage() for details.
- [+]waitpid (40 / 0 / 0)
- waitpid.01
The wait() and waitpid() functions shall obtain status information pertaining to one of the caller's child processes. Various options permit status information to be obtained for child processes that have terminated or stopped.
- waitpid.02
If status information is available for two or more child processes, the order in which their status is reported is unspecified.
- waitpid.03.01
The wait() function shall suspend execution of the calling thread until status information for one of the terminated child processes of the calling process is available
- waitpid.03.02
until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process.
- waitpid.03.03
If more than one thread is suspended in wait() or waitpid() awaiting termination of the same process, exactly one thread shall return the process status at the time of the target process termination.
- waitpid.03.04
If status information is available prior to the call to wait(), return shall be immediate.
- waitpid.04
The pid argument specifies a set of child processes for which status is requested. The waitpid() function shall only return the status of a child process from this set:
- waitpid.04.01
If pid is equal to (pid_t)-1, status is requested for any child process. In this respect, waitpid() is then equivalent to wait().
- waitpid.04.02
If pid is greater than 0, it specifies the process ID of a single child process for which status is requested.
- waitpid.04.03
If pid is 0, status is requested for any child process whose process group ID is equal to that of the calling process.
- waitpid.04.04
If pid is less than (pid_t)-1, status is requested for any child process whose process group ID is equal to the absolute value of pid.
- waitpid.05
The options argument is constructed from the bitwise-inclusive OR of zero or more of the following flags, defined in the <sys/wait.h> header:
- waitpid.05.01
WCONTINUED [XSI] The waitpid() function shall report the status of any continued child process specified by pid whose status has not been reported since it continued from a job control stop.
- waitpid.05.02
WNOHANG The waitpid() function shall not suspend execution of the calling thread if status is not immediately available for one of the child processes specified by pid.
- waitpid.05.03
WUNTRACED The status of any child processes specified by pid that are stopped, and whose status has not yet been reported since they stopped, shall also be reported to the requesting process.
- waitpid.06
[XSI] If the calling process has SA_NOCLDWAIT set or has SIGCHLD set to SIG_IGN, and the process has no unwaited-for children that were transformed into zombie processes, the calling thread shall block until all of the children of the process containing the calling thread terminate, and wait() and waitpid() shall fail and set errno to [ECHILD].
- waitpid.07
If wait() or waitpid() return because the status of a child process is available, these functions shall return a value equal to the process ID of the child process.
- waitpid.08
In this case, if the value of the argument stat_loc is not a null pointer, information shall be stored in the location pointed to by stat_loc.
- waitpid.09
If _POSIX_REALTIME_SIGNALS is defined
- waitpid.09.01
and the implementation queues the SIGCHLD signal, then if wait() or waitpid() returns because the status of a child process is available, any pending SIGCHLD signal associated with the process ID of the child process shall be discarded. Any other pending SIGCHLD signals shall remain pending.
- waitpid.09.02
Otherwise, if SIGCHLD is blocked, if wait() or waitpid() return because the status of a child process is available, any pending SIGCHLD signal shall be cleared unless the status of another child process is available.
- waitpid.10
If wait() or waitpid() returns because the status of a child process is available, these functions shall return a value equal to the process ID of the child process for which status is reported.
- waitpid.11
The waitpid() function shall fail if:
- waitpid.11.01
[ECHILD] The process specified by pid does not exist or is not a child of the calling process, or the process group specified by pid does not exist or does not have any member process that is a child of the calling process.
- waitpid.11.02
[EINTR] The function was interrupted by a signal. The value of the location pointed to by stat_loc is undefined.
If wait() or waitpid() returns due to the delivery of a signal to the calling process, -1 shall be returned and errno set to [EINTR].
- waitpid.11.03
[EINVAL] The options argument is not valid.
- waitpid.12
The value stored at the location pointed to by stat_loc shall be 0 if and only if the status returned is from a terminated child process that terminated by one of the following means:
- waitpid.12.01
The process returned 0 from main().
- waitpid.12.02
The process called _exit() or exit() with a status argument of 0.
- waitpid.12.03
The process was terminated because the last thread in the process terminated.
- waitpid.13
Regardless of its value, this information may be interpreted using the following macros, which are defined in <sys/wait.h> and evaluate to integral expressions; the stat_val argument is the integer value pointed to by stat_loc.
- waitpid.13.01
WIFEXITED(stat_val) Evaluates to a non-zero value if status was returned for a child process that terminated normally.
- waitpid.13.02
WEXITSTATUS(stat_val) If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to _exit() or exit(), or the value the child process returned from main().
- waitpid.13.03
WIFSIGNALED(stat_val) Evaluates to a non-zero value if status was returned for a child process that terminated due to the receipt of a signal that was not caught (see <signal.h>).
- waitpid.13.04
WTERMSIG(stat_val) If the value of WIFSIGNALED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the termination of the child process.
- waitpid.13.05
WIFSTOPPED(stat_val) Evaluates to a non-zero value if status was returned for a child process that is currently stopped.
- waitpid.13.06
WSTOPSIG(stat_val) If the value of WIFSTOPPED(stat_val) is non-zero, this macro evaluates to the number of the signal that caused the child process to stop.
- waitpid.13.07
WIFCONTINUED(stat_val) [XSI]
Evaluates to a non-zero value if status was returned for a child process that has continued from a job control stop.
- waitpid.14
[SPN] It is unspecified whether the status value returned by calls to wait() or waitpid() for processes created by posix_spawn() or posix_spawnp() can indicate a WIFSTOPPED(stat_val) before subsequent calls to wait() or waitpid() indicate WIFEXITED(stat_val) as the result of an error detected before the new process image starts executing.
- waitpid.15
It is unspecified whether the status value returned by calls to wait() or waitpid() for processes created by posix_spawn() or posix_spawnp() can indicate a WIFSIGNALED(stat_val) if a signal is sent to the parent's process group after posix_spawn() or posix_spawnp() is called.
- waitpid.16
If the information pointed to by stat_loc was stored by a call to waitpid() that specified the WUNTRACED flag [XSI] and did not specify the WCONTINUED flag, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), and WIFSTOPPED(*stat_loc) shall evaluate to a non-zero value.
- waitpid.17
If the information pointed to by stat_loc was stored by a call to waitpid() that specified the WUNTRACED [XSI] and WCONTINUED flags, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), WIFSTOPPED(*stat_loc), [XSI] and WIFCONTINUED(*stat_loc) shall evaluate to a non-zero value.
- waitpid.18
If the information pointed to by stat_loc was stored by a call to waitpid() that did not specify the WUNTRACED [XSI] or WCONTINUED flags, or by a call to the wait() function, exactly one of the macros WIFEXITED(*stat_loc) and WIFSIGNALED(*stat_loc) shall evaluate to a non-zero value.
- waitpid.19
If the information pointed to by stat_loc was stored by a call to waitpid() that did not specify the WUNTRACED flag [XSI] and specified the WCONTINUED flag, or by a call to the wait() function, exactly one of the macros WIFEXITED(*stat_loc), WIFSIGNALED(*stat_loc), [XSI] and WIFCONTINUED(*stat_loc) shall evaluate to a non-zero value.
- waitpid.20
If waitpid() was invoked with WNOHANG set in options, it has at least one child process specified by pid for which status is not available, and status is not available for any process specified by pid, 0 is returned.
- waitpid.21
Otherwise, (pid_t)-1 shall be returned, and errno set to indicate the error.
- app.waitpid.30
Implementations need not support the XSI optional functionality of WCONTINUED() or WIFCONTINUED().
- [+]process.resources (57 / 28 / 1)
- [+]getrlimit (10 / 6 / 0)
- getrlimit.01
The getrlimit() function shall get, and the setrlimit() function shall set, limits on the consumption of a variety of resources.
- getrlimit.04
The value RLIM_INFINITY, defined in <sys/resource.h>, shall be considered to be larger than any other limit value.
- getrlimit.05
The following resources are defined:
- getrlimit.06
When using the getrlimit() function, if a resource limit can be represented correctly in an object of type rlim_t, then its representation is returned; otherwise, if the value of the resource limit is equal to that of the corresponding saved hard limit, the value returned shall be RLIM_SAVED_MAX; otherwise, the value returned shall be RLIM_SAVED_CUR.
- getrlimit.09
The determination of whether a limit can be correctly represented in an object of type rlim_t is implementation-defined
- getrlimit.10.01
Upon successful completion, getrlimit() and setrlimit() shall return 0.
- getrlimit.10.02
Otherwise, these functions shall return -1 and set errno to indicate the error.
- getrlimit.12
The getrlimit() and setrlimit() functions shall fail if:
- getrlimit.12.01
[EINVAL] An invalid resource was specified; or in a setrlimit() call, the new rlim_cur exceeds the new rlim_max.
- getrlimit.12.02
[EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the calling process does not have appropriate privileges.
- getrlimit.14
A resource limit is represented by an rlimit structure.
- [+]getrlimit64 (10 / 4 / 0)
- getrlimit64.getrlimit.01
The getrlimit() function shall get, and the setrlimit() function shall set, limits on the consumption of a variety of resources.
- getrlimit64.getrlimit.04
The value RLIM_INFINITY, defined in <sys/resource.h>, shall be considered to be larger than any other limit value.
- getrlimit64.getrlimit.05
The following resources are defined:
- getrlimit64.getrlimit.06
When using the getrlimit() function, if a resource limit can be represented correctly in an object of type rlim_t, then its representation is returned; otherwise, if the value of the resource limit is equal to that of the corresponding saved hard limit, the value returned shall be RLIM_SAVED_MAX; otherwise, the value returned shall be RLIM_SAVED_CUR.
- getrlimit64.getrlimit.09
The determination of whether a limit can be correctly represented in an object of type rlim_t is implementation-defined
- getrlimit64.getrlimit.10.01
Upon successful completion, getrlimit() and setrlimit() shall return 0.
- getrlimit64.getrlimit.10.02
Otherwise, these functions shall return -1 and set errno to indicate the error.
- getrlimit64.getrlimit.12
The getrlimit() and setrlimit() functions shall fail if:
- getrlimit64.getrlimit.12.01
[EINVAL] An invalid resource was specified; or in a setrlimit() call, the new rlim_cur exceeds the new rlim_max.
- getrlimit64.getrlimit.12.02
[EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the calling process does not have appropriate privileges.
- getrlimit64.getrlimit.14
A resource limit is represented by an rlimit structure.
- [+]getrusage (7 / 6 / 0)
- getrusage.01
The getrusage() function shall provide measures of the resources used by the current process or its terminated and waited-for child processes.
- getrusage.02
If the value of the who argument is RUSAGE_SELF, information shall be returned about resources used by the current process.
- getrusage.03
If the value of the who argument is RUSAGE_CHILDREN, information shall be returned about resources used by the terminated and waited-for children of the current process.
- getrusage.04
If the child is never waited for (for example, if the parent has SA_NOCLDWAIT set or sets SIGCHLD to SIG_IGN), the resource information for the child process is discarded and not included in the resource information provided by getrusage().
- app.getrusage.05
The r_usage argument is a pointer to an object of type struct rusage in which the returned information is stored.
- getrusage.06.01
Upon successful completion, getrusage() shall return 0
- getrusage.06.02
otherwise, -1 shall be returned and errno set to indicate the error.
- getrusage.08
The getrusage() function shall fail if:
- getrusage.08.01
[EINVAL] The value of the who argument is not valid.
- [+]setrlimit (10 / 8 / 0)
- setrlimit.01
The getrlimit() function shall get, and the setrlimit() function shall set, limits on the consumption of a variety of resources.
- setrlimit.02
Soft limits may be changed by a process to any value that is less than or equal to the hard limit.
- setrlimit.03
A process may (irreversibly) lower its hard limit to any value that is greater than or equal to the soft limit. Only a process with appropriate privileges can raise a hard limit.
- setrlimit.05
The following resources are defined:
- setrlimit.07
When using the setrlimit() function, if the requested new limit is RLIM_INFINITY, the new limit shall be "no limit''; otherwise, if the requested new limit is RLIM_SAVED_MAX, the new limit shall be the corresponding saved hard limit; otherwise, if the requested new limit is RLIM_SAVED_CUR, the new limit shall be the corresponding saved soft limit; otherwise, the new limit shall be the requested value. In addition, if the corresponding saved limit can be represented correctly in an object of type rlim_t then it shall be overwritten with the new limit.
- app.setrlimit.08
The result of setting a limit to RLIM_SAVED_MAX or RLIM_SAVED_CUR is unspecified unless a previous call to getrlimit() returned that value as the soft or hard limit for the corresponding resource limit.
- setrlimit.10.01
Upon successful completion, getrlimit() and setrlimit() shall return 0.
- setrlimit.10.02
Otherwise, these functions shall return -1 and set errno to indicate the error.
- setrlimit.12
The getrlimit() and setrlimit() functions shall fail if:
- setrlimit.12.01
[EINVAL] An invalid resource was specified; or in a setrlimit() call, the new rlim_cur exceeds the new rlim_max.
- setrlimit.12.02
[EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the calling process does not have appropriate privileges.
- setrlimit.13
The setrlimit() function may fail if:
- setrlimit.13.01
[EINVAL] The limit specified cannot be lowered because current usage is already higher than the limit.
- [+]setrlimit64 (11 / 1 / 0)
- setrlimit64.setrlimit.01
The getrlimit() function shall get, and the setrlimit() function shall set, limits on the consumption of a variety of resources.
- setrlimit64.setrlimit.02
Soft limits may be changed by a process to any value that is less than or equal to the hard limit.
- setrlimit64.setrlimit.03
A process may (irreversibly) lower its hard limit to any value that is greater than or equal to the soft limit. Only a process with appropriate privileges can raise a hard limit.
- setrlimit64.setrlimit.05
The following resources are defined:
- setrlimit64.setrlimit.07
When using the setrlimit() function, if the requested new limit is RLIM_INFINITY, the new limit shall be "no limit''; otherwise, if the requested new limit is RLIM_SAVED_MAX, the new limit shall be the corresponding saved hard limit; otherwise, if the requested new limit is RLIM_SAVED_CUR, the new limit shall be the corresponding saved soft limit; otherwise, the new limit shall be the requested value. In addition, if the corresponding saved limit can be represented correctly in an object of type rlim_t then it shall be overwritten with the new limit.
- setrlimit64.setrlimit.08
The result of setting a limit to RLIM_SAVED_MAX or RLIM_SAVED_CUR is unspecified unless a previous call to getrlimit() returned that value as the soft or hard limit for the corresponding resource limit.
- setrlimit64.setrlimit.10.01
Upon successful completion, getrlimit() and setrlimit() shall return 0.
- setrlimit64.setrlimit.10.02
Otherwise, these functions shall return -1 and set errno to indicate the error.
- setrlimit64.setrlimit.12
The getrlimit() and setrlimit() functions shall fail if:
- setrlimit64.setrlimit.12.01
[EINVAL] An invalid resource was specified; or in a setrlimit() call, the new rlim_cur exceeds the new rlim_max.
- setrlimit64.setrlimit.12.02
[EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the calling process does not have appropriate privileges.
- setrlimit64.setrlimit.13
The setrlimit() function may fail if:
- setrlimit64.setrlimit.13.01
[EINVAL] The limit specified cannot be lowered because current usage is already higher than the limit.
- [+]ulimit (9 / 3 / 1)
- ulimit.01
shall be inherited by child processes.
- ulimit.02 (failed)
The return value shall be the integer part of the soft file size limit divided by 512.
The return value shall be the integer part of the new file size limit divided by 512.
- app.ulimit.03
If the result cannot be represented as a long, the result is unspecified.
- ulimit.04
Set the file size limit for output operations of the process to the value
- app.ulimit.05
If the result would overflow an rlim_t, the actual value set is unspecified.
- ulimit.06
Any process may decrease its own limit, but only a process with appropriate privileges may increase the limit.
- ulimit.08
The ulimit() function shall not change the setting of errno if successful.
- ulimit.09.01
Upon successful completion, ulimit() shall return the value of the requested limit.
- ulimit.09.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- ulimit.11
The ulimit() function shall fail and the limit shall be unchanged if:
- ulimit.11.01
[EINVAL] The cmd argument is not valid.
- ulimit.11.02
[EPERM] A process not having appropriate privileges attempts to increase its file size limit.
- app.ulimit.12
of the second argument, taken as a long, multiplied by 512.
- [+]process.scheduler (86 / 23 / 0)
- [+]sched_get_priority_max (4 / 2 / 0)
- sched_get_priority_max.01 (struct)
The sched_get_priority_max() and sched_get_priority_min() functions shall return the appropriate maximum or minimum, respectively, for the scheduling policy specified by policy.
- sched_get_priority_max.02
The value of policy shall be one of the scheduling policy values defined in <sched.h>.
- sched_get_priority_max.03.01
If successful, the sched_get_priority_max() and sched_get_priority_min() functions shall return the appropriate maximum or minimum values, respectively.
- sched_get_priority_max.03.02
If unsuccessful, they shall return a value of -1 and set errno to indicate the error.
- sched_get_priority_max.04
The sched_get_priority_max() and sched_get_priority_min() functions shall fail if:
- sched_get_priority_max.04.01
[EINVAL] The value of the policy parameter does not represent a defined scheduling policy.
- [+]sched_get_priority_min (4 / 2 / 0)
- sched_get_priority_min.01 (struct)
The sched_get_priority_max() and sched_get_priority_min() functions shall return the appropriate maximum or minimum, respectively, for the scheduling policy specified by policy.
- sched_get_priority_min.02
The value of policy shall be one of the scheduling policy values defined in <sched.h>.
- sched_get_priority_min.03.01
If successful, the sched_get_priority_max() and sched_get_priority_min() functions shall return the appropriate maximum or minimum values, respectively.
- sched_get_priority_min.03.02
If unsuccessful, they shall return a value of -1 and set errno to indicate the error.
- sched_get_priority_min.04
The sched_get_priority_max() and sched_get_priority_min() functions shall fail if:
- sched_get_priority_min.04.01
[EINVAL] The value of the policy parameter does not represent a defined scheduling policy.
- [+]sched_getparam (7 / 5 / 0)
- sched_getparam.01
The sched_getparam() function shall return the scheduling parameters of a process specified by pid in the sched_param structure pointed to by param.
- sched_getparam.02
If a process specified by pid exists, and if the calling process has permission, the scheduling parameters for the process whose process ID is equal to pid shall be returned.
- sched_getparam.03
If pid is zero, the scheduling parameters for the calling process shall be returned.
- app.sched_getparam.04
The behavior of the sched_getparam() function is unspecified if the value of pid is negative.
- sched_getparam.05.01
Upon successful completion, the sched_getparam() function shall return zero.
- sched_getparam.05.02
If the call to sched_getparam() is unsuccessful, the function shall return a value of -1 and set errno to indicate the error.
- sched_getparam.06
The sched_getparam() function shall fail if:
- sched_getparam.06.01
[EPERM] The requesting process does not have permission to obtain the scheduling parameters of the specified process.
- sched_getparam.06.02
[ESRCH] No process can be found corresponding to that specified by pid.
- [+]sched_getscheduler (6 / 4 / 0)
- sched_getscheduler.01
The sched_getscheduler() function shall return the scheduling policy of the process specified by pid.
- app.sched_getscheduler.02
If the value of pid is negative, the behavior of the sched_getscheduler() function is unspecified.
- sched_getscheduler.03 (struct)
The values that can be returned by sched_getscheduler() are defined in the <sched.h> header.
- sched_getscheduler.04 (struct)
If a process specified by pid exists, and if the calling process has permission, the scheduling policy shall be returned for the process whose process ID is equal to pid.
- sched_getscheduler.05
If pid is zero, the scheduling policy shall be returned for the calling process.
- sched_getscheduler.06.01
Upon successful completion, the sched_getscheduler() function shall return the scheduling policy of the specified process.
- sched_getscheduler.06.02
If unsuccessful, the function shall return -1 and set errno to indicate the error.
- sched_getscheduler.07
The sched_getscheduler() function shall fail if:
- sched_getscheduler.07.01
[EPERM] The requesting process does not have permission to determine the scheduling policy of the specified process.
- sched_getscheduler.07.02
[ESRCH] No process can be found corresponding to that specified by pid.
- [+]sched_rr_get_interval (5 / 2 / 0)
- sched_rr_get_interval.01
The sched_rr_get_interval() function shall update the timespec structure referenced by the interval argument to contain the current execution time limit (that is, time quantum) for the process specified by pid.
- sched_rr_get_interval.02
If pid is zero, the current execution time limit for the calling process shall be returned.
- sched_rr_get_interval.03.01
If successful, the sched_rr_get_interval() function shall return zero.
- sched_rr_get_interval.03.02
Otherwise, it shall return a value of -1 and set errno to indicate the error.
- sched_rr_get_interval.04
The sched_rr_get_interval() function shall fail if:
- sched_rr_get_interval.04.01
[ESRCH] No process can be found corresponding to that specified by pid.
- [+]sched_setparam (31 / 3 / 0)
- sched_setparam.01
The sched_setparam() function shall set the scheduling parameters of the process specified by pid to the values specified by the sched_param structure pointed to by param.
- sched_setparam.02
The value of the sched_priority member in the sched_param structure shall be any integer within the inclusive priority range for the current scheduling policy of the process specified by pid.
- sched_setparam.03
Higher numerical values for the priority represent higher priorities.
- app.sched_setparam.04
If the value of pid is negative, the behavior of the sched_setparam() function is unspecified.
- sched_setparam.05
If a process specified by pid exists, and if the calling process has permission, the scheduling parameters shall be set for the process whose process ID is equal to pid.
- sched_setparam.06
If pid is zero, the scheduling parameters shall be set for the calling process.
- sched_setparam.07
The conditions under which one process has permission to change the scheduling parameters of another process are implementation-defined.
- sched_setparam.08
Implementations may require the requesting process to have the appropriate privilege to set its own scheduling parameters or those of another process.
- sched_setparam.09
The target process, whether it is running or not running, shall be moved to the tail of the thread list for its priority.
- sched_setparam.10
If the priority of the process specified by the pid argument is set higher than that of the lowest priority running process and if the specified process is ready to run, the process specified by the pid argument shall preempt a lowest priority running process.
- sched_setparam.11
Similarly, if the process calling sched_setparam() sets its own priority lower than that of one or more other non-empty process lists, then the process that is the head of the highest priority list shall also preempt the calling process.
- sched_setparam.12
Thus, in either case, the originating process might not receive notification of the completion of the requested priority change until the higher priority process has executed.
- sched_setparam.13
If the scheduling policy of the target process is SCHED_SPORADIC, the value specified by the sched_ss_low_priority member of the param argument shall be any integer within the inclusive priority range for the sporadic server policy.
- sched_setparam.14
The sched_ss_repl_period and sched_ss_init_budget members of the param argument shall represent the time parameters to be used by the sporadic server scheduling policy for the target process.
- sched_setparam.15
The sched_ss_max_repl member of the param argument shall represent the maximum number of replenishments that are allowed to be pending simultaneously for the process scheduled under this scheduling policy.
- sched_setparam.16
The specified sched_ss_repl_period shall be greater than or equal to the specified sched_ss_init_budget for the function to succeed; if it is not, then the function shall fail.
- sched_setparam.17
The value of sched_ss_max_repl shall be within the inclusive range [1, {SS_REPL_MAX}] for the function to succeed; if not, the function shall fail.
- sched_setparam.18
If the scheduling policy of the target process is either SCHED_FIFO or SCHED_RR, the sched_ss_low_priority, sched_ss_repl_period, and sched_ss_init_budget members of the param argument shall have no effect on the scheduling behavior.
- sched_setparam.19
If the scheduling policy of this process is not SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC, the effects of these members are implementation-defined; this case includes the SCHED_OTHER policy.
- sched_setparam.20
If the current scheduling policy for the process specified by pid is not SCHED_FIFO, SCHED_RR, [SS] or SCHED_SPORADIC, the result is implementation-defined; this case includes the SCHED_OTHER policy.
- sched_setparam.21
The effect of this function on individual threads is dependent on the scheduling contention scope of the threads:
- sched_setparam.21.01
For threads with system scheduling contention scope, these functions shall have no effect on their scheduling.
- sched_setparam.21.02.01
For threads with process scheduling contention scope, the threads' scheduling parameters shall not be affected.
- sched_setparam.21.02.02
However, the scheduling of these threads with respect to threads in other processes may be dependent on the scheduling parameters of their process, which are governed using these functions.
- sched_setparam.22
If an implementation supports a two-level scheduling model in which library threads are multiplexed on top of several kernel-scheduled entities, then the underlying kernel-scheduled entities for the system contention scope threads shall not be affected by these functions.
- sched_setparam.23
The underlying kernel-scheduled entities for the process contention scope threads shall have their scheduling parameters changed to the value specified in param.
- sched_setparam.24
Kernel-scheduled entities for use by process contention scope threads that are created after this call completes shall inherit their scheduling policy and associated scheduling parameters from the process.
- sched_setparam.25
This function is not atomic with respect to other threads in the process. Threads may continue to execute while this function call is in the process of changing the scheduling policy for the underlying kernel-scheduled entities used by the process contention scope threads.
- sched_setparam.26
If successful, the sched_setparam() function shall return zero.
- sched_setparam.27
If the call to sched_setparam() is unsuccessful, the priority shall remain unchanged, and the function shall return a value of -1 and set errno to indicate the error.
- sched_setparam.28
The sched_setparam() function shall fail if:
- sched_setparam.28.01
[EINVAL] One or more of the requested scheduling parameters is outside the range defined for the scheduling policy of the specified pid.
- sched_setparam.28.02
[EPERM] The requesting process does not have permission to set the scheduling parameters for the specified process, or does not have the appropriate privilege to invoke sched_setparam().
- sched_setparam.28.03
[ESRCH] No process can be found corresponding to that specified by pid.
- [+]sched_setscheduler (26 / 3 / 0)
- sched_setscheduler.01
The sched_setscheduler() function shall set the scheduling policy and scheduling parameters of the process specified by pid to policy and the parameters specified in the sched_param structure pointed to by param, respectively.
- sched_setscheduler.02
The value of the sched_priority member in the sched_param structure shall be any integer within the inclusive priority range for the scheduling policy specified by policy.
- app.sched_setscheduler.03
If the value of pid is negative, the behavior of the sched_setscheduler() function is unspecified.
- sched_setscheduler.04
The possible values for the policy parameter are defined in the <sched.h> header.
- sched_setscheduler.05
If a process specified by pid exists, and if the calling process has permission, the scheduling policy and scheduling parameters shall be set for the process whose process ID is equal to pid.
- sched_setscheduler.06
If pid is zero, the scheduling policy and scheduling parameters shall be set for the calling process.
- sched_setscheduler.07
The conditions under which one process has the appropriate privilege to change the scheduling parameters of another process are implementation-defined.
- sched_setscheduler.08
Implementations may require that the requesting process have permission to set its own scheduling parameters or those of another process.
- sched_setscheduler.09
Additionally, implementation-defined restrictions may apply as to the appropriate privileges required to set a process' own scheduling policy, or another process' scheduling policy, to a particular value.
- sched_setscheduler.10
The sched_setscheduler() function shall be considered successful if it succeeds in setting the scheduling policy and scheduling parameters of the process specified by pid to the values specified by policy and the structure pointed to by param, respectively.
- sched_setscheduler.11
If the scheduling policy specified by policy is SCHED_SPORADIC, the value specified by the sched_ss_low_priority member of the param argument shall be any integer within the inclusive priority range for the sporadic server policy.
- sched_setscheduler.12 (struct)
The sched_ss_repl_period and sched_ss_init_budget members of the param argument shall represent the time parameters used by the sporadic server scheduling policy for the target process.
- sched_setscheduler.13
The sched_ss_max_repl member of the param argument shall represent the maximum number of replenishments that are allowed to be pending simultaneously for the process scheduled under this scheduling policy.
- sched_setscheduler.14
The specified sched_ss_repl_period shall be greater than or equal to the specified sched_ss_init_budget for the function to succeed; if it is not, then the function shall fail.
- sched_setscheduler.15
The value of sched_ss_max_repl shall be within the inclusive range [1, {SS_REPL_MAX}] for the function to succeed; if not, the function shall fail.
- sched_setscheduler.16
If the scheduling policy specified by policy is either SCHED_FIFO or SCHED_RR, the sched_ss_low_priority, sched_ss_repl_period, and sched_ss_init_budget members of the param argument shall have no effect on the scheduling behavior.
- sched_setscheduler.17
The effect of this function on individual threads is dependent on the scheduling contention scope of the threads:
- sched_setscheduler.17.01
For threads with system scheduling contention scope, these functions shall have no effect on their scheduling.
- sched_setscheduler.17.02.01
For threads with process scheduling contention scope, the threads' scheduling policy and associated parameters shall not be affected.
- sched_setscheduler.17.02.02
However, the scheduling of these threads with respect to threads in other processes may be dependent on the scheduling parameters of their process, which are governed using these functions.
- sched_setscheduler.18
If an implementation supports a two-level scheduling model in which library threads are multiplexed on top of several kernel-scheduled entities, then the underlying kernel-scheduled entities for the system contention scope threads shall not be affected by these functions.
- sched_setscheduler.19
The underlying kernel-scheduled entities for the process contention scope threads shall have their scheduling policy and associated scheduling parameters changed to the values specified in policy and param, respectively.
- sched_setscheduler.20
Kernel-scheduled entities for use by process contention scope threads that are created after this call completes shall inherit their scheduling policy and associated scheduling parameters from the process.
- sched_setscheduler.21
This function is not atomic with respect to other threads in the process. Threads may continue to execute while this function call is in the process of changing the scheduling policy and associated scheduling parameters for the underlying kernel-scheduled entities used by the process contention scope threads.
- sched_setscheduler.22.01
Upon successful completion, the function shall return the former scheduling policy of the specified process.
- sched_setscheduler.22.02
If the sched_setscheduler() function fails to complete successfully, the policy and scheduling parameters shall remain unchanged, and the function shall return a value of -1 and set errno to indicate the error.
- sched_setscheduler.23
The sched_setscheduler() function shall fail if:
- sched_setscheduler.23.01
[EINVAL] The value of the policy parameter is invalid, or one or more of the parameters contained in param is outside the valid range for the specified scheduling policy.
- sched_setscheduler.23.02
[EPERM] The requesting process does not have permission to set either or both of the scheduling parameters or the scheduling policy of the specified process.
- sched_setscheduler.23.03
[ESRCH] No process can be found corresponding to that specified by pid.
- [+]sched_yield (3 / 2 / 0)
- sched_yield.01
The sched_yield() function shall force the running thread to relinquish the processor until it again becomes the head of its thread list.
- sched_yield.02.01
The sched_yield() function shall return 0 if it completes successfully
- sched_yield.02.02
otherwise, it shall return a value of -1 and set errno to indicate the error.
- [+]pthread.attr (155 / 81 / 0)
- [+]pthread_attr_destroy (6 / 3 / 0)
- pthread_attr_destroy.06
These functions shall not return an error code of [EINTR].
- pthread_attr_destroy.01
The pthread_attr_destroy() function shall destroy a thread attributes object.
- app.pthread_attr_destroy.01
the results of otherwise referencing the object after it has been destroyed are undefined.
- pthread_attr_destroy.02
A destroyed attr attributes object can be reinitialized using pthread_attr_init();
- pthread_attr_destroy.03
Upon successful completion, pthread_attr_destroy() and pthread_attr_init() shall return a value of 0;
- pthread_attr_destroy.04
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_destroy.05
The pthread_attr_destroy() function may fail if:
- pthread_attr_destroy.05.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- [+]pthread_attr_getdetachstate (10 / 5 / 0)
- pthread_attr_getdetachstate.01
The detachstate attribute controls whether the thread is created in a detached state. If the thread is created detached, then use of the ID of the newly created thread by the pthread_detach() or pthread_join() function is an error.
- pthread_attr_getdetachstate.02
The pthread_attr_getdetachstate() and pthread_attr_setdetachstate() functions, respectively, shall get and set the detachstate attribute in the attr object.
- pthread_attr_getdetachstate.03
For pthread_attr_getdetachstate(), detachstate shall be set to either PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
- pthread_attr_getdetachstate.04
A value of PTHREAD_CREATE_DETACHED shall cause all threads created with attr to be in the detached state, whereas using a value of PTHREAD_CREATE_JOINABLE shall cause all threads created with attr to be in the joinable state.
- pthread_attr_getdetachstate.05
The default value of the detachstate attribute shall be PTHREAD_CREATE_JOINABLE.
- pthread_attr_getdetachstate.06.01
Upon successful completion, pthread_attr_getdetachstate() and pthread_attr_setdetachstate() shall return a value of 0;
- pthread_attr_getdetachstate.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getdetachstate.07
The pthread_attr_getdetachstate() function stores the value of the detachstate attribute in detachstate if successful.
- pthread_attr_getdetachstate.08
These functions may fail if:
- pthread_attr_getdetachstate.08.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getdetachstate.09
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getguardsize (9 / 4 / 0)
- pthread_attr_getguardsize.01
The pthread_attr_getguardsize() function shall get the guardsize attribute in the attr object. This attribute shall be returned in the guardsize parameter.
- pthread_attr_getguardsize.02
If a thread's stack is created with guard protection, the implementation allocates extra memory at the overflow end of the stack as a buffer against stack overflow of the stack pointer. If an application overflows into this buffer an error shall result (possibly in a SIGSEGV signal being delivered to the thread).
- pthread_attr_getguardsize.03
If an implementation rounds up the value of guardsize to a multiple of {PAGESIZE}, a call to pthread_attr_getguardsize() specifying attr shall store in the guardsize parameter the guard size specified by the previous pthread_attr_setguardsize() function call.
- pthread_attr_getguardsize.04
The default value of the guardsize attribute is {PAGESIZE} bytes. The actual value of {PAGESIZE} is implementation-defined.
- pthread_attr_getguardsize.05.01
If successful, the pthread_attr_getguardsize() and pthread_attr_setguardsize() functions shall return zero;
- pthread_attr_getguardsize.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getguardsize.06
These functions shall fail if:
- pthread_attr_getguardsize.06.01
[EINVAL] The parameter guardsize is invalid.
- pthread_attr_getguardsize.07
These functions may fail if:
- pthread_attr_getguardsize.07.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getguardsize.08
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getinheritsched (9 / 3 / 0)
- pthread_attr_getinheritsched.01
The pthread_attr_getinheritsched(), and pthread_attr_setinheritsched() functions, respectively, shall get and set the inheritsched attribute in the attr argument.
- pthread_attr_getinheritsched.02
When the attributes objects are used by pthread_create(), the inheritsched attribute determines how the other scheduling attributes of the created thread shall be set.
- pthread_attr_getinheritsched.03
The supported values of inheritsched shall be:
- pthread_attr_getinheritsched.03.01
PTHREAD_INHERIT_SCHED Specifies that the thread scheduling attributes shall be inherited from the creating thread, and the scheduling attributes in this attr argument shall be ignored.
- pthread_attr_getinheritsched.03.02
PTHREAD_EXPLICIT_SCHED Specifies that the thread scheduling attributes shall be set to the corresponding values from this attributes object.
- pthread_attr_getinheritsched.04
The following thread scheduling attributes defined by IEEE Std 1003.1-2001 are affected by the inheritsched attribute: scheduling policy ( schedpolicy), scheduling parameters ( schedparam), and scheduling contention scope ( contentionscope).
- pthread_attr_getinheritsched.05.01
If successful, the pthread_attr_getinheritsched() and pthread_attr_setinheritsched() functions shall return zero;
- pthread_attr_getinheritsched.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getinheritsched.06
The pthread_attr_getinheritsched() function may fail if:
- pthread_attr_getinheritsched.06.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getinheritsched.07
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getschedparam (7 / 2 / 0)
- pthread_attr_getschedparam.01
The pthread_attr_getschedparam(), and pthread_attr_setschedparam() functions, respectively, shall get and set the scheduling parameter attributes in the attr argument.
- pthread_attr_getschedparam.02
For the SCHED_FIFO and SCHED_RR policies, the only required member of param is sched_priority.
- pthread_attr_getschedparam.03
For the SCHED_SPORADIC policy, the required members of the param structure are sched_priority, sched_ss_low_priority, sched_ss_repl_period, sched_ss_init_budget, and sched_ss_max_repl.
- pthread_attr_getschedparam.04.01
If successful, the pthread_attr_getschedparam() and pthread_attr_setschedparam() functions shall return zero;
- pthread_attr_getschedparam.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getschedparam.05
The pthread_attr_getschedparam() function may fail if:
- pthread_attr_getschedparam.05.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getschedparam.06
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getschedpolicy (6 / 3 / 0)
- pthread_attr_getschedpolicy.01
The pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy() functions, respectively, shall get and set the schedpolicy attribute in the attr argument.
- pthread_attr_getschedpolicy.03
When threads executing with the scheduling policy SCHED_FIFO, SCHED_RR, [TSP] or SCHED_SPORADIC are waiting on a mutex, they shall acquire the mutex in priority order when the mutex is unlocked.
- pthread_attr_getschedpolicy.04.01
If successful, the pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy() functions shall return zero;
- pthread_attr_getschedpolicy.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getschedpolicy.05
The pthread_attr_getschedpolicy() function may fail if:
- pthread_attr_getschedpolicy.05.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getschedpolicy.06
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getscope (5 / 3 / 0)
- pthread_attr_getscope.01
The pthread_attr_getscope() and pthread_attr_setscope() functions, respectively, shall get and set the contentionscope attribute in the attr object.
- pthread_attr_getscope.02.01
If successful, the pthread_attr_getscope() and pthread_attr_setscope() functions shall return zero;
- pthread_attr_getscope.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getscope.03
The pthread_attr_getscope() function may fail if:
- pthread_attr_getscope.03.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getscope.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getstack (6 / 2 / 0)
- pthread_attr_getstack.01
The pthread_attr_getstack() and pthread_attr_setstack() functions, respectively, shall get and set the thread creation stack attributes stackaddr and stacksize in the attr object.
- pthread_attr_getstack.02.01
Upon successful completion, these functions shall return a value of 0;
- pthread_attr_getstack.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getstack.03
The pthread_attr_getstack() function shall store the stack attribute values in stackaddr and stacksize if successful.
- pthread_attr_getstack.04
The pthread_attr_getstack() function may fail if:
- pthread_attr_getstack.04.01
[EINVAL] The value specified by addr does not refer to an initialized thread attribute object.
- pthread_attr_getstack.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getstackaddr (6 / 4 / 0)
- pthread_attr_getstackaddr.01
The pthread_attr_getstackaddr() and pthread_attr_setstackaddr() functions, respectively, shall get and set the thread creation stackaddr attribute in the attr object.
- pthread_attr_getstackaddr.02.01
Upon successful completion, pthread_attr_getstackaddr() and pthread_attr_setstackaddr() shall return a value of 0;
- pthread_attr_getstackaddr.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getstackaddr.03
The pthread_attr_getstackaddr() function stores the stackaddr attribute value in stackaddr if successful.
- pthread_attr_getstackaddr.04
These functions may fail if:
- pthread_attr_getstackaddr.04.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getstackaddr.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_getstacksize (6 / 4 / 0)
- pthread_attr_getstacksize.01
The pthread_attr_getstacksize() and pthread_attr_setstacksize() functions, respectively, shall get and set the thread creation stacksize attribute in the attr object.
- pthread_attr_getstacksize.02.01
Upon successful completion, pthread_attr_getstacksize() and pthread_attr_setstacksize() shall return a value of 0;
- pthread_attr_getstacksize.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_getstacksize.03
The pthread_attr_getstacksize() function stores the stacksize attribute value in stacksize if successful.
- pthread_attr_getstacksize.04
These functions may fail if:
- pthread_attr_getstacksize.04.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_getstacksize.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_init (8 / 4 / 0)
- app.pthread_attr_init.01
Results are undefined if pthread_attr_init() is called specifying an already initialized attr attributes object.
- pthread_attr_init.01
The pthread_attr_init() function shall initialize a thread attributes object attr with the default value for all of the individual attributes used by a given implementation.
- pthread_attr_init.02
The resulting attributes object (possibly modified by setting individual attribute values) when used by pthread_create() defines the attributes of the thread created.
- pthread_attr_init.03
A single attributes object can be used in multiple simultaneous calls to pthread_create().
- pthread_attr_init.06
Upon successful completion, pthread_attr_destroy() and pthread_attr_init() shall return a value of 0;
- pthread_attr_init.07
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_init.08
The pthread_attr_init() function shall fail if:
- pthread_attr_init.08.01
[ENOMEM] Insufficient memory exists to initialize the thread attributes object.
- pthread_attr_init.09
The pthread_attr_init() function may fail if:
- pthread_attr_init.09.01
[EBUSY] The implementation has detected an attempt to reinitialize the thread attribute referenced by attr, a previously initialized, but not yet destroyed, thread attribute.
- pthread_attr_init.10
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setdetachstate (10 / 6 / 0)
- pthread_attr_setdetachstate.01
The detachstate attribute controls whether the thread is created in a detached state. If the thread is created detached, then use of the ID of the newly created thread by the pthread_detach() or pthread_join() function is an error.
- pthread_attr_setdetachstate.02
The pthread_attr_getdetachstate() and pthread_attr_setdetachstate() functions, respectively, shall get and set the detachstate attribute in the attr object.
- pthread_attr_setdetachstate.03
For pthread_attr_setdetachstate(), the application shall set detachstate to either PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
- pthread_attr_setdetachstate.04
A value of PTHREAD_CREATE_DETACHED shall cause all threads created with attr to be in the detached state, whereas using a value of PTHREAD_CREATE_JOINABLE shall cause all threads created with attr to be in the joinable state.
- pthread_attr_setdetachstate.05
The default value of the detachstate attribute shall be PTHREAD_CREATE_JOINABLE.
- pthread_attr_setdetachstate.06.01
Upon successful completion, pthread_attr_getdetachstate() and pthread_attr_setdetachstate() shall return a value of 0;
- pthread_attr_setdetachstate.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setdetachstate.07
The pthread_attr_setdetachstate() function shall fail if:
- pthread_attr_setdetachstate.07.01
[EINVAL] The value of detachstate was not valid
- pthread_attr_setdetachstate.08
These functions may fail if:
- pthread_attr_setdetachstate.08.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setdetachstate.09
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setguardsize (11 / 8 / 0)
- pthread_attr_setguardsize.01
The pthread_attr_setguardsize() function shall set the guardsize attribute in the attr object. The new value of this attribute shall be obtained from the guardsize parameter.
- pthread_attr_setguardsize.02.01
If guardsize is zero, a guard area shall not be provided for threads created with attr.
- pthread_attr_setguardsize.02.02
If guardsize is greater than zero, a guard area of at least size guardsize bytes shall be provided for each thread created with attr.
- pthread_attr_setguardsize.03
If a thread's stack is created with guard protection, the implementation allocates extra memory at the overflow end of the stack as a buffer against stack overflow of the stack pointer. If an application overflows into this buffer an error shall result (possibly in a SIGSEGV signal being delivered to the thread).
- pthread_attr_setguardsize.04
The default value of the guardsize attribute is {PAGESIZE} bytes. The actual value of {PAGESIZE} is implementation-defined.
- pthread_attr_setguardsize.05
If the stackaddr or stack attribute has been set (that is, the caller is allocating and managing its own thread stacks), the guardsize attribute shall be ignored and no protection shall be provided by the implementation. It is the responsibility of the application to manage stack overflow along with stack allocation and management in this case.
- pthread_attr_setguardsize.06.01
If successful, the pthread_attr_getguardsize() and pthread_attr_setguardsize() functions shall return zero;
- pthread_attr_setguardsize.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setguardsize.07
These functions shall fail if:
- pthread_attr_setguardsize.07.01
[EINVAL] The parameter guardsize is invalid.
- pthread_attr_setguardsize.08
These functions may fail if:
- pthread_attr_setguardsize.08.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setguardsize.09
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setinheritsched (11 / 4 / 0)
- pthread_attr_setinheritsched.01
The pthread_attr_getinheritsched(), and pthread_attr_setinheritsched() functions, respectively, shall get and set the inheritsched attribute in the attr argument.
- pthread_attr_setinheritsched.02
When the attributes objects are used by pthread_create(), the inheritsched attribute determines how the other scheduling attributes of the created thread shall be set.
- pthread_attr_setinheritsched.03
The supported values of inheritsched shall be:
- pthread_attr_setinheritsched.03.01
PTHREAD_INHERIT_SCHED Specifies that the thread scheduling attributes shall be inherited from the creating thread, and the scheduling attributes in this attr argument shall be ignored.
- pthread_attr_setinheritsched.03.02
PTHREAD_EXPLICIT_SCHED Specifies that the thread scheduling attributes shall be set to the corresponding values from this attributes object.
- pthread_attr_setinheritsched.04
The following thread scheduling attributes defined by IEEE Std 1003.1-2001 are affected by the inheritsched attribute: scheduling policy ( schedpolicy), scheduling parameters ( schedparam), and scheduling contention scope ( contentionscope).
- pthread_attr_setinheritsched.05.01
If successful, the pthread_attr_getinheritsched() and pthread_attr_setinheritsched() functions shall return zero;
- pthread_attr_setinheritsched.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setinheritsched.06
The pthread_attr_setinheritsched() function may fail if:
- pthread_attr_setinheritsched.06.01
[EINVAL] The value of inheritsched is not valid.
- pthread_attr_setinheritsched.06.02
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setinheritsched.06.03
[ENOTSUP] An attempt was made to set the attribute to an unsupported value.
- pthread_attr_setinheritsched.07
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setschedparam (8 / 4 / 0)
- pthread_attr_setschedparam.01
The pthread_attr_getschedparam(), and pthread_attr_setschedparam() functions, respectively, shall get and set the scheduling parameter attributes in the attr argument.
- pthread_attr_setschedparam.04
The specified sched_ss_repl_period must be greater than or equal to the specified sched_ss_init_budget for the function to succeed; if it is not, then the function shall fail.
- pthread_attr_setschedparam.05
The value of sched_ss_max_repl shall be within the inclusive range [1, {SS_REPL_MAX}] for the function to succeed; if not, the function shall fail.
- pthread_attr_setschedparam.06.01
If successful, the pthread_attr_getschedparam() and pthread_attr_setschedparam() functions shall return zero;
- pthread_attr_setschedparam.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setschedparam.07
The pthread_attr_setschedparam() function may fail if:
- pthread_attr_setschedparam.07.01
[EINVAL] The value of param is not valid, or the value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setschedparam.07.02
[ENOTSUP] An attempt was made to set the attribute to an unsupported value.
- pthread_attr_setschedparam.08
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setschedpolicy (8 / 4 / 0)
- pthread_attr_setschedpolicy.01
The pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy() functions, respectively, shall get and set the schedpolicy attribute in the attr argument.
- pthread_attr_setschedpolicy.02
The supported values of policy shall include SCHED_FIFO, SCHED_RR, and SCHED_OTHER, which are defined in the <sched.h> header.
- pthread_attr_setschedpolicy.03
When threads executing with the scheduling policy SCHED_FIFO, SCHED_RR, [TSP] or SCHED_SPORADIC are waiting on a mutex, they shall acquire the mutex in priority order when the mutex is unlocked.
- pthread_attr_setschedpolicy.04.01
If successful, the pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy() functions shall return zero;
- pthread_attr_setschedpolicy.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setschedpolicy.05
The pthread_attr_setschedpolicy() function may fail if:
- pthread_attr_setschedpolicy.05.01
[EINVAL] The value of policy is not valid, or the value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setschedpolicy.05.02
[ENOTSUP] An attempt was made to set the attribute to an unsupported value.
- pthread_attr_setschedpolicy.06
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setscope (7 / 6 / 0)
- pthread_attr_setscope.01
The pthread_attr_getscope() and pthread_attr_setscope() functions, respectively, shall get and set the contentionscope attribute in the attr object.
- pthread_attr_setscope.02
The contentionscope attribute may have the values PTHREAD_SCOPE_SYSTEM, signifying system scheduling contention scope, or PTHREAD_SCOPE_PROCESS, signifying process scheduling contention scope.
- pthread_attr_setscope.03.01
If successful, the pthread_attr_getscope() and pthread_attr_setscope() functions shall return zero;
- pthread_attr_setscope.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setscope.04
The pthread_attr_setscope() function may fail if:
- pthread_attr_setscope.04.01
[EINVAL] The value of contentionscope is not valid, or the value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setscope.04.02
[ENOTSUP] An attempt was made to set the attribute to an unsupported value.
- pthread_attr_setscope.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setstack (11 / 5 / 0)
- pthread_attr_setstack.01
The pthread_attr_getstack() and pthread_attr_setstack() functions, respectively, shall get and set the thread creation stack attributes stackaddr and stacksize in the attr object.
- pthread_attr_setstack.02
The stack attributes specify the area of storage to be used for the created thread's stack. The base (lowest addressable byte) of the storage shall be stackaddr, and the size of the storage shall be stacksize bytes.
- pthread_attr_setstack.03
The stacksize shall be at least {PTHREAD_STACK_MIN}.
- pthread_attr_setstack.04
The stackaddr shall be aligned appropriately to be used as a stack;
- pthread_attr_setstack.05
All pages within the stack described by stackaddr and stacksize shall be both readable and writable by the thread.
- pthread_attr_setstack.06.01
Upon successful completion, these functions shall return a value of 0;
- pthread_attr_setstack.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setstack.07
The pthread_attr_setstack() function shall fail if:
- pthread_attr_setstack.07.01
[EINVAL] The value of stacksize is less than {PTHREAD_STACK_MIN} or exceeds an implementation-defined limit.
- pthread_attr_setstack.08
The pthread_attr_setstack() function may fail if:
- pthread_attr_setstack.08.01
[EINVAL] The value of stackaddr does not have proper alignment to be used as a stack, or ( stackaddr + stacksize) lacks proper alignment, or the value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setstack.08.02
[EACCES] The stack page(s) described by stackaddr and stacksize are not both readable and writable by the thread.
- pthread_attr_setstack.09
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setstackaddr (5 / 3 / 0)
- pthread_attr_setstackaddr.01
The pthread_attr_getstackaddr() and pthread_attr_setstackaddr() functions, respectively, shall get and set the thread creation stackaddr attribute in the attr object.
- app.pthread_attr_setstackaddr.02
The size of the storage shall be at least {PTHREAD_STACK_MIN}.
- pthread_attr_setstackaddr.03.01
Upon successful completion, pthread_attr_getstackaddr() and pthread_attr_setstackaddr() shall return a value of 0;
- pthread_attr_setstackaddr.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setstackaddr.04
These functions may fail if:
- pthread_attr_setstackaddr.04.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setstackaddr.05
These functions shall not return an error code of [EINTR].
- [+]pthread_attr_setstacksize (6 / 4 / 0)
- pthread_attr_setstacksize.01
The pthread_attr_getstacksize() and pthread_attr_setstacksize() functions, respectively, shall get and set the thread creation stacksize attribute in the attr object.
- pthread_attr_setstacksize.02.01
Upon successful completion, pthread_attr_getstacksize() and pthread_attr_setstacksize() shall return a value of 0;
- pthread_attr_setstacksize.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_attr_setstacksize.03
The pthread_attr_setstacksize() function shall fail if:
- pthread_attr_setstacksize.03.01
[EINVAL] The value of stacksize is less than {PTHREAD_STACK_MIN} or exceeds a system-imposed limit.
- pthread_attr_setstacksize.04
These functions may fail if:
- pthread_attr_setstacksize.04.01
[EINVAL] The value specified by attr does not refer to an initialized thread attribute object.
- pthread_attr_setstacksize.05
These functions shall not return an error code of [EINTR].
- [+]pthread.cond.cond (57 / 29 / 0)
- [+]pthread_cond_broadcast (9 / 6 / 0)
- pthread_cond_broadcast.01
The pthread_cond_broadcast() function shall unblock all threads currently blocked on the specified condition variable cond.
- pthread_cond_broadcast.02
If more than one thread is blocked on a condition variable, the scheduling policy shall determine the order in which threads are unblocked.
- pthread_cond_broadcast.03
When each thread unblocked as a result of a pthread_cond_broadcast() or pthread_cond_signal() returns from its call to pthread_cond_wait() or pthread_cond_timedwait(), the thread shall own the mutex with which it called pthread_cond_wait() or pthread_cond_timedwait().
- pthread_cond_broadcast.04
The thread(s) that are unblocked shall contend for the mutex according to the scheduling policy (if applicable), and as if each had called pthread_mutex_lock().
- pthread_cond_broadcast.05
The pthread_cond_broadcast() and pthread_cond_signal() functions shall have no effect if there are no threads currently blocked on cond.
- pthread_cond_broadcast.06.01
If successful, the pthread_cond_broadcast() and pthread_cond_signal() functions shall return zero
- pthread_cond_broadcast.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_broadcast.07
The pthread_cond_broadcast() and pthread_cond_signal() function may fail if:
- pthread_cond_broadcast.07.01
[EINVAL] The value cond does not refer to an initialized condition variable.
- pthread_cond_broadcast.08
These functions shall not return an error code of [EINTR].
- [+]pthread_cond_destroy (7 / 2 / 0)
- pthread_cond_destroy.01
The pthread_cond_destroy() function shall destroy the given condition variable specified by cond; the object becomes, in effect, uninitialized.
- app.pthread_cond_destroy.02
the results of otherwise referencing the object after it has been destroyed are undefined.
- app.pthread_cond_destroy.03
It shall be safe to destroy an initialized condition variable upon which no threads are currently blocked. Attempting to destroy a condition variable upon which other threads are currently blocked results in undefined behavior.
- app.pthread_cond_destroy.04
Only cond itself may be used for performing synchronization. The result of referring to copies of cond in calls to pthread_cond_wait(), pthread_cond_timedwait(), pthread_cond_signal(), pthread_cond_broadcast(), and pthread_cond_destroy() is undefined.
- pthread_cond_destroy.05.01
If successful, the pthread_cond_destroy() and pthread_cond_init() functions shall return zero
- pthread_cond_destroy.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_destroy.06
The [EBUSY] and [EINVAL] error checks, if implemented, shall act as if they were performed immediately at the beginning of processing for the function and caused an error return prior to modifying the state of the condition variable specified by cond.
- pthread_cond_destroy.07
The pthread_cond_destroy() function may fail if:
- pthread_cond_destroy.07.01
[EBUSY] The implementation has detected an attempt to destroy the object referenced by cond while it is referenced (for example, while being used in a pthread_cond_wait() or pthread_cond_timedwait()) by another thread.
- pthread_cond_destroy.07.02
[EINVAL] The value specified by cond is invalid.
- pthread_cond_destroy.08
These functions shall not return an error code of [EINTR].
- [+]pthread_cond_init (11 / 3 / 0)
- pthread_cond_init.01
The pthread_cond_init() function shall initialize the condition variable referenced by cond with attributes referenced by attr.
- pthread_cond_init.02
If attr is NULL, the default condition variable attributes shall be used; the effect is the same as passing the address of a default condition variable attributes object.
- app.pthread_cond_init.03
Attempting to initialize an already initialized condition variable results in undefined behavior.
- pthread_cond_init.04.01
If successful, the pthread_cond_destroy() and pthread_cond_init() functions shall return zero
- pthread_cond_init.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_init.05
The [EBUSY] and [EINVAL] error checks, if implemented, shall act as if they were performed immediately at the beginning of processing for the function and caused an error return prior to modifying the state of the condition variable specified by cond.
- pthread_cond_init.06
The pthread_cond_init() function shall fail if:
- pthread_cond_init.06.01
[EAGAIN] The system lacked the necessary resources (other than memory) to initialize another condition variable.
- pthread_cond_init.06.02
[ENOMEM] Insufficient memory exists to initialize the condition variable.
- pthread_cond_init.07
The pthread_cond_init() function may fail if:
- pthread_cond_init.07.01
[EBUSY] The implementation has detected an attempt to reinitialize the object referenced by cond, a previously initialized, but not yet destroyed, condition variable.
- pthread_cond_init.07.02
[EINVAL] The value specified by attr is invalid.
- pthread_cond_init.08
These functions shall not return an error code of [EINTR].
- pthread_cond_init.09
Upon successful initialization, the state of the condition variable shall become initialized.
- [+]pthread_cond_signal (9 / 6 / 0)
- pthread_cond_signal.01
The pthread_cond_signal() function shall unblock at least one of the threads that are blocked on the specified condition variable cond (if any threads are blocked on cond).
- pthread_cond_signal.02
If more than one thread is blocked on a condition variable, the scheduling policy shall determine the order in which threads are unblocked.
- pthread_cond_signal.03
When each thread unblocked as a result of a pthread_cond_broadcast() or pthread_cond_signal() returns from its call to pthread_cond_wait() or pthread_cond_timedwait(), the thread shall own the mutex with which it called pthread_cond_wait() or pthread_cond_timedwait().
- pthread_cond_signal.04
The thread(s) that are unblocked shall contend for the mutex according to the scheduling policy (if applicable), and as if each had called pthread_mutex_lock().
- pthread_cond_signal.05
The pthread_cond_broadcast() and pthread_cond_signal() functions shall have no effect if there are no threads currently blocked on cond.
- pthread_cond_signal.06.01
If successful, the pthread_cond_broadcast() and pthread_cond_signal() functions shall return zero
- pthread_cond_signal.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_signal.07
The pthread_cond_broadcast() and pthread_cond_signal() function may fail if:
- pthread_cond_signal.07.01
[EINVAL] The value cond does not refer to an initialized condition variable.
- pthread_cond_signal.08
These functions shall not return an error code of [EINTR].
- [+]pthread_cond_timedwait (13 / 9 / 0)
- pthread_cond_timedwait.01
The pthread_cond_timedwait() and pthread_cond_wait() functions shall block on a condition variable.
- app.pthread_cond_timedwait.02
They shall be called with mutex locked by the calling thread or undefined behavior results.
- pthread_cond_timedwait.03
These functions atomically release mutex and cause the calling thread to block on the condition variable cond; atomically here means "atomically with respect to access by another thread to the mutex and then the condition variable".
- pthread_cond_timedwait.04
Upon successful return, the mutex shall have been locked and shall be owned by the calling thread.
- app.pthread_cond_timedwait.05
During this time, the effect of an attempt by any thread to wait on that condition variable using a different mutex is undefined.
- pthread_cond_timedwait.06
The pthread_cond_timedwait() function shall be equivalent to pthread_cond_wait(), except that an error is returned if the absolute time specified by abstime passes (that is, system time equals or exceeds abstime) before the condition cond is signaled or broadcasted, or if the absolute time specified by abstime has already been passed at the time of the call.
- pthread_cond_timedwait.07
When such timeouts occur, pthread_cond_timedwait() shall nonetheless release and re-acquire the mutex referenced by mutex.
- pthread_cond_timedwait.08
Except in the case of [ETIMEDOUT], all these error checks shall act as if they were performed immediately at the beginning of processing for the function and shall cause an error return, in effect, prior to modifying the state of the mutex specified by mutex or the condition variable specified by cond.
- pthread_cond_timedwait.09.01
Upon successful completion, a value of zero shall be returned
- pthread_cond_timedwait.09.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_timedwait.10
The pthread_cond_timedwait() function shall fail if:
- pthread_cond_timedwait.10.01
[ETIMEDOUT] The time specified by abstime to pthread_cond_timedwait() has passed.
- pthread_cond_timedwait.10.02
[EINVAL] The value specified by abstime is invalid.
- pthread_cond_timedwait.11
These functions may fail if:
- pthread_cond_timedwait.11.01
[EINVAL] The value specified by cond or mutex is invalid.
- pthread_cond_timedwait.11.02
[EPERM] The mutex was not owned by the current thread at the time of the call.
- pthread_cond_timedwait.12
These functions shall not return an error code of [EINTR].
- [+]pthread_cond_wait (8 / 3 / 0)
- pthread_cond_wait.01
The pthread_cond_timedwait() and pthread_cond_wait() functions shall block on a condition variable.
- app.pthread_cond_wait.02
They shall be called with mutex locked by the calling thread or undefined behavior results.
- pthread_cond_wait.03
These functions atomically release mutex and cause the calling thread to block on the condition variable cond; atomically here means "atomically with respect to access by another thread to the mutex and then the condition variable".
- pthread_cond_wait.04
Upon successful return, the mutex shall have been locked and shall be owned by the calling thread.
- app.pthread_cond_wait.05
During this time, the effect of an attempt by any thread to wait on that condition variable using a different mutex is undefined.
- pthread_cond_wait.06
Except in the case of [ETIMEDOUT], all these error checks shall act as if they were performed immediately at the beginning of processing for the function and shall cause an error return, in effect, prior to modifying the state of the mutex specified by mutex or the condition variable specified by cond.
- pthread_cond_wait.07.01
Upon successful completion, a value of zero shall be returned
- pthread_cond_wait.07.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cond_wait.08
These functions may fail if:
- pthread_cond_wait.08.01
[EPERM] The mutex was not owned by the current thread at the time of the call.
[EINVAL] The value specified by cond or mutex is invalid.
- pthread_cond_wait.09
These functions shall not return an error code of [EINTR].
- [+]pthread.cond.condattr (27 / 11 / 0)
- [+]pthread_condattr_destroy (5 / 3 / 0)
- pthread_condattr_destroy.01
The pthread_condattr_destroy() function shall destroy a condition variable attributes object; the object becomes, in effect, uninitialized.
- pthread_condattr_destroy.02
If successful, the pthread_condattr_destroy() and pthread_condattr_init() functions shall return zero;
- pthread_condattr_destroy.03
otherwise, an error number shall be returned to indicate the error.
- pthread_condattr_destroy.04
The pthread_condattr_destroy() function may fail if:
- pthread_condattr_destroy.04.01
[EINVAL] The value specified by attr is invalid.
- pthread_condattr_destroy.05
These functions shall not return an error code of [EINTR].
- [+]pthread_condattr_getpshared (8 / 3 / 0)
- pthread_condattr_getpshared.01
The pthread_condattr_getpshared() function shall obtain the value of the process-shared attribute from the attributes object referenced by attr.
- pthread_condattr_getpshared.02
The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a condition variable to be operated upon by any thread that has access to the memory where the condition variable is allocated, even if the condition variable is allocated in memory that is shared by multiple processes.
- pthread_condattr_getpshared.03
If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the condition variable shall only be operated upon by threads created within the same process as the thread that initialized the condition variable; if threads of differing processes attempt to operate on such a condition variable, the behavior is undefined.
- pthread_condattr_getpshared.04
If successful, the pthread_condattr_getpshared() function shall return zero
- pthread_condattr_getpshared.05
and store the value of the process-shared attribute of attr into the object referenced by the pshared parameter.
- pthread_condattr_getpshared.06
Otherwise, an error number shall be returned to indicate the error.
- pthread_condattr_getpshared.07
The pthread_condattr_getpshared() and pthread_condattr_setpshared() functions may fail if:
- pthread_condattr_getpshared.07.01
[EINVAL] The value specified by attr is invalid.
- pthread_condattr_getpshared.08
These functions shall not return an error code of [EINTR].
- [+]pthread_condattr_init (5 / 2 / 0)
- pthread_condattr_init.01
The pthread_condattr_init() function shall initialize a condition variable attributes object attr with the default value for all of the attributes defined by the implementation.
- app.pthread_condattr_init.02
Results are undefined if pthread_condattr_init() is called specifying an already initialized attr attributes object.
- pthread_condattr_init.03
If successful, the pthread_condattr_destroy() and pthread_condattr_init() functions shall return zero;
- pthread_condattr_init.04
otherwise, an error number shall be returned to indicate the error.
- pthread_condattr_init.05
The pthread_condattr_init() function shall fail if:
- pthread_condattr_init.05.01
[ENOMEM] Insufficient memory exists to initialize the condition variable attributes object.
- pthread_condattr_init.06
These functions shall not return an error code of [EINTR].
- [+]pthread_condattr_setpshared (9 / 3 / 0)
- pthread_condattr_setpshared.01
The pthread_condattr_setpshared() function shall set the process-shared attribute in an initialized attributes object referenced by attr.
- pthread_condattr_setpshared.02
The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a condition variable to be operated upon by any thread that has access to the memory where the condition variable is allocated, even if the condition variable is allocated in memory that is shared by multiple processes.
- pthread_condattr_setpshared.03
If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the condition variable shall only be operated upon by threads created within the same process as the thread that initialized the condition variable; if threads of differing processes attempt to operate on such a condition variable, the behavior is undefined.
- pthread_condattr_setpshared.04
The default value of the attribute is PTHREAD_PROCESS_PRIVATE.
- pthread_condattr_setpshared.05
If successful, the pthread_condattr_setpshared() function shall return zero;
- pthread_condattr_setpshared.06
otherwise, an error number shall be returned to indicate the error.
- pthread_condattr_setpshared.07
The pthread_condattr_getpshared() and pthread_condattr_setpshared() functions may fail if:
- pthread_condattr_setpshared.07.01
[EINVAL] The value specified by attr is invalid.
- pthread_condattr_setpshared.08
The pthread_condattr_setpshared() function may fail if:
- pthread_condattr_setpshared.08.01
[EINVAL] The new value specified for the attribute is outside the range of legal values for that attribute.
- pthread_condattr_setpshared.09
These functions shall not return an error code of [EINTR].
- [+]pthread.mutex (94 / 50 / 1)
- [+]pthread_mutex_destroy (9 / 4 / 0)
- pthread_mutex_destroy.01
The pthread_mutex_destroy() function shall destroy the mutex object referenced by mutex; the mutex object becomes, in effect, uninitialized.
- pthread_mutex_destroy.02
A destroyed mutex object can be reinitialized using pthread_mutex_init();
- app.pthread_mutex_destroy.03
the results of otherwise referencing the object after it has been destroyed are undefined.
- pthread_mutex_destroy.04
It shall be safe to destroy an initialized mutex that is unlocked.
- app.pthread_mutex_destroy.05
Attempting to destroy a locked mutex results in undefined behavior.
- pthread_mutex_destroy.06.01
If successful, the pthread_mutex_destroy() and pthread_mutex_init() functions shall return zero;
- pthread_mutex_destroy.06.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutex_destroy.07
The [EBUSY] and [EINVAL] error checks, if implemented, act as if they were performed immediately at the beginning of processing for the function and shall cause an error return prior to modifying the state of the mutex specified by mutex.
- pthread_mutex_destroy.08
The pthread_mutex_destroy() function may fail if:
- pthread_mutex_destroy.08.01
[EBUSY] The implementation has detected an attempt to destroy the object referenced by mutex while it is locked or referenced (for example, while being used in a pthread_cond_timedwait() or pthread_cond_wait()) by another thread.
- pthread_mutex_destroy.08.02
[EINVAL] The value specified by mutex is invalid.
- pthread_mutex_destroy.09
These functions shall not return an error code of [EINTR].
- [+]pthread_mutex_init (12 / 5 / 0)
- pthread_mutex_init.01
The pthread_mutex_init() function shall initialize the mutex referenced by mutex with attributes specified by attr.
- pthread_mutex_init.02
If attr is NULL, the default mutex attributes are used; the effect shall be the same as passing the address of a default mutex attributes object.
- pthread_mutex_init.03
Upon successful initialization, the state of the mutex becomes initialized and unlocked.
- app.pthread_mutex_init.04
Attempting to initialize an already initialized mutex results in undefined behavior.
- pthread_mutex_init.05.01
If successful, the pthread_mutex_destroy() and pthread_mutex_init() functions shall return zero;
- pthread_mutex_init.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutex_init.06
The [EBUSY] and [EINVAL] error checks, if implemented, act as if they were performed immediately at the beginning of processing for the function and shall cause an error return prior to modifying the state of the mutex specified by mutex.
- pthread_mutex_init.07
The pthread_mutex_init() function shall fail if:
- pthread_mutex_init.07.01
[EAGAIN] The system lacked the necessary resources (other than memory) to initialize another mutex.
- pthread_mutex_init.07.02
[ENOMEM] Insufficient memory exists to initialize the mutex.
- pthread_mutex_init.07.03
[EPERM] The caller does not have the privilege to perform the operation.
- pthread_mutex_init.08
The pthread_mutex_init() function may fail if:
- pthread_mutex_init.08.01
[EBUSY] The implementation has detected an attempt to reinitialize the object referenced by mutex, a previously initialized, but not yet destroyed, mutex.
- pthread_mutex_init.08.02
[EINVAL] The value specified by attr is invalid.
- pthread_mutex_init.09
These functions shall not return an error code of [EINTR].
- [+]pthread_mutex_lock (15 / 9 / 0)
- pthread_mutex_lock.01
The mutex object referenced by mutex shall be locked by calling pthread_mutex_lock().
- pthread_mutex_lock.02
If the mutex is already locked, the calling thread shall block until the mutex becomes available.
- pthread_mutex_lock.03
This operation shall return with the mutex object referenced by mutex in the locked state with the calling thread as its owner.
- pthread_mutex_lock.04
If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection shall not be provided.
- pthread_mutex_lock.04.01
A thread attempting to relock this mutex without first unlocking it shall deadlock.
Attempting to relock the mutex causes deadlock.
- pthread_mutex_lock.05
If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then error checking shall be provided.
- pthread_mutex_lock.05.01
A thread attempting to relock this mutex without first unlocking it shall return with an error.
If a thread attempts to relock a mutex that it has already locked, an error shall be returned.
- pthread_mutex_lock.06
If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex shall maintain the concept of a lock count.
- pthread_mutex_lock.06.01
When a thread successfully acquires a mutex for the first time, the lock count shall be set to one.
- pthread_mutex_lock.06.02
Every time a thread relocks this mutex, the lock count shall be incremented by one.
- app.pthread_mutex_lock.07
If the mutex type is PTHREAD_MUTEX_DEFAULT,
- app.pthread_mutex_lock.07.01
attempting to recursively lock the mutex results in undefined behavior.
Attempting to recursively lock a mutex of this type results in undefined behavior.
- pthread_mutex_lock.08
If a signal is delivered to a thread waiting for a mutex, upon return from the signal handler the thread shall resume waiting for the mutex as if it was not interrupted.
- pthread_mutex_lock.09.01
If successful, the pthread_mutex_lock() and pthread_mutex_unlock() functions shall return zero;
- pthread_mutex_lock.09.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutex_lock.10
The pthread_mutex_lock() and pthread_mutex_trylock() functions shall fail if:
- pthread_mutex_lock.10.01
[EINVAL] The mutex was created with the protocol attribute having the value PTHREAD_PRIO_PROTECT and the calling thread's priority is higher than the mutex's current priority ceiling.
- pthread_mutex_lock.11
The pthread_mutex_lock() function may fail if:
- pthread_mutex_lock.11.01
[EINVAL] The value specified by mutex does not refer to an initialized mutex object.
- pthread_mutex_lock.11.02
[EAGAIN] [XSI] The mutex could not be acquired because the maximum number of recursive locks for mutex has been exceeded.
- pthread_mutex_lock.11.03
[EDEADLK] A deadlock condition was detected or the current thread already owns the mutex.
- pthread_mutex_lock.12
These functions shall not return an error code of [EINTR].
- [+]pthread_mutex_trylock (12 / 8 / 0)
- pthread_mutex_trylock.01
This operation shall return with the mutex object referenced by mutex in the locked state with the calling thread as its owner.
- pthread_mutex_trylock.02
If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then error checking shall be provided.
- pthread_mutex_trylock.02.01
A thread attempting to relock this mutex without first unlocking it shall return with an error.
If a thread attempts to relock a mutex that it has already locked, an error shall be returned.
- pthread_mutex_trylock.03
If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex shall maintain the concept of a lock count.
- pthread_mutex_trylock.03.01
When a thread successfully acquires a mutex for the first time, the lock count shall be set to one.
- pthread_mutex_trylock.03.02
Every time a thread relocks this mutex, the lock count shall be incremented by one.
- pthread_mutex_trylock.03.02.01
If the mutex type is PTHREAD_MUTEX_RECURSIVE and the mutex is currently owned by the calling thread, the mutex lock count shall be incremented by one and the pthread_mutex_trylock() function shall immediately return success.
- pthread_mutex_trylock.04
The pthread_mutex_trylock() function shall be equivalent to pthread_mutex_lock(), except that if the mutex object referenced by mutex is currently locked (by any thread, including the current thread), the call shall return immediately.
A thread attempting to relock this mutex without first unlocking it shall succeed in locking the mutex. The relocking deadlock which can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex.
- pthread_mutex_trylock.05.01
The pthread_mutex_trylock() function shall return zero if a lock on the mutex object referenced by mutex is acquired.
- pthread_mutex_trylock.05.02
Otherwise, an error number is returned to indicate the error.
- pthread_mutex_trylock.06
The pthread_mutex_trylock() function shall fail if:
- pthread_mutex_trylock.06.01
[EINVAL] The mutex was created with the protocol attribute having the value PTHREAD_PRIO_PROTECT and the calling thread's priority is higher than the mutex's current priority ceiling.
- pthread_mutex_trylock.06.02
[EBUSY] The mutex could not be acquired because it was already locked.
- pthread_mutex_trylock.07
The pthread_mutex_lock(), pthread_mutex_trylock(), and pthread_mutex_unlock() functions may fail if:
- pthread_mutex_trylock.07.01
[EINVAL] The value specified by mutex does not refer to an initialized mutex object.
- pthread_mutex_trylock.07.02
[EAGAIN] [XSI] The mutex could not be acquired because the maximum number of recursive locks for mutex has been exceeded.
- pthread_mutex_trylock.08
These functions shall not return an error code of [EINTR].
- [+]pthread_mutex_unlock (13 / 11 / 0)
- app.pthread_mutex_unlock.01
If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection shall not be provided.
- app.pthread_mutex_unlock.01.01
Attempting to unlock a mutex locked by a different thread results in undefined behavior.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, undefined behavior results.
- app.pthread_mutex_unlock.01.02
Attempting to unlock an unlocked mutex results in undefined behavior.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, undefined behavior results.
- pthread_mutex_unlock.02
If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then error checking shall be provided.
- pthread_mutex_unlock.02.01
A thread attempting to unlock a mutex which another thread has locked shall return with an error.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, an error shall be returned.
- pthread_mutex_unlock.02.02
A thread attempting to unlock an unlocked mutex shall return with an error.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, an error shall be returned.
- pthread_mutex_unlock.03
If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex shall maintain the concept of a lock count.
- pthread_mutex_unlock.03.01
Each time the thread unlocks the mutex, the lock count shall be decremented by one.
- pthread_mutex_unlock.03.02
When the lock count reaches zero, the mutex shall become available for other threads to acquire.
- pthread_mutex_unlock.03.02.01
[XSI] (In the case of PTHREAD_MUTEX_RECURSIVE mutexes, the mutex shall become available when the count reaches zero and the calling thread no longer has any locks on this mutex.)
- pthread_mutex_unlock.03.03
A thread attempting to unlock a mutex which another thread has locked shall return with an error.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, an error shall be returned.
- pthread_mutex_unlock.03.04
A thread attempting to unlock an unlocked mutex shall return with an error.
If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, an error shall be returned.
- app.pthread_mutex_unlock.04
If the mutex type is PTHREAD_MUTEX_DEFAULT,
- app.pthread_mutex_unlock.04.01
Attempting to unlock the mutex if it was not locked by the calling thread results in undefined behavior.
Attempting to unlock a mutex of this type which was not locked by the calling thread results in undefined behavior.
- app.pthread_mutex_unlock.04.02
Attempting to unlock the mutex if it is not locked results in undefined behavior.
Attempting to unlock a mutex of this type which is not locked results in undefined behavior.
- pthread_mutex_unlock.05
The pthread_mutex_unlock() function shall release the mutex object referenced by mutex. [XSI] The manner in which a mutex is released is dependent upon the mutex's type attribute.
- pthread_mutex_unlock.06
If there are threads blocked on the mutex object referenced by mutex when pthread_mutex_unlock() is called, resulting in the mutex becoming available, the scheduling policy shall determine which thread shall acquire the mutex.
- pthread_mutex_unlock.07.01
If successful, the pthread_mutex_lock() and pthread_mutex_unlock() functions shall return zero;
- pthread_mutex_unlock.07.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutex_unlock.08
The pthread_mutex_unlock() function may fail if:
- pthread_mutex_unlock.08.01
[EINVAL] The value specified by mutex does not refer to an initialized mutex object.
- pthread_mutex_unlock.08.02
[EPERM] The current thread does not own the mutex.
- pthread_mutex_unlock.09
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_destroy (6 / 3 / 0)
- pthread_mutexattr_destroy.01
The pthread_mutexattr_destroy() function shall destroy a mutex attributes object; the object becomes, in effect, uninitialized.
- pthread_mutexattr_destroy.02
A destroyed attr attributes object can be reinitialized using pthread_mutexattr_init();
- app.pthread_mutexattr_destroy.03
the results of otherwise referencing the object after it has been destroyed are undefined.
- pthread_mutexattr_destroy.04.01
Upon successful completion, pthread_mutexattr_destroy() and pthread_mutexattr_init() shall return zero;
- pthread_mutexattr_destroy.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutexattr_destroy.05
The pthread_mutexattr_destroy() function may fail if:
- pthread_mutexattr_destroy.05.01
[EINVAL] The value specified by attr is invalid.
- pthread_mutexattr_destroy.06
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_getpshared (5 / 0 / 0)
- pthread_mutexattr_getpshared.01
The pthread_mutexattr_getpshared() function shall obtain the value of the process-shared attribute from the attributes object referenced by attr.
- pthread_mutexattr_getpshared.02.01
Upon successful completion, pthread_mutexattr_getpshared() shall return zero and store the value of the process-shared attribute of attr into the object referenced by the pshared parameter.
- pthread_mutexattr_getpshared.02.02
Otherwise, an error number shall be returned to indicate the error.
- pthread_mutexattr_getpshared.03
The pthread_mutexattr_getpshared() and pthread_mutexattr_setpshared() functions may fail if:
- pthread_mutexattr_getpshared.03.01
[EINVAL] The value specified by attr is invalid.
- pthread_mutexattr_getpshared.04
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_gettype (5 / 3 / 1)
- pthread_mutexattr_gettype.01
The pthread_mutexattr_gettype() and pthread_mutexattr_settype() functions, respectively, shall get and set the mutex type attribute.
- pthread_mutexattr_gettype.01.01 (failed)
and store the value of the type attribute of attr into the object referenced by the type parameter.
- pthread_mutexattr_gettype.02 (struct)
The type of mutex is contained in the type attribute of the mutex attributes.
- pthread_mutexattr_gettype.03.01
Upon successful completion, the pthread_mutexattr_gettype() function shall return zero
- pthread_mutexattr_gettype.03.02
Otherwise, an error shall be returned to indicate the error.
- pthread_mutexattr_gettype.04
The pthread_mutexattr_gettype() and pthread_mutexattr_settype() functions may fail if:
- pthread_mutexattr_gettype.04.01
[EINVAL] The value specified by attr is invalid.
- pthread_mutexattr_gettype.05
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_init (5 / 3 / 0)
- pthread_mutexattr_init.01
The pthread_mutexattr_init() function shall initialize a mutex attributes object attr with the default value for all of the attributes defined by the implementation.
- app.pthread_mutexattr_init.02
Results are undefined if pthread_mutexattr_init() is called specifying an already initialized attr attributes object.
- pthread_mutexattr_init.03.01
Upon successful completion, pthread_mutexattr_destroy() and pthread_mutexattr_init() shall return zero;
- pthread_mutexattr_init.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutexattr_init.04
The pthread_mutexattr_init() function shall fail if:
- pthread_mutexattr_init.04.01
[ENOMEM]
- pthread_mutexattr_init.05
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_setpshared (6 / 0 / 0)
- pthread_mutexattr_setpshared.01
The pthread_mutexattr_setpshared() function shall set the process-shared attribute in an initialized attributes object referenced by attr.
- pthread_mutexattr_setpshared.02.01
Upon successful completion, pthread_mutexattr_setpshared() shall return zero;
- pthread_mutexattr_setpshared.02.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutexattr_setpshared.03
The pthread_mutexattr_setpshared() function may fail if
- pthread_mutexattr_setpshared.03.01
[EINVAL] The value specified by attr is invalid.
- pthread_mutexattr_setpshared.03.02
[EINVAL] The new value specified for the attribute is outside the range of legal values for that attribute.
- pthread_mutexattr_setpshared.04
These functions shall not return an error code of [EINTR].
- [+]pthread_mutexattr_settype (6 / 4 / 0)
- pthread_mutexattr_settype.01
The pthread_mutexattr_gettype() and pthread_mutexattr_settype() functions, respectively, shall get and set the mutex type attribute.
- pthread_mutexattr_settype.01.01
This attribute is set in the type parameter to these functions.
- pthread_mutexattr_settype.02 (struct)
The type of mutex is contained in the type attribute of the mutex attributes.
- pthread_mutexattr_settype.03.01
If successful, the pthread_mutexattr_settype() function shall return zero;
- pthread_mutexattr_settype.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_mutexattr_settype.04
The pthread_mutexattr_settype() function shall fail if:
- pthread_mutexattr_settype.04.01
[EINVAL] The value type is invalid.
- pthread_mutexattr_settype.05
The pthread_mutexattr_gettype() and pthread_mutexattr_settype() functions may fail if:
- pthread_mutexattr_settype.05.01
[EINVAL] The value specified by attr is invalid.
- pthread_mutexattr_settype.06
These functions shall not return an error code of [EINTR].
- [+]pthread.pthread (90 / 57 / 0)
- [+]__errno_location (1 / 1 / 0)
- __errno_location.01
The __errno_location() function shall return the address of the errno variable for the current thread.
- [+]_pthread_cleanup_pop (2 / 1 / 0)
- _pthread_cleanup_pop.pthread_cleanup_pop.01
The pthread_cleanup_pop() function shall remove the routine at the top of the calling thread's cancellation cleanup stack and optionally invoke it (if execute is non-zero).
- _pthread_cleanup_pop.pthread_cleanup_pop.02
These functions shall not return an error code of [EINTR].
- [+]_pthread_cleanup_push (2 / 1 / 0)
- _pthread_cleanup_push.pthread_cleanup_push.01
The pthread_cleanup_push() function shall push the specified cancellation cleanup handler routine onto the calling thread's cancellation cleanup stack.
- _pthread_cleanup_push.pthread_cleanup_push.02
These functions shall not return an error code of [EINTR].
- [+]pthread_cancel (10 / 4 / 0)
- pthread_cancel.01
The pthread_cancel() function shall request that thread be canceled.
- pthread_cancel.02
The target thread's cancelability state and type determines when the cancellation takes effect.
- pthread_cancel.03
When the cancellation is acted on, the cancellation cleanup handlers for thread shall be called.
- pthread_cancel.04
When the last cancellation cleanup handler returns, the thread-specific data destructor functions shall be called for thread.
- pthread_cancel.05
When the last destructor function returns, thread shall be terminated.
- pthread_cancel.06
The cancellation processing in the target thread shall run asynchronously with respect to the calling thread returning from pthread_cancel().
- pthread_cancel.07.01
If successful, the pthread_cancel() function shall return zero;
- pthread_cancel.07.02
otherwise, an error number shall be returned to indicate the error.
- pthread_cancel.08
The pthread_cancel() function may fail if:
- pthread_cancel.08.01
[ESRCH] No thread could be found corresponding to that specified by the given thread ID.
- pthread_cancel.09
The pthread_cancel() function shall not return an error code of [EINTR].
- [+]pthread_create (19 / 10 / 0)
- pthread_create.01
The pthread_create() function shall create a new thread, with attributes specified by attr, within a process.
- pthread_create.02
If attr is NULL, the default attributes shall be used.
- pthread_create.03
If the attributes specified by attr are modified later, the thread's attributes shall not be affected.
- pthread_create.04
Upon successful completion, pthread_create() shall store the ID of the created thread in the location referenced by thread.
- pthread_create.05
The thread is created executing start_routine with arg as its sole argument.
- pthread_create.06
If the start_routine returns, the effect shall be as if there was an implicit call to pthread_exit() using the return value of start_routine as the exit status.
- pthread_create.07
The signal mask shall be inherited from the creating thread.
- pthread_create.08
The set of signals pending for the new thread shall be empty.
- pthread_create.09
The alternate stack shall not be inherited.
- pthread_create.10
The floating-point environment shall be inherited from the creating thread.
- pthread_create.11
If pthread_create() fails, no new thread is created and the contents of the location referenced by thread are undefined.
- pthread_create.12
If _POSIX_THREAD_CPUTIME is defined, the new thread shall have a CPU-time clock accessible, and the initial value of this clock shall be set to zero.
- pthread_create.13.01
If successful, the pthread_create() function shall return zero;
- pthread_create.13.02
otherwise, an error number shall be returned to indicate the error.
- pthread_create.14
The pthread_create() function shall fail if:
- pthread_create.14.01
[EAGAIN] The system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process {PTHREAD_THREADS_MAX} would be exceeded.
- pthread_create.14.02
[EPERM] The caller does not have appropriate permission to set the required scheduling parameters or scheduling policy.
- pthread_create.15
The pthread_create() function may fail if:
- pthread_create.15.01
[EINVAL] The attributes specified by attr are invalid.
- pthread_create.16
The pthread_create() function shall not return an error code of [EINTR].
- pthread_create.pthread_key_create.03
Upon thread creation, the value NULL shall be associated with all defined keys in the new thread.
- [+]pthread_detach (7 / 5 / 0)
- pthread_detach.01
The pthread_detach() function shall indicate to the implementation that storage for the thread thread can be reclaimed when that thread terminates.
- pthread_detach.02
If thread has not terminated, pthread_detach() shall not cause it to terminate.
- pthread_detach.03.01
If the call succeeds, pthread_detach() shall return 0;
- pthread_detach.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_detach.04
The pthread_detach() function shall not return an error code of [EINTR].
- app.pthread_detach.05
The effect of multiple pthread_detach() calls on the same target thread is unspecified.
- pthread_detach.06
The pthread_detach() function may fail if:
- pthread_detach.06.1
[EINVAL] The implementation has detected that the value specified by thread does not refer to a joinable thread.
- pthread_detach.06.2
[ESRCH] No thread could be found corresponding to that specified by the given thread ID.
- [+]pthread_equal (3 / 3 / 0)
- pthread_equal.01
The pthread_equal() function shall return a non-zero value if t1 and t2 are equal;
- pthread_equal.02
otherwise, zero shall be returned.
- app.pthread_equal.03
If either t1 or t2 are not valid thread IDs, the behavior is undefined.
- pthread_equal.04
The pthread_equal() function shall not return an error code of [EINTR].
- [+]pthread_exit (8 / 4 / 0)
- pthread_exit.01
The pthread_exit() function shall terminate the calling thread and make the value value_ptr available to any successful join with the terminating thread.
- pthread_exit.02
Any cancellation cleanup handlers that have been pushed and not yet popped shall be popped in the reverse order that they were pushed and then executed.
- pthread_exit.03
After all cancellation cleanup handlers have been executed, if the thread has any thread-specific data, appropriate destructor functions shall be called in an unspecified order.
- pthread_exit.04
Thread termination does not release any application visible process resources, including, but not limited to, mutexes and file descriptors, nor does it perform any process-level cleanup actions, including, but not limited to, calling any atexit() routines that may exist.
- pthread_exit.05
An implicit call to pthread_exit() is made when a thread other than the thread in which main() was first invoked returns from the start routine that was used to create it.
- pthread_exit.06
The function's return value shall serve as the thread's exit status.
- pthread_exit.07
The process shall exit with an exit status of 0 after the last thread has been terminated. The behavior shall be as if the implementation called exit() with a zero argument at thread termination time.
- pthread_exit.08
The pthread_exit() function cannot return to its caller.
- [+]pthread_join (11 / 8 / 0)
- pthread_join.01
The pthread_join() function shall suspend execution of the calling thread until the target thread terminates, unless the target thread has already terminated.
- app.pthread_join.01
The results of multiple simultaneous calls to pthread_join() specifying the same target thread are undefined.
- pthread_join.02
On return from a successful pthread_join() call with a non-NULL value_ptr argument, the value passed to pthread_exit() by the terminating thread shall be made available in the location referenced by value_ptr.
- pthread_join.03
When a pthread_join() returns successfully, the target thread has been terminated.
- pthread_join.05
If the thread calling pthread_join() is canceled, then the target thread shall not be detached.
- pthread_join.06
It is unspecified whether a thread that has exited but remains unjoined counts against {PTHREAD_THREADS_MAX}.
- pthread_join.07.01
If successful, the pthread_join() function shall return zero;
- pthread_join.07.02
otherwise, an error number shall be returned to indicate the error.
- pthread_join.08
The pthread_join() function shall fail if:
- pthread_join.08.01
[ESRCH] No thread could be found corresponding to that specified by the given thread ID.
- pthread_join.09
The pthread_join() function may fail if:
- pthread_join.09.01
[EDEADLK] A deadlock was detected or the value of thread specifies the calling thread.
- pthread_join.09.02
[EINVAL] The value specified by thread does not refer to a joinable thread.
- pthread_join.10
The pthread_join() function shall not return an error code of [EINTR].
- [+]pthread_once (10 / 5 / 0)
- pthread_once.01
The first call to pthread_once() by any thread in a process, with a given once_control, shall call the init_routine with no arguments
- pthread_once.02
Subsequent calls of pthread_once() with the same once_control shall not call the init_routine.
- pthread_once.03
On return from pthread_once(), init_routine shall have completed.
- pthread_once.04
The once_control parameter shall determine whether the associated initialization routine has been called.
- pthread_once.05
The pthread_once() function is not a cancellation point. However, if init_routine is a cancellation point and is canceled, the effect on once_control shall be as if pthread_once() was never called.
- pthread_once.06
The behavior of pthread_once() is undefined if once_control has automatic storage duration or is not initialized by PTHREAD_ONCE_INIT.
- pthread_once.07.01
Upon successful completion, pthread_once() shall return zero;
- pthread_once.07.02
otherwise, an error number shall be returned to indicate the error.
- pthread_once.08
The pthread_once() function may fail if:
- pthread_once.08.01
[EINVAL] If either once_control or init_routine is invalid.
- pthread_once.09
The pthread_once() function shall not return an error code of [EINTR].
- [+]pthread_self (2 / 2 / 0)
- pthread_self.01
The pthread_self() function shall return the thread ID of the calling thread.
- pthread_self.02
The pthread_self() function shall not return an error code of [EINTR].
- [+]pthread_setcancelstate (7 / 6 / 0)
- pthread_setcancelstate.01
The pthread_setcancelstate() function shall atomically both set the calling thread's cancelability state to the indicated state and return the previous cancelability state at the location referenced by oldstate.
- pthread_setcancelstate.02
Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.
- pthread_setcancelstate.03
The cancelability state and type of any newly created threads, including the thread in which main() was first invoked, shall be PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively.
- pthread_setcancelstate.04.01
If successful, the pthread_setcancelstate() and pthread_setcanceltype() functions shall return zero
- pthread_setcancelstate.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setcancelstate.05
The pthread_setcancelstate() function may fail if:
- pthread_setcancelstate.05.01
[EINVAL] The specified state is not PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.
- pthread_setcancelstate.07
These functions shall not return an error code of [EINTR].
- [+]pthread_setcanceltype (6 / 5 / 0)
- pthread_setcanceltype.01
The pthread_setcanceltype() function shall atomically both set the calling thread's cancelability type to the indicated type and return the previous cancelability type at the location referenced by oldtype.
- pthread_setcanceltype.02
Legal values for type are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
- pthread_setcanceltype.04.01
If successful, the pthread_setcancelstate() and pthread_setcanceltype() functions shall return zero
- pthread_setcanceltype.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setcanceltype.06
The pthread_setcanceltype() function may fail if:
- pthread_setcanceltype.06.01
[EINVAL] The specified type is not PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.
- pthread_setcanceltype.07
These functions shall not return an error code of [EINTR].
- [+]pthread_testcancel (2 / 2 / 0)
- pthread_testcancel.01
The pthread_testcancel() function shall create a cancellation point in the calling thread.
- pthread_testcancel.02
The pthread_testcancel() function shall have no effect if cancelability is disabled.
- [+]pthread.rwlock.rwlock (115 / 31 / 0)
- [+]pthread_rwlock_destroy (7 / 3 / 0)
- pthread_rwlock_destroy.01
The pthread_rwlock_destroy() function shall destroy the read-write lock object referenced by rwlock and release any resources used by the lock.
- app.pthread_rwlock_destroy.02
Results are undefined if pthread_rwlock_destroy() is called when any thread holds rwlock.
- app.pthread_rwlock_destroy.03
Attempting to destroy an uninitialized read-write lock results in undefined behavior.
- pthread_rwlock_destroy.04
If successful, the pthread_rwlock_destroy() and pthread_rwlock_init() functions shall return zero;
- pthread_rwlock_destroy.05
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_destroy.06
The [EBUSY] and [EINVAL] error checks, if implemented, act as if they were performed immediately at the beginning of processing for the function and caused an error return prior to modifying the state of the read-write lock specified by rwlock.
- pthread_rwlock_destroy.07
The pthread_rwlock_destroy() function may fail if:
- pthread_rwlock_destroy.07.01
[EBUSY] The implementation has detected an attempt to destroy the object referenced by rwlock while it is locked.
- pthread_rwlock_destroy.07.02
[EINVAL] The value specified by rwlock is invalid.
- pthread_rwlock_destroy.08
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlock_init (14 / 6 / 0)
- pthread_rwlock_init.01
The pthread_rwlock_init() function shall allocate any resources required to use the read-write lock referenced by rwlock
- pthread_rwlock_init.02
and initializes the lock to an unlocked state
- pthread_rwlock_init.03
with attributes referenced by attr.
- pthread_rwlock_init.04
If attr is NULL, the default read-write lock attributes shall be used; the effect is the same as passing the address of a default read-write lock attributes object.
- app.pthread_rwlock_init.05
Results are undefined if pthread_rwlock_init() is called specifying an already initialized read-write lock.
- pthread_rwlock_init.07
If the pthread_rwlock_init() function fails, rwlock shall not be initialized and the contents of rwlock are undefined.
- pthread_rwlock_init.08
If successful, the pthread_rwlock_destroy() and pthread_rwlock_init() functions shall return zero;
- pthread_rwlock_init.09
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_init.10
The [EBUSY] and [EINVAL] error checks, if implemented, act as if they were performed immediately at the beginning of processing for the function and caused an error return prior to modifying the state of the read-write lock specified by rwlock.
- pthread_rwlock_init.11
The pthread_rwlock_init() function shall fail if:
- pthread_rwlock_init.11.01
[EAGAIN] The system lacked the necessary resources (other than memory) to initialize another read-write lock.
- pthread_rwlock_init.11.02
[ENOMEM] Insufficient memory exists to initialize the read-write lock.
- pthread_rwlock_init.11.03
[EPERM] The caller does not have the privilege to perform the operation.
- pthread_rwlock_init.12
The pthread_rwlock_init() function may fail if:
- pthread_rwlock_init.12.01
[EBUSY] The implementation has detected an attempt to reinitialize the object referenced by rwlock, a previously initialized but not yet destroyed read-write lock.
- pthread_rwlock_init.12.02
[EINVAL] The value specified by attr is invalid.
- pthread_rwlock_init.13
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlock_rdlock (17 / 3 / 0)
- pthread_rwlock_rdlock.01
The pthread_rwlock_rdlock() function shall apply a read lock to the read-write lock referenced by rwlock.
- pthread_rwlock_rdlock.02
The calling thread acquires the read lock if a writer does not hold the lock and there are no writers blocked on the lock.
- pthread_rwlock_rdlock.03
If the Thread Execution Scheduling option is supported, and the threads involved in the lock are executing with the scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock;
- pthread_rwlock_rdlock.04
otherwise, the calling thread shall acquire the lock.
- pthread_rwlock_rdlock.05
If the Threads Execution Scheduling option is supported, and the threads involved in the lock are executing with the SCHED_SPORADIC scheduling policy, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock;
- pthread_rwlock_rdlock.06
otherwise, the calling thread shall acquire the lock.
- pthread_rwlock_rdlock.07
If the Thread Execution Scheduling option is not supported, it is implementation-defined whether the calling thread acquires the lock when a writer does not hold the lock and there are writers blocked on the lock.
- pthread_rwlock_rdlock.08
If a writer holds the lock, the calling thread shall not acquire the read lock.
- pthread_rwlock_rdlock.09
If the read lock is not acquired, the calling thread shall block until it can acquire the lock.
- app.pthread_rwlock_rdlock.10
The calling thread may deadlock if at the time the call is made it holds a write lock.
- pthread_rwlock_rdlock.11
A thread may hold multiple concurrent read locks on rwlock (that is, successfully call the pthread_rwlock_rdlock() function n times).
- app.pthread_rwlock_rdlock.13
Results are undefined if any of these functions are called with an uninitialized read-write lock.
- pthread_rwlock_rdlock.14
If a signal is delivered to a thread waiting for a read-write lock for reading, upon return from the signal handler the thread resumes waiting for the read-write lock for reading as if it was not interrupted.
- pthread_rwlock_rdlock.15
If successful, the pthread_rwlock_rdlock() function shall return zero;
- pthread_rwlock_rdlock.16
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_rdlock.17
The pthread_rwlock_rdlock() and pthread_rwlock_tryrdlock() functions may fail if:
- pthread_rwlock_rdlock.17.01
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object.
- pthread_rwlock_rdlock.17.02
[EAGAIN] The read lock could not be acquired because the maximum number of read locks for rwlock has been exceeded.
- pthread_rwlock_rdlock.18
The pthread_rwlock_rdlock() function may fail if:
- pthread_rwlock_rdlock.18.01
[EDEADLK] A deadlock condition was detected or the current thread already owns the read-write lock for writing.
- pthread_rwlock_rdlock.19
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlock_timedrdlock (15 / 2 / 0)
- pthread_rwlock_timedrdlock.01
The pthread_rwlock_timedrdlock() function shall apply a read lock to the read-write lock referenced by rwlock as in the pthread_rwlock_rdlock() function.
- pthread_rwlock_timedrdlock.02
However, if the lock cannot be acquired without waiting for other threads to unlock the lock, this wait shall be terminated when the specified timeout expires.
- pthread_rwlock_timedrdlock.03
The timeout shall expire when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), or if the absolute time specified by abs_timeout has already been passed at the time of the call.
- pthread_rwlock_timedrdlock.04
If the Timers option is supported, the timeout shall be based on the CLOCK_REALTIME clock.
- pthread_rwlock_timedrdlock.05
If the Timers option is not supported, the timeout shall be based on the system clock as returned by the time() function.
- pthread_rwlock_timedrdlock.06
The resolution of the timeout shall be the resolution of the clock on which it is based.
- pthread_rwlock_timedrdlock.07
Under no circumstances shall the function fail with a timeout if the lock can be acquired immediately.
- app.pthread_rwlock_timedrdlock.08
The validity of the abs_timeout parameter need not be checked if the lock can be immediately acquired.
- pthread_rwlock_timedrdlock.09
If a signal that causes a signal handler to be executed is delivered to a thread blocked on a read-write lock via a call to pthread_rwlock_timedrdlock(), upon return from the signal handler the thread shall resume waiting for the lock as if it was not interrupted.
- app.pthread_rwlock_timedrdlock.10
The calling thread may deadlock if at the time the call is made it holds a write lock on rwlock.
- app.pthread_rwlock_timedrdlock.11
The results are undefined if this function is called with an uninitialized read-write lock.
- pthread_rwlock_timedrdlock.12
The pthread_rwlock_timedrdlock() function shall return zero if the lock for reading on the read-write lock object referenced by rwlock is acquired.
- pthread_rwlock_timedrdlock.13
Otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_timedrdlock.14
The pthread_rwlock_timedrdlock() function shall fail if:
- pthread_rwlock_timedrdlock.14.01
[ETIMEDOUT] The lock could not be acquired before the specified timeout expired.
- pthread_rwlock_timedrdlock.15
The pthread_rwlock_timedrdlock() function may fail if:
- pthread_rwlock_timedrdlock.15.01
[EAGAIN] The read lock could not be acquired because the maximum number of read locks for lock would be exceeded.
- pthread_rwlock_timedrdlock.15.02
[EDEADLK] A deadlock condition was detected or the calling thread already holds a write lock on rwlock.
- pthread_rwlock_timedrdlock.15.03
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object, or the abs_timeout nanosecond value is less than zero or greater than or equal to 1000 million.
- pthread_rwlock_timedrdlock.16
This function shall not return an error code of [EINTR].
- [+]pthread_rwlock_timedwrlock (14 / 2 / 0)
- pthread_rwlock_timedwrlock.01
The pthread_rwlock_timedwrlock() function shall apply a write lock to the read-write lock referenced by rwlock as in the pthread_rwlock_wrlock() function.
- pthread_rwlock_timedwrlock.02
However, if the lock cannot be acquired without waiting for other threads to unlock the lock, this wait shall be terminated when the specified timeout expires.
- pthread_rwlock_timedwrlock.03
The timeout shall expire when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), or if the absolute time specified by abs_timeout has already been passed at the time of the call.
- pthread_rwlock_timedwrlock.04
If the Timers option is supported, the timeout shall be based on the CLOCK_REALTIME clock.
- pthread_rwlock_timedwrlock.05
If the Timers option is not supported, the timeout shall be based on the system clock as returned by the time() function.
- pthread_rwlock_timedwrlock.06
The resolution of the timeout shall be the resolution of the clock on which it is based.
- pthread_rwlock_timedwrlock.07
Under no circumstances shall the function fail with a timeout if the lock can be acquired immediately.
- app.pthread_rwlock_timedwrlock.08
The validity of the abs_timeout parameter need not be checked if the lock can be immediately acquired.
- pthread_rwlock_timedwrlock.09
If a signal that causes a signal handler to be executed is delivered to a thread blocked on a read-write lock via a call to pthread_rwlock_timedwrlock(), upon return from the signal handler the thread shall resume waiting for the lock as if it was not interrupted.
- app.pthread_rwlock_timedwrlock.10
The calling thread may deadlock if at the time the call is made it holds the read-write lock.
- app.pthread_rwlock_timedwrlock.11
The results are undefined if this function is called with an uninitialized read-write lock.
- pthread_rwlock_timedwrlock.12
The pthread_rwlock_timedwrlock() function shall return zero if the lock for writing on the read-write lock object referenced by rwlock is acquired.
- pthread_rwlock_timedwrlock.13
Otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_timedwrlock.14
The pthread_rwlock_timedwrlock() function shall fail if:
- pthread_rwlock_timedwrlock.14.01
[ETIMEDOUT] The lock could not be acquired before the specified timeout expired.
- pthread_rwlock_timedwrlock.15
The pthread_rwlock_timedwrlock() function may fail if:
- pthread_rwlock_timedwrlock.15.01
[EDEADLK] A deadlock condition was detected or the calling thread already holds the rwlock.
- pthread_rwlock_timedwrlock.15.02
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object, or the abs_timeout nanosecond value is less than zero or greater than or equal to 1000 million.
- pthread_rwlock_timedwrlock.16
This function shall not return an error code of [EINTR].
- [+]pthread_rwlock_tryrdlock (17 / 6 / 0)
- pthread_rwlock_tryrdlock.01
The calling thread acquires the read lock if a writer does not hold the lock and there are no writers blocked on the lock.
- pthread_rwlock_tryrdlock.02
If the Thread Execution Scheduling option is supported, and the threads involved in the lock are executing with the scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock;
- pthread_rwlock_tryrdlock.03
otherwise, the calling thread shall acquire the lock.
- pthread_rwlock_tryrdlock.04
If the Threads Execution Scheduling option is supported, and the threads involved in the lock are executing with the SCHED_SPORADIC scheduling policy, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock;
- pthread_rwlock_tryrdlock.05
otherwise, the calling thread shall acquire the lock.
- pthread_rwlock_tryrdlock.06
If the Thread Execution Scheduling option is not supported, it is implementation-defined whether the calling thread acquires the lock when a writer does not hold the lock and there are writers blocked on the lock.
- pthread_rwlock_tryrdlock.07
If a writer holds the lock, the calling thread shall not acquire the read lock.
- pthread_rwlock_tryrdlock.08
A thread may hold multiple concurrent read locks on rwlock (that is, successfully call the pthread_rwlock_rdlock() function n times).
- pthread_rwlock_tryrdlock.09
The pthread_rwlock_tryrdlock() function shall apply a read lock as in the pthread_rwlock_rdlock() function, with the exception
- pthread_rwlock_tryrdlock.10
the function shall fail if the equivalent pthread_rwlock_rdlock() call would have blocked the calling thread.
- pthread_rwlock_tryrdlock.10.01
In no case shall the pthread_rwlock_tryrdlock() function ever block; it always either acquires the lock
- pthread_rwlock_tryrdlock.10.02
or fails and returns immediately.
- app.pthread_rwlock_tryrdlock.11
Results are undefined if any of these functions are called with an uninitialized read-write lock.
- pthread_rwlock_tryrdlock.12
The pthread_rwlock_tryrdlock() function shall return zero if the lock for reading on the read-write lock object referenced by rwlock is acquired.
- pthread_rwlock_tryrdlock.13
Otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_tryrdlock.14
The pthread_rwlock_tryrdlock() function shall fail if:
- pthread_rwlock_tryrdlock.14.01
[EBUSY] The read-write lock could not be acquired for reading because a writer holds the lock or a writer with the appropriate priority was blocked on it.
- pthread_rwlock_tryrdlock.15
The pthread_rwlock_rdlock() and pthread_rwlock_tryrdlock() functions may fail if:
- pthread_rwlock_tryrdlock.15.01
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object.
- pthread_rwlock_tryrdlock.15.02
[EAGAIN] The read lock could not be acquired because the maximum number of read locks for rwlock has been exceeded.
- pthread_rwlock_tryrdlock.16
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlock_trywrlock (8 / 4 / 0)
- pthread_rwlock_trywrlock.01
The pthread_rwlock_trywrlock() function shall apply a write lock like the pthread_rwlock_wrlock() function, with the exception that
- pthread_rwlock_trywrlock.02
the function shall fail if any thread currently holds rwlock (for reading or writing).
- pthread_rwlock_trywrlock.03
The calling thread acquires the write lock if no other thread (reader or writer) holds the read-write lock rwlock.
- app.pthread_rwlock_trywrlock.04
Results are undefined if any of these functions are called with an uninitialized read-write lock.
- pthread_rwlock_trywrlock.05
The pthread_rwlock_trywrlock() function shall return zero if the lock for writing on the read-write lock object referenced by rwlock is acquired.
- pthread_rwlock_trywrlock.06
Otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_trywrlock.07
The pthread_rwlock_trywrlock() function shall fail if:
- pthread_rwlock_trywrlock.07.01
[EBUSY] The read-write lock could not be acquired for writing because it was already locked for reading or writing.
- pthread_rwlock_trywrlock.08
The pthread_rwlock_trywrlock() and pthread_rwlock_wrlock() functions may fail if:
- pthread_rwlock_trywrlock.08.01
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object.
- pthread_rwlock_trywrlock.09
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlock_unlock (13 / 2 / 0)
- pthread_rwlock_unlock.01
The pthread_rwlock_unlock() function shall release a lock held on the read-write lock object referenced by rwlock.
- app.pthread_rwlock_unlock.02
Results are undefined if the read-write lock rwlock is not held by the calling thread.
- pthread_rwlock_unlock.03
If this function is called to release a read lock from the read-write lock object and there are other read locks currently held on this read-write lock object, the read-write lock object remains in the read locked state.
- pthread_rwlock_unlock.04
If this function releases the last read lock for this read-write lock object, the read-write lock object shall be put in the unlocked state with no owners.
- pthread_rwlock_unlock.05
If this function is called to release a write lock for this read-write lock object, the read-write lock object shall be put in the unlocked state.
- pthread_rwlock_unlock.06
If there are threads blocked on the lock when it becomes available, the scheduling policy shall determine which thread(s) shall acquire the lock.
- pthread_rwlock_unlock.07
If the Thread Execution Scheduling option is supported, when threads executing with the scheduling policies SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC are waiting on the lock, they shall acquire the lock in priority order when the lock becomes available.
- pthread_rwlock_unlock.08
For equal priority threads, write locks shall take precedence over read locks.
- pthread_rwlock_unlock.09
If the Thread Execution Scheduling option is not supported, it is implementation-defined whether write locks take precedence over read locks.
- app.pthread_rwlock_unlock.10
Results are undefined if any of these functions are called with an uninitialized read-write lock.
- pthread_rwlock_unlock.11
If successful, the pthread_rwlock_unlock() function shall return zero;
- pthread_rwlock_unlock.12
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_unlock.13
The pthread_rwlock_unlock() function may fail if:
- pthread_rwlock_unlock.13.01
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object.
- pthread_rwlock_unlock.13.02
[EPERM] The current thread does not hold a lock on the read-write lock.
- pthread_rwlock_unlock.14
The pthread_rwlock_unlock() function shall not return an error code of [EINTR].
- app.pthread_rwlock_unlock.pthread_rwlock_rdlock.01
If so, the application shall ensure that the thread performs matching unlocks (that is, it calls the pthread_rwlock_unlock() function n times).
- [+]pthread_rwlock_wrlock (10 / 3 / 0)
- pthread_rwlock_wrlock.01
The pthread_rwlock_wrlock() function shall apply a write lock to the read-write lock referenced by rwlock.
- pthread_rwlock_wrlock.02
The calling thread acquires the write lock if no other thread (reader or writer) holds the read-write lock rwlock.
- pthread_rwlock_wrlock.03
Otherwise, the thread shall block until it can acquire the lock.
- pthread_rwlock_wrlock.04
The calling thread may deadlock if at the time the call is made it holds the read-write lock (whether a read or write lock).
- app.pthread_rwlock_wrlock.05
Results are undefined if any of these functions are called with an uninitialized read-write lock.
- pthread_rwlock_wrlock.06
If a signal is delivered to a thread waiting for a read-write lock for writing, upon return from the signal handler the thread resumes waiting for the read-write lock for writing as if it was not interrupted.
- pthread_rwlock_wrlock.07
If successful, the pthread_rwlock_wrlock() function shall return zero;
- pthread_rwlock_wrlock.08
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlock_wrlock.09
The pthread_rwlock_trywrlock() and pthread_rwlock_wrlock() functions may fail if:
- pthread_rwlock_wrlock.09.01
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock object.
- pthread_rwlock_wrlock.10
The pthread_rwlock_wrlock() function may fail if:
- pthread_rwlock_wrlock.10.01
[EDEADLK] A deadlock condition was detected or the current thread already owns the read-write lock for writing or reading.
- pthread_rwlock_wrlock.11
These functions shall not return an error code of [EINTR].
- [+]pthread.rwlock.rwlockattr (27 / 10 / 0)
- [+]pthread_rwlockattr_destroy (5 / 3 / 0)
- pthread_rwlockattr_destroy.01
The pthread_rwlockattr_destroy() function shall destroy a read-write lock attributes object.
- pthread_rwlockattr_destroy.02
If successful, the pthread_rwlockattr_destroy() and pthread_rwlockattr_init() functions shall return zero;
- pthread_rwlockattr_destroy.03
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlockattr_destroy.04
The pthread_rwlockattr_destroy() function may fail if:
- pthread_rwlockattr_destroy.04.01
[EINVAL] The value specified by attr is invalid.
- pthread_rwlockattr_destroy.05
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlockattr_getpshared (8 / 3 / 0)
- pthread_rwlockattr_getpshared.01
The pthread_rwlockattr_getpshared() function shall obtain the value of the process-shared attribute from the initialized attributes object referenced by attr.
- pthread_rwlockattr_getpshared.02
The process-shared attribute shall be set to PTHREAD_PROCESS_SHARED to permit a read-write lock to be operated upon by any thread that has access to the memory where the read-write lock is allocated, even if the read-write lock is allocated in memory that is shared by multiple processes.
- pthread_rwlockattr_getpshared.03
If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the read-write lock shall only be operated upon by threads created within the same process as the thread that initialized the read-write lock; if threads of differing processes attempt to operate on such a read-write lock, the behavior is undefined
- pthread_rwlockattr_getpshared.04
Upon successful completion, the pthread_rwlockattr_getpshared() function shall return zero
- pthread_rwlockattr_getpshared.05
and store the value of the process-shared attribute of attr into the object referenced by the pshared parameter.
- pthread_rwlockattr_getpshared.06
Otherwise, an error number shall be returned to indicate the error.
- pthread_rwlockattr_getpshared.07
The pthread_rwlockattr_getpshared() and pthread_rwlockattr_setpshared() functions may fail if:
- pthread_rwlockattr_getpshared.07.01
[EINVAL] The value specified by attr is invalid.
- pthread_rwlockattr_getpshared.08
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlockattr_init (5 / 2 / 0)
- pthread_rwlockattr_init.01
The pthread_rwlockattr_init() function shall initialize a read-write lock attributes object attr with the default value for all of the attributes defined by the implementation.
- app.pthread_rwlockattr_init.02
Results are undefined if pthread_rwlockattr_init() is called specifying an already initialized attr attributes object.
- pthread_rwlockattr_init.03
If successful, the pthread_rwlockattr_destroy() and pthread_rwlockattr_init() functions shall return zero;
- pthread_rwlockattr_init.04
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlockattr_init.05
The pthread_rwlockattr_init() function shall fail if:
- pthread_rwlockattr_init.05.01
[ENOMEM] Insufficient memory exists to initialize the read-write lock attributes object.
- pthread_rwlockattr_init.06
These functions shall not return an error code of [EINTR].
- [+]pthread_rwlockattr_setpshared (9 / 2 / 0)
- pthread_rwlockattr_setpshared.01
The pthread_rwlockattr_setpshared() function shall set the process-shared attribute in an initialized attributes object referenced by attr.
- pthread_rwlockattr_setpshared.02
The process-shared attribute shall be set to PTHREAD_PROCESS_SHARED to permit a read-write lock to be operated upon by any thread that has access to the memory where the read-write lock is allocated, even if the read-write lock is allocated in memory that is shared by multiple processes.
- pthread_rwlockattr_setpshared.03
If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the read-write lock shall only be operated upon by threads created within the same process as the thread that initialized the read-write lock; if threads of differing processes attempt to operate on such a read-write lock, the behavior is undefined
- pthread_rwlockattr_setpshared.04
The default value of the process-shared attribute shall be PTHREAD_PROCESS_PRIVATE.
- pthread_rwlockattr_setpshared.05
If successful, the pthread_rwlockattr_setpshared() function shall return zero;
- pthread_rwlockattr_setpshared.06
otherwise, an error number shall be returned to indicate the error.
- pthread_rwlockattr_setpshared.07
The pthread_rwlockattr_getpshared() and pthread_rwlockattr_setpshared() functions may fail if:
- pthread_rwlockattr_setpshared.07.01
[EINVAL] The value specified by attr is invalid.
- pthread_rwlockattr_setpshared.08
The pthread_rwlockattr_setpshared() function may fail if:
- pthread_rwlockattr_setpshared.08.01
[EINVAL] The new value specified for the attribute is outside the range of legal values for that attribute.
- pthread_rwlockattr_setpshared.09
These functions shall not return an error code of [EINTR].
- [+]pthread.scheduler (40 / 19 / 0)
- [+]pthread_getconcurrency (2 / 1 / 0)
- pthread_getconcurrency.02
The pthread_getconcurrency() function shall return the value set by a previous call to the pthread_setconcurrency() function. If the pthread_setconcurrency() function was not previously called, this function shall return zero to indicate that the implementation is maintaining the concurrency level.
The pthread_getconcurrency() function shall always return the concurrency level set by a previous call to pthread_setconcurrency(). If the pthread_setconcurrency() function has never been called, pthread_getconcurrency() shall return zero.
- pthread_getconcurrency.05
These functions shall not return an error code of [EINTR].
- [+]pthread_getschedparam (6 / 3 / 0)
- pthread_getschedparam.01
For SCHED_OTHER, the affected scheduling parameters are implementation-defined.
- pthread_getschedparam.02
The pthread_getschedparam() function shall retrieve the scheduling policy and scheduling parameters for the thread whose thread ID is given by thread and shall store those values in policy and param, respectively. The priority value returned from pthread_getschedparam() shall be the value specified by the most recent pthread_setschedparam(), pthread_setschedprio(), or pthread_create() call affecting the target thread. It shall not reflect any temporary adjustments to its priority as a result of any priority inheritance or ceiling functions.
- pthread_getschedparam.08.01
If successful, the pthread_getschedparam() and pthread_setschedparam() functions shall return zero
- pthread_getschedparam.08.02
otherwise, an error number shall be returned to indicate the error.
- pthread_getschedparam.09
The pthread_getschedparam() function may fail if:
- pthread_getschedparam.09.01
[ESRCH] The value specified by thread does not refer to an existing thread.
- pthread_getschedparam.11
These functions shall not return an error code of [EINTR].
- [+]pthread_setconcurrency (6 / 4 / 0)
- pthread_setconcurrency.01
The pthread_setconcurrency() function allows an application to inform the threads implementation of its desired concurrency level, new_level. The actual level of concurrency provided by the implementation as a result of this function call is unspecified.
A call to pthread_setconcurrency() shall inform the implementation of its desired concurrency level. The implementation shall use this as a hint, not a requirement.
- pthread_setconcurrency.03.01
If successful, the pthread_setconcurrency() function shall return zero;
- pthread_setconcurrency.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setconcurrency.04
The pthread_setconcurrency() function shall fail if:
- pthread_setconcurrency.04.01
[EINVAL] The value specified by new_level is negative.
- pthread_setconcurrency.04.02
[EAGAIN] The value specified by new_level would cause a system resource to be exceeded.
- pthread_setconcurrency.05
These functions shall not return an error code of [EINTR].
- [+]pthread_setschedparam (16 / 7 / 0)
- pthread_setschedparam.01
For SCHED_OTHER, the affected scheduling parameters are implementation-defined.
The scheduling parameters for the SCHED_OTHER policy are implementation-defined.
- pthread_setschedparam.03
The policy parameter may have the value SCHED_OTHER, SCHED_FIFO, or SCHED_RR.
- pthread_setschedparam.04
The pthread_setschedparam() function shall set the scheduling policy and associated scheduling parameters for the thread whose thread ID is given by thread to the policy and associated parameters provided in policy and param, respectively.
- pthread_setschedparam.05
If _POSIX_THREAD_SPORADIC_SERVER is defined, then the policy argument may have the value SCHED_SPORADIC
- pthread_setschedparam.06
The sporadic server scheduling policy has the associated parameters sched_ss_low_priority, sched_ss_repl_period, sched_ss_init_budget, sched_priority, and sched_ss_max_repl.
- pthread_setschedparam.06.01
The specified sched_ss_repl_period shall be greater than or equal to the specified sched_ss_init_budget for the function to succeed; if it is not, then the function shall fail.
- pthread_setschedparam.06.02
The value of sched_ss_max_repl shall be within the inclusive range [1, {SS_REPL_MAX}] for the function to succeed; if not, the function shall fail.
- pthread_setschedparam.07
If the pthread_setschedparam() function fails, the scheduling parameters shall not be changed for the target thread.
- pthread_setschedparam.08.01
If successful, the pthread_getschedparam() and pthread_setschedparam() functions shall return zero
- pthread_setschedparam.08.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setschedparam.10
The pthread_setschedparam() function may fail if:
- pthread_setschedparam.10.01
[EINVAL] The value specified by policy or one of the scheduling parameters associated with the scheduling policy policy is invalid.
- pthread_setschedparam.10.02
[ENOTSUP] An attempt was made to set the policy or scheduling parameters to an unsupported value.
- pthread_setschedparam.10.03
[ENOTSUP] [TSP] An attempt was made to dynamically change the scheduling policy to SCHED_SPORADIC, and the implementation does not support this change.
- pthread_setschedparam.10.04
[EPERM] The caller does not have the appropriate permission to set either the scheduling parameters or the scheduling policy of the specified thread.
- pthread_setschedparam.10.05
[EPERM] The implementation does not allow the application to modify one of the parameters to the value specified.
- pthread_setschedparam.10.06
[ESRCH] The value specified by thread does not refer to a existing thread.
- pthread_setschedparam.11
These functions shall not return an error code of [EINTR].
- app.pthread_setschedparam.12
with the exception for the pthread_setschedparam() function that if the scheduling policy was not SCHED_SPORADIC at the time of the call, it is implementation-defined whether the function is supported; in other words, the implementation need not allow the application to dynamically change the scheduling policy to SCHED_SPORADIC
- [+]pthread_setschedprio (10 / 4 / 0)
- pthread_setschedprio.01
The pthread_setschedprio() function shall set the scheduling priority for the thread whose thread ID is given by thread to the value given by prio.
- pthread_setschedprio.02
If the pthread_setschedprio() function fails, the scheduling priority of the target thread shall not be changed.
- pthread_setschedprio.03.01
If successful, the pthread_setschedprio() function shall return zero
- pthread_setschedprio.03.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setschedprio.04
The pthread_setschedprio() function may fail if:
- pthread_setschedprio.04.01
[EINVAL] The value of prio is invalid for the scheduling policy of the specified thread.
- pthread_setschedprio.04.02
[ENOTSUP] An attempt was made to set the priority to an unsupported value.
- pthread_setschedprio.04.03
[EPERM] The caller does not have the appropriate permission to set the scheduling policy of the specified thread.
- pthread_setschedprio.04.04
[EPERM] The implementation does not allow the application to modify the priority to the value specified.
- pthread_setschedprio.04.05
[ESRCH] The value specified by thread does not refer to an existing thread.
- pthread_setschedprio.05
The pthread_setschedprio() function shall not return an error code of [EINTR].
- [+]pthread.sem (86 / 44 / 0)
- [+]sem_close (6 / 3 / 0)
- app.sem_close.01
The effects of calling sem_close() for an unnamed semaphore (one created by sem_init()) are undefined.
- sem_close.02
The sem_close() function shall deallocate (that is, make available for reuse by a subsequent sem_open() by this process) any system resources allocated by the system for use by this process for this semaphore.
- sem_close.03
If the semaphore has not been removed with a successful call to sem_unlink(), then sem_close() has no effect on the state of the semaphore.
- sem_close.04
If the sem_unlink() function has been successfully invoked for name after the most recent call to sem_open() with O_CREAT for this semaphore, then when all processes that have opened the semaphore close it, the semaphore is no longer accessible.
- sem_close.05.01
Upon successful completion, a value of zero shall be returned.
- sem_close.05.02
Otherwise, a value of -1 shall be returned and errno set to indicate the error.
- sem_close.06
The sem_close() function may fail if:
- sem_close.06.01
[EINVAL] The sem argument is not a valid semaphore descriptor.
- [+]sem_destroy (5 / 3 / 0)
- sem_destroy.01
The sem_destroy() function shall destroy the unnamed semaphore indicated by sem.
- app.sem_destroy.02
Only a semaphore that was created using sem_init() may be destroyed using sem_destroy(); the effect of calling sem_destroy() with a named semaphore is undefined.
- app.sem_destroy.03
The effect of subsequent use of the semaphore sem is undefined until sem is reinitialized by another call to sem_init().
- app.sem_destroy.04
It is safe to destroy an initialized semaphore upon which no threads are currently blocked. The effect of destroying a semaphore upon which other threads are currently blocked is undefined.
- sem_destroy.05.01
Upon successful completion, a value of zero shall be returned.
- sem_destroy.05.02
Otherwise, a value of -1 shall be returned and errno set to indicate the error.
- sem_destroy.06
The sem_destroy() function may fail if:
- sem_destroy.06.01
[EINVAL] The sem argument is not a valid semaphore.
- sem_destroy.06.02
[EBUSY] There are currently processes blocked on the semaphore.
- [+]sem_getvalue (5 / 4 / 0)
- sem_getvalue.01
The sem_getvalue() function shall update the location referenced by the sval argument to have the value of the semaphore referenced by sem without affecting the state of the semaphore. The updated value represents an actual semaphore value that occurred at some unspecified time during the call, but it need not be the actual value of the semaphore when it is returned to the calling process.
- sem_getvalue.02
If sem is locked, then the object to which sval points shall either be set to zero or to a negative number whose absolute value represents the number of processes waiting for the semaphore at some unspecified time during the call.
- sem_getvalue.03.01
Upon successful completion, the sem_getvalue() function shall return a value of zero.
- sem_getvalue.03.02
Otherwise, it shall return a value of -1 and set errno to indicate the error.
- sem_getvalue.04
The sem_getvalue() function may fail if:
- sem_getvalue.04.01
[EINVAL] The sem argument does not refer to a valid semaphore.
- [+]sem_init (10 / 4 / 0)
- sem_init.01
The sem_init() function shall initialize the unnamed semaphore referred to by sem.
- sem_init.02
The value of the initialized semaphore shall be value.
- sem_init.03
Following a successful call to sem_init(), the semaphore may be used in subsequent calls to sem_wait(), [TMO] sem_timedwait(), sem_trywait(), sem_post(), and sem_destroy(). This semaphore shall remain usable until the semaphore is destroyed.
- sem_init.04
If the pshared argument has a non-zero value, then the semaphore is shared between processes; in this case, any process that can access the semaphore sem can use sem for performing sem_wait(), [TMO] sem_timedwait(), sem_trywait(), sem_post(), and sem_destroy() operations.
- app.sem_init.05
Only sem itself may be used for performing synchronization. The result of referring to copies of sem in calls to sem_wait(), [TMO] sem_timedwait(), sem_trywait(), sem_post(), and sem_destroy() is undefined.
- sem_init.06
If the pshared argument is zero, then the semaphore is shared between threads of the process; any thread in this process can use sem for performing sem_wait(), [TMO] sem_timedwait(), sem_trywait(), sem_post(), and sem_destroy() operations.
- app.sem_init.07
The use of the semaphore by threads other than those created in the same process is undefined.
- app.sem_init.08
Attempting to initialize an already initialized semaphore results in undefined behavior.
- sem_init.09.01
Upon successful completion, the sem_init() function shall initialize the semaphore in sem.
- sem_init.09.02
Otherwise, it shall return -1 and set errno to indicate the error.
- sem_init.10
The sem_init() function shall fail if:
- sem_init.10.01
[EINVAL] The value argument exceeds {SEM_VALUE_MAX}.
- sem_init.10.02
[ENOSPC] A resource required to initialize the semaphore has been exhausted, or the limit on semaphores ( {SEM_NSEMS_MAX}) has been reached.
- sem_init.10.03
[EPERM] The process lacks the appropriate privileges to initialize the semaphore.
- [+]sem_open (21 / 9 / 0)
- sem_open.00
The sem_open() function shall establish a connection between a named semaphore and a process.
- sem_open.01
If O_CREAT is set and the semaphore already exists, then O_CREAT has no effect, except as noted under O_EXCL. Otherwise, sem_open() creates a named semaphore.
- app.sem_open.02
The O_CREAT flag requires a third and a fourth argument: mode, which is of type mode_t, and value, which is of type unsigned.
- sem_open.03
The semaphore is created with an initial value of value.
- app.sem_open.04
Valid initial values for semaphores are less than or equal to {SEM_VALUE_MAX}
- sem_open.05
the group ID of the semaphore is set to a system default group ID or to the effective group ID of the process.
- sem_open.05.01
The user ID of the semaphore is set to the effective user ID of the process;
- sem_open.06
The permission bits of the semaphore are set to the value of the mode argument except those set in the file mode creation mask of the process. When bits in mode other than the file permission bits are specified, the effect is unspecified.
- sem_open.07
After the semaphore named name has been created by sem_open() with the O_CREAT flag, other processes can connect to the semaphore by calling sem_open() with the same value of name.
- sem_open.08
If O_EXCL and O_CREAT are set, sem_open() fails if the semaphore name exists.
- app.sem_open.10
If flags other than O_CREAT and O_EXCL are specified in the oflag parameter, the effect is unspecified.
- sem_open.1000
Following a call to sem_open() with semaphore name name, the process may reference the semaphore associated with name using the address returned from the call. This semaphore may be used in subsequent calls to sem_wait(), [TMO] sem_timedwait(), sem_trywait(), sem_post(), and sem_close(). The semaphore remains usable by this process until the semaphore is closed by a successful call to sem_close(), _exit(), or one of the exec functions.
- sem_open.11
The check for the existence of the semaphore and the creation of the semaphore if it does not exist are atomic with respect to other processes executing sem_open() with O_EXCL and O_CREAT set.
- app.sem_open.12
The name argument conforms to the construction rules for a pathname.
- app.sem_open.13
If name begins with the slash character, then processes calling sem_open() with the same value of name shall refer to the same semaphore object, as long as that name has not been removed. If name does not begin with the slash character, the effect is implementation-defined.
- app.sem_open.14
The interpretation of slash characters other than the leading slash character in name is implementation-defined.
- sem_open.15
If a process makes multiple successful calls to sem_open() with the same value for name, the same semaphore address shall be returned for each such successful call, provided that there have been no calls to sem_unlink() for this semaphore, and at least one previous successful sem_open() call for this semaphore has not been matched with a sem_close() call.
- sem_open.16.01
Upon successful completion, the sem_open() function shall return the address of the semaphore.
- sem_open.16.02
Otherwise, it shall return a value of SEM_FAILED and set errno to indicate the error. The symbol SEM_FAILED is defined in the <semaphore.h> header. No successful return from sem_open() shall return the value SEM_FAILED.
- sem_open.17
If any of the following conditions occur, the sem_open() function shall return SEM_FAILED and set errno to the corresponding value:
- sem_open.17.01
[EACCES] The named semaphore exists and the permissions specified by oflag are denied, or the named semaphore does not exist and permission to create the named semaphore is denied.
- sem_open.17.02
[EEXIST] O_CREAT and O_EXCL are set and the named semaphore already exists.
- sem_open.17.03
[EINTR] The sem_open() operation was interrupted by a signal.
- sem_open.17.04
[EINVAL] The sem_open() operation is not supported for the given name, or O_CREAT was specified in oflag and value was greater than {SEM_VALUE_MAX}.
- sem_open.17.05
[EMFILE] Too many semaphore descriptors or file descriptors are currently in use by this process.
- sem_open.17.06
[ENAMETOOLONG] The length of the name argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- sem_open.17.07
[ENFILE] Too many semaphores are currently open in the system.
- sem_open.17.08
[ENOENT] O_CREAT is not set and the named semaphore does not exist.
- sem_open.17.09
[ENOSPC] There is insufficient space for the creation of the new named semaphore.
- app.sem_open.18
If O_EXCL is set and O_CREAT is not set, the effect is undefined.
- [+]sem_post (8 / 7 / 0)
- sem_post.01
If the semaphore value resulting from this operation is positive, then no threads were blocked waiting for the semaphore to become unlocked; the semaphore value is simply incremented.
- sem_post.02
If the value of the semaphore resulting from this operation is zero, then one of the threads blocked waiting for the semaphore shall be allowed to return successfully from its call to sem_wait().
- sem_post.03
If the Process Scheduling option is supported, the thread to be unblocked shall be chosen in a manner appropriate to the scheduling policies and parameters in effect for the blocked threads. In the case of the schedulers SCHED_FIFO and SCHED_RR, the highest priority waiting thread shall be unblocked, and if there is more than one highest priority thread blocked waiting for the semaphore, then the highest priority thread that has been waiting the longest shall be unblocked. If the Process Scheduling option is not defined, the choice of a thread to unblock is unspecified.
- sem_post.04
If the Process Sporadic Server option is supported, and the scheduling policy is SCHED_SPORADIC, the semantics are as per SCHED_FIFO above.
- sem_post.05
The sem_post() function shall be reentrant with respect to signals and may be invoked from a signal-catching function.
- sem_post.06.01
If successful, the sem_post() function shall return zero;
- sem_post.06.02
otherwise, the function shall return -1 and set errno to indicate the error.
- sem_post.07
The sem_post() function may fail if:
- sem_post.07.01
[EINVAL] The sem argument does not refer to a valid semaphore.
- [+]sem_timedwait (11 / 4 / 0)
- sem_timedwait.01
The sem_timedwait() function shall lock the semaphore referenced by sem as in the sem_wait() function. However, if the semaphore cannot be locked without waiting for another process or thread to unlock the semaphore by performing a sem_post() function, this wait shall be terminated when the specified timeout expires.
- sem_timedwait.02
The timeout shall expire when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), or if the absolute time specified by abs_timeout has already been passed at the time of the call.
- sem_timedwait.03
If the Timers option is supported, the timeout shall be based on the CLOCK_REALTIME clock. If the Timers option is not supported, the timeout shall be based on the system clock as returned by the time() function. The resolution of the timeout shall be the resolution of the clock on which it is based. The timespec data type is defined as a structure in the <time.h> header
- sem_timedwait.04
Under no circumstance shall the function fail with a timeout if the semaphore can be locked immediately. The validity of the abs_timeout need not be checked if the semaphore can be locked immediately.
- sem_timedwait.05.01
The sem_timedwait() function shall return zero if the calling process successfully performed the semaphore lock operation on the semaphore designated by sem.
- sem_timedwait.05.02
If the call was unsuccessful, the state of the semaphore shall be unchanged, and the function shall return a value of -1 and set errno to indicate the error.
- sem_timedwait.06
The sem_timedwait() function shall fail if:
- sem_timedwait.06.01
[EINVAL] The process or thread would have blocked, and the abs_timeout parameter specified a nanoseconds field value less than zero or greater than or equal to 1000 million.
- sem_timedwait.06.02
[ETIMEDOUT] The semaphore could not be locked before the specified timeout expired.
- sem_timedwait.07
The sem_timedwait() function may fail if:
- sem_timedwait.07.01
[EDEADLK] A deadlock condition was detected.
- sem_timedwait.07.02
[EINTR] A signal interrupted this function.
- sem_timedwait.07.03
[EINVAL] The sem argument does not refer to a valid semaphore.
- [+]sem_trywait (8 / 4 / 0)
- sem_trywait.01
The sem_trywait() function shall lock the semaphore referenced by sem only if the semaphore is currently not locked; that is, if the semaphore value is currently positive. Otherwise, it shall not lock the semaphore.
- sem_trywait.02
Upon successful return, the state of the semaphore shall be locked and shall remain locked until the sem_post() function is executed and returns successfully.
- sem_trywait.04.01
The sem_trywait() and sem_wait() functions shall return zero if the calling process successfully performed the semaphore lock operation on the semaphore designated by sem.
- sem_trywait.04.02
If the call was unsuccessful, the state of the semaphore shall be unchanged, and the function shall return a value of -1 and set errno to indicate the error.
- sem_trywait.05
The sem_trywait() and sem_wait() functions shall fail if:
- sem_trywait.05.01
[EAGAIN] The semaphore was already locked, so it cannot be immediately locked by the sem_trywait() operation ( sem_trywait() only).
- sem_trywait.06
The sem_trywait() and sem_wait() functions may fail if:
- sem_trywait.06.01
[EDEADLK] A deadlock condition was detected.
- sem_trywait.06.02
[EINTR] A signal interrupted this function.
- sem_trywait.06.03
[EINVAL] The sem argument does not refer to a valid semaphore.
- [+]sem_unlink (4 / 1 / 0)
- sem_unlink.01
The sem_unlink() function shall remove the semaphore named by the string name. If the semaphore named by name is currently referenced by other processes, then sem_unlink() shall have no effect on the state of the semaphore. If one or more processes have the semaphore open when sem_unlink() is called, destruction of the semaphore is postponed until all references to the semaphore have been destroyed by calls to sem_close(), _exit(), or exec.
- sem_unlink.02
Calls to sem_open() to recreate or reconnect to the semaphore refer to a new semaphore after sem_unlink() is called.
- sem_unlink.03
The sem_unlink() call shall not block until all references have been destroyed; it shall return immediately.
- sem_unlink.04
Upon successful completion, the sem_unlink() function shall return a value of 0. Otherwise, the semaphore shall not be changed and the function shall return a value of -1 and set errno to indicate the error.
- [+]sem_wait (8 / 5 / 0)
- sem_wait.01
The sem_wait() function shall lock the semaphore referenced by sem by performing a semaphore lock operation on that semaphore. If the semaphore value is currently zero, then the calling thread shall not return from the call to sem_wait() until it either locks the semaphore or the call is interrupted by a signal.
- sem_wait.02
Upon successful return, the state of the semaphore shall be locked and shall remain locked until the sem_post() function is executed and returns successfully.
- sem_wait.03
The sem_wait() function is interruptible by the delivery of a signal.
- sem_wait.04.01
The sem_trywait() and sem_wait() functions shall return zero if the calling process successfully performed the semaphore lock operation on the semaphore designated by sem.
- sem_wait.04.02
If the call was unsuccessful, the state of the semaphore shall be unchanged, and the function shall return a value of -1 and set errno to indicate the error.
- sem_wait.06
The sem_trywait() and sem_wait() functions may fail if:
- sem_wait.06.01
[EDEADLK] A deadlock condition was detected.
- sem_wait.06.02
[EINTR] A signal interrupted this function.
- sem_wait.06.03
[EINVAL] The sem argument does not refer to a valid semaphore.
- [+]pthread.tls (35 / 22 / 0)
- [+]pthread_getspecific (5 / 3 / 0)
- pthread_getspecific.01
The pthread_getspecific() function shall return the value currently bound to the specified key on behalf of the calling thread.
- pthread_getspecific.01.01
The pthread_getspecific() function shall return the thread-specific data value associated with the given key
- pthread_getspecific.01.02
If no thread-specific data value is associated with key, then the value NULL shall be returned.
- pthread_getspecific.03
These functions shall not return an error code of [EINTR].
- pthread_getspecific.04
Both pthread_getspecific() and pthread_setspecific() may be called from a thread-specific data destructor function.
- pthread_getspecific.05
A call to pthread_getspecific() for the thread-specific data key being destroyed shall return the value NULL, unless the value is changed (after the destructor starts) by a call to pthread_setspecific().
- app.pthread_getspecific.08
The effect of calling pthread_getspecific() or pthread_setspecific() with a key value not obtained from pthread_key_create() or after key has been deleted with pthread_key_delete() is undefined.
- [+]pthread_key_create (14 / 10 / 0)
- pthread_key_create.01
The pthread_key_create() function shall create a thread-specific data key visible to all threads in the process
- pthread_key_create.02
Upon key creation, the value NULL shall be associated with the new key in all active threads.
- pthread_key_create.04.01
If successful, the pthread_key_create() function shall store the newly created key value at *key and shall return zero
- pthread_key_create.04.02
Otherwise, an error number shall be returned to indicate the error.
- pthread_key_create.05
The pthread_key_create() function shall fail if:
- pthread_key_create.05.01
[EAGAIN] The system lacked the necessary resources to create another thread-specific data key, or the system-imposed limit on the total number of keys per process {PTHREAD_KEYS_MAX} has been exceeded.
- pthread_key_create.05.02
[ENOMEM] Insufficient memory exists to create the key.
- pthread_key_create.06
At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key,
- pthread_key_create.06.01
the value of the key is set to NULL,
- pthread_key_create.06.02.call_allowed
and then the function pointed to is called with the previously associated value as its sole argument.
- pthread_key_create.06.02.is_called
and then the function pointed to is called with the previously associated value as its sole argument.
- pthread_key_create.06.02.right_params
and then the function pointed to is called with the previously associated value as its sole argument.
- pthread_key_create.08.01
If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with associated destructors, then the process is repeated.
- pthread_key_create.08.02
If, after at least {PTHREAD_DESTRUCTOR_ITERATIONS} iterations of destructor calls for outstanding non-NULL values, there are still some non-NULL values with associated destructors, implementations may stop calling destructors, or they may continue calling destructors until no non-NULL values with associated destructors exist, even though this might result in an infinite loop.
- pthread_key_create.10
An optional destructor function may be associated with each key value.
- pthread_key_create.40
The pthread_key_create() function shall not return an error code of [EINTR].
- [+]pthread_key_delete (8 / 5 / 0)
- pthread_key_delete.01
The pthread_key_delete() function shall delete a thread-specific data key previously returned by pthread_key_create().
- app.pthread_key_delete.02
Any attempt to use key following the call to pthread_key_delete() results in undefined behavior.
- pthread_key_delete.03
No destructor functions shall be invoked by pthread_key_delete().
- pthread_key_delete.04
Any destructor function that may have been associated with key shall no longer be called upon thread exit.
- pthread_key_delete.05.01
If successful, the pthread_key_delete() function shall return zero
- pthread_key_delete.05.02
otherwise, an error number shall be returned to indicate the error.
- pthread_key_delete.06
The pthread_key_delete() function may fail if:
- pthread_key_delete.06.01
[EINVAL] The key value is invalid.
- pthread_key_delete.07
The pthread_key_delete() function shall not return an error code of [EINTR].
- pthread_key_delete.08
The pthread_key_delete() function shall be callable from within destructor functions.
- [+]pthread_setspecific (8 / 4 / 0)
- pthread_setspecific.01
The pthread_setspecific() function shall associate a thread-specific value with a key obtained via a previous call to pthread_key_create().
- pthread_setspecific.02
Different threads may bind different values to the same key.
Although the same key value may be used by different threads, the values bound to the key by pthread_setspecific() are maintained on a per-thread basis and persist for the life of the calling thread.
- pthread_setspecific.03
Both pthread_getspecific() and pthread_setspecific() may be called from a thread-specific data destructor function.
- pthread_setspecific.04.01
If successful, the pthread_setspecific() function shall return zero;
- pthread_setspecific.04.02
otherwise, an error number shall be returned to indicate the error.
- pthread_setspecific.05
The pthread_setspecific() function shall fail if:
- pthread_setspecific.05.01
[ENOMEM] Insufficient memory exists to associate the non-NULL value with the key.
- pthread_setspecific.06
The pthread_setspecific() function may fail if:
- pthread_setspecific.06.01
[EINVAL] The key value is invalid.
- pthread_setspecific.07
These functions shall not return an error code of [EINTR].
- app.pthread_setspecific.08
The effect of calling pthread_getspecific() or pthread_setspecific() with a key value not obtained from pthread_key_create() or after key has been deleted with pthread_key_delete() is undefined.
- app.pthread_setspecific.09
Calling pthread_setspecific() from a thread-specific data destructor routine may result either in lost storage (after at least PTHREAD_DESTRUCTOR_ITERATIONS attempts at destruction) or in an infinite loop.
- [+]signal.sigaction (128 / 39 / 0)
- [+]__libc_current_sigrtmax (1 / 1 / 0)
- __libc_current_sigrtmax.01
__libc_current_sigrtmax() returns the number of an available real-time signal with the lowest priority.
- [+]__libc_current_sigrtmin (1 / 1 / 0)
- __libc_current_sigrtmin.01
__libc_current_sigrtmin() returns the number of an available real-time signal with the highest priority.
- [+]__sysv_signal (13 / 4 / 0)
- app.__sysv_signal.01
Use of this function is unspecified in a multi-threaded process
- __sysv_signal.02 (struct)
The signal() function chooses one of three ways in which receipt of the signal number sig is to be subsequently handled.
- __sysv_signal.02.01 (struct)
If the value of func is SIG_DFL, default handling for that signal shall occur
- __sysv_signal.02.02
If the value of func is SIG_IGN, the signal shall be ignored
- __sysv_signal.02.03 (struct)
Otherwise, the application shall ensure that func points to a function to be called when that signal occurs. An invocation of such a function because of a signal, or (recursively) of any further functions called by that invocation (other than functions in the standard library), is called a "signal handler"
- __sysv_signal.03
When a signal occurs, and func points to a function
- __sysv_signal.03.01
it is implementation-defined whether the equivalent of a:signal(sig, SIG_DFL);is executed or the implementation prevents some implementation-defined set of signals (at least including sig) from occurring until the current signal handling has completed.
- __sysv_signal.03.02
(If the value of sig is SIGILL, the implementation may alternatively define that no action is taken.)
- __sysv_signal.03.03 (struct)
Next the equivalent of:(*func)(sig);is executed.
- __sysv_signal.04
If and when the function returns
- __sysv_signal.04.01
if the value of sig was SIGFPE, SIGILL, or SIGSEGV or any other implementation-defined value corresponding to a computational exception, the behavior is undefined
- __sysv_signal.04.02
Otherwise, the program shall resume execution at the point it was interrupted.
- __sysv_signal.05
If the signal occurs as the result of calling the abort(), raise(), [CX] kill(), pthread_kill(), or sigqueue() function, the signal handler shall not call the raise() function
- __sysv_signal.06
If the signal occurs other than as the result of calling abort(), raise(), [CX] kill(), pthread_kill(), or sigqueue(),
- __sysv_signal.06.01
the behavior is undefined if the signal handler refers to any object with static storage duration other than by assigning a value to an object declared as volatile sig_atomic_t, or if the signal handler calls any function in the standard library other than one of the functions listed in Signal Concepts
- __sysv_signal.06.02
Furthermore, if such a call fails, the value of errno is unspecified
- __sysv_signal.07
If the request can be honored, signal() shall return the value of func for the most recent call to signal() for the specified signal sig
- __sysv_signal.08
Otherwise, SIG_ERR shall be returned and a positive value shall be stored in errno
- __sysv_signal.09
The signal() function shall fail if
- __sysv_signal.09.01
[EINVAL] [CX] The sig argument is not a valid signal number or an attempt is made to catch a signal that cannot be caught or ignore a signal that cannot be ignored.
- __sysv_signal.10
The signal() function may fail if
- __sysv_signal.10.01
[EINVAL] [CX] An attempt was made to set the action to SIG_DFL for a signal that cannot be caught or ignored (or both).
- __sysv_signal.11
__sysv_signal() has the same behavior as signal()
Generalizes:
- __sysv_signal.02.01
- __sysv_signal.02.02
- __sysv_signal.02.03
- __sysv_signal.03.01
- __sysv_signal.03.02
- __sysv_signal.03.03
- __sysv_signal.04.01
- __sysv_signal.04.02
- __sysv_signal.05
- __sysv_signal.06.01
- __sysv_signal.06.02
- __sysv_signal.07
- __sysv_signal.08
- __sysv_signal.09.01
- __sysv_signal.10.01
- [+]bsd_signal (6 / 3 / 0)
- bsd_signal.01
The function call bsd_signal(sig, func) shall be equivalent to the following:void (*bsd_signal(int sig, void (*func)(int)))(int){ struct sigaction act, oact;
act.sa_handler = func; act.sa_flags = SA_RESTART; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, sig); if (sigaction(sig, &act, &oact) == -1) return(SIG_ERR); return(oact.sa_handler);}
- app.bsd_signal.02 (struct)
The handler function should be declared:void handler(int sig);
- app.bsd_signal.03 (struct)
The behavior is undefined if func is a function that takes more than one argument, or an argument of a different type
- bsd_signal.04
Upon successful completion, bsd_signal() shall return the previous action for sig
- bsd_signal.05
Otherwise, SIG_ERR shall be returned and errno shall be set to indicate the error.
- bsd_signal.39
The sigaction() function shall fail if:
- bsd_signal.39.01
[EINVAL] The sig argument is not a valid signal number or an attempt is made to catch a signal that cannot be caught or ignore a signal that cannot be ignored.
- bsd_signal.39.02
[ENOTSUP] The SA_SIGINFO bit flag is set in the sa_flags field of the sigaction structure, and the implementation does not support either the Realtime Signals Extension option, or the XSI Extension option.
- bsd_signal.40
The sigaction() function may fail if:
- bsd_signal.40.01
[EINVAL] An attempt was made to set the action to SIG_DFL for a signal that cannot be caught or ignored (or both).
- [+]pause (5 / 0 / 0)
- pause.01
The pause() function shall suspend the calling thread until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process.
Generalizes:
- pause.02
- pause.03
- pause.04
- pause.05
- pause.06.01
- pause.02 (struct)
If the action is to terminate the process, pause() shall not return
- pause.03
If the action is to execute a signal-catching function, pause() shall return after the signal-catching function returns
- pause.04
Since pause() suspends thread execution indefinitely unless interrupted by a signal, there is no successful completion return value
- pause.05
A value of -1 shall be returned and errno set to indicate the error.
- pause.06
The pause() function shall fail if:
- pause.06.01
[EINTR] A signal is caught by the calling process and control is returned from the signal-catching function.
- [+]pthread_sigmask (15 / 3 / 0)
- pthread_sigmask.01
[THR] The pthread_sigmask() function shall examine or change (or both) the calling thread's signal mask, regardless of the number of threads in the process.The function shall be equivalent to sigprocmask(), without the restriction that the call be made in a single-threaded process.
Generalizes:
- pthread_sigmask.02
- pthread_sigmask.03
- pthread_sigmask.04.01
- pthread_sigmask.04.02
- pthread_sigmask.04.03
- pthread_sigmask.05
- pthread_sigmask.06
- pthread_sigmask.07
- pthread_sigmask.08
- pthread_sigmask.10
- pthread_sigmask.11
- pthread_sigmask.12
- pthread_sigmask.14.01
- pthread_sigmask.15
- pthread_sigmask.16
- pthread_sigmask.02
In a single-threaded process, the sigprocmask() function shall examine or change (or both) the signal mask of the calling thread.
Generalizes:
- pthread_sigmask.01
- pthread_sigmask.03
- pthread_sigmask.04.01
- pthread_sigmask.04.02
- pthread_sigmask.04.03
- pthread_sigmask.05
- pthread_sigmask.06
- pthread_sigmask.07
- pthread_sigmask.08
- pthread_sigmask.10
- pthread_sigmask.11
- pthread_sigmask.12
- pthread_sigmask.14.01
- pthread_sigmask.15
- pthread_sigmask.16
- pthread_sigmask.03 (struct)
If the argument set is not a null pointer, it points to a set of signals to be used to change the currently blocked set.
- pthread_sigmask.04
The argument how indicates the way in which the set is changed, and the application shall ensure it consists of one of the following values:
- pthread_sigmask.04.01
SIG_BLOCK The resulting set shall be the union of the current set and the signal set pointed to by set.
- pthread_sigmask.04.02
SIG_SETMASK The resulting set shall be the signal set pointed to by set.
- pthread_sigmask.04.03
SIG_UNBLOCK The resulting set shall be the intersection of the current set and the complement of the signal set pointed to by set.
- pthread_sigmask.05
If the argument oset is not a null pointer, the previous mask shall be stored in the location pointed to by oset
- pthread_sigmask.06
If set is a null pointer, the value of the argument how is not significant and the thread's signal mask shall be unchanged
- pthread_sigmask.07
If there are any pending unblocked signals after the call to sigprocmask(), at least one of those signals shall be delivered before the call to sigprocmask() returns.
- pthread_sigmask.08
It is not possible to block those signals which cannot be ignored. This shall be enforced by the system without causing an error to be indicated.
- app.pthread_sigmask.09
If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless the signal was generated by the kill() function, the sigqueue() function, or the raise() function
- pthread_sigmask.10
If sigprocmask() fails, the thread's signal mask shall not be changed
- pthread_sigmask.11
Upon successful completion pthread_sigmask() shall return 0
- pthread_sigmask.12
otherwise, it shall return the corresponding error number
- pthread_sigmask.14
The pthread_sigmask() and sigprocmask() functions shall fail if:
- pthread_sigmask.14.01
[EINVAL] The value of the how argument is not equal to one of the defined values.
- pthread_sigmask.15
The pthread_sigmask() function shall not return an error code of [EINTR]
- pthread_sigmask.16
When multiple unblocked signals, all in the range SIGRTMIN to SIGRTMAX, are pending, the behavior shall be as if the implementation delivers the pending unblocked signal with the lowest signal number within that range.
- [+]sigaction (32 / 10 / 0)
- sigaction.01
The sigaction() function allows the calling process to examine and/or specify the action to be associated with a specific signal. The argument sig specifies the signal; acceptable values are defined in <signal.h>.
- app.sigaction.02
The storage occupied by sa_handler and sa_sigaction may overlap, and a conforming application shall not use both simultaneously.
- sigaction.03
If the argument act is not a null pointer, it points to a structure specifying the action to be associated with the specified signal
- sigaction.04
If the argument oact is not a null pointer, the action previously associated with the signal is stored in the location pointed to by the argument oact
- sigaction.05
If the argument act is a null pointer, signal handling is unchanged
- sigaction.06
The SIGKILL and SIGSTOP
- sigaction.06.01
signals shall not be added to the signal mask using this mechanism
- sigaction.06.02 (struct)
this restriction shall be enforced by the system without causing an error to be indicated.
- sigaction.08 (struct)
If the SA_SIGINFO flag (see below) is cleared in the sa_flags field of the sigaction structure, the sa_handler field identifies the action to be associated with the specified signal
- sigaction.09 (struct)
If the SA_SIGINFO flag is set in the sa_flags field, and the implementation supports the Realtime Signals Extension option or the XSI Extension option, the sa_sigaction field specifies a signal-catching function
- sigaction.10
SA_NOCLDSTOP
- sigaction.10.01
If sig is SIGCHLD and the SA_NOCLDSTOP flag is not set in sa_flags, and the implementation supports the SIGCHLD signal, then a SIGCHLD signal shall be generated for the calling process whenever any of its child processes stop
- sigaction.10.02
and a SIGCHLD signal may be generated for the calling process whenever any of its stopped child processes are continued.
- sigaction.11
If sig is SIGCHLD and the SA_NOCLDSTOP flag is set in sa_flags, then the implementation shall not generate a SIGCHLD signal in this way
- sigaction.12
SA_ONSTACK
- sigaction.12.01
If set and an alternate signal stack has been declared with sigaltstack(), the signal shall be delivered to the calling process on that stack
- sigaction.12.02
Otherwise, the signal shall be delivered on the current stack
- sigaction.14
SA_RESETHAND
- sigaction.14.01
If set, the disposition of the signal shall be reset to SIG_DFL and the SA_SIGINFO flag shall be cleared on entry to the signal handler
- sigaction.14.02
SIGILL and SIGTRAP cannot be automatically reset when delivered; the system silently enforces this restriction
- sigaction.14.03
Otherwise, the disposition of the signal shall not be modified on entry to the signal handler
- sigaction.14.04
In addition, if this flag is set, sigaction() behaves as if the SA_NODEFER flag were also set
- sigaction.18
SA_RESTART
- sigaction.18.01 (struct)
This flag affects the behavior of interruptible functions; that is, those specified to fail with errno set to [EINTR]. If set, and a function specified as interruptible is interrupted by this signal, the function shall restart and shall not fail with [EINTR] unless otherwise specified
- sigaction.18.02 (struct)
If the flag is not set, interruptible functions interrupted by this signal shall fail with errno set to [EINTR]
- sigaction.20
SA_SIGINFO
- sigaction.20.01 (struct)
If cleared and the signal is caught, the signal-catching function shall be entered as: void func(int signo);where signo is the only argument to the signal-catching function. In this case, the application shall use the sa_handler member to describe the signal-catching function and the application shall not modify the sa_sigaction member.
- sigaction.21
[XSI|RTS] If SA_SIGINFO is set and the signal is caught, the signal-catching function shall be entered as:void func(int signo, siginfo_t *info, void *context);where two additional arguments are passed to the signal-catching function. The second argument shall point to an object of type siginfo_t explaining the reason why the signal was generated; the third argument can be cast to a pointer to an object of type ucontext_t to refer to the receiving thread's context that was interrupted when the signal was delivered. In this case, the application shall use the sa_sigaction member to describe the signal-catching function and the application shall not modify the sa_handler member.
- sigaction.22
The si_signo member contains the system-generated signal number. [XSI] The si_errno member may contain implementation-defined additional error information; if non-zero, it contains an error number identifying the condition that caused the signal to be generated. [XSI|RTS] The si_code member contains a code identifying the cause of the signal. [XSI] If the value of si_code is less than or equal to 0, then the signal was generated by a process and si_pid and si_uid, respectively, indicate the process ID and the real user ID of the sender. The <signal.h> header description contains information about the signal-specific contents of the elements of the siginfo_t type.
- sigaction.23
SA_NOCLDWAIT
- sigaction.23.01
If set, and sig equals SIGCHLD, child processes of the calling processes shall not be transformed into zombie processes when they terminate. If the calling process subsequently waits for its children, and the process has no unwaited-for children that were transformed into zombie processes, it shall block until all of its children terminate, and wait(), waitid(), and waitpid() shall fail and set errno to [ECHILD]
- sigaction.23.02
Otherwise, terminating child processes shall be transformed into zombie processes, unless SIGCHLD is set to SIG_IGN.
- sigaction.25
SA_NODEFER
- sigaction.25.01
If set and sig is caught, sig shall not be added to the thread's signal mask on entry to the signal handler unless it is included in sa_mask
- sigaction.25.02
Otherwise, sig shall always be added to the thread's signal mask on entry to the signal handler
- sigaction.27
When a signal is caught by a signal-catching function installed by sigaction(), a new signal mask is calculated and installed for the duration of the signal-catching function (or until a call to either sigprocmask() or sigsuspend() is made). This mask is formed by taking the union of the current signal mask and the value of the sa_mask for the signal being delivered [XSI] unless SA_NODEFER or SA_RESETHAND is set, and then including the signal being delivered.
- sigaction.28
If and when the user's signal handler returns normally, the original signal mask is restored
- sigaction.29
Once an action is installed for a specific signal, it shall remain installed until another action is explicitly requested (by another call to sigaction()), [XSI] until the SA_RESETHAND flag causes resetting of the handler, or until one of the exec functions is called
- sigaction.30 (struct)
If the previous action for sig had been established by signal(), the values of the fields returned in the structure pointed to by oact are unspecified, and in particular oact-> sa_handler is not necessarily the same value passed to signal(). However, if a pointer to the same structure or a copy thereof is passed to a subsequent call to sigaction() via the act argument, handling of the signal shall be as if the original call to signal() were repeated
- sigaction.31
If sigaction() fails, no new signal handler is installed
- sigaction.32
It is unspecified whether an attempt to set the action for a signal that cannot be caught or ignored to SIG_DFL is ignored or causes an error to be returned with errno set to [EINVAL].
- app.sigaction.33
If SA_SIGINFO is not set in sa_flags, then the disposition of subsequent occurrences of sig when it is already pending is implementation-defined
- sigaction.34 (struct)
the signal-catching function shall be invoked with a single argument.
- sigaction.35 (struct)
If the implementation supports the Realtime Signals Extension option, and if SA_SIGINFO is set in sa_flags, then subsequent occurrences of sig generated by sigqueue() or as a result of any signal-generating function that supports the specification of an application-defined value (when sig is already pending) shall be queued in FIFO order until delivered or accepted; the signal-catching function shall be invoked with three arguments. The application specified value is passed to the signal-catching function as the si_value member of the siginfo_t structure.
- app.sigaction.36
The result of the use of sigaction() and a sigwait() function concurrently within a process on the same signal is unspecified.
- sigaction.37
Upon successful completion, sigaction() shall return 0
Generalizes:
- sigaction.01
- sigaction.03
- sigaction.04
- sigaction.05
- sigaction.06.01
- sigaction.06.02
- sigaction.08
- sigaction.09
- sigaction.10.01
- sigaction.10.02
- sigaction.11
- sigaction.12.01
- sigaction.12.02
- sigaction.14.01
- sigaction.14.02
- sigaction.14.03
- sigaction.14.04
- sigaction.18.01
- sigaction.18.02
- sigaction.20.01
- sigaction.21
- sigaction.22
- sigaction.23.01
- sigaction.23.02
- sigaction.25.01
- sigaction.25.02
- sigaction.27
- sigaction.28
- sigaction.29
- sigaction.30
- sigaction.31
- sigaction.32
- sigaction.34
- sigaction.35
- sigaction.38
- sigaction.39.01
- sigaction.39.02
- sigaction.40.01
- sigaction.41.01
- sigaction.41.02
- sigaction.38
otherwise, -1 shall be returned, errno shall be set to indicate the error, and no new signal-catching function shall be installed
- sigaction.39
The sigaction() function shall fail if:
- sigaction.39.01
[EINVAL] The sig argument is not a valid signal number or an attempt is made to catch a signal that cannot be caught or ignore a signal that cannot be ignored.
- sigaction.39.02
[ENOTSUP] The SA_SIGINFO bit flag is set in the sa_flags field of the sigaction structure, and the implementation does not support either the Realtime Signals Extension option, or the XSI Extension option.
- sigaction.40
The sigaction() function may fail if:
- sigaction.40.01
[EINVAL] An attempt was made to set the action to SIG_DFL for a signal that cannot be caught or ignored (or both).
- sigaction.41
Setting a signal action to SIG_DFL for a signal that is pending, and whose default action is to ignore the signal
- sigaction.41.01
shall cause the pending signal to be discarded, whether or not it is blocked.
- sigaction.41.02
If the Realtime Signals Extension option is supported, any queued values pending shall be discarded and the resources used to queue them shall be released and returned to the system for other use.
- [+]sigaltstack (14 / 2 / 0)
- sigaltstack.01
The sigaltstack() function allows a process to define and examine the state of an alternate stack for signal handlers for the current thread.
Generalizes:
- sigaltstack.02
- sigaltstack.03
- sigaltstack.04.01
- sigaltstack.04.02
- sigaltstack.05
- sigaltstack.06
- sigaltstack.07
- sigaltstack.08
- sigaltstack.09.01
- sigaltstack.09.02
- sigaltstack.10
- sigaltstack.11
- sigaltstack.12
- sigaltstack.13
- sigaltstack.14
- sigaltstack.15
- sigaltstack.17
- sigaltstack.18
- sigaltstack.19.01
- sigaltstack.19.02
- sigaltstack.19.03
- sigaltstack.02
Signals that have been explicitly declared to execute on the alternate stack shall be delivered on the alternate stack
- sigaltstack.03 (struct)
If ss is not a null pointer, it points to a stack_t structure that specifies the alternate signal stack that shall take effect upon return from sigaltstack().
- sigaltstack.04
The ss_flags member specifies the new stack state
- sigaltstack.04.01 (struct)
If it is set to SS_DISABLE, the stack is disabled and ss_sp and ss_size are ignored
- sigaltstack.04.02 (struct)
Otherwise, the stack shall be enabled, and the ss_sp and ss_size members specify the new address and size of the stack
- sigaltstack.05 (struct)
The range of addresses starting at ss_sp up to but not including ss_sp+ ss_size is available to the implementation for use as the stack.
- sigaltstack.06 (struct)
This function makes no assumptions regarding which end is the stack base and in which direction the stack grows as items are pushed.
- sigaltstack.07
If oss is not a null pointer, on successful completion it shall point to a stack_t structure that specifies the alternate signal stack that was in effect prior to the call to sigaltstack()
- sigaltstack.08 (struct)
The ss_sp and ss_size members specify the address and size of that stack
- sigaltstack.09
The ss_flags member specifies the stack's state, and may contain one of the following values
- sigaltstack.09.01
SS_ONSTACK The process is currently executing on the alternate signal stack. Attempts to modify the alternate signal stack while the process is executing on it fail. This flag shall not be modified by processes.
- sigaltstack.09.02 (struct)
SS_DISABLE The alternate signal stack is currently disabled.
- sigaltstack.10
The value SIGSTKSZ is a system default specifying the number of bytes that would be used to cover the usual case when manually allocating an alternate stack area
- sigaltstack.11
The value MINSIGSTKSZ is defined to be the minimum stack size for a signal handler
- sigaltstack.12
In computing an alternate stack size, a program should add that amount to its stack requirements to allow for the system implementation overhead
- sigaltstack.13 (struct)
The constants SS_ONSTACK, SS_DISABLE, SIGSTKSZ, and MINSIGSTKSZ are defined in <signal.h>.
- sigaltstack.14
After a successful call to one of the exec functions, there are no alternate signal stacks in the new process image
- sigaltstack.15
In some implementations, a signal (whether or not indicated to execute on the alternate stack) shall always execute on the alternate stack if it is delivered while another signal is being caught using the alternate stack.
- app.sigaltstack.16
Use of this function by library threads that are not bound to kernel-scheduled entities results in undefined behavior.
- sigaltstack.17
Upon successful completion, sigaltstack() shall return 0
- sigaltstack.18
otherwise, it shall return -1 and set errno to indicate the error
- sigaltstack.19
The sigaltstack() function shall fail if
- sigaltstack.19.01
[EINVAL] The ss argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE.
- sigaltstack.19.02
[ENOMEM] The size of the alternate stack area is less than MINSIGSTKSZ.
- sigaltstack.19.03
[EPERM] An attempt was made to modify an active stack.
- [+]siginterrupt (4 / 3 / 0)
- siginterrupt.01
The siginterrupt() function shall change the restart behavior when a function is interrupted by the specified signal. The function siginterrupt(sig, flag) has an effect as if implemented as:int siginterrupt(int sig, int flag) { int ret; struct sigaction act;
(void) sigaction(sig, NULL, &act); if (flag) act.sa_flags &= ~SA_RESTART; else act.sa_flags |= SA_RESTART; ret = sigaction(sig, &act, NULL); return ret;}
- siginterrupt.02
Upon successful completion, siginterrupt() shall return 0
- siginterrupt.03
otherwise, -1 shall be returned and errno set to indicate the error
- siginterrupt.04
The siginterrupt() function shall fail if
- siginterrupt.04.01
[EINVAL] The sig argument is not a valid signal number.
- [+]signal (12 / 4 / 0)
- app.signal.01
Use of this function is unspecified in a multi-threaded process
- signal.02 (struct)
The signal() function chooses one of three ways in which receipt of the signal number sig is to be subsequently handled.
- signal.02.01 (struct)
If the value of func is SIG_DFL, default handling for that signal shall occur
- signal.02.02
If the value of func is SIG_IGN, the signal shall be ignored
- signal.02.03 (struct)
Otherwise, the application shall ensure that func points to a function to be called when that signal occurs. An invocation of such a function because of a signal, or (recursively) of any further functions called by that invocation (other than functions in the standard library), is called a "signal handler"
- signal.03
When a signal occurs, and func points to a function
- signal.03.01
it is implementation-defined whether the equivalent of a:signal(sig, SIG_DFL);is executed or the implementation prevents some implementation-defined set of signals (at least including sig) from occurring until the current signal handling has completed.
- signal.03.02
(If the value of sig is SIGILL, the implementation may alternatively define that no action is taken.)
- signal.03.03 (struct)
Next the equivalent of:(*func)(sig);is executed.
- signal.04
If and when the function returns
- signal.04.01
if the value of sig was SIGFPE, SIGILL, or SIGSEGV or any other implementation-defined value corresponding to a computational exception, the behavior is undefined
- signal.04.02
Otherwise, the program shall resume execution at the point it was interrupted.
- signal.05
If the signal occurs as the result of calling the abort(), raise(), [CX] kill(), pthread_kill(), or sigqueue() function, the signal handler shall not call the raise() function
- signal.06
If the signal occurs other than as the result of calling abort(), raise(), [CX] kill(), pthread_kill(), or sigqueue(),
- signal.06.01
the behavior is undefined if the signal handler refers to any object with static storage duration other than by assigning a value to an object declared as volatile sig_atomic_t, or if the signal handler calls any function in the standard library other than one of the functions listed in Signal Concepts
- signal.06.02
Furthermore, if such a call fails, the value of errno is unspecified
- signal.07
If the request can be honored, signal() shall return the value of func for the most recent call to signal() for the specified signal sig
- signal.08
Otherwise, SIG_ERR shall be returned and a positive value shall be stored in errno
- signal.09
The signal() function shall fail if
- signal.09.01
[EINVAL] [CX] The sig argument is not a valid signal number or an attempt is made to catch a signal that cannot be caught or ignore a signal that cannot be ignored.
- signal.10
The signal() function may fail if
- signal.10.01
[EINVAL] [CX] An attempt was made to set the action to SIG_DFL for a signal that cannot be caught or ignored (or both).
- [+]sigpending (2 / 2 / 0)
- sigpending.01 (struct)
The sigpending() function shall store, in the location referenced by the set argument, the set of signals that are blocked from delivery to the calling thread and that are pending on the process or the calling thread
- sigpending.02
Upon successful completion, sigpending() shall return 0
- sigpending.03
otherwise, -1 shall be returned and errno set to indicate the error
- [+]sigprocmask (13 / 6 / 0)
- sigprocmask.02
In a single-threaded process, the sigprocmask() function shall examine or change (or both) the signal mask of the calling thread.
Generalizes:
- sigprocmask.03
- sigprocmask.04.01
- sigprocmask.04.02
- sigprocmask.04.03
- sigprocmask.05
- sigprocmask.06
- sigprocmask.07
- sigprocmask.08
- sigprocmask.10
- sigprocmask.12
- sigprocmask.13
- sigprocmask.14.01
- sigprocmask.16
- sigprocmask.03 (struct)
If the argument set is not a null pointer, it points to a set of signals to be used to change the currently blocked set.
- sigprocmask.04
The argument how indicates the way in which the set is changed, and the application shall ensure it consists of one of the following values:
- sigprocmask.04.01
SIG_BLOCK The resulting set shall be the union of the current set and the signal set pointed to by set.
- sigprocmask.04.02
SIG_SETMASK The resulting set shall be the signal set pointed to by set.
- sigprocmask.04.03
SIG_UNBLOCK The resulting set shall be the intersection of the current set and the complement of the signal set pointed to by set.
- sigprocmask.05
If the argument oset is not a null pointer, the previous mask shall be stored in the location pointed to by oset
- sigprocmask.06
If set is a null pointer, the value of the argument how is not significant and the thread's signal mask shall be unchanged
- sigprocmask.07
If there are any pending unblocked signals after the call to sigprocmask(), at least one of those signals shall be delivered before the call to sigprocmask() returns.
- sigprocmask.08
It is not possible to block those signals which cannot be ignored. This shall be enforced by the system without causing an error to be indicated.
- app.sigprocmask.09
If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless the signal was generated by the kill() function, the sigqueue() function, or the raise() function
- sigprocmask.10
If sigprocmask() fails, the thread's signal mask shall not be changed
- app.sigprocmask.11
The use of the sigprocmask() function is unspecified in a multi-threaded process
- sigprocmask.12
Upon successful completion, sigprocmask() shall return 0
- sigprocmask.13
otherwise, -1 shall be returned, errno shall be set to indicate the error, and the process' signal mask shall be unchanged.
- sigprocmask.14
The pthread_sigmask() and sigprocmask() functions shall fail if:
- sigprocmask.14.01
[EINVAL] The value of the how argument is not equal to one of the defined values.
- sigprocmask.16
When multiple unblocked signals, all in the range SIGRTMIN to SIGRTMAX, are pending, the behavior shall be as if the implementation delivers the pending unblocked signal with the lowest signal number within that range.
- [+]sigreturn (2 / 0 / 0)
- sigreturn.01
The sigreturn() function is used by the system to cleanup after a signal handler has returned.
- sigreturn.02
This function is not in the source standard; it is only in the binary standard.
- [+]sigsuspend (8 / 0 / 0)
- sigsuspend.01
The sigsuspend() function shall replace the current signal mask of the calling thread with the set of signals pointed to by sigmask and then suspend the thread until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process
Generalizes:
- sigsuspend.02
- sigsuspend.03
- sigsuspend.04.01
- sigsuspend.04.02
- sigsuspend.05
- sigsuspend.06
- sigsuspend.07
- sigsuspend.08.01
- sigsuspend.02
This shall not cause any other signals that may have been pending on the process to become pending on the thread.
- sigsuspend.03 (struct)
If the action is to terminate the process then sigsuspend() shall never return
- sigsuspend.04
If the action is to execute a signal-catching function
- sigsuspend.04.01
then sigsuspend() shall return after the signal-catching function returns
- sigsuspend.04.02
with the signal mask restored to the set that existed prior to the sigsuspend() call
- sigsuspend.05
It is not possible to block signals that cannot be ignored. This is enforced by the system without causing an error to be indicated
- sigsuspend.06
Since sigsuspend() suspends thread execution indefinitely, there is no successful completion return value
- sigsuspend.07
If a return occurs, -1 shall be returned and errno set to indicate the error.
- sigsuspend.08
The sigsuspend() function shall fail if
- sigsuspend.08.01
[EINTR] A signal is caught by the calling process and control is returned from the signal-catching function.
- [+]signal.sigctrl (29 / 12 / 0)
- [+]sighold (4 / 3 / 0)
- app.sighold.01
Use of any of these functions is unspecified in a multi-threaded process.
- sighold.02
The sighold() function shall add sig to the calling process' signal mask
- sighold.03
For all other functions, upon successful completion, 0 shall be returned
- sighold.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- sighold.10
These functions shall fail if:
- sighold.10.01
[EINVAL] The sig argument is an illegal signal number.
- [+]sigignore (5 / 3 / 0)
- app.sigignore.01
Use of any of these functions is unspecified in a multi-threaded process.
- sigignore.02
The sigignore() function shall set the disposition of sig to SIG_IGN
- sigignore.03
For all other functions, upon successful completion, 0 shall be returned
- sigignore.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- sigignore.10
These functions shall fail if:
- sigignore.10.01
[EINVAL] The sig argument is an illegal signal number.
- sigignore.11
The sigset() and sigignore() functions shall fail if:
- sigignore.11.01
[EINVAL] An attempt is made to catch a signal that cannot be caught, or to ignore a signal that cannot be ignored.
- [+]sigpause (6 / 1 / 0)
- app.sigpause.01
Use of any of these functions is unspecified in a multi-threaded process.
- sigpause.02
The sigpause() function shall
- sigpause.02.01
remove sig from the calling process' signal mask
- sigpause.02.02
suspend the calling process until a signal is received
- sigpause.03
The sigpause() function shall restore the process' signal mask to its original state before returning
- sigpause.04
The sigpause() function shall suspend execution of the thread until a signal is received
- sigpause.05
whereupon it shall return -1 and set errno to [EINTR].
- sigpause.10
These functions shall fail if:
- sigpause.10.01
[EINVAL] The sig argument is an illegal signal number.
- [+]sigrelse (4 / 3 / 0)
- app.sigrelse.01
Use of any of these functions is unspecified in a multi-threaded process.
- sigrelse.02
The sigrelse() function shall remove sig from the calling process' signal mask
- sigrelse.03
For all other functions, upon successful completion, 0 shall be returned
- sigrelse.04
Otherwise, -1 shall be returned and errno set to indicate the error.
- sigrelse.10
These functions shall fail if:
- sigrelse.10.01
[EINVAL] The sig argument is an illegal signal number.
- [+]sigset (10 / 2 / 0)
- app.sigset.01
Use of any of these functions is unspecified in a multi-threaded process.
- sigset.02
The sigset() function shall modify signal dispositions
- sigset.02.01
The disp argument specifies the signal's disposition, which may be SIG_DFL, SIG_IGN, or the address of a signal handler
- app.sigset.03
The sig argument specifies the signal, which may be any signal except SIGKILL and SIGSTOP
- sigset.04
If sigset() is used, and disp is the address of a signal handler, the system shall add sig to the calling process' signal mask before executing the signal handler
- sigset.05
when the signal handler returns, the system shall restore the calling process' signal mask to its state prior to the delivery of the signal
- sigset.06
In addition, if sigset() is used, and disp is equal to SIG_HOLD, sig shall be added to the calling process' signal mask and sig's disposition shall remain unchanged
- sigset.07
If sigset() is used, and disp is not equal to SIG_HOLD, sig shall be removed from the calling process' signal mask
- sigset.08
Upon successful completion, sigset() shall return
- sigset.08.01
SIG_HOLD if the signal had been blocked
- sigset.08.02
the signal's previous disposition if it had not been blocked
- sigset.09
Otherwise, SIG_ERR shall be returned and errno set to indicate the error
- sigset.10
These functions shall fail if:
- sigset.10.01
[EINVAL] The sig argument is an illegal signal number.
- sigset.11
The sigset() and sigignore() functions shall fail if:
- sigset.11.01
[EINVAL] An attempt is made to catch a signal that cannot be caught, or to ignore a signal that cannot be ignored.
- [+]signal.sigsend (65 / 15 / 0)
- [+]kill (20 / 5 / 0)
- kill.01
The kill() function shall send a signal to a process or a group of processes specified by pid.
Generalizes:
- kill.02
- kill.03
- kill.04
- kill.05
- kill.06.01
- kill.06.02
- kill.07
- kill.08
- kill.09
- kill.10
- kill.11.01
- kill.11.02
- kill.12
- kill.13
- kill.14.01
- kill.14.02
- kill.14.03
- kill.15
- kill.16
- kill.02
If sig is 0 (the null signal), error checking is performed but no signal is actually sent.
- kill.03
For a process to have permission to send a signal to a process designated by pid, unless the sending process has appropriate privileges, the real or effective user ID of the sending process shall match the real or saved set-user-ID of the receiving process.
- kill.04
If pid is greater than 0, sig shall be sent to the process whose process ID is equal to pid.
- kill.05
If pid is 0, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the process group ID of the sender, and for which the process has permission to send a signal.
- kill.06
If pid is -1
- kill.06.01
sig shall be sent to all processes (excluding an unspecified set of system processes) for which the process has permission to send that signal.
- kill.06.02
If pid is specified as -1, sig shall not be sent to the calling process. Other than this, the rules in the ISO POSIX (2003) apply.
- kill.07
If pid is negative, but not -1, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the absolute value of pid, and for which the process has permission to send a signal.
- kill.08
If the value of pid causes sig to be generated for the sending process, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns.
- kill.09
The user ID tests described above shall not be applied when sending SIGCONT to a process that is a member of the same session as the sending process.
- kill.10
An implementation that provides extended security controls may impose further implementation-defined restrictions on the sending of signals, including the null signal. In particular, the system may deny the existence of some or all of the processes specified by pid.
- kill.11.01
The kill() function is successful if the process has permission to send sig to any of the processes specified by pid.
- kill.11.02
Upon successful completion, 0 shall be returned.
- kill.12
If kill() fails, no signal shall be sent.
- kill.13
Otherwise, -1 shall be returned and errno set to indicate the error.
- kill.14
The kill() function shall fail if:
- kill.14.01
[EINVAL] The value of the sig argument is an invalid or unsupported signal number.
- kill.14.02
[EPERM] The process does not have permission to send the signal to any receiving process.
- kill.14.03
[ESRCH] No process or process group can be found corresponding to that specified by pid.
- kill.15
When any stop signal (SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU) is generated for a process, any pending SIGCONT signals for that process shall be discarded
- kill.16
when SIGCONT is generated for a process, all pending stop signals for that process shall be discarded
- [+]killpg (12 / 3 / 0)
- killpg.01
The killpg() function shall send the signal specified by sig to the process group specified by pgrp.
Generalizes:
- killpg.02
- killpg.kill.07
- killpg.kill.08
- killpg.kill.09
- killpg.kill.10
- killpg.kill.11.01
- killpg.kill.11.02
- killpg.kill.12
- killpg.kill.13
- killpg.kill.14.01
- killpg.kill.14.02
- killpg.kill.14.03
- killpg.02 (struct)
If pgrp is greater than 1, killpg(pgrp, sig) shall be equivalent to kill(-pgrp, sig)
- app.killpg.03
If pgrp is less than or equal to 1, the behavior of killpg() is undefined.
- killpg.kill.07
If pid is negative, but not -1, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the absolute value of pid, and for which the process has permission to send a signal.
- killpg.kill.08
If the value of pid causes sig to be generated for the sending process, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns.
- killpg.kill.09
The user ID tests described above shall not be applied when sending SIGCONT to a process that is a member of the same session as the sending process.
- killpg.kill.10
An implementation that provides extended security controls may impose further implementation-defined restrictions on the sending of signals, including the null signal. In particular, the system may deny the existence of some or all of the processes specified by pid.
- killpg.kill.11.01
The kill() function is successful if the process has permission to send sig to any of the processes specified by pid.
- killpg.kill.11.02
Upon successful completion, 0 shall be returned.
- killpg.kill.12
If kill() fails, no signal shall be sent.
- killpg.kill.13
Otherwise, -1 shall be returned and errno set to indicate the error.
- killpg.kill.14
The kill() function shall fail if:
- killpg.kill.14.01
[EINVAL] The value of the sig argument is an invalid or unsupported signal number.
- killpg.kill.14.02
[EPERM] The process does not have permission to send the signal to any receiving process.
- killpg.kill.14.03
[ESRCH] No process or process group can be found corresponding to that specified by pid.
- [+]pthread_kill (8 / 3 / 0)
- pthread_kill.01
The pthread_kill() function shall request that a signal be delivered to the specified thread.
Generalizes:
- pthread_kill.02
- pthread_kill.03
- pthread_kill.04.01
- pthread_kill.04.02
- pthread_kill.05.01
- pthread_kill.05.02
- pthread_kill.06
- pthread_kill.02
As in kill(), if sig is zero, error checking shall be performed but no signal shall actually be sent.
- pthread_kill.03
Upon successful completion, the function shall return a value of zero.
- pthread_kill.04.01
Otherwise, the function shall return an error number
- pthread_kill.04.02
If the pthread_kill() function fails, no signal shall be sent
- pthread_kill.05
The pthread_kill() function shall fail if
- pthread_kill.05.01
[ESRCH] No thread could be found corresponding to that specified by the given thread ID.
- pthread_kill.05.02
[EINVAL] The value of the sig argument is an invalid or unsupported signal number.
- pthread_kill.06
The pthread_kill() function shall not return an error code of [EINTR]
- [+]raise (13 / 2 / 0)
- raise.01 (struct)
The raise() function shall send the signal sig to the executing [CX] thread or process.
- raise.02
If a signal handler is called, the raise() function shall not return until after the signal handler does
- raise.03
[THR] If the implementation supports the Threads option, the effect of the raise() function shall be equivalent to calling:pthread_kill(pthread_self(), sig);
Generalizes:
- raise.01
- raise.02
- raise.04
- raise.05
- raise.06
- raise.07.01
- raise.kill.01
- raise.kill.04
- raise.kill.08
- raise.kill.09
- raise.kill.11.01
- raise.kill.12
- raise.pthread_kill.01
- raise.04
[CX] Otherwise, the effect of the raise() function shall be equivalent to calling:kill(getpid(), sig);
Generalizes:
- raise.kill.01
- raise.kill.04
- raise.kill.08
- raise.kill.09
- raise.kill.11.01
- raise.kill.12
- raise.05
Upon successful completion, 0 shall be returned
- raise.06
Otherwise, a non-zero value shall be returned [CX] and errno shall be set to indicate the error.
- raise.07
The raise() function shall fail if
- raise.07.01
[EINVAL] [CX] The value of the sig argument is an invalid signal number.
- raise.kill.01
The kill() function shall send a signal to a process or a group of processes specified by pid.
Generalizes:
- raise.kill.04
- raise.kill.08
- raise.kill.09
- raise.kill.11.01
- raise.kill.12
- raise.kill.04
If pid is greater than 0, sig shall be sent to the process whose process ID is equal to pid.
- raise.kill.08
If the value of pid causes sig to be generated for the sending process, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns.
- raise.kill.09
The user ID tests described above shall not be applied when sending SIGCONT to a process that is a member of the same session as the sending process.
- raise.kill.11.01
The kill() function is successful if the process has permission to send sig to any of the processes specified by pid.
- raise.kill.12
If kill() fails, no signal shall be sent.
- raise.pthread_kill.01
The pthread_kill() function shall request that a signal be delivered to the specified thread.
Generalizes:
- raise.01
- raise.02
- raise.03
- raise.04
- raise.05
- raise.06
- raise.07.01
- raise.kill.01
- raise.kill.04
- raise.kill.08
- raise.kill.09
- raise.kill.11.01
- raise.kill.12
- [+]sigqueue (12 / 2 / 0)
- sigqueue.01
The sigqueue() function shall cause the signal specified by signo to be sent with the value specified by value to the process specified by pid
Generalizes:
- sigqueue.02
- sigqueue.03
- sigqueue.04
- sigqueue.05
- sigqueue.06
- sigqueue.07
- sigqueue.08
- sigqueue.09
- sigqueue.10.01
- sigqueue.10.02
- sigqueue.11
- sigqueue.12.01
- sigqueue.12.02
- sigqueue.12.03
- sigqueue.12.04
- sigqueue.02
If signo is zero (the null signal), error checking is performed but no signal is actually sent
- sigqueue.03
For a process to have permission to send a signal to a process designated by pid, unless the sending process has appropriate privileges, the real or effective user ID of the sending process shall match the real or saved set-user-ID of the receiving process.
- sigqueue.04 (struct)
The sigqueue() function shall return immediately
- sigqueue.05 (struct)
If SA_SIGINFO is set for signo and if the resources were available to queue the signal, the signal shall be queued and sent to the receiving process.
- sigqueue.06 (struct)
If SA_SIGINFO is not set for signo, then signo shall be sent at least once to the receiving process
- sigqueue.07 (struct)
it is unspecified whether value shall be sent to the receiving process as a result of this call
- sigqueue.08
If the value of pid causes signo to be generated for the sending process, and if signo is not blocked for the calling thread and if no other thread has signo unblocked or is waiting in a sigwait() function for signo, either signo or at least the pending, unblocked signal shall be delivered to the calling thread before the sigqueue() function returns
- sigqueue.09
Should any multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected for delivery, it shall be the lowest numbered one
- sigqueue.10
Upon successful completion
- sigqueue.10.01
the specified signal shall have been queued
- sigqueue.10.02
and the sigqueue() function shall return a value of zero
- sigqueue.11
Otherwise, the function shall return a value of -1 and set errno to indicate the error
- sigqueue.12
The sigqueue() function shall fail if:
- sigqueue.12.01
[EAGAIN] No resources are available to queue the signal. The process has already queued {SIGQUEUE_MAX} signals that are still pending at the receiver(s), or a system-wide resource limit has been exceeded.
- sigqueue.12.02
[EINVAL] The value of the signo argument is an invalid or unsupported signal number.
- sigqueue.12.03
[EPERM] The process does not have the appropriate privilege to send the signal to the receiving process.
- sigqueue.12.04
[ESRCH] The process pid does not exist.
- [+]signal.sigset (24 / 24 / 0)
- [+]sigaddset (3 / 3 / 0)
- sigaddset.01
The sigaddset() function adds the individual signal specified by the signo to the signal set pointed to by set.
- sigaddset.01.01
Upon successful completion, sigaddset() shall return 0;
- sigaddset.01.02
otherwise, it shall return -1 and set errno to indicate the error.
- app.sigaddset.02
Applications shall call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object.
- sigaddset.05
The sigaddset() function may fail if:
- sigaddset.05.01
[EINVAL] The value of the signo argument is an invalid or unsupported signal number.
- [+]sigandset (3 / 3 / 0)
- sigandset.01
The sigandset() shall combine the two signal sets referenced by left and right, using a logical AND operation, and shall place the result in the location referenced by set
- sigandset.01.01
On success, sigandset() shall return 0
- sigandset.01.02
Otherise, sigandset() shall return -1 and set errno to indicate the error
- sigandset.04.01
[EINVAL] One or more of set, left, or right was a null pointer.
- [+]sigdelset (3 / 3 / 0)
- sigdelset.01
The sigdelset() function deletes the individual signal specified by signo from the signal set pointed to by set.
- sigdelset.01.01
Upon successful completion, sigdelset() shall return 0;
- sigdelset.01.02
otherwise, it shall return -1 and set errno to indicate the error.
- app.sigdelset.02
Applications should call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object.
- sigdelset.05
The sigdelset() function may fail if:
- sigdelset.05.01
[EINVAL] The signo argument is not a valid signal number, or is an unsupported signal number.
- [+]sigemptyset (2 / 2 / 0)
- sigemptyset.01
The sigemptyset() function initializes the signal set pointed to by set, such that all signals defined in IEEE Std 1003.1-2001 are excluded.
- sigemptyset.01.01
Upon successful completion, sigemptyset() shall return 0;
- sigemptyset.01.02
otherwise, it shall return -1 and set errno to indicate the error.
- [+]sigfillset (2 / 2 / 0)
- sigfillset.01
The sigfillset() function shall initialize the signal set pointed to by set, such that all signals defined in this volume of IEEE Std 1003.1-2001 are included.
- sigfillset.01.01
Upon successful completion, sigfillset() shall return 0;
- sigfillset.01.02
otherwise, it shall return -1 and set errno to indicate the error.
- [+]sigisemptyset (4 / 4 / 0)
- sigisemptyset.01
The sigisemptyset() function shall check for empty signal set referenced by set.
- sigisemptyset.01.01
The sigisemptyset() function shall return a positive non-zero value if the signal set referenced by set is empty
- sigisemptyset.01.02
zero if this set is empty
- sigisemptyset.01.03
On error, sigisemptyset() shall return -1 and set errno to indicate the error.
- sigisemptyset.04.01
[EINVAL] set is a null pointer.
- [+]sigismember (4 / 4 / 0)
- sigismember.01
The sigismember() function shall test whether the signal specified by signo is a member of the set pointed to by set.
- sigismember.01.01
Upon successful completion, sigismember() shall return 1 if the specified signal is a member of the specified set
- sigismember.01.02
or 0 if it is not.
- sigismember.01.03
Otherwise, it shall return -1 and set errno to indicate the error.
- app.sigismember.02
Applications should call either sigemptyset() or sigfillset() at least once for each object of type sigset_t prior to any other use of that object.
- sigismember.05
The sigismember() function may fail if:
- sigismember.05.01
[EINVAL] The signo argument is not a valid signal number, or is an unsupported signal number.
- [+]sigorset (3 / 3 / 0)
- sigorset.01
The sigorset() shall combine the two signal sets referenced by left and right, using a logical OR operation, and shall place the result in the location referenced by set
- sigorset.01.01
On success, sigorset() shall return 0
- sigorset.01.02
Otherise, sigorset() shall return -1 and set errno to indicate the error.
- sigorset.04.01
[EINVAL] One or more of set, left, or right was a null pointer.
- [+]signal.sigstr (7 / 7 / 1)
- [+]psignal (4 / 4 / 0)
- psignal.01
The psignal() function shall display a message on the stderr stream
- psignal.02
If s is not the null pointer, and does not point to an empty string (e.g. "\0"), the message shall consist of the string s, a colon, a space, and a string describing the signal number sig
- psignal.03
otherwise psignal() shall display only a message describing the signal number sig
- psignal.04
If sig is invalid, the message displayed shall indicate an unknown signal
- psignal.07 (struct)
psignal() returns no value
- [+]strsignal (3 / 3 / 1)
- strsignal.01
The strsignal() function shall return a pointer to a string describing the signal number sig
- app.strsignal.02 (struct)
The string can only be used until the next call to strsignal()
- strsignal.07
If sig is a valid signal number, strsignal() shall return a pointer to the appropriate description string
- strsignal.08 (failed)
Otherwise, strsignal() shall return either a pointer to the string "unknown signal", or a null pointer
- app.strsignal.09 (struct)
Although the function is not declared as returning a pointer to a constant character string, applications shall not modify the returned string
- [+]signal.sigwait (46 / 10 / 0)
- [+]sigtimedwait (20 / 3 / 0)
- sigtimedwait.01
The sigtimedwait() function shall be equivalent to sigwaitinfo() except that if none of the signals specified by set are pending, sigtimedwait() shall wait for the time interval specified in the timespec structure referenced by timeout.
- sigtimedwait.02
If the timespec structure pointed to by timeout is zero-valued and if none of the signals specified by set are pending, then sigtimedwait() shall return immediately with an error.
- app.sigtimedwait.03
If timeout is the NULL pointer, the behavior is unspecified
- sigtimedwait.04
If the Monotonic Clock option is supported, the CLOCK_MONOTONIC clock shall be used to measure the time interval specified by the timeout argument
- sigtimedwait.05
The sigwaitinfo() function selects the pending signal from the set specified by set.
- sigtimedwait.06
Should any of multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected, it shall be the lowest numbered one.
- app.sigtimedwait.07
The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified.
- sigtimedwait.08
If no signal in set is pending at the time of the call
- sigtimedwait.08.01
the calling thread shall be suspended until one or more signals in set become pending
- sigtimedwait.08.02
or until it is interrupted by an unblocked, caught signal
- sigtimedwait.09
The sigwaitinfo() function shall be equivalent to the sigwait() function if the info argument is NULL
- sigtimedwait.10
If the info argument is non-NULL, the sigwaitinfo() function shall be equivalent to sigwait(), except that the selected signal number shall be stored in the si_signo member, and the cause of the signal shall be stored in the si_code member.
- sigtimedwait.11
If any value is queued to the selected signal, the first such queued value shall be dequeued and
- sigtimedwait.12
if the info argument is non-NULL, the value shall be stored in the si_value member of info
- sigtimedwait.13
The system resource used to queue the signal shall be released and returned to the system for other use
- sigtimedwait.14
If no value is queued, the content of the si_value member is undefined
- sigtimedwait.15
If no further signals are queued for the selected signal, the pending indication for that signal shall be reset
- sigtimedwait.16
Upon successful completion (that is, one of the signals specified by set is pending or is generated) sigwaitinfo() and sigtimedwait() shall return the selected signal number.
- sigtimedwait.17
Otherwise, the function shall return a value of -1 and set errno to indicate the error.
- sigtimedwait.18
The sigtimedwait() function shall fail if:
- sigtimedwait.18.01
[EAGAIN] No signal specified by set was generated within the specified timeout period.
- sigtimedwait.19
The sigtimedwait() and sigwaitinfo() functions may fail if:
- sigtimedwait.19.01
[EINTR] The wait was interrupted by an unblocked, caught signal. It shall be documented in system documentation whether this error causes these functions to fail.
- sigtimedwait.20
The sigtimedwait() function may also fail if:
- sigtimedwait.20.01
[EINVAL] The timeout argument specified a tv_nsec value less than zero or greater than or equal to 1000 million.
- sigtimedwait.21
An implementation should only check for this error if no signal is pending in set and it is necessary to wait.
- [+]sigwait (11 / 4 / 0)
- sigwait.01
The sigwait() function shall select a pending signal from set, atomically clear it from the system's set of pending signals, and return that signal number in the location referenced by sig.
- app.sigwait.02
If prior to the call to sigwait() there are multiple pending instances of a single signal number, it is implementation-defined whether upon successful return there are any remaining pending signals for that signal number.
- sigwait.03
If the implementation supports queued signals and there are multiple signals queued for the signal number selected, the first such queued signal shall cause a return from sigwait() and the remainder shall remain queued.
- sigwait.04
If no signal in set is pending at the time of the call, the thread shall be suspended until one or more becomes pending.
- sigwait.05
The signals defined by set shall have been blocked at the time of the call to sigwait(); otherwise, the behavior is undefined.
- app.sigwait.06
The effect of sigwait() on the signal actions for the signals in set is unspecified
- sigwait.07
If more than one thread is using sigwait() to wait for the same signal, no more than one of these threads shall return from sigwait() with the signal number.
- app.sigwait.08
If more than a single thread is blocked in sigwait() for a signal when that signal is generated for the process, it is unspecified which of the waiting threads returns from sigwait().
- sigwait.09
If the signal is generated for a specific thread, as by pthread_kill(), only that thread shall return.
- sigwait.10
Should any of the multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected, it shall be the lowest numbered one.
- app.sigwait.11
The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified
- sigwait.12
Upon successful completion, sigwait() shall
- sigwait.12.01
store the signal number of the received signal at the location referenced by sig
- sigwait.12.02
return zero
- sigwait.13
Otherwise, an error number shall be returned to indicate the error
- sigwait.14
The sigwait() function may fail if:
- sigwait.14.01
[EINVAL] The set argument contains an invalid or unsupported signal number.
- [+]sigwaitinfo (15 / 3 / 0)
- sigwaitinfo.05
The sigwaitinfo() function selects the pending signal from the set specified by set.
- sigwaitinfo.06
Should any of multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected, it shall be the lowest numbered one.
- app.sigwaitinfo.07
The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified.
- sigwaitinfo.08
If no signal in set is pending at the time of the call
- sigwaitinfo.08.01
the calling thread shall be suspended until one or more signals in set become pending
- sigwaitinfo.08.02
or until it is interrupted by an unblocked, caught signal
- sigwaitinfo.09
The sigwaitinfo() function shall be equivalent to the sigwait() function if the info argument is NULL
- sigwaitinfo.10
If the info argument is non-NULL, the sigwaitinfo() function shall be equivalent to sigwait(), except that the selected signal number shall be stored in the si_signo member, and the cause of the signal shall be stored in the si_code member.
- sigwaitinfo.11
If any value is queued to the selected signal, the first such queued value shall be dequeued and
- sigwaitinfo.12
if the info argument is non-NULL, the value shall be stored in the si_value member of info
- sigwaitinfo.13
The system resource used to queue the signal shall be released and returned to the system for other use
- sigwaitinfo.14
If no value is queued, the content of the si_value member is undefined
- sigwaitinfo.15
If no further signals are queued for the selected signal, the pending indication for that signal shall be reset
- sigwaitinfo.16
Upon successful completion (that is, one of the signals specified by set is pending or is generated) sigwaitinfo() and sigtimedwait() shall return the selected signal number.
- sigwaitinfo.17
Otherwise, the function shall return a value of -1 and set errno to indicate the error.
- sigwaitinfo.19
The sigtimedwait() and sigwaitinfo() functions may fail if:
- sigwaitinfo.19.01
[EINTR] The wait was interrupted by an unblocked, caught signal. It shall be documented in system documentation whether this error causes these functions to fail.
- sigwaitinfo.21
An implementation should only check for this error if no signal is pending in set and it is necessary to wait.
- [+]socket.netdata (16 / 16 / 0)
- [+]htonl (4 / 4 / 0)
- htonl.01
These functions shall convert 16-bit and 32-bit quantities between network byte order and host byte order.
- htonl.02
On some implementations, these functions are defined as macros.
- htonl.03
The uint32_t and uint16_t types are defined in <inttypes.h>.
- htonl.04
The htonl() and htons() functions shall return the argument value converted from host to network byte order.
- [+]htons (4 / 4 / 0)
- htons.01
These functions shall convert 16-bit and 32-bit quantities between network byte order and host byte order.
- htons.02
On some implementations, these functions are defined as macros.
- htons.03
The uint32_t and uint16_t types are defined in <inttypes.h>.
- htons.04
The htonl() and htons() functions shall return the argument value converted from host to network byte order.
- [+]ntohl (4 / 4 / 0)
- ntohl.01
These functions shall convert 16-bit and 32-bit quantities between network byte order and host byte order.
- ntohl.02
On some implementations, these functions are defined as macros.
- ntohl.03
The uint32_t and uint16_t types are defined in <inttypes.h>.
- ntohl.04
The ntohl() and ntohs() functions shall return the argument value converted from network to host byte order.
- [+]ntohs (4 / 4 / 0)
- ntohs.01
These functions shall convert 16-bit and 32-bit quantities between network byte order and host byte order.
- ntohs.02
On some implementations, these functions are defined as macros.
- ntohs.03
The uint32_t and uint16_t types are defined in <inttypes.h>.
- ntohs.04
The ntohl() and ntohs() functions shall return the argument value converted from network to host byte order.
- [+]socket.netdb (175 / 71 / 0)
- [+]__h_errno_location (1 / 1 / 0)
- __h_errno_location.01
__h_errno_location() returns the address of the h_errno variable, where h_errno is as specified in ISO POSIX (2003).
- [+]endprotoent (2 / 1 / 0)
- endprotoent.01
The endprotoent() function shall close the connection to the database, releasing any open file descriptor.
- endprotoent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]endservent (2 / 1 / 0)
- endservent.01
The endservent() function shall close the database, releasing any open file descriptor.
- endservent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]freeaddrinfo (4 / 0 / 0)
- freeaddrinfo.01
The freeaddrinfo() function shall free one or more addrinfo structures returned by getaddrinfo(), along with any additional storage associated with those structures.
- freeaddrinfo.02
If the ai_next field of the structure is not null, the entire list of structures shall be freed.
- freeaddrinfo.03
The freeaddrinfo() function shall support the freeing of arbitrary sublists of an addrinfo list originally returned by getaddrinfo().
- freeaddrinfo.04
The freeaddrinfo() and getaddrinfo() functions shall be thread-safe.
- [+]gai_strerror (3 / 1 / 0)
- gai_strerror.01
The gai_strerror() function shall return a text string describing an error value for the getaddrinfo() and getnameinfo() functions listed in the <netdb.h> header.
- gai_strerror.01.01
When the ecode argument is one of the following values listed in the <netdb.h> header:[EAI_AGAIN][EAI_BADFLAGS][EAI_FAIL][EAI_FAMILY][EAI_MEMORY][EAI_NONAME][EAI_OVERFLOW][EAI_SERVICE][EAI_SOCKTYPE][EAI_SYSTEM]the function return value shall point to a string describing the error.
- gai_strerror.01.02
If the argument is not one of those values, the function shall return a pointer to a string whose contents indicate an unknown error.
- gai_strerror.02
Upon successful completion, gai_strerror() shall return a pointer to an implementation-defined string.
- [+]getaddrinfo (57 / 20 / 0)
- getaddrinfo.01 (struct)
The getaddrinfo() function shall translate the name of a service location (for example, a host name) and/or a service name and shall return a set of socket addresses and associated information to be used in creating a socket with which to address the specified service.
- getaddrinfo.02 (struct)
The nodename and servname arguments are either null pointers or pointers to null-terminated strings.
- getaddrinfo.03
One or both of these two arguments shall be supplied by the application as a non-null pointer.
- getaddrinfo.04
The freeaddrinfo() and getaddrinfo() functions shall be thread-safe.
- getaddrinfo.05
The format of a valid name depends on the address family or families.
- getaddrinfo.06
If a specific family is not given and the name could be interpreted as valid within multiple supported families, the implementation shall attempt to resolve the name in all supported families and, in absence of errors, one or more results shall be returned.
- getaddrinfo.07
If the nodename argument is not null, it can be a descriptive name or can be an address string.
- getaddrinfo.08
If the specified address family is AF_INET, [IP6] AF_INET6, or AF_UNSPEC, valid descriptive names include host names.
- getaddrinfo.09
If the specified address family is AF_INET or AF_UNSPEC, address strings using Internet standard dot notation as specified in inet_addr() are valid.
- getaddrinfo.10.ip6
[IP6] If the specified address family is AF_INET6 or AF_UNSPEC, standard IPv6 text forms described in inet_ntop() are valid.
- getaddrinfo.11
If nodename is not null, the requested service location is named by nodename; otherwise, the requested service location is local to the caller.
- getaddrinfo.12
If servname is null, the call shall return network-level addresses for the specified nodename.
- getaddrinfo.13 (struct)
If servname is not null, it is a null-terminated character string identifying the requested service.
- getaddrinfo.14
This can be either a descriptive name or a numeric representation suitable for use with the address family or families.
- getaddrinfo.15
If the specified address family is AF_INET, [IP6] AF_INET6, or AF_UNSPEC, the service can be specified as a string specifying a decimal port number.
- getaddrinfo.16
If the hints argument is not null, it refers to a structure containing input values that may direct the operation by providing options and by limiting the returned information to a specific socket type, address family, and/or protocol.
If ai_family is not AF_UNSPEC and ai_protocol is not zero, then addresses are returned for use only with the specified address family and protocol
- app.getaddrinfo.17
In this hints structure every member other than ai_flags, ai_family, ai_socktype, and ai_protocol shall be set to zero or a null pointer.
- getaddrinfo.18
A value of AF_UNSPEC for ai_family means that the caller shall accept any address family.
- getaddrinfo.19
A value of zero for ai_socktype means that the caller shall accept any socket type.
- getaddrinfo.20
A value of zero for ai_protocol means that the caller shall accept any protocol.
- getaddrinfo.21
If hints is a null pointer, the behavior shall be as if it referred to a structure containing the value zero for the ai_flags, ai_socktype, and ai_protocol fields, and AF_UNSPEC for the ai_family field.
- getaddrinfo.22
The ai_flags field to which the hints parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST, AI_NUMERICSERV, AI_V4MAPPED, AI_ALL, and AI_ADDRCONFIG.
- getaddrinfo.23
If the AI_PASSIVE flag is specified, the returned address information shall be suitable for use in binding a socket for accepting incoming connections for the specified service.
- getaddrinfo.24
In this case, if the nodename argument is null, then the IP address portion of the socket address structure shall be set to INADDR_ANY for an IPv4 address or IN6ADDR_ANY_INIT for an IPv6 address.
- getaddrinfo.25
If the AI_PASSIVE flag is not specified, the returned address information shall be suitable for a call to connect() (for a connection-mode protocol) or for a call to connect(), sendto(), or sendmsg() (for a connectionless protocol).
- getaddrinfo.26
In this case, if the nodename argument is null, then the IP address portion of the socket address structure shall be set to the loopback address.
- getaddrinfo.27
The AI_PASSIVE flag shall be ignored if the nodename argument is not null.
- getaddrinfo.28
If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name).
Generalizes:
- getaddrinfo.49
- getaddrinfo.50
- getaddrinfo.29 (struct)
the terms ``canonical name'' and ``alias'' cannot be precisely defined for the general case.
- getaddrinfo.30
A numeric host address string is not a ``name'', and thus does not have a ``canonical name'' form; no address to host name translation is performed.
- getaddrinfo.31.01
If the AI_NUMERICHOST flag is specified, then a non-null nodename string supplied shall be a numeric host address string.
- getaddrinfo.31.02
Otherwise, an [EAI_NONAME] error is returned.
- getaddrinfo.31.03
This flag shall prevent any type of name resolution service (for example, the DNS) from being invoked.
- getaddrinfo.32.01
If the AI_NUMERICSERV flag is specified, then a non-null servname string supplied shall be a numeric port string.
- getaddrinfo.32.02
Otherwise, an [EAI_NONAME] error shall be returned.
- getaddrinfo.32.03
This flag shall prevent any type of name resolution service (for example, NIS+) from being invoked.
- getaddrinfo.33.ip6.01
If the AI_V4MAPPED flag is specified along with an ai_family of AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( ai_addrlen shall be 16).
- getaddrinfo.33.ip6.02
The AI_V4MAPPED flag shall be ignored unless ai_family equals AF_INET6.
- getaddrinfo.33.ip6.03
If the AI_ALL flag is used with the AI_V4MAPPED flag, then getaddrinfo() shall return all matching IPv6 and IPv4 addresses.
- getaddrinfo.33.ip6.04
The AI_ALL flag without the AI_V4MAPPED flag is ignored.
- getaddrinfo.34
If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be returned only if an IPv4 address is configured on the local system
- getaddrinfo.34.ip6.01
and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system
- getaddrinfo.35 (struct)
The ai_socktype field to which argument hints points specifies the socket type for the service, as defined in socket().
- getaddrinfo.36
If a specific socket type is not given (for example, a value of zero) and the service name could be interpreted as valid with multiple supported socket types, the implementation shall attempt to resolve the service name for all supported socket types and, in the absence of errors, all possible results shall be returned.
- getaddrinfo.37
A non-zero socket type value shall limit the returned information to values with the specified socket type.
- getaddrinfo.38
If the ai_family field to which hints points has the value AF_UNSPEC, addresses shall be returned for use with any address family that can be used with the specified nodename and/or servname.
- getaddrinfo.39
Otherwise, addresses shall be returned for use only with the specified address family.
- getaddrinfo.41 (struct)
the value of ai_protocol shall be interpreted as in a call to the socket() function with the corresponding values of ai_family and ai_protocol
- getaddrinfo.42.01
A zero return value for getaddrinfo() indicates successful completion
- getaddrinfo.42.02
a non-zero return value indicates failure. The possible values for the failures are listed in the ERRORS section.
- getaddrinfo.43 (struct)
Upon successful return of getaddrinfo(), the location to which res points shall refer to a linked list of addrinfo structures, each of which shall specify a socket address and information for use in creating a socket with which to use that socket address.
- getaddrinfo.44
The list shall include at least one addrinfo structure.
- getaddrinfo.45 (struct)
The ai_next field of each structure contains a pointer to the next structure on the list, or a null pointer if it is the last structure on the list.
- getaddrinfo.46 (struct)
Each structure on the list shall include values for use with a call to the socket() function, and a socket address for use with the connect() function or, if the AI_PASSIVE flag was specified, for use with the bind() function.
- getaddrinfo.47 (struct)
The fields ai_family, ai_socktype, and ai_protocol shall be usable as the arguments to the socket() function to create a socket suitable for use with the returned address.
- getaddrinfo.48 (struct)
The fields ai_addr and ai_addrlen are usable as the arguments to the connect() or bind() functions with such a socket, according to the AI_PASSIVE flag.
- getaddrinfo.49
If nodename is not null, and if requested by the AI_CANONNAME flag, the ai_canonname field of the first returned addrinfo structure shall point to a null-terminated string containing the canonical name corresponding to the input nodename
Generalizes:
- getaddrinfo.50
if the canonical name is not available, then ai_canonname shall refer to the nodename argument or a string with the same contents.
- getaddrinfo.51 (struct)
The contents of the ai_flags field of the returned structures are undefined.
- getaddrinfo.52
All fields in socket address structures returned by getaddrinfo() that are not filled in through an explicit argument (for example, sin6_flowinfo) shall be set to zero.
- getaddrinfo.53
The getaddrinfo() function shall fail and return the corresponding error value if:
- getaddrinfo.53.01
[EAI_AGAIN] The name could not be resolved at this time. Future attempts may succeed.
- getaddrinfo.53.02
[EAI_BADFLAGS] The flags parameter had an invalid value.
- getaddrinfo.53.03
[EAI_FAIL] A non-recoverable error occurred when attempting to resolve the name.
- getaddrinfo.53.04
[EAI_FAMILY] The address family was not recognized.
- getaddrinfo.53.05
[EAI_MEMORY] There was a memory allocation failure when trying to allocate storage for the return value.
- getaddrinfo.53.06
[EAI_NONAME] The name does not resolve for the supplied parameters.
- getaddrinfo.53.07
[EAI_NONAME] Neither nodename nor servname were supplied. At least one of these shall be supplied.
- getaddrinfo.53.08
[EAI_SERVICE] The service passed was not recognized for the specified socket type.
- getaddrinfo.53.09
[EAI_SOCKTYPE] The intended socket type was not recognized.
- getaddrinfo.53.10
[EAI_SYSTEM] A system error occurred; the error code can be found in errno.
- getaddrinfo.53.11
[EAI_OVERFLOW] An argument buffer overflowed.
- [+]gethostbyaddr (11 / 5 / 0)
- gethostbyaddr.02
The gethostbyaddr() function shall return an entry containing addresses of address family type for the host with address addr.
Generalizes:
- gethostbyaddr.08
- gethostbyaddr.09
- app.gethostbyaddr.03
The len argument contains the length of the address pointed to by addr.
- gethostbyaddr.04
The gethostbyaddr() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- app.gethostbyaddr.05
The addr argument of gethostbyaddr() shall be an in_addr structure when type is AF_INET.
- app.gethostbyaddr.06
It contains a binary format (that is, not null-terminated) address in network byte order.
- app.gethostbyaddr.07
The gethostbyaddr() function is not guaranteed to return addresses of address families other than AF_INET, even when such addresses exist in the database.
- gethostbyaddr.08
If gethostbyaddr() returns successfully, then the h_addrtype field in the result shall be the same as the type argument that was passed to the function
- gethostbyaddr.09
the h_addr_list field shall list a single address that is a copy of the addr argument that was passed to the function
- gethostbyaddr.10.01
Upon successful completion, these functions shall return a pointer to a hostent structure if the requested entry was found, and a null pointer if the end of the database was reached or the requested entry was not found.
- gethostbyaddr.10.02
Upon unsuccessful completion, gethostbyaddr() and gethostbyname() shall set h_errno to indicate the error.
- gethostbyaddr.11
These functions shall fail in the following cases. The gethostbyaddr() and gethostbyname() functions shall set h_errno to the value shown in the list below.
- gethostbyaddr.11.01
[HOST_NOT_FOUND] No such host is known.
- gethostbyaddr.11.02
[NO_DATA] The server recognized the request and the name, but no address is available. Another type of request to the name server for the domain might return an answer.
- gethostbyaddr.11.03
[NO_RECOVERY] An unexpected server failure occurred which cannot be recovered.
- gethostbyaddr.11.04
[TRY_AGAIN] A temporary and possibly transient error occurred, such as a failure of a server to respond.
- gethostbyaddr.12
Any changes to errno are unspecified.
- [+]gethostbyname (11 / 4 / 0)
- gethostbyname.02
The gethostbyname() function shall return an entry containing addresses of address family AF_INET for the host with name name.
Generalizes:
- gethostbyname.04
- gethostbyname.08.01
- gethostbyname.08.02
- gethostbyname.10.01
- gethostbyname.04
The gethostbyname() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- app.gethostbyname.05
The name argument of gethostbyname() shall be a node name
- app.gethostbyname.06
the behavior of gethostbyname() when passed a numeric address string is unspecified
- app.gethostbyname.07
For IPv4, a numeric address string shall be in the dotted-decimal notation described in inet_addr().
- gethostbyname.08
If name is not a numeric address string and is an alias for a valid host name, then
- gethostbyname.08.01
gethostbyname() shall return information about the host name to which the alias refers
- gethostbyname.08.02
name shall be included in the list of aliases returned
- gethostbyname.10.01
Upon successful completion, these functions shall return a pointer to a hostent structure if the requested entry was found, and a null pointer if the end of the database was reached or the requested entry was not found.
- gethostbyname.10.02
Upon unsuccessful completion, gethostbyaddr() and gethostbyname() shall set h_errno to indicate the error.
- gethostbyname.11
These functions shall fail in the following cases. The gethostbyaddr() and gethostbyname() functions shall set h_errno to the value shown in the list below.
- gethostbyname.11.01
[HOST_NOT_FOUND] No such host is known.
- gethostbyname.11.02
[NO_DATA] The server recognized the request and the name, but no address is available. Another type of request to the name server for the domain might return an answer.
- gethostbyname.11.03
[NO_RECOVERY] An unexpected server failure occurred which cannot be recovered.
- gethostbyname.11.04
[TRY_AGAIN] A temporary and possibly transient error occurred, such as a failure of a server to respond.
- gethostbyname.12
Any changes to errno are unspecified.
- [+]getnameinfo (27 / 6 / 0)
- getnameinfo.01
The getnameinfo() function shall translate a socket address to a node name and service location, all of which are defined as in getaddrinfo().
Generalizes:
- getnameinfo.02 (struct)
The sa argument points to a socket address structure to be translated.
- getnameinfo.03.ip6
[IP6] If the socket address structure contains an IPv4-mapped IPv6 address or an IPv4-compatible IPv6 address, the implementation shall extract the embedded IPv4 address and lookup the node name for that IPv4 address.
- getnameinfo.04.ip6
The IPv6 unspecified address ( "::" ) and the IPv6 loopback address ( "::1" ) are not IPv4-compatible addresses. If the address is the IPv6 unspecified address ( "::" ), a lookup is not performed, and the [EAI_NONAME] error is returned.
- app.getnameinfo.05.01
If the node argument is non-NULL and the nodelen argument is non-zero, then the node argument points to a buffer able to contain up to nodelen characters that receives the node name as a null-terminated string.
- getnameinfo.06
If the node's name cannot be located, the numeric form of the address contained in the socket address structure pointed to by the sa argument is returned instead of its name.
- app.getnameinfo.07.01
If the service argument is non-NULL and the servicelen argument is non-zero, then the service argument points to a buffer able to contain up to servicelen bytes that receives the service name as a null-terminated string.
- getnameinfo.07.02 (struct)
If the service argument is NULL or the servicelen argument is zero, the service name shall not be returned.
- getnameinfo.08
If the service's name cannot be located, the numeric form of the service address (for example, its port number) shall be returned instead of its name.
- getnameinfo.09 (struct)
The flags argument is a flag that changes the default actions of the function.
- getnameinfo.09.00
By default the fully-qualified domain name (FQDN) for the host shall be returned
- getnameinfo.09.01
If the flag bit NI_NOFQDN is set, only the node name portion of the FQDN shall be returned for local hosts.
- getnameinfo.09.02
If the flag bit NI_NUMERICHOST is set, the numeric form of the address contained in the socket address structure pointed to by the sa argument shall be returned instead of its name, under all circumstances.
- getnameinfo.09.03
If the flag bit NI_NAMEREQD is set, an error shall be returned if the host's name cannot be located.
- getnameinfo.09.04
If the flag bit NI_NUMERICSERV is set, the numeric form of the service address shall be returned (for example, its port number) instead of its name, under all circumstances.
- getnameinfo.09.05.00
This flag shall be ignored if the sa argument is not an IPv6 address.
- getnameinfo.09.05.ip6
If the flag bit NI_NUMERICSCOPE is set, the numeric form of the scope identifier shall be returned (for example, interface index) instead of its name.
- getnameinfo.09.06.01
If the flag bit NI_DGRAM is set, this indicates that the service is a datagram service (SOCK_DGRAM).
- getnameinfo.09.06.02
The default behavior shall assume that the service is a stream service (SOCK_STREAM).
- getnameinfo.11
The getnameinfo() function shall be thread-safe.
- getnameinfo.12.01
A zero return value for getnameinfo() indicates successful completion
- getnameinfo.12.02
a non-zero return value indicates failure. The possible values for the failures are listed in the ERRORS section.
- getnameinfo.13
Upon successful completion, getnameinfo() shall return the node and service names, if requested, in the buffers provided. The returned names are always null-terminated strings.
- getnameinfo.15
The getnameinfo() function shall fail and return the corresponding value if:
- getnameinfo.15.01
[EAI_AGAIN] The name could not be resolved at this time. Future attempts may succeed.
- getnameinfo.15.02
[EAI_BADFLAGS] The flags had an invalid value.
- getnameinfo.15.03
[EAI_FAIL] A non-recoverable error occurred.
- getnameinfo.15.04
[EAI_FAMILY] The address family was not recognized or the address length was invalid for the specified family.
- getnameinfo.15.05
[EAI_MEMORY] There was a memory allocation failure.
- getnameinfo.15.06
[EAI_NONAME] The name does not resolve for the supplied parameters.
- getnameinfo.15.07
[EAI_NONAME] NI_NAMEREQD is set and the host's name cannot be located, or both nodename and servname were null.
- getnameinfo.15.08
[EAI_OVERFLOW] An argument buffer overflowed. The buffer pointed to by the node argument or the service argument was too small.
- getnameinfo.15.09
[EAI_SYSTEM] A system error occurred. The error code can be found in errno.
- [+]getprotobyname (7 / 3 / 0)
- getprotobyname.01
The getprotobyname() function shall search the database from the beginning and find the first entry for which the protocol name specified by name matches the p_name member
- getprotobyname.03
opening and closing a connection to the database as necessary
- getprotobyname.06
The getprotobyname(), getprotobynumber(), and getprotoent() functions shall each return a pointer to a protoent structure, the members of which shall contain the fields of an entry in the network protocol database.
Generalizes:
- getprotobyname.01
- getprotobyname.08.01
- getprotobyname.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getprotobyname.08
Upon successful completion, getprotobyname(), getprotobynumber(), and getprotoent() return
- getprotobyname.08.01
a pointer to a protoent structure if the requested entry was found
- getprotobyname.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getprotobyname.09
Otherwise, a null pointer is returned
- [+]getprotobynumber (7 / 3 / 0)
- getprotobynumber.01
The getprotobynumber() function shall search the database from the beginning and find the first entry for which the protocol number specified by proto matches the p_proto member
- getprotobynumber.03
opening and closing a connection to the database as necessary
- getprotobynumber.06
The getprotobyname(), getprotobynumber(), and getprotoent() functions shall each return a pointer to a protoent structure, the members of which shall contain the fields of an entry in the network protocol database.
- getprotobynumber.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getprotobynumber.08
Upon successful completion, getprotobyname(), getprotobynumber(), and getprotoent() return
- getprotobynumber.08.01
a pointer to a protoent structure if the requested entry was found
- getprotobynumber.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getprotobynumber.09
Otherwise, a null pointer is returned
- [+]getprotoent (8 / 4 / 0)
- getprotoent.01
The getprotoent() function shall read the next entry of the database
- getprotoent.02
If the stayopen argument is non-zero, the connection to the network protocol database shall not be closed after each call to getprotoent() (either directly, or indirectly through one of the other getproto*() functions), and the implementation may maintain an open file descriptor for the database.
- getprotoent.03
opening and closing a connection to the database as necessary
- getprotoent.06
The getprotobyname(), getprotobynumber(), and getprotoent() functions shall each return a pointer to a protoent structure, the members of which shall contain the fields of an entry in the network protocol database.
Generalizes:
- getprotoent.01
- getprotoent.08.01
- getprotoent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getprotoent.08
Upon successful completion, getprotobyname(), getprotobynumber(), and getprotoent() return
- getprotoent.08.01
a pointer to a protoent structure if the requested entry was found
- getprotoent.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getprotoent.09
Otherwise, a null pointer is returned
- [+]getservbyname (9 / 7 / 0)
- getservbyname.01
The getservbyname() function shall search the database from the beginning and find the first entry for which
- getservbyname.01.01
the service name specified by name matches the s_name member
- getservbyname.01.02
the protocol name specified by proto matches the s_proto member
- getservbyname.03
opening and closing a connection to the database as necessary
- getservbyname.04
If proto is a null pointer, any value of the s_proto member shall be matched.
- getservbyname.06
The getservbyname(), getservbyport(), and getservent() functions shall each return a pointer to a servent structure, the members of which shall contain the fields of an entry in the network services database.
Generalizes:
- getservbyname.01.01
- getservbyname.01.02
- getservbyname.08.01
- getservbyname.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getservbyname.08
Upon successful completion, getservbyname(), getservbyport(), and getservent() return
- getservbyname.08.01
a pointer to a servent structure if the requested entry was found
- getservbyname.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getservbyname.09
Otherwise, a null pointer is returned
- [+]getservbyport (10 / 7 / 0)
- getservbyport.01
The getservbyport() function shall search the database from the beginning and find the first entry for which
- getservbyport.01.01
the port specified by port matches the s_port member
- getservbyport.01.02
the protocol name specified by proto matches the s_proto member
- getservbyport.03
opening and closing a connection to the database as necessary
- getservbyport.04
If proto is a null pointer, any value of the s_proto member shall be matched.
- getservbyport.05
The port argument shall be in network byte order
- getservbyport.06
The getservbyname(), getservbyport(), and getservent() functions shall each return a pointer to a servent structure, the members of which shall contain the fields of an entry in the network services database.
Generalizes:
- getservbyport.01.01
- getservbyport.01.02
- getservbyport.08.01
- getservbyport.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getservbyport.08
Upon successful completion, getservbyname(), getservbyport(), and getservent() return
- getservbyport.08.01
a pointer to a servent structure if the requested entry was found
- getservbyport.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getservbyport.09
Otherwise, a null pointer is returned
- [+]getservent (8 / 4 / 0)
- getservent.01
The getservent() function shall read the next entry of the database
- getservent.02
If the stayopen argument is non-zero, the net database shall not be closed after each call to the getservent() function (either directly, or indirectly through one of the other getserv*() functions), and the implementation may maintain an open file descriptor for the database.
- getservent.03
opening and closing a connection to the database as necessary
- getservent.06
The getservbyname(), getservbyport(), and getservent() functions shall each return a pointer to a servent structure, the members of which shall contain the fields of an entry in the network services database.
Generalizes:
- getservent.01
- getservent.08.01
- getservent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getservent.08
Upon successful completion, getservbyname(), getservbyport(), and getservent() return
- getservent.08.01
a pointer to a servent structure if the requested entry was found
- getservent.08.02
a null pointer if the end of the database was reached or the requested entry was not found
- getservent.09
Otherwise, a null pointer is returned
- [+]setprotoent (4 / 2 / 0)
- setprotoent.01
The setprotoent() function shall
- setprotoent.01.01
open a connection to the database
- setprotoent.01.02
set the next entry to the first entry
- setprotoent.02
If the stayopen argument is non-zero, the connection to the network protocol database shall not be closed after each call to getprotoent() (either directly, or indirectly through one of the other getproto*() functions), and the implementation may maintain an open file descriptor for the database.
- setprotoent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]setservent (4 / 2 / 0)
- setservent.01
The setservent() function shall
- setservent.01.01
open a connection to the database
- setservent.01.02
set the next entry to the first entry
- setservent.02
If the stayopen argument is non-zero, the net database shall not be closed after each call to the getservent() function (either directly, or indirectly through one of the other getserv*() functions), and the implementation may maintain an open file descriptor for the database.
- setservent.07
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]socket.netif (13 / 10 / 0)
- [+]if_freenameindex (1 / 0 / 0)
- if_freenameindex.01
The if_freenameindex() function shall free the memory allocated by if_nameindex()
- app.if_freenameindex.02
The ptr argument shall be a pointer that was returned by if_nameindex()
- app.if_freenameindex.03
After if_freenameindex() has been called, the application shall not use the array of which ptr is the address
- [+]if_indextoname (4 / 3 / 0)
- if_indextoname.01
The if_indextoname() function shall map an interface index to its corresponding name
The function shall place in this buffer the name of the interface with index ifindex
- app.if_indextoname.02
When this function is called, ifname shall point to a buffer of at least {IF_NAMESIZE} bytes
- if_indextoname.03.01
If ifindex is an interface index, then the function shall return the value supplied in ifname, which points to a buffer now containing the interface name.
- if_indextoname.03.02
Otherwise, the function shall return a NULL pointer and set errno to indicate the error
- if_indextoname.04
The if_indextoname() function shall fail if:
- if_indextoname.04.01
[ENXIO] The interface does not exist.
- [+]if_nameindex (5 / 4 / 0)
- if_nameindex.01 (struct)
The if_nameindex() function shall return an array of if_nameindex structures, one structure per interface.
- if_nameindex.02
The end of the array is indicated by a structure with
- if_nameindex.02.01
an if_index field of zero
- if_nameindex.02.02
an if_name field of NULL
- app.if_nameindex.03
Applications should call if_freenameindex() to release the memory that may be dynamically allocated by this function, after they have finished using it
- if_nameindex.04.01
An array of structures identifying local interfaces.
- if_nameindex.04.02
A NULL pointer is returned upon an error, with errno set to indicate the error.
- if_nameindex.05
The if_nameindex() function may fail if:
- if_nameindex.05.01
[ENOBUFS] Insufficient resources are available to complete the function.
- [+]if_nametoindex (3 / 3 / 0)
- if_nametoindex.01
The if_nametoindex() function shall return the interface index corresponding to name ifname.
- if_nametoindex.02.01
The corresponding index if ifname is the name of an interface
- if_nametoindex.02.02
otherwise, zero
- [+]socket.rpc.clnt (17 / 0 / 0)
- [+]authnone_create (1 / 0 / 0)
- authnone_create.01
Create and return an RPC authentication handle that passes nonusable authentication information with each remote procedure call.
- [+]clnt_create (2 / 0 / 0)
- clnt_create.01
Generic client creation routine.
- clnt_create.02
clnt_create() tries all the transports of the nettype class available from the NETPATH environment variable and the the netconfig database, and chooses the first successful one.
- [+]clnt_pcreateerror (2 / 0 / 0)
- clnt_pcreateerror.01
Print a message to standard error indicating why a client RPC handle could not be created.
- clnt_pcreateerror.02
The message is prepended with the string s and a colon, and appended with a NEWLINE.
- [+]clnt_perrno (2 / 0 / 0)
- clnt_perrno.01
Print a message to standard error corresponding to the condition indicated by stat.
- clnt_perrno.02
A NEWLINE is appended at the end of the message.
- [+]clnt_perror (2 / 0 / 0)
- clnt_perror.01
Print a message to standard error indicating why an RPC call failed;
- clnt_perror.02
The message is prepended with string s and a colon. A NEWLINE is appended at the end of the message.
- [+]clnt_spcreateerror (3 / 0 / 0)
- clnt_spcreateerror.01
Like clnt_pcreateerror(), except that it returns a string instead of printing to the standard error.
- clnt_spcreateerror.02
A NEWLINE is not appended to the message in this case.
- clnt_spcreateerror.03
unlike clnt_sperror() and clnt_spcreaterror() [see rpc_clnt_create(RS_LIB)], clnt_sperrno() does not return pointer to static data so the result will not get overwritten on each call.
- [+]clnt_sperrno (2 / 0 / 0)
- clnt_sperrno.01
Take the same arguments as clnt_perrno(), but instead of sending a message to the standard error indicating why an RPC call failed, return a pointer to a string which contains the message.
- clnt_sperrno.02
unlike clnt_sperror() and clnt_spcreaterror() [see rpc_clnt_create(RS_LIB)], clnt_sperrno() does not return pointer to static data so the result will not get overwritten on each call.
- [+]clnt_sperror (3 / 0 / 0)
- clnt_sperror.01
Like clnt_perror(), except that (like clnt_sperrno()) it returns a string instead of printing to standard error.
- clnt_sperror.02
However, clnt_sperror() does not append a NEWLINE at the end of the message.
- clnt_sperror.03
unlike clnt_sperror() and clnt_spcreaterror() [see rpc_clnt_create(RS_LIB)], clnt_sperrno() does not return pointer to static data so the result will not get overwritten on each call.
- [+]socket.rpc.pmap (12 / 3 / 0)
- [+]pmap_getport (6 / 1 / 0)
- pmap_getport.01
The pmap_getport() function shall return the port number assigned to a service registered with a RPC Binding service running on a given target system, using the protocol described in RFC 1833: Binding Protocols for ONC RPC Version 2.
- pmap_getport.02
Conforming implementations shall support both IPPROTO_UDP and IPPROTO_TCP protocols.
- pmap_getport.03
The value of address->sin_port shall be ignored, and the standard value for the portmapper port shall always be used.
- pmap_getport.04.01
On success, the pmap_getport() function shall return the port number in host byte order of the RPC application registered with the remote portmapper.
- pmap_getport.04.02
On failure, if either the program was not registered or the remote portmapper service could not be reached, the pmap_getport() function shall return 0.
- pmap_getport.05
If the remote portmap service could not be reached, the status is left in the global variable rpc_createerr.
- [+]pmap_set (3 / 2 / 0)
- pmap_set.01
pmap_set() establishes a mapping between the triple [program,version,protocol] and port on the machine's RPC Bind service.
- pmap_set.02.01
pmap_set() returns non-zero if it suceeds
- pmap_set.02.02
0 otherwise
- [+]pmap_unset (3 / 0 / 0)
- pmap_unset.01
As a user interface to the RPC Bind service, pmap_unset() destroys all mapping between the triple [prognum,versnum, *] and ports on the machine's RPC Bind service.
- pmap_unset.02.01
pmap_unset() returns non-zero if it succeeds
- pmap_unset.02.02
zero otherwise.
- [+]socket.rpc.secure (2 / 0 / 0)
- [+]key_decryptsession (2 / 0 / 0)
- key_decryptsession.01
The key_decryptsession() function takes a server netname remotename and a DES key deskey, and decrypts the key by using the the public key of the server and the secret key associated with the effective UID of the calling process.
- key_decryptsession.02
The key_decryptsession() function is the inverse of key_encryptsession() function.
- [+]socket.rpc.svc (30 / 0 / 0)
- [+]svc_getreqset (3 / 0 / 0)
- svc_getreqset.01
This routine is only of interest if a service implementor does not call svc_run(), but instead implements custom asynchronous event processing.
- svc_getreqset.02
It is called when poll() has determined that an RPC request has arrived on some RPC file descriptors;
- svc_getreqset.03
The routine returns when all file descriptors associated with the value of rdfds have been serviced
- [+]svc_register (5 / 0 / 0)
- svc_register.01
The svc_register() function shall associate the program identified by prognum at version versnum with the service dispatch procedure, dispatch.
- svc_register.02
If protocol is zero, the service is not registered with the portmap service.
- svc_register.03
If protocol is non-zero, then a mapping of the triple [prognum, versnum, protocol] to xprt->xp_port is established with the local portmap service.
- app.svc_register.04
The procedure dispatch has the following form:int dispatch(struct svc_req * request, SVCXPRT * xprt);
- svc_register.05
svc_register() returns 1 if it succeeds,
- svc_register.06
and zero otherwise.
- [+]svc_run (2 / 0 / 0)
- svc_run.01
The svc_run() function shall wait for RPC requests to arrive, read and unpack each request, and dispatch it to the appropriate registered handler.
- svc_run.02 (struct)
Under normal conditions, svc_run() shall not return;
- svc_run.03
it shall only return if serious errors occur that prevent further processing.
- [+]svc_sendreply (2 / 0 / 0)
- svc_sendreply.01
This routine returns one if it succeeds,
- svc_sendreply.02
zero other-wise.
- [+]svcerr_auth (1 / 0 / 0)
- svcerr_auth.01
Called by a service dispatch routine that refuses to perform a remote procedure call due to an authentication error.
- [+]svcerr_decode (1 / 0 / 0)
- svcerr_decode.01
Called by a service dispatch routine that cannot successfully decode the remote parameters [see svc_getargs() in rpc_svc_reg(RS_LIB)].
- [+]svcerr_noproc (1 / 0 / 0)
- svcerr_noproc.01
Called by a service dispatch routine that does not implement the procedure number that the caller requests.
- [+]svcerr_noprog (1 / 0 / 0)
- svcerr_noprog.01
Called when the desired program is not registered with the RPC package.
- [+]svcerr_progvers (1 / 0 / 0)
- svcerr_progvers.01
Called when the desired version of a program is not registered with the RPC package.
- [+]svcerr_systemerr (1 / 0 / 0)
- svcerr_systemerr.01
Called by a service dispatch routine when it detects a system error not covered by any particular protocol. For example, if a service can no longer allocate storage, it may call this routine.
- [+]svcerr_weakauth (2 / 0 / 0)
- svcerr_weakauth.01
Called by a service dispatch routine that refuses to perform a remote procedure call due to insufficient (but correct) authentication parameters.
- svcerr_weakauth.02
The routine calls svcerr_auth(xprt, AUTH_TOOWEAK).
- [+]svctcp_create (9 / 0 / 0)
- svctcp_create.01
svctcp_create() cretes a TCP/IP-based RPC service transport, to which it returns a pointer.
- svctcp_create.02
The transport is associated with the socket sock
- svctcp_create.03
which may be RPC_ANYSOCK, in which case a new socket is created.
- svctcp_create.04
If the socket is not bound to a local TCP port, then this routine binds it to an arbitrary port.
- svctcp_create.05
Upon completion, xprt->xp_sock is the transport's socket descriptor,
- svctcp_create.06
and xprt->xp_port is the transport's port number.
- svctcp_create.07
Since TCP-based RPC uses buffered I/O, users may specify the size of buffers; values of zero choose suitable defaults.
- svctcp_create.08
svctcp_create() returns NULL if it fails,
- svctcp_create.09
or a pointer to the RPC service transport otherwise.
- [+]svcudp_create (1 / 0 / 0)
- svcudp_create.01
This call is equivalent to svcudp_bufcreate( sock, SZ, SZ) for some default size SZ.
- [+]socket.rpc.xdr (75 / 1 / 0)
- [+]xdr_accepted_reply (1 / 0 / 0)
- xdr_accepted_reply.01
Used for encoding RPC reply messages.
- [+]xdr_array (3 / 0 / 0)
- xdr_array.01
A filter primitive that translates between variable-length arrays and their corresponding external representations.
- xdr_array.02
this element count cannot exceed maxsize.
- xdr_array.03
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_bool (3 / 0 / 0)
- xdr_bool.01
A filter primitive that translates between booleans (C integers) and their external representations.
- xdr_bool.02
When encoding data, this filter produces values of either one or zero.
- xdr_bool.03
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_bytes (3 / 0 / 0)
- xdr_bytes.01
A filter primitive that translates between counted byte strings and their external representations.
- xdr_bytes.02
strings cannot be longer than maxsize.
- xdr_bytes.03
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_callhdr (1 / 0 / 0)
- xdr_callhdr.01
Used for describing RPC call header messages.
- [+]xdr_callmsg (1 / 0 / 0)
- xdr_callmsg.01
Used for describing RPC call messages.
- [+]xdr_char (2 / 0 / 0)
- xdr_char.01
A filter primitive that translates between C characters and their external representations.
- xdr_char.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_double (2 / 0 / 0)
- xdr_double.01
A filter primitive that translates between C double precision numbers and their external representations.
- xdr_double.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_enum (2 / 0 / 0)
- xdr_enum.01
A filter primitive that translates between C enums (actually integers) and their external representations.
- xdr_enum.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_float (2 / 0 / 0)
- xdr_float.01
A filter primitive that translates between C floats and their external representations.
- xdr_float.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_free (1 / 0 / 0)
- xdr_free.01
Generic freeing routine.
- [+]xdr_int (2 / 0 / 0)
- xdr_int.01
A filter primitive that translates between C integers and their external representations.
- xdr_int.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_long (2 / 0 / 0)
- xdr_long.01
A filter primitive that translates between C long integers and their external representations.
- xdr_long.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_opaque (3 / 0 / 0)
- xdr_opaque.01
A filter primitive that translates between fixed size opaque data and its external representation.
- xdr_opaque.02
The parameter cp is the address of the opaque object, and cnt is its size in bytes.
- xdr_opaque.03
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_opaque_auth (1 / 0 / 0)
- xdr_opaque_auth.01
Used for describing RPC authentication information messages.
- [+]xdr_pointer (2 / 0 / 0)
- xdr_pointer.01
Like xdr_reference() except that it serializes NULL pointers, whereas xdr_reference() does not.
- xdr_pointer.02
Thus, xdr_pointer() can represent recursive data structures, such as binary trees or linked lists.
- [+]xdr_reference (3 / 0 / 0)
- xdr_reference.01
A primitive that provides pointer chasing within structures.
- xdr_reference.02
This routine returns one if it succeeds, zero otherwise.
- xdr_reference.03
this routine does not understand NULL pointers.
- [+]xdr_rejected_reply (1 / 0 / 0)
- xdr_rejected_reply.01
Used for describing RPC reply messages.
- [+]xdr_replymsg (1 / 0 / 0)
- xdr_replymsg.01
Used for describing RPC reply messages.
- [+]xdr_short (2 / 0 / 0)
- xdr_short.01
A filter primitive that translates between C short integers and their external representations.
- xdr_short.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_string (3 / 0 / 0)
- xdr_string.01
A filter primitive that translates between C strings and their corresponding external representations.
- xdr_string.02
Strings cannot be longer than maxsize.
- xdr_string.03
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_u_char (2 / 0 / 0)
- xdr_u_char.01
A filter primitive that translates between unsigned C characters and their external representations.
- xdr_u_char.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_u_int (3 / 0 / 0)
- xdr_u_int.01
xdr_u_int() is a filter primitive that translates between C unsigned integers and their external representations.
- xdr_u_int.02
On success, 1 is returned.
- xdr_u_int.03
On error, 0 is returned.
- [+]xdr_u_long (2 / 0 / 0)
- xdr_u_long.01
A filter primitive that translates between C unsigned long integers and their external representations.
- xdr_u_long.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_u_short (2 / 0 / 0)
- xdr_u_short.01
A filter primitive that translates between C unsigned short integers and their external representations.
- xdr_u_short.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_union (7 / 0 / 0)
- xdr_union.01
A filter primitive that translates between a discriminated C union and its corresponding external representation.
- xdr_union.02
It first translates the discriminant of the union located at dscmp.
- xdr_union.03
This discriminant is always an enum_t.
- xdr_union.04
Next the union located at unp is translated.
- xdr_union.05
If the union's discriminant is equal to the associated value, then the proc is called to translate the union.
- xdr_union.06
If the discriminant is not found in the choices array, then the defaultarm procedure is called (if it is not NULL).
- xdr_union.07
Returns one if it succeeds, zero otherwise.
- [+]xdr_vector (2 / 0 / 0)
- xdr_vector.01
A filter primitive that translates between fixed-length arrays and their corresponding external representations.
- xdr_vector.02
This routine returns one if it succeeds, zero otherwise.
- [+]xdr_void (1 / 1 / 0)
- xdr_void.01
This routine always returns one.
- [+]xdr_wrapstring (2 / 0 / 0)
- xdr_wrapstring.01
A primitive that calls xdr_string(xdrs, sp,MAXUN.UNSIGNED ); where MAXUN.UNSIGNED is the maximum value of an unsigned integer.
- xdr_wrapstring.02
Returns one if it succeeds, zero otherwise.
- [+]xdrmem_create (3 / 0 / 0)
- xdrmem_create.01
This routine initializes the XDR stream object pointed to by xdrs.
- xdrmem_create.02
The stream's data is written to, or read from, a chunk of memory at location addr whose length is no more than size bytes long.
- xdrmem_create.03
The op determines the direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or XDR_FREE).
- [+]xdrrec_create (8 / 0 / 0)
- xdrrec_create.01
This routine initializes the XDR stream object pointed to by xdrs.
- xdrrec_create.02
The stream's data is written to a buffer of size sendsize;
- xdrrec_create.03
a value of zero indicates the system should use a suitable default.
- xdrrec_create.04
The stream's data is read from a buffer of size recvsize; it too can be set to a suitable default by passing a zero value.
- xdrrec_create.05
When a stream's output buffer is full, writeit is called.
- xdrrec_create.06
Similarly, when a stream's input buffer is empty, readit is called.
- xdrrec_create.07
The behavior of these two routines is similar to the system calls read() and write(), except that handle is passed to the former routines as the first parameter.
- xdrrec_create.08
the XDR stream's op field must be set by the caller.
- [+]xdrrec_eof (2 / 0 / 0)
- xdrrec_eof.01
This routine can be invoked only on streams created by xdrrec_create().
- xdrrec_eof.02
After consuming the rest of the current record in the stream, this routine returns one if the stream has no more input, zero otherwise.
- [+]socket.socket (449 / 85 / 0)
- [+]accept (19 / 5 / 0)
- accept.01.01
The accept() function shall extract the first connection on the queue of pending connections,
- accept.01.02
create a new socket with the same socket type protocol and address family as the specified socket,
- accept.01.03
and allocate a new file descriptor for that socket.
- accept.02
The accept() function takes the following arguments:
- accept.02.01 (struct)
socket Specifies a socket that was created with socket(), has been bound to an address with bind(), and has issued a successful call to listen().
- accept.02.02 (struct)
address Either a null pointer, or a pointer to a sockaddr structure where the address of the connecting socket shall be returned.
- accept.02.03 (struct)
address_len Points to a socklen_t structure which on input specifies the length of the supplied sockaddr structure, and on output specifies the length of the stored address.
- accept.03
If address is not a null pointer,
- accept.03.01 (struct)
the address of the peer for the accepted connection shall be stored in the sockaddr structure pointed to by address,
- accept.03.02 (struct)
and the length of this address shall be stored in the object pointed to by address_len.
- accept.04 (struct)
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address shall be truncated.
- app.accept.05
If the protocol permits connections by unbound clients, and the peer is not bound, then the value stored in the object pointed to by address is unspecified.
- accept.06 (struct)
If the listen queue is empty of connection requests and O_NONBLOCK is not set on the file descriptor for the socket, accept() shall block until a connection is present.
- accept.07
If the listen() queue is empty of connection requests and O_NONBLOCK is set on the file descriptor for the socket, accept() shall fail and set errno to [EAGAIN] or [EWOULDBLOCK].
- accept.08
The accepted socket cannot itself accept more connections.
- accept.09 (struct)
The original socket remains open and can accept more connections.
- accept.10.01
Upon successful completion, accept() shall return the non-negative file descriptor of the accepted socket.
- accept.10.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- accept.11
The accept() function shall fail if:
- accept.11.01
[EAGAIN] or [EWOULDBLOCK] O_NONBLOCK is set for the socket file descriptor and no connections are present to be accepted.
- accept.11.02
[EBADF] The socket argument is not a valid file descriptor.
- accept.11.03
[ECONNABORTED] A connection has been aborted.
- accept.11.04
[EINTR] The accept() function was interrupted by a signal that was caught before a valid connection arrived.
- accept.11.05
[EINVAL] The socket is not accepting connections.
- accept.11.06
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- accept.11.07
[ENFILE] The maximum number of file descriptors in the system are already open.
- accept.11.08
[ENOTSOCK] The socket argument does not refer to a socket.
- accept.11.09
[EOPNOTSUPP] The socket type of the specified socket does not support accepting connections.
- accept.12
The accept() function may fail if:
- accept.12.01
[ENOBUFS] No buffer space is available.
- accept.12.02
[ENOMEM] There was insufficient memory available to complete the operation.
- accept.12.03
[EPROTO] [XSR] A protocol error has occurred; for example, the STREAMS protocol stack has not been initialized.
- [+]bind (26 / 4 / 0)
- bind.01
The bind() function shall assign a local socket address address to a socket identified by descriptor socket that has no local socket address assigned.
- bind.02
Sockets created with the socket() function are initially unnamed; they are identified only by their address family.
- bind.03
The bind() function takes the following arguments:
- bind.03.01 (struct)
socket Specifies the file descriptor of the socket to be bound.
- bind.03.02 (struct)
address Points to a sockaddr structure containing the address to be bound to the socket. The length and format of the address depend on the address family of the socket.
- bind.03.03 (struct)
address_len Specifies the length of the sockaddr structure pointed to by the address argument.
- bind.04
The socket specified by socket may require the process to have appropriate privileges to use the bind() function.
- bind.05.01
Upon successful completion, bind() shall return 0;
- bind.05.02
otherwise, -1 shall be returned and errno set to indicate the error.
- bind.06
The bind() function shall fail if:
- bind.06.01
[EADDRINUSE] The specified address is already in use.
- bind.06.02
[EADDRNOTAVAIL] The specified address is not available from the local machine.
- bind.06.03
[EAFNOSUPPORT] The specified address is not a valid address for the address family of the specified socket.
- bind.06.04
[EBADF] The socket argument is not a valid file descriptor.
- bind.06.05
[EINVAL] The socket is already bound to an address, and the protocol does not support binding to a new address; or the socket has been shut down.
- bind.06.06
[ENOTSOCK] The socket argument does not refer to a socket.
- bind.06.07
[EOPNOTSUPP] The socket type of the specified socket does not support binding to an address.
- bind.07
If the address family of the socket is AF_UNIX, then bind() shall fail if:
- bind.07.01
[EACCES] A component of the path prefix denies search permission, or the requested name requires writing in a directory with a mode that denies write permission.
- bind.07.02
[EDESTADDRREQ] or [EISDIR] The address argument is a null pointer.
- bind.07.03
[EIO] An I/O error occurred.
- bind.07.04
[ELOOP] A loop exists in symbolic links encountered during resolution of the pathname in address.
- bind.07.05
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire pathname exceeded {PATH_MAX} characters.
- bind.07.06
[ENOENT] A component of the pathname does not name an existing file or the pathname is an empty string.
- bind.07.07
[ENOTDIR] A component of the path prefix of the pathname in address is not a directory.
- bind.07.08
[EROFS] The name would reside on a read-only file system.
- bind.08
The bind() function may fail if:
- bind.08.01
[EACCES] The specified address is protected and the current user does not have permission to bind to it.
- bind.08.02
[EINVAL] The address_len argument is not a valid length for the address family.
- bind.08.03
[EISCONN] The socket is already connected.
- bind.08.04
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the pathname in address.
- bind.08.05
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- bind.08.06
[ENOBUFS] Insufficient resources were available to complete the call.
- [+]bindresvport (5 / 3 / 0)
- bindresvport.01
If the process has appropriate privilege, the bindresvport() function shall bind a socket to a privileged IP port.
- bindresvport.02.01
On success, 0 is returned.
- bindresvport.02.02
On error, -1 is returned and the global variable errno is set appropriately.
- bindresvport.03.01
[EPERM] The process did not have appropriate privilege.
- bindresvport.03.02
[EPFNOSUPPORT] Address of sin did not match address family of sd .
- [+]connect (43 / 4 / 0)
- connect.01
The connect() function shall attempt to make a connection on a socket.
Generalizes:
- connect.02.01
- connect.02.02
- connect.02.03
- connect.03
- connect.04
- connect.05
- connect.06
- connect.07
- connect.08
- connect.09
- connect.10.01
- connect.10.02
- connect.11.01
- connect.11.02
- connect.12
- connect.13
- connect.14
- connect.15.01
- connect.15.02
- connect.16.01
- connect.16.02
- connect.16.03
- connect.16.04
- connect.16.05
- connect.16.06
- connect.16.07
- connect.16.08
- connect.16.09
- connect.16.10
- connect.16.11
- connect.16.12
- connect.17.01
- connect.17.02
- connect.17.03
- connect.17.04
- connect.17.05
- connect.18.01
- connect.18.02
- connect.18.03
- connect.18.04
- connect.18.05
- connect.18.06
- connect.18.07
- connect.18.08
- connect.18.09
- connect.18.10
- connect.02
The function takes the following arguments:
- connect.02.01 (struct)
socket Specifies the file descriptor associated with the socket.
- connect.02.02 (struct)
address Points to a sockaddr structure containing the peer address. The length and format of the address depend on the address family of the socket.
- connect.02.03 (struct)
address_len Specifies the length of the sockaddr structure pointed to by the address argument.
- connect.03
If the socket has not already been bound to a local address, connect() shall bind it to an address which, unless the socket's address family is AF_UNIX, is an unused local address.
- connect.04
If the initiating socket is not connection-mode, then connect() shall set the socket's peer address, and no connection is made.
- connect.05
For SOCK_DGRAM sockets, the peer address identifies where all datagrams are sent on subsequent send() functions, and limits the remote sender for subsequent recv() functions.
- connect.06
If address is a null address for the protocol, the socket's peer address shall be reset.
- connect.07
If the initiating socket is connection-mode, then connect() shall attempt to establish a connection to the address specified by the address argument.
- connect.08 (struct)
If the connection cannot be established immediately and O_NONBLOCK is not set for the file descriptor for the socket, connect() shall block for up to an unspecified timeout interval until the connection is established.
- connect.09
If the timeout interval expires before the connection is established, connect() shall fail and the connection attempt shall be aborted.
- connect.10.01
If connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() shall fail and set errno to [EINTR],
- connect.10.02
but the connection request shall not be aborted, and the connection shall be established asynchronously.
- connect.11.01
If the connection cannot be established immediately and O_NONBLOCK is set for the file descriptor for the socket, connect() shall fail and set errno to [EINPROGRESS],
- connect.11.02
but the connection request shall not be aborted, and the connection shall be established asynchronously.
- connect.12
Subsequent calls to connect() for the same socket, before the connection is established, shall fail and set errno to [EALREADY].
- connect.13
When the connection has been established asynchronously, select() and poll() shall indicate that the file descriptor for the socket is ready for writing.
- connect.14
The socket in use may require the process to have appropriate privileges to use the connect() function.
- connect.15.01
Upon successful completion, connect() shall return 0;
- connect.15.02
otherwise, -1 shall be returned and errno set to indicate the error.
- connect.16
The connect() function shall fail if:
- connect.16.01
[EADDRNOTAVAIL] The specified address is not available from the local machine.
- connect.16.02
[EAFNOSUPPORT] The specified address is not a valid address for the address family of the specified socket.
- connect.16.03
[EALREADY] A connection request is already in progress for the specified socket.
- connect.16.04
[EBADF] The socket argument is not a valid file descriptor.
- connect.16.05
[ECONNREFUSED] The target address was not listening for connections or refused the connection request.
- connect.16.06
[EINPROGRESS] O_NONBLOCK is set for the file descriptor for the socket and the connection cannot be immediately established; the connection shall be established asynchronously.
- connect.16.07
[EINTR] The attempt to establish a connection was interrupted by delivery of a signal that was caught; the connection shall be established asynchronously.
- connect.16.08
[EISCONN] The specified socket is connection-mode and is already connected.
- connect.16.09
[ENETUNREACH] No route to the network is present.
- connect.16.10
[ENOTSOCK] The socket argument does not refer to a socket.
- connect.16.11
[EPROTOTYPE] The specified address has a different type than the socket bound to the specified peer address.
- connect.16.12
[ETIMEDOUT] The attempt to connect timed out before a connection was made.
- connect.17
If the address family of the socket is AF_UNIX, then connect() shall fail if:
- connect.17.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- connect.17.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the pathname in address.
- connect.17.03
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire pathname exceeded {PATH_MAX} characters.
- connect.17.04
[ENOENT] A component of the pathname does not name an existing file or the pathname is an empty string.
- connect.17.05
[ENOTDIR] A component of the path prefix of the pathname in address is not a directory.
- connect.18
The connect() function may fail if:
- connect.18.01
[EACCES] Search permission is denied for a component of the path prefix; or write access to the named socket is denied.
- connect.18.02
[EADDRINUSE] Attempt to establish a connection that uses addresses that are already in use.
- connect.18.03
[ECONNRESET] Remote host reset the connection request.
- connect.18.04
[EHOSTUNREACH] The destination host cannot be reached (probably because the host is down or a remote router cannot reach it).
- connect.18.05
[EINVAL] The address_len argument is not a valid length for the address family; or invalid address family in the sockaddr structure.
- connect.18.06
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the pathname in address.
- connect.18.07
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- connect.18.08
[ENETDOWN] The local network interface used to reach the destination is down.
- connect.18.09
[ENOBUFS] No buffer space is available.
- connect.18.10
[EOPNOTSUPP] The socket is listening and cannot be connected.
- [+]getpeername (10 / 3 / 0)
- getpeername.01.01
The getpeername() function shall retrieve the peer address of the specified socket,
- getpeername.01.02 (struct)
store this address in the sockaddr structure pointed to by the address argument,
- getpeername.01.03 (struct)
and store the length of this address in the object pointed to by the address_len argument.
- getpeername.02
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address shall be truncated.
- app.getpeername.03
If the protocol permits connections by unbound clients, and the peer is not bound, then the value stored in the object pointed to by address is unspecified.
- getpeername.04.01
Upon successful completion, 0 shall be returned.
- getpeername.04.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- getpeername.05
The getpeername() function shall fail if:
- getpeername.05.01
[EBADF] The socket argument is not a valid file descriptor.
- getpeername.05.02
[EINVAL] The socket has been shut down.
- getpeername.05.03
[ENOTCONN] The socket is not connected or otherwise has not had the peer pre-specified.
- getpeername.05.04
[ENOTSOCK] The socket argument does not refer to a socket.
- getpeername.05.05
[EOPNOTSUPP] The operation is not supported for the socket protocol.
- getpeername.06
The getpeername() function may fail if:
- getpeername.06.01
[ENOBUFS] Insufficient resources were available in the system to complete the call.
- [+]getsockname (8 / 3 / 0)
- getsockname.01.01
The getsockname() function shall retrieve the locally-bound name of the specified socket, store this address in the sockaddr structure pointed to by the address argument,
- getsockname.01.02 (struct)
and store the length of this address in the object pointed to by the address_len argument.
- getsockname.02 (struct)
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address shall be truncated.
- getsockname.03 (struct)
If the socket has not been bound to a local name, the value stored in the object pointed to by address is unspecified.
- getsockname.04.01
Upon successful completion,
- getsockname.04.01.01
0 shall be returned,
- getsockname.04.01.02 (struct)
the address argument shall point to the address of the socket,
- getsockname.04.01.03 (struct)
and the address_len argument shall point to the length of the address.
- getsockname.04.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- getsockname.05
The getsockname() function shall fail if:
- getsockname.05.01
[EBADF] The socket argument is not a valid file descriptor.
- getsockname.05.02
[ENOTSOCK] The socket argument does not refer to a socket.
- getsockname.05.03
[EOPNOTSUPP] The operation is not supported for this socket's protocol.
- getsockname.06
The getsockname() function may fail if:
- getsockname.06.01
[EINVAL] The socket has been shut down.
- getsockname.06.02
[ENOBUFS] Insufficient resources were available in the system to complete the function.
- [+]getsockopt (36 / 3 / 0)
- getsockopt.01
The getsockopt() function manipulates options associated with a socket.
Generalizes:
- getsockopt.02
- getsockopt.03.01
- getsockopt.03.02
- getsockopt.04
- getsockopt.05
- getsockopt.06
- getsockopt.07.01
- getsockopt.07.02
- getsockopt.07.03
- getsockopt.07.04
- getsockopt.07.05.01
- getsockopt.07.05.02
- getsockopt.07.05.03
- getsockopt.07.06.01
- getsockopt.07.06.02
- getsockopt.07.06.03
- getsockopt.07.06.04
- getsockopt.07.07
- getsockopt.07.08
- getsockopt.07.09
- getsockopt.07.10
- getsockopt.07.11
- getsockopt.07.12.01
- getsockopt.07.12.02
- getsockopt.07.12.03
- getsockopt.07.12.04
- getsockopt.07.13.01
- getsockopt.07.13.02
- getsockopt.07.13.03
- getsockopt.07.13.04
- getsockopt.07.13.05
- getsockopt.07.13.06
- getsockopt.07.14.01
- getsockopt.07.14.02
- getsockopt.07.14.03.01
- getsockopt.07.14.03.02
- getsockopt.07.14.04
- getsockopt.07.14.05
- getsockopt.07.15.01
- getsockopt.07.15.02
- getsockopt.07.15.03
- getsockopt.07.15.04
- getsockopt.07.16.01
- getsockopt.07.16.02.01
- getsockopt.07.16.02.02
- getsockopt.07.16.03
- getsockopt.07.16.04
- getsockopt.07.16.05
- getsockopt.08
- getsockopt.09.01
- getsockopt.09.02
- getsockopt.10.01
- getsockopt.10.02
- getsockopt.10.03
- getsockopt.10.04
- getsockopt.11.01
- getsockopt.11.02
- getsockopt.11.03
- getsockopt.30.01.01
- getsockopt.30.01.02
- getsockopt.30.02.01
- getsockopt.30.02.02
- getsockopt.30.02.03
- getsockopt.30.03.01
- getsockopt.30.03.02
- getsockopt.30.03.03
- getsockopt.02
The getsockopt() function shall retrieve the value for the option specified by the option_name argument for the socket specified by the socket argument.
- getsockopt.03.01 (struct)
If the size of the option value is greater than option_len, the value stored in the object pointed to by the option_value argument shall be silently truncated.
- getsockopt.03.02 (struct)
Otherwise, the object pointed to by the option_len argument shall be modified to indicate the actual length of the value.
- getsockopt.04 (struct)
The level argument specifies the protocol level at which the option resides.
- getsockopt.05 (struct)
To retrieve options at the socket level, specify the level argument as SOL_SOCKET. To retrieve options at other levels, supply the appropriate level identifier for the protocol controlling the option.
- getsockopt.06
The socket in use may require the process to have appropriate privileges to use the getsockopt() function.
- getsockopt.07
The option_name argument specifies a single option to be retrieved. It can be one of the following values defined in <sys/socket.h>:
- getsockopt.07.01 (struct)
SO_DEBUG Reports whether debugging information is being recorded. This option shall store an int value. This is a Boolean option.
- getsockopt.07.02 (struct)
SO_ACCEPTCONN Reports whether socket listening is enabled. This option shall store an int value. This is a Boolean option.
- getsockopt.07.03 (struct)
SO_BROADCAST Reports whether transmission of broadcast messages is supported, if this is supported by the protocol. This option shall store an int value. This is a Boolean option.
- getsockopt.07.04 (struct)
SO_REUSEADDR Reports whether the rules used in validating addresses supplied to bind() should allow reuse of local addresses, if this is supported by the protocol. This option shall store an int value. This is a Boolean option.
- getsockopt.07.05
SO_KEEPALIVE
- getsockopt.07.05.01 (struct)
Reports whether connections are kept active with periodic transmission of messages, if this is supported by the protocol.
- getsockopt.07.05.02
If the connected socket fails to respond to these messages, the connection shall be broken and threads writing to that socket shall be notified with a SIGPIPE signal.
- getsockopt.07.05.03 (struct)
This option shall store an int value. This is a Boolean option.
- getsockopt.07.06
SO_LINGER
- getsockopt.07.06.01 (struct)
Reports whether the socket lingers on close() if data is present.
- getsockopt.07.06.02
If SO_LINGER is set, the system shall block the calling thread during close() until it can transmit the data or until the end of the interval indicated by the l_linger member, whichever comes first.
- getsockopt.07.06.03
If SO_LINGER is not specified, and close() is issued, the system handles the call in a way that allows the calling thread to continue as quickly as possible.
- getsockopt.07.06.04 (struct)
This option shall store a linger structure.
- getsockopt.07.07 (struct)
SO_OOBINLINE Reports whether the socket leaves received out-of-band data (data marked urgent) inline. This option shall store an int value. This is a Boolean option.
- getsockopt.07.08 (struct)
SO_SNDBUF Reports send buffer size information. This option shall store an int value.
- getsockopt.07.09 (struct)
SO_RCVBUF Reports receive buffer size information. This option shall store an int value.
- getsockopt.07.10 (struct)
SO_ERROR Reports information about error status and clears it. This option shall store an int value.
- getsockopt.07.11 (struct)
SO_TYPE Reports the socket type. This option shall store an int value. Socket types are described in Socket Types.
- getsockopt.07.12
SO_DONTROUTE
- getsockopt.07.12.01 (struct)
Reports whether outgoing messages bypass the standard routing facilities.
- getsockopt.07.12.02
The destination shall be on a directly-connected network, and messages are directed to the appropriate network interface according to the destination address.
- getsockopt.07.12.03
The effect, if any, of this option depends on what protocol is in use.
- getsockopt.07.12.04 (struct)
This option shall store an int value. This is a Boolean option.
- getsockopt.07.13
SO_RCVLOWAT
- getsockopt.07.13.01 (struct)
Reports the minimum number of bytes to process for socket input operations.
- getsockopt.07.13.02 (struct)
The default value for SO_RCVLOWAT is 1.
- getsockopt.07.13.03
If SO_RCVLOWAT is set to a larger value, blocking receive calls normally wait until they have received the smaller of the low water mark value or the requested amount.
- getsockopt.07.13.04
They may return less than the low water mark if an error occurs, a signal is caught, or the type of data next in the receive queue is different from that returned;
- getsockopt.07.13.05 (struct)
This option shall store an int value.
- getsockopt.07.13.06
Note that not all implementations allow this option to be retrieved.
- getsockopt.07.14
SO_RCVTIMEO
- getsockopt.07.14.01 (struct)
Reports the timeout value for input operations.
- getsockopt.07.14.02 (struct)
This option shall store a timeval structure with the number of seconds and microseconds specifying the limit on how long to wait for an input operation to complete.
- getsockopt.07.14.03.01
If a receive operation has blocked for this much time without receiving additional data, it shall return with a partial count
- getsockopt.07.14.03.02
or errno set to [EAGAIN] or [EWOULDBLOCK] if no data was received.
- getsockopt.07.14.04 (struct)
The default for this option is zero, which indicates that a receive operation shall not time out.
- getsockopt.07.14.05
Note that not all implementations allow this option to be retrieved.
- getsockopt.07.15
SO_SNDLOWAT
- getsockopt.07.15.01 (struct)
Reports the minimum number of bytes to process for socket output operations.
- getsockopt.07.15.02
Non-blocking output operations shall process no data if flow control does not allow the smaller of the send low water mark value or the entire request to be processed.
- getsockopt.07.15.03 (struct)
This option shall store an int value.
- getsockopt.07.15.04
Note that not all implementations allow this option to be retrieved.
- getsockopt.07.16
SO_SNDTIMEO
- getsockopt.07.16.01 (struct)
Reports the timeout value specifying the amount of time that an output function blocks because flow control prevents data from being sent.
- getsockopt.07.16.02.01
If a send operation has blocked for this time, it shall return with a partial count
- getsockopt.07.16.02.02
or with errno set to [EAGAIN] or [EWOULDBLOCK] if no data was sent.
- getsockopt.07.16.03 (struct)
The default for this option is zero, which indicates that a send operation shall not time out.
- getsockopt.07.16.04 (struct)
The option shall store a timeval structure.
- getsockopt.07.16.05
Note that not all implementations allow this option to be retrieved.
- getsockopt.08 (struct)
For Boolean options, a zero value indicates that the option is disabled and a non-zero value indicates that the option is enabled.
- getsockopt.09.01
Upon successful completion, getsockopt() shall return 0;
- getsockopt.09.02
otherwise, -1 shall be returned and errno set to indicate the error.
- getsockopt.10
The getsockopt() function shall fail if:
- getsockopt.10.01
[EBADF] The socket argument is not a valid file descriptor.
- getsockopt.10.02
[EINVAL] The specified option is invalid at the specified socket level.
- getsockopt.10.03
[ENOPROTOOPT] The option is not supported by the protocol.
- getsockopt.10.04
[ENOTSOCK] The socket argument does not refer to a socket.
- getsockopt.11
The getsockopt() function may fail if:
- getsockopt.11.01
[EACCES] The calling process does not have the appropriate privileges.
- getsockopt.11.02
[EINVAL] The socket has been shut down.
- getsockopt.11.03
[ENOBUFS] Insufficient resources are available in the system to complete the function.
- app.getsockopt.30
If the level parameter is IPPROTO_IP, the following values shall be supported for option_name (see RFC 791:Internet Protocol for further details):
- app.getsockopt.30.01
IP_OPTIONS
- app.getsockopt.30.01.01
The option_value shall point to a memory buffer in which the options shall be placed
- app.getsockopt.30.01.02
on entry option_len shall point to an integer value indicating the maximum size of the memory buffer, in bytes
- app.getsockopt.30.02
IP_TTL
- app.getsockopt.30.02.01
The option_value shall point to a buffer large enough to hold the time to live value (at least 1 byte)
- app.getsockopt.30.02.02
option_len shall point to an integer value holding the maximum size of that buffer
- app.getsockopt.30.03
IP_TOS
- app.getsockopt.30.03.01
The option_value shall point to a buffer large enough to hold the type of service indicator (at least 1 byte)
- app.getsockopt.30.03.02
option_len shall point to an integer value holding the maximum size of that buffer
- getsockopt.30
If the level parameter is IPPROTO_IP, the following values shall be supported for option_name (see RFC 791:Internet Protocol for further details):
- getsockopt.30.01
IP_OPTIONS
- getsockopt.30.01.01
Get the Internet Protocol options sent with every packet from this socket.
- getsockopt.30.01.02
On successful return, the value referenced by option_len shall be updated to the size of data copied to the buffer. For IPv4, the maximum length of options is 40 bytes.
- getsockopt.30.02
IP_TTL
- getsockopt.30.02.01
Get the current unicast Internet Protocol Time To Live value used when sending packets with this socket.
- getsockopt.30.02.02
On successful return, the value referenced by option_len shall be updated to contain the number of bytes copied into the buffer, which shall be no larger than the initial value
- getsockopt.30.02.03
option_value shall point to an integer containing the time to live value
- getsockopt.30.03
IP_TOS
- getsockopt.30.03.01
Get the Internet Protocol type of service indicator used when sending packets with this socket.
- getsockopt.30.03.02
On successful return, the value referenced by option_len shall be updated to contain the number of bytes copied into the buffer, which shall be no larger than the initial value
- getsockopt.30.03.03
option_value shall point to an integer containing the time to live value
- [+]listen (20 / 4 / 0)
- listen.01
The listen() function shall mark a connection-mode socket, specified by the socket argument, as accepting connections.
- listen.02 (struct)
The backlog argument provides a hint to the implementation which the implementation shall use to limit the number of outstanding connections in the socket's listen queue.
- listen.03
Implementations may impose a limit on backlog and silently reduce the specified value.
- listen.04
Normally, a larger backlog argument value shall result in a larger or equal length of the listen queue.
- listen.05
Implementations shall support values of backlog up to SOMAXCONN, defined in <sys/socket.h>.
- listen.06
The implementation may include incomplete connections in its listen queue. The limits on the number of incomplete connections and completed connections queued may be different.
- listen.07
The implementation may have an upper limit on the length of the listen queue-either global or per accepting socket.
- listen.08
If backlog exceeds this limit, the length of the listen queue is set to the limit.
- listen.09
If listen() is called with a backlog argument value that is less than 0, the function behaves as if it had been called with a backlog argument value of 0.
- listen.10
A backlog argument of 0 may allow the socket to accept connections, in which case the length of the listen queue may be set to an implementation-defined minimum value.
- listen.11
The socket in use may require the process to have appropriate privileges to use the listen() function.
- listen.12.01
Upon successful completions, listen() shall return 0;
- listen.12.02
otherwise, -1 shall be returned and errno set to indicate the error.
- listen.13
The listen() function shall fail if:
- listen.13.01
[EBADF] The socket argument is not a valid file descriptor.
- listen.13.02
[EDESTADDRREQ] The socket is not bound to a local address, and the protocol does not support listening on an unbound socket.
- listen.13.03
[EINVAL] The socket is already connected.
- listen.13.04
[ENOTSOCK] The socket argument does not refer to a socket.
- listen.13.05
[EOPNOTSUPP] The socket protocol does not support listen().
- listen.14
The listen() function may fail if:
- listen.14.01
[EACCES] The calling process does not have the appropriate privileges.
- listen.14.02
[EINVAL] The socket has been shut down.
- listen.14.03
[ENOBUFS] Insufficient resources are available in the system to complete the call.
- [+]recv (25 / 8 / 0)
- recv.01
The recv() function shall receive a message from a connection-mode or connectionless-mode socket.
- recv.02
It is normally used with connected sockets because it does not permit the application to retrieve the source address of received data.
- recv.03
The recv() function takes the following arguments:
- recv.03.01 (struct)
socket Specifies the socket file descriptor.
- recv.03.02 (struct)
buffer Points to a buffer where the message should be stored.
- recv.03.03 (struct)
length Specifies the length in bytes of the buffer pointed to by the buffer argument.
- recv.03.04
flags Specifies the type of message reception. Values of this argument are formed by logically OR'ing zero or more of the following values:
- recv.03.04.01
MSG_PEEK Peeks at an incoming message. The data is treated as unread and the next recv() or similar function shall still return this data.
- recv.03.04.02 (struct)
MSG_OOB Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific.
- recv.03.04.03
MSG_WAITALL
- recv.03.04.03.01 (struct)
On SOCK_STREAM sockets this requests that the function block until the full amount of data can be returned.
- recv.03.04.03.02
The function may return the smaller amount of data if the socket is a message-based socket, if a signal is caught, if the connection is terminated, if MSG_PEEK was specified, or if an error is pending for the socket.
- recv.04
The recv() function shall return the length of the message written to the buffer pointed to by the buffer argument.
- recv.05
For message-based sockets, such as SOCK_DGRAM and SOCK_SEQPACKET, the entire message shall be read in a single operation.
- recv.06
If a message is too long to fit in the supplied buffer, and MSG_PEEK is not set in the flags argument, the excess bytes shall be discarded.
- recv.07
For stream-based sockets, such as SOCK_STREAM, message boundaries shall be ignored. In this case, data shall be returned to the user as soon as it becomes available, and no data shall be discarded.
- recv.08
If the MSG_WAITALL flag is not set, data shall be returned only up to the end of the first message.
- recv.09.01 (struct)
If no messages are available at the socket and O_NONBLOCK is not set on the socket's file descriptor, recv() shall block until a message arrives.
- recv.09.02
If no messages are available at the socket and O_NONBLOCK is set on the socket's file descriptor, recv() shall fail and set errno to [EAGAIN] or [EWOULDBLOCK].
- recv.10
Upon successful completion, recv() shall return the length of the message in bytes.
- recv.11.01
If no messages are available to be received and the peer has performed an orderly shutdown, recv() shall return 0.
- recv.11.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- recv.12
The recv() function shall fail if:
- recv.12.01
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and no data is waiting to be received; or MSG_OOB is set and no out-of-band data is available and either the socket's file descriptor is marked O_NONBLOCK or the socket does not support blocking to await out-of-band data.
- recv.12.02
[EBADF] The socket argument is not a valid file descriptor.
- recv.12.03
[ECONNRESET] A connection was forcibly closed by a peer.
- recv.12.04
[EINTR] The recv() function was interrupted by a signal that was caught, before any data was available.
- recv.12.05
[EINVAL] The MSG_OOB flag is set and no out-of-band data is available.
- recv.12.06
[ENOTCONN] A receive is attempted on a connection-mode socket that is not connected.
- recv.12.07
[ENOTSOCK] The socket argument does not refer to a socket.
- recv.12.08
[EOPNOTSUPP] The specified flags are not supported for this socket type or protocol.
- recv.12.09
[ETIMEDOUT] The connection timed out during connection establishment, or due to a transmission timeout on active connection.
- recv.13
The recv() function may fail if:
- recv.13.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- recv.13.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- recv.13.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- [+]recvfrom (28 / 7 / 0)
- recvfrom.01
The recvfrom() function shall receive a message from a connection-mode or connectionless-mode socket.
- recvfrom.02 (struct)
It is normally used with connectionless-mode sockets because it permits the application to retrieve the source address of received data.
- recvfrom.03
The recvfrom() function takes the following arguments:
- recvfrom.03.01 (struct)
socket Specifies the socket file descriptor.
- recvfrom.03.02 (struct)
buffer Points to the buffer where the message should be stored.
- recvfrom.03.03 (struct)
length Specifies the length in bytes of the buffer pointed to by the buffer argument.
- recvfrom.03.04
flags Specifies the type of message reception. Values of this argument are formed by logically OR'ing zero or more of the following values:
- recvfrom.03.04.01
MSG_PEEK Peeks at an incoming message. The data is treated as unread and the next recvfrom() or similar function shall still return this data.
- recvfrom.03.04.02 (struct)
MSG_OOB Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific.
- recvfrom.03.04.03
MSG_WAITALL
- recvfrom.03.04.03.01
On SOCK_STREAM sockets this requests that the function block until the full amount of data can be returned.
- recvfrom.03.04.03.02
The function may return the smaller amount of data if the socket is a message-based socket, if a signal is caught, if the connection is terminated, if MSG_PEEK was specified, or if an error is pending for the socket.
- recvfrom.03.05 (struct)
address A null pointer, or points to a sockaddr structure in which the sending address is to be stored. The length and format of the address depend on the address family of the socket.
- recvfrom.03.06 (struct)
address_len Specifies the length of the sockaddr structure pointed to by the address argument.
- recvfrom.04
The recvfrom() function shall return the length of the message written to the buffer pointed to by the buffer argument.
- recvfrom.05
For message-based sockets, such as [RS] SOCK_RAW, SOCK_DGRAM, and SOCK_SEQPACKET, the entire message shall be read in a single operation.
- recvfrom.06
If a message is too long to fit in the supplied buffer, and MSG_PEEK is not set in the flags argument, the excess bytes shall be discarded.
- recvfrom.07
For stream-based sockets, such as SOCK_STREAM, message boundaries shall be ignored. In this case, data shall be returned to the user as soon as it becomes available, and no data shall be discarded.
- recvfrom.08
If the MSG_WAITALL flag is not set, data shall be returned only up to the end of the first message.
- recvfrom.09
Not all protocols provide the source address for messages.
- recvfrom.10
If the address argument is not a null pointer and the protocol provides the source address of messages,
- recvfrom.10.01
the source address of the received message shall be stored in the sockaddr structure pointed to by the address argument,
- recvfrom.10.02 (struct)
and the length of this address shall be stored in the object pointed to by the address_len argument
- recvfrom.11
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address shall be truncated.
- app.recvfrom.13
If the address argument is not a null pointer and the protocol does not provide the source address of messages, the value stored in the object pointed to by address is unspecified.
- recvfrom.14.01 (struct)
If no messages are available at the socket and O_NONBLOCK is not set on the socket's file descriptor, recvfrom() shall block until a message arrives.
- recvfrom.14.02
If no messages are available at the socket and O_NONBLOCK is set on the socket's file descriptor, recvfrom() shall fail and set errno to [EAGAIN] or [EWOULDBLOCK].
- recvfrom.15
Upon successful completion, recvfrom() shall return the length of the message in bytes.
- recvfrom.16.01
If no messages are available to be received and the peer has performed an orderly shutdown, recvfrom() shall return 0.
- recvfrom.16.02
Otherwise, the function shall return -1 and set errno to indicate the error.
- recvfrom.17
The recvfrom() function shall fail if:
- recvfrom.17.01
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and no data is waiting to be received; or MSG_OOB is set and no out-of-band data is available and either the socket's file descriptor is marked O_NONBLOCK or the socket does not support blocking to await out-of-band data.
- recvfrom.17.02
[EBADF] The socket argument is not a valid file descriptor.
- recvfrom.17.03
[ECONNRESET] A connection was forcibly closed by a peer.
- recvfrom.17.04
[EINTR] A signal interrupted recvfrom() before any data was available.
- recvfrom.17.05
[EINVAL] The MSG_OOB flag is set and no out-of-band data is available.
- recvfrom.17.06
[ENOTCONN] A receive is attempted on a connection-mode socket that is not connected.
- recvfrom.17.07
[ENOTSOCK] The socket argument does not refer to a socket.
- recvfrom.17.08
[EOPNOTSUPP] The specified flags are not supported for this socket type.
- recvfrom.17.09
[ETIMEDOUT] The connection timed out during connection establishment, or due to a transmission timeout on active connection.
- recvfrom.18
The recvfrom() function may fail if:
- recvfrom.18.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- recvfrom.18.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- recvfrom.18.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- [+]recvmsg (34 / 11 / 0)
- recvmsg.01
The recvmsg() function shall receive a message from a connection-mode or connectionless-mode socket.
- recvmsg.02
It is normally used with connectionless-mode sockets because it permits the application to retrieve the source address of received data.
- recvmsg.03
The recvmsg() function takes the following arguments:
- recvmsg.03.01 (struct)
socket Specifies the socket file descriptor.
- recvmsg.03.02
message
- recvmsg.03.02.01 (struct)
Points to a msghdr structure, containing both the buffer to store the source address and the buffers for the incoming message.
- recvmsg.03.02.02 (struct)
The length and format of the address depend on the address family of the socket.
- recvmsg.03.02.03 (struct)
The msg_flags member is ignored on input, but may contain meaningful values on output.
- recvmsg.03.03
flags Specifies the type of message reception. Values of this argument are formed by logically OR'ing zero or more of the following values:
- recvmsg.03.03.01 (struct)
MSG_OOB Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific.
- recvmsg.03.03.02 (struct)
MSG_PEEK Peeks at the incoming message.
- recvmsg.03.03.03
MSG_WAITALL
- recvmsg.03.03.03.01
On SOCK_STREAM sockets this requests that the function block until the full amount of data can be returned.
- recvmsg.03.03.03.02
The function may return the smaller amount of data if the socket is a message-based socket, if a signal is caught, if the connection is terminated, if MSG_PEEK was specified, or if an error is pending for the socket.
- recvmsg.04
The recvmsg() function shall receive messages from unconnected or connected sockets and shall return the length of the message.
- recvmsg.05 (struct)
The recvmsg() function shall return the total length of the message.
- recvmsg.06
For message-based sockets, such as SOCK_DGRAM and SOCK_SEQPACKET, the entire message shall be read in a single operation.
- recvmsg.07
If a message is too long to fit in the supplied buffers, and MSG_PEEK is not set in the flags argument, the excess bytes shall be discarded, and MSG_TRUNC shall be set in the msg_flags member of the msghdr structure.
- recvmsg.08
For stream-based sockets, such as SOCK_STREAM, message boundaries shall be ignored. In this case, data shall be returned to the user as soon as it becomes available, and no data shall be discarded.
- recvmsg.09
If the MSG_WAITALL flag is not set, data shall be returned only up to the end of the first message.
- recvmsg.10.01 (struct)
If no messages are available at the socket and O_NONBLOCK is not set on the socket's file descriptor, recvmsg() shall block until a message arrives.
- recvmsg.10.02
If no messages are available at the socket and O_NONBLOCK is set on the socket's file descriptor, the recvmsg() function shall fail and set errno to [EAGAIN] or [EWOULDBLOCK].
- recvmsg.11
In the msghdr structure, the msg_name and msg_namelen members specify the source address if the socket is unconnected.
- recvmsg.12 (struct)
If the socket is connected, the msg_name and msg_namelen members shall be ignored.
- recvmsg.13 (struct)
The msg_name member may be a null pointer if no names are desired or required.
- recvmsg.14
The msg_iov and msg_iovlen fields are used to specify where the received data shall be stored.
- recvmsg.15
msg_iov points to an array of iovec structures; msg_iovlen shall be set to the dimension of this array.
- recvmsg.16
In each iovec structure, the iov_base field specifies a storage area and the iov_len field gives its size in bytes.
- recvmsg.17
Each storage area indicated by msg_iov is filled with received data in turn until all of the received data is stored or all of the areas have been filled.
- recvmsg.18
Upon successful completion, the msg_flags member of the message header shall be the bitwise-inclusive OR of all of the following flags that indicate conditions detected for the received message:
- recvmsg.18.01
MSG_EOR End-of-record was received (if supported by the protocol).
- recvmsg.18.02
MSG_OOB Out-of-band data was received.
- recvmsg.18.03
MSG_TRUNC Normal data was truncated.
- recvmsg.18.04
MSG_CTRUNC Control data was truncated.
- recvmsg.19 (struct)
Upon successful completion, recvmsg() shall return the length of the message in bytes.
- recvmsg.20.01
If no messages are available to be received and the peer has performed an orderly shutdown, recvmsg() shall return 0.
- recvmsg.20.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- recvmsg.21
The recvmsg() function shall fail if:
- recvmsg.21.01
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and no data is waiting to be received; or MSG_OOB is set and no out-of-band data is available and either the socket's file descriptor is marked O_NONBLOCK or the socket does not support blocking to await out-of-band data.
- recvmsg.21.02
[EBADF] The socket argument is not a valid open file descriptor.
- recvmsg.21.03
[ECONNRESET] A connection was forcibly closed by a peer.
- recvmsg.21.04
[EINTR] This function was interrupted by a signal before any data was available.
- recvmsg.21.05
[EINVAL] The sum of the iov_len values overflows a ssize_t, or the MSG_OOB flag is set and no out-of-band data is available.
- recvmsg.21.06
[EMSGSIZE] The msg_iovlen member of the msghdr structure pointed to by message is less than or equal to 0, or is greater than {IOV_MAX}.
- recvmsg.21.07
[ENOTCONN] A receive is attempted on a connection-mode socket that is not connected.
- recvmsg.21.08
[ENOTSOCK] The socket argument does not refer to a socket.
- recvmsg.21.09
[EOPNOTSUPP] The specified flags are not supported for this socket type.
- recvmsg.21.10
[ETIMEDOUT] The connection timed out during connection establishment, or due to a transmission timeout on active connection.
- recvmsg.22
The recvmsg() function may fail if:
- recvmsg.22.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- recvmsg.22.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- recvmsg.22.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- [+]send (25 / 3 / 0)
- send.01
The send() function shall initiate transmission of a message from the specified socket to its peer.
Generalizes:
- send.02
- send.03.01
- send.03.02
- send.03.03
- send.03.04.01
- send.03.04.02
- send.04
- send.05
- send.06
- send.07
- send.08
- send.09
- send.10
- send.11
- send.12.01
- send.12.02
- send.13.01
- send.13.02
- send.13.03
- send.13.04
- send.13.05
- send.13.06
- send.13.07
- send.13.08
- send.13.09
- send.13.10
- send.14.01
- send.14.02
- send.14.03
- send.14.04
- send.14.05
- send.02
The send() function shall send a message only when the socket is connected (including when the peer of a connectionless socket has been set via connect()).
- send.03
The send() function takes the following arguments:
- send.03.01 (struct)
socket Specifies the socket file descriptor.
- send.03.02 (struct)
buffer Points to the buffer containing the message to send.
- send.03.03 (struct)
length Specifies the length of the message in bytes.
- send.03.04
flags Specifies the type of message transmission. Values of this argument are formed by logically OR'ing zero or more of the following flags:
- send.03.04.01 (struct)
MSG_EOR Terminates a record (if supported by the protocol).
- send.03.04.02 (struct)
MSG_OOB Sends out-of-band data on sockets that support out-of-band communications. The significance and semantics of out-of-band data are protocol-specific.
- send.04 (struct)
The length of the message to be sent is specified by the length argument.
- send.05
If the message is too long to pass through the underlying protocol, send() shall fail and no data shall be transmitted.
- send.06
Successful completion of a call to send() does not guarantee delivery of the message.
- send.07
A return value of -1 indicates only locally-detected errors.
- send.08 (struct)
If space is not available at the sending socket to hold the message to be transmitted, and the socket file descriptor does not have O_NONBLOCK set, send() shall block until space is available.
- send.09
If space is not available at the sending socket to hold the message to be transmitted, and the socket file descriptor does have O_NONBLOCK set, send() shall fail.
- send.10
The select() and poll() functions can be used to determine when it is possible to send more data.
- send.11
The socket in use may require the process to have appropriate privileges to use the send() function.
- send.12.01
Upon successful completion, send() shall return the number of bytes sent.
- send.12.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- send.13
The send() function shall fail if:
- send.13.01
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and the requested operation would block.
- send.13.02
[EBADF] The socket argument is not a valid file descriptor.
- send.13.03
[ECONNRESET] A connection was forcibly closed by a peer.
- send.13.04
[EDESTADDRREQ] The socket is not connection-mode and no peer address is set.
- send.13.05
[EINTR] A signal interrupted send() before any data was transmitted.
- send.13.06
[EMSGSIZE] The message is too large to be sent all at once, as the socket requires.
- send.13.07
[ENOTCONN] The socket is not connected or otherwise has not had the peer pre-specified.
- send.13.08
[ENOTSOCK] The socket argument does not refer to a socket.
- send.13.09
[EOPNOTSUPP] The socket argument is associated with a socket that does not support one or more of the values set in flags.
- send.13.10
[EPIPE] The socket is shut down for writing, or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM, the SIGPIPE signal is generated to the calling thread.
- send.14
The send() function may fail if:
- send.14.01
[EACCES] The calling process does not have the appropriate privileges.
- send.14.02
[EIO] An I/O error occurred while reading from or writing to the file system.
- send.14.03
[ENETDOWN] The local network interface used to reach the destination is down.
- send.14.04
[ENETUNREACH] No route to the network is present.
- send.14.05
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- [+]sendmsg (41 / 8 / 0)
- sendmsg.01
The sendmsg() function shall send a message through a connection-mode or connectionless-mode socket.
Generalizes:
- sendmsg.02.01
- sendmsg.02.02
- sendmsg.03.01
- sendmsg.03.02.01
- sendmsg.03.02.02
- sendmsg.03.02.03
- sendmsg.03.03.01
- sendmsg.03.03.02
- sendmsg.04
- sendmsg.05.01
- sendmsg.05.02
- sendmsg.06
- sendmsg.07
- sendmsg.08
- sendmsg.09
- sendmsg.10
- sendmsg.11.01
- sendmsg.11.02
- sendmsg.12
- sendmsg.13
- sendmsg.14.01
- sendmsg.14.02
- sendmsg.15.01
- sendmsg.15.02
- sendmsg.15.03
- sendmsg.15.04
- sendmsg.15.05
- sendmsg.15.06
- sendmsg.15.07
- sendmsg.15.08
- sendmsg.15.09
- sendmsg.15.10
- sendmsg.15.11
- sendmsg.16.01
- sendmsg.16.02
- sendmsg.16.03
- sendmsg.16.04
- sendmsg.16.05
- sendmsg.17.01
- sendmsg.17.02
- sendmsg.17.03
- sendmsg.17.04
- sendmsg.17.05
- sendmsg.17.06
- sendmsg.17.07
- sendmsg.17.08
- sendmsg.17.09
- sendmsg.18.01
- sendmsg.18.02
- sendmsg.02.01
If the socket is connectionless-mode, the message shall be sent to the address specified by msghdr.
- sendmsg.02.02
If the socket is connection-mode, the destination address in msghdr shall be ignored.
- sendmsg.03
The sendmsg() function takes the following arguments:
- sendmsg.03.01 (struct)
socket Specifies the socket file descriptor.
- sendmsg.03.02
message
- sendmsg.03.02.01 (struct)
Points to a msghdr structure, containing both the destination address and the buffers for the outgoing message.
- sendmsg.03.02.02 (struct)
The length and format of the address depend on the address family of the socket.
- sendmsg.03.02.03 (struct)
The msg_flags member is ignored.
- sendmsg.03.03
flags Specifies the type of message transmission. The application may specify 0 or the following flag:
- sendmsg.03.03.01 (struct)
MSG_EOR Terminates a record (if supported by the protocol).
- sendmsg.03.03.02 (struct)
MSG_OOB Sends out-of-band data on sockets that support out-of-bound data. The significance and semantics of out-of-band data are protocol-specific.
- sendmsg.04
The msg_iov and msg_iovlen fields of message specify zero or more buffers containing the data to be sent.
- sendmsg.05.01 (struct)
msg_iov points to an array of iovec structures;
- sendmsg.05.02 (struct)
msg_iovlen shall be set to the dimension of this array.
- sendmsg.06 (struct)
In each iovec structure, the iov_base field specifies a storage area and the iov_len field gives its size in bytes.
- sendmsg.07
Some of these sizes can be zero.
- sendmsg.08
The data from each storage area indicated by msg_iov is sent in turn.
- sendmsg.09
Successful completion of a call to sendmsg() does not guarantee delivery of the message.
- sendmsg.10
A return value of -1 indicates only locally-detected errors.
- sendmsg.11.01
If space is not available at the sending socket to hold the message to be transmitted and the socket file descriptor does not have O_NONBLOCK set, the sendmsg() function shall block until space is available.
- sendmsg.11.02
If space is not available at the sending socket to hold the message to be transmitted and the socket file descriptor does have O_NONBLOCK set, the sendmsg() function shall fail.
- sendmsg.12
If the socket protocol supports broadcast and the specified address is a broadcast address for the socket protocol, sendmsg() shall fail if the SO_BROADCAST option is not set for the socket.
- sendmsg.13
The socket in use may require the process to have appropriate privileges to use the sendmsg() function.
- sendmsg.14.01
Upon successful completion, sendmsg() shall return the number of bytes sent.
- sendmsg.14.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- sendmsg.15
The sendmsg() function shall fail if:
- sendmsg.15.01
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and the requested operation would block.
- sendmsg.15.02
[EAFNOSUPPORT] Addresses in the specified address family cannot be used with this socket.
- sendmsg.15.03
[EBADF] The socket argument is not a valid file descriptor.
- sendmsg.15.04
[ECONNRESET] A connection was forcibly closed by a peer.
- sendmsg.15.05
[EINTR] A signal interrupted sendmsg() before any data was transmitted.
- sendmsg.15.06
[EINVAL] The sum of the iov_len values overflows an ssize_t.
- sendmsg.15.07
[EMSGSIZE] The message is too large to be sent all at once (as the socket requires), or the msg_iovlen member of the msghdr structure pointed to by message is less than or equal to 0 or is greater than {IOV_MAX}.
- sendmsg.15.08
[ENOTCONN] The socket is connection-mode but is not connected.
- sendmsg.15.09
[ENOTSOCK] The socket argument does not refer to a socket.
- sendmsg.15.10
[EOPNOTSUPP] The socket argument is associated with a socket that does not support one or more of the values set in flags.
- sendmsg.15.11
[EPIPE] The socket is shut down for writing, or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM, the SIGPIPE signal is generated to the calling thread.
- sendmsg.16
If the address family of the socket is AF_UNIX, then sendmsg() shall fail if:
- sendmsg.16.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- sendmsg.16.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the pathname in the socket address.
- sendmsg.16.03
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire pathname exceeded {PATH_MAX} characters.
- sendmsg.16.04
[ENOENT] A component of the pathname does not name an existing file or the path name is an empty string.
- sendmsg.16.05
[ENOTDIR] A component of the path prefix of the pathname in the socket address is not a directory.
- sendmsg.17
The sendmsg() function may fail if:
- sendmsg.17.01
[EACCES] Search permission is denied for a component of the path prefix; or write access to the named socket is denied.
- sendmsg.17.02
[EDESTADDRREQ] The socket is not connection-mode and does not have its peer address set, and no destination address was specified.
- sendmsg.17.03
[EHOSTUNREACH] The destination host cannot be reached (probably because the host is down or a remote router cannot reach it).
- sendmsg.17.04
[EIO] An I/O error occurred while reading from or writing to the file system.
- sendmsg.17.05
[EISCONN] A destination address was specified and the socket is already connected.
- sendmsg.17.06
[ENETDOWN] The local network interface used to reach the destination is down.
- sendmsg.17.07
[ENETUNREACH] No route to the network is present.
- sendmsg.17.08
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- sendmsg.17.09
[ENOMEM] Insufficient memory was available to fulfill the request.
- sendmsg.18
If the address family of the socket is AF_UNIX, then sendmsg() may fail if:
- sendmsg.18.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the pathname in the socket address.
- sendmsg.18.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- [+]sendto (37 / 5 / 0)
- sendto.01
The sendto() function shall send a message through a connection-mode or connectionless-mode socket.
Generalizes:
- sendto.02.01
- sendto.02.02
- sendto.03.01
- sendto.03.02
- sendto.03.03
- sendto.03.04.01
- sendto.03.04.02.01
- sendto.03.04.02.02
- sendto.03.05.01
- sendto.03.05.02
- sendto.03.06
- sendto.04
- sendto.05
- sendto.06
- sendto.07.01
- sendto.07.02
- sendto.08
- sendto.09
- sendto.10
- sendto.11.01
- sendto.11.02
- sendto.12.01
- sendto.12.02
- sendto.12.03
- sendto.12.04
- sendto.12.05
- sendto.12.06
- sendto.12.07
- sendto.12.08
- sendto.12.09
- sendto.12.10
- sendto.13.01
- sendto.13.02
- sendto.13.03
- sendto.13.04
- sendto.13.05
- sendto.14.01
- sendto.14.02
- sendto.14.03
- sendto.14.04
- sendto.14.05
- sendto.14.06
- sendto.14.07
- sendto.14.08
- sendto.14.09
- sendto.14.10
- sendto.15.01
- sendto.15.02
- sendto.02.01
If the socket is connectionless-mode, the message shall be sent to the address specified by dest_addr.
- sendto.02.02
If the socket is connection-mode, dest_addr shall be ignored.
- sendto.03
The sendto() function takes the following arguments:
- sendto.03.01 (struct)
socket Specifies the socket file descriptor.
- sendto.03.02 (struct)
message Points to a buffer containing the message to be sent.
- sendto.03.03 (struct)
length Specifies the size of the message in bytes.
- sendto.03.04
flags Specifies the type of message transmission. Values of this argument are formed by logically OR'ing zero or more of the following flags:
- sendto.03.04.01 (struct)
MSG_EOR Terminates a record (if supported by the protocol).
- sendto.03.04.02
MSG_OOB
- sendto.03.04.02.01 (struct)
Sends out-of-band data on sockets that support out-of-band data.
- sendto.03.04.02.02 (struct)
The significance and semantics of out-of-band data are protocol-specific.
- sendto.03.05
dest_addr
- sendto.03.05.01 (struct)
Points to a sockaddr structure containing the destination address.
- sendto.03.05.02 (struct)
The length and format of the address depend on the address family of the socket.
- sendto.03.06 (struct)
dest_len Specifies the length of the sockaddr structure pointed to by the dest_addr argument.
- sendto.04
If the socket protocol supports broadcast and the specified address is a broadcast address for the socket protocol, sendto() shall fail if the SO_BROADCAST option is not set for the socket.
- sendto.05 (struct)
The dest_addr argument specifies the address of the target.
- sendto.06 (struct)
The length argument specifies the length of the message.
- sendto.07.01
Successful completion of a call to sendto() does not guarantee delivery of the message.
- sendto.07.02
A return value of -1 indicates only locally-detected errors.
- sendto.08 (struct)
If space is not available at the sending socket to hold the message to be transmitted and the socket file descriptor does not have O_NONBLOCK set, sendto() shall block until space is available.
- sendto.09
If space is not available at the sending socket to hold the message to be transmitted and the socket file descriptor does have O_NONBLOCK set, sendto() shall fail.
- sendto.10
The socket in use may require the process to have appropriate privileges to use the sendto() function.
- sendto.11.01
Upon successful completion, sendto() shall return the number of bytes sent.
- sendto.11.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- sendto.12
The sendto() function shall fail if:
- sendto.12.01
[EAFNOSUPPORT] Addresses in the specified address family cannot be used with this socket.
- sendto.12.02
[EAGAIN] or [EWOULDBLOCK] The socket's file descriptor is marked O_NONBLOCK and the requested operation would block.
- sendto.12.03
[EBADF] The socket argument is not a valid file descriptor.
- sendto.12.04
[ECONNRESET] A connection was forcibly closed by a peer.
- sendto.12.05
[EINTR] A signal interrupted sendto() before any data was transmitted.
- sendto.12.06
[EMSGSIZE] The message is too large to be sent all at once, as the socket requires.
- sendto.12.07
[ENOTCONN] The socket is connection-mode but is not connected.
- sendto.12.08
[ENOTSOCK] The socket argument does not refer to a socket.
- sendto.12.09
[EOPNOTSUPP] The socket argument is associated with a socket that does not support one or more of the values set in flags.
- sendto.12.10
[EPIPE] The socket is shut down for writing, or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM, the SIGPIPE signal is generated to the calling thread.
- sendto.13
If the address family of the socket is AF_UNIX, then sendto() shall fail if:
- sendto.13.01
[EIO] An I/O error occurred while reading from or writing to the file system.
- sendto.13.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the pathname in the socket address.
- sendto.13.03
[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire pathname exceeded {PATH_MAX} characters.
- sendto.13.04
[ENOENT] A component of the pathname does not name an existing file or the pathname is an empty string.
- sendto.13.05
[ENOTDIR] A component of the path prefix of the pathname in the socket address is not a directory.
- sendto.14
The sendto() function may fail if:
- sendto.14.01
[EACCES] Search permission is denied for a component of the path prefix; or write access to the named socket is denied.
- sendto.14.02
[EDESTADDRREQ] The socket is not connection-mode and does not have its peer address set, and no destination address was specified.
- sendto.14.03
[EHOSTUNREACH] The destination host cannot be reached (probably because the host is down or a remote router cannot reach it).
- sendto.14.04
[EINVAL] The dest_len argument is not a valid length for the address family.
- sendto.14.05
[EIO] An I/O error occurred while reading from or writing to the file system.
- sendto.14.06
[EISCONN] A destination address was specified and the socket is already connected. This error may or may not be returned for connection mode sockets.
- sendto.14.07
[ENETDOWN] The local network interface used to reach the destination is down.
- sendto.14.08
[ENETUNREACH] No route to the network is present.
- sendto.14.09
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- sendto.14.10
[ENOMEM] Insufficient memory was available to fulfill the request.
- sendto.15
If the address family of the socket is AF_UNIX, then sendto() may fail if:
- sendto.15.01
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the pathname in the socket address.
- sendto.15.02
[ENAMETOOLONG] Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
- [+]setsockopt (37 / 2 / 0)
- setsockopt.01
The setsockopt() function shall set the option specified by the option_name argument, at the protocol level specified by the level argument, to the value pointed to by the option_value argument for the socket associated with the file descriptor specified by the socket argument.
- setsockopt.02 (struct)
The level argument specifies the protocol level at which the option resides.
- setsockopt.03 (struct)
To set options at the socket level, specify the level argument as SOL_SOCKET.
- setsockopt.04 (struct)
To set options at other levels, supply the appropriate level identifier for the protocol controlling the option.
- setsockopt.05 (struct)
The option_name argument specifies a single option to set.
- setsockopt.06
The option_name argument and any specified options are passed uninterpreted to the appropriate protocol module for interpretations.
- setsockopt.07.01
SO_DEBUG
- setsockopt.07.01.01 (struct)
Turns on recording of debugging information.
- setsockopt.07.01.02 (struct)
This option enables or disables debugging in the underlying protocol modules.
- setsockopt.07.01.03 (struct)
This option takes an int value. This is a Boolean option.
- setsockopt.07.02
SO_BROADCAST
- setsockopt.07.02.01 (struct)
Permits sending of broadcast messages, if this is supported by the protocol.
- setsockopt.07.02.02 (struct)
This option takes an int value. This is a Boolean option.
- setsockopt.07.03
SO_REUSEADDR
- setsockopt.07.03.01 (struct)
Specifies that the rules used in validating addresses supplied to bind() should allow reuse of local addresses, if this is supported by the protocol.
- setsockopt.07.03.02 (struct)
This option takes an int value. This is a Boolean option.
- setsockopt.07.04
SO_KEEPALIVE
- setsockopt.07.04.01 (struct)
Keeps connections active by enabling the periodic transmission of messages, if this is supported by the protocol.
- setsockopt.07.04.02 (struct)
This option takes an int value.
- setsockopt.07.05.01
If the connected socket fails to respond to these messages, the connection is broken and threads writing to that socket are notified with a SIGPIPE signal.
- setsockopt.07.05.02 (struct)
This is a Boolean option.
- setsockopt.07.06
SO_LINGER
- setsockopt.07.06.01 (struct)
Lingers on a close() if data is present.
- setsockopt.07.06.02 (struct)
This option controls the action taken when unsent messages queue on a socket and close() is performed.
- setsockopt.07.06.03 (struct)
If SO_LINGER is set, the system shall block the calling thread during close() until it can transmit the data or until the time expires.
- setsockopt.07.06.04 (struct)
If SO_LINGER is not specified, and close() is issued, the system handles the call in a way that allows the calling thread to continue as quickly as possible.
- setsockopt.07.06.05 (struct)
This option takes a linger structure, as defined in the <sys/socket.h> header, to specify the state of the option and linger interval.
- setsockopt.07.07
SO_OOBINLINE
- setsockopt.07.07.01 (struct)
Leaves received out-of-band data (data marked urgent) inline.
- setsockopt.07.07.02 (struct)
This option takes an int value. This is a Boolean option.
- setsockopt.07.08
SO_SNDBUF
- setsockopt.07.08.01 (struct)
Sets send buffer size.
- setsockopt.07.08.02 (struct)
This option takes an int value.
- setsockopt.07.09
SO_RCVBUF
- setsockopt.07.09.01 (struct)
Sets receive buffer size.
- setsockopt.07.09.02 (struct)
This option takes an int value.
- setsockopt.07.10
SO_DONTROUTE
- setsockopt.07.10.01 (struct)
Requests that outgoing messages bypass the standard routing facilities.
- setsockopt.07.10.02
The destination shall be on a directly-connected network, and messages are directed to the appropriate network interface according to the destination address.
- setsockopt.07.10.03
The effect, if any, of this option depends on what protocol is in use.
- setsockopt.07.10.04 (struct)
This option takes an int value. This is a Boolean option.
- setsockopt.07.11
SO_RCVLOWAT
- setsockopt.07.11.01 (struct)
Sets the minimum number of bytes to process for socket input operations.
- setsockopt.07.11.02 (struct)
The default value for SO_RCVLOWAT is 1.
- setsockopt.07.11.03
If SO_RCVLOWAT is set to a larger value, blocking receive calls normally wait until they have received the smaller of the low water mark value or the requested amount.
- setsockopt.07.11.04
They may return less than the low water mark if an error occurs, a signal is caught, or the type of data next in the receive queue is different from that returned;
- setsockopt.07.11.05 (struct)
This option takes an int value.
- setsockopt.07.11.06
Note that not all implementations allow this option to be set.
- setsockopt.07.12
SO_RCVTIMEO
- setsockopt.07.12.01 (struct)
Sets the timeout value that specifies the maximum amount of time an input function waits until it completes.
- setsockopt.07.12.02 (struct)
It accepts a timeval structure with the number of seconds and microseconds specifying the limit on how long to wait for an input operation to complete.
- setsockopt.07.12.03.01
If a receive operation has blocked for this much time without receiving additional data, it shall return with a partial count
- setsockopt.07.12.03.02
or errno set to [EAGAIN] or [EWOULDBLOCK] if no data is received.
- setsockopt.07.12.04 (struct)
The default for this option is zero, which indicates that a receive operation shall not time out.
- setsockopt.07.12.05 (struct)
This option takes a timeval structure.
- setsockopt.07.12.06
Note that not all implementations allow this option to be set.
- setsockopt.07.13
SO_SNDLOWAT
- setsockopt.07.13.01 (struct)
Sets the minimum number of bytes to process for socket output operations.
- setsockopt.07.13.02
Non-blocking output operations shall process no data if flow control does not allow the smaller of the send low water mark value or the entire request to be processed.
- setsockopt.07.13.03 (struct)
This option takes an int value.
- setsockopt.07.13.04
Note that not all implementations allow this option to be set.
- setsockopt.07.14
SO_SNDTIMEO
- setsockopt.07.14.01 (struct)
Sets the timeout value specifying the amount of time that an output function blocks because flow control prevents data from being sent.
- setsockopt.07.14.02
If a send operation has blocked for this time, it shall return with a partial count
- setsockopt.07.14.03
or with errno set to [EAGAIN] or [EWOULDBLOCK] if no data is sent.
- setsockopt.07.14.04 (struct)
The default for this option is zero, which indicates that a send operation shall not time out.
- setsockopt.07.14.05 (struct)
This option stores a timeval structure.
- setsockopt.07.14.06
Note that not all implementations allow this option to be set.
- setsockopt.08.01 (struct)
For Boolean options, 0 indicates that the option is disabled
- setsockopt.08.02 (struct)
and 1 indicates that the option is enabled.
- setsockopt.09 (struct)
Options at other protocol levels vary in format and name.
- setsockopt.10.01
Upon successful completion, setsockopt() shall return 0.
- setsockopt.10.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- setsockopt.11
The setsockopt() function shall fail if:
- setsockopt.11.01
[EBADF] The socket argument is not a valid file descriptor.
- setsockopt.11.02
[EDOM] The send and receive timeout values are too big to fit into the timeout fields in the socket structure.
- setsockopt.11.03
[EINVAL] The specified option is invalid at the specified socket level or the socket has been shut down.
- setsockopt.11.04
[EISCONN] The socket is already connected, and a specified option cannot be set while the socket is connected.
- setsockopt.11.05
[ENOPROTOOPT] The option is not supported by the protocol.
- setsockopt.11.06
[ENOTSOCK] The socket argument does not refer to a socket.
- setsockopt.12
The setsockopt() function may fail if:
- setsockopt.12.01
[ENOMEM] There was insufficient memory available for the operation to complete.
- setsockopt.12.02
[ENOBUFS] Insufficient resources are available in the system to complete the call.
- setsockopt.30
If the level parameter is IPPROTO_IP, the following values shall be supported for option_name (see RFC 791:Internet Protocol for further details):
- setsockopt.30.01
IP_OPTIONS
- setsockopt.30.01.01
Set the Internet Protocol options sent with every packet from this socket.
- setsockopt.30.02
IP_TOS
- setsockopt.30.02.01
Set the Type of Service flags to use when sending packets with this socket.
- setsockopt.30.03
IP_TTL
- setsockopt.30.03.01
Set the current unicast Internet Protocol Time To Live value used when sending packets with this socket.
- setsockopt.30.04
IP_MULTICAST_TTL
- setsockopt.30.04.01
Sets the Time To Live value of outgoing multicast packets for this socket.
- setsockopt.30.04.02
If the new TTL value is -1, the implementation should use an unspecified default TTL value.
- setsockopt.30.04.03
If the new TTL value is out of the range of acceptable values (0-255), setsockopt() shall return -1 and set errno to indicate the error.
- setsockopt.30.05
IP_MULTICAST_LOOP
- setsockopt.30.05.01
Sets a boolean flag indicating whether multicast packets originating locally should be looped back to the local sockets.
- setsockopt.30.06
IP_ADD_MEMBERSHIP
- setsockopt.30.06.01
Join a multicast group.
- setsockopt.30.06.02
If imr_address is set to INADDR_ANY, then an appropriate interface is chosen by the system.
- setsockopt.30.07
IP_DROP_MEMBERSHIP
- setsockopt.30.07.01
Leave a multicast group.
- setsockopt.30.08
IP_MULTICAST_IF
- setsockopt.30.08.01
Set the local device for a multicast socket.
- app.setsockopt.30
If the level parameter is IPPROTO_IP, the following values shall be supported for option_name (see RFC 791:Internet Protocol for further details):
- app.setsockopt.30.01
IP_OPTIONS
- app.setsockopt.30.01.01
The option_value shall point to a memory buffer containing the options
- app.setsockopt.30.01.02
option_len shall contain the size in bytes of that buffer
- app.setsockopt.30.01.03
For IPv4, the maximum length of options is 40 bytes.
- app.setsockopt.30.02
IP_TOS
- app.setsockopt.30.02.01
The option_value shall point to a value containing the type of service value.
- app.setsockopt.30.02.02
The least significant two bits of the value shall contain the new Type of Service indicator.
- app.setsockopt.30.02.03
The option_len parameter shall hold the size, in bytes, of the buffer referred to by option_value.
- app.setsockopt.30.03
IP_TTL
- app.setsockopt.30.03.01
The option_value shall point to a value containing the time to live value
- app.setsockopt.30.03.02
which shall be between 1 and 255
- app.setsockopt.30.03.03
The option_len parameter shall hold the size, in bytes, of the buffer referred to by option_value.
- app.setsockopt.30.04
IP_MULTICAST_TTL
- app.setsockopt.30.04.01
optval shall point to an integer which contains the new TTL value.
- app.setsockopt.30.05
IP_MULTICAST_LOOP
- app.setsockopt.30.05.01
optval shall point to an integer which contains the new flag value.
- app.setsockopt.30.06
IP_ADD_MEMBERSHIP
- app.setsockopt.30.06.01
optval shall point to a ip_mreq structure.
- app.setsockopt.30.06.02
Before calling, the caller should fill in the imr_multiaddr field with the multicast group address and the imr_address field with the address of the local interface.
- app.setsockopt.30.07
IP_DROP_MEMBERSHIP
- app.setsockopt.30.07.01
optval shall point to a ip_mreq structure containing the same values as were used with IP_ADD_MEMBERSHIP.
- app.setsockopt.30.08
IP_MULTICAST_IF
- app.setsockopt.30.08.01
optval shall point to a ip_mreq structure initialized in the same manner as with IP_ADD_MEMBERSHIP.
- [+]shutdown (9 / 2 / 0)
- shutdown.01
The shutdown() function shall cause all or part of a full-duplex connection on the socket associated with the file descriptor socket to be shut down.
Generalizes:
- shutdown.02.01
- shutdown.02.02.01
- shutdown.02.02.02
- shutdown.02.02.03
- shutdown.03
- shutdown.04.01
- shutdown.04.02
- shutdown.05.01
- shutdown.05.02
- shutdown.05.03
- shutdown.05.04
- shutdown.06.01
- shutdown.02
The shutdown() function takes the following arguments:
- shutdown.02.01 (struct)
socket Specifies the file descriptor of the socket.
- shutdown.02.02
how Specifies the type of shutdown. The values are as follows:
- shutdown.02.02.01 (struct)
SHUT_RD Disables further receive operations.
- shutdown.02.02.02 (struct)
SHUT_WR Disables further send operations.
- shutdown.02.02.03 (struct)
SHUT_RDWR Disables further send and receive operations.
- shutdown.03
The shutdown() function disables subsequent send and/or receive operations on a socket, depending on the value of the how argument.
Generalizes:
- shutdown.01
- shutdown.02.01
- shutdown.02.02.01
- shutdown.02.02.02
- shutdown.02.02.03
- shutdown.04.01
- shutdown.04.02
- shutdown.05.01
- shutdown.05.02
- shutdown.05.03
- shutdown.05.04
- shutdown.06.01
- shutdown.04.01
Upon successful completion, shutdown() shall return 0;
- shutdown.04.02
otherwise, -1 shall be returned and errno set to indicate the error.
- shutdown.05
The shutdown() function shall fail if:
- shutdown.05.01
[EBADF] The socket argument is not a valid file descriptor.
- shutdown.05.02
[EINVAL] The how argument is invalid.
- shutdown.05.03
[ENOTCONN] The socket is not connected.
- shutdown.05.04
[ENOTSOCK] The socket argument does not refer to a socket.
- shutdown.06
The shutdown() function may fail if:
- shutdown.06.01
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- [+]sockatmark (9 / 1 / 0)
- sockatmark.01
The sockatmark() function shall determine whether the socket specified by the descriptor s is at the out-of-band data mark
- sockatmark.02
If the protocol for the socket supports out-of-band data by marking the stream with an out-of-band data mark, the sockatmark() function shall return 1 when all data preceding the mark has been read and the out-of-band data mark is the first element in the receive queue.
- sockatmark.03
The sockatmark() function shall not remove the mark from the stream.
- sockatmark.04
Upon successful completion, the sockatmark() function shall return a value indicating whether the socket is at an out-of-band data mark.
- sockatmark.05.01
If the protocol has marked the data stream and all data preceding the mark has been read, the return value shall be 1;
- sockatmark.05.02
if there is no mark, or if data precedes the mark in the receive queue, the sockatmark() function shall return 0.
- sockatmark.05.03
Otherwise, it shall return a value of -1 and set errno to indicate the error.
- sockatmark.06
The sockatmark() function shall fail if:
- sockatmark.06.01
[EBADF] The s argument is not a valid file descriptor.
- sockatmark.06.02
[ENOTTY] The s argument does not specify a descriptor for a socket.
- [+]socket (20 / 6 / 0)
- socket.01.01
The socket() function shall create an unbound socket in a communications domain,
Generalizes:
- socket.01.02
- socket.02.01
- socket.02.02
- socket.02.03.01
- socket.02.03.02
- socket.03.01
- socket.03.02
- socket.04.01
- socket.04.02
- socket.04.03.01
- socket.04.03.02
- socket.04.03.03
- socket.05.01
- socket.05.02
- socket.05.03
- socket.06
- socket.07.01
- socket.07.02
- socket.08.01
- socket.08.02
- socket.08.03
- socket.08.04
- socket.08.05
- socket.09.01
- socket.09.02
- socket.09.03
- socket.rpc.01
- socket.01.02
and return a file descriptor that can be used in later function calls that operate on sockets.
- socket.02
The socket() function takes the following arguments:
- socket.02.01 (struct)
domain Specifies the communications domain in which a socket is to be created.
- socket.02.02 (struct)
type Specifies the type of socket to be created.
- socket.02.03
protocol
- socket.02.03.01 (struct)
Specifies a particular protocol to be used with the socket.
- socket.02.03.02 (struct)
Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type.
- socket.03.01
The domain argument specifies the address family used in the communications domain.
- socket.03.02
The address families supported by the system are implementation-defined.
- socket.04
The type argument specifies the socket type, which determines the semantics of communication over the socket. The following socket types are defined; implementations may specify additional socket types:
- socket.04.01 (struct)
SOCK_STREAM Provides sequenced, reliable, bidirectional, connection-mode byte streams, and may provide a transmission mechanism for out-of-band data.
- socket.04.02 (struct)
SOCK_DGRAM Provides datagrams, which are connectionless-mode, unreliable messages of fixed maximum length.
- socket.04.03
SOCK_SEQPACKET
- socket.04.03.01 (struct)
Provides sequenced, reliable, bidirectional, connection-mode transmission paths for records.
- socket.04.03.02
A record can be sent using one or more output operations and received using one or more input operations, but a single operation never transfers part of more than one record.
- socket.04.03.03
Record boundaries are visible to the receiver via the MSG_EOR flag.
- socket.05.01
If the protocol argument is non-zero, it shall specify a protocol that is supported by the address family.
- socket.05.02 (struct)
If the protocol argument is zero, the default protocol for this address family and type shall be used.
- socket.05.03
The protocols supported by the system are implementation-defined.
- socket.06
The process may need to have appropriate privileges to use the socket() function or to create some sockets.
- socket.07.01
Upon successful completion, socket() shall return a non-negative integer, the socket file descriptor.
- socket.07.02
Otherwise, a value of -1 shall be returned and errno set to indicate the error.
- socket.08
The socket() function shall fail if:
- socket.08.01
[EAFNOSUPPORT] The implementation does not support the specified address family.
- socket.08.02
[EMFILE] No more file descriptors are available for this process.
- socket.08.03
[ENFILE] No more file descriptors are available for the system.
- socket.08.04
[EPROTONOSUPPORT] The protocol is not supported by the address family, or the protocol is not supported by the implementation.
- socket.08.05
[EPROTOTYPE] The socket type is not supported by the protocol.
- socket.09
The socket() function may fail if:
- socket.09.01
[EACCES] The process does not have appropriate privileges.
- socket.09.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- socket.09.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- socket.rpc.01
This is the default authentication used by RPC.
- [+]socketpair (17 / 3 / 0)
- socketpair.01
The socketpair() function shall create an unbound pair of connected sockets in a specified domain, of a specified type, under the protocol optionally specified by the protocol argument.
- app.socketpair.02
The two sockets shall be identical.
- socketpair.03 (struct)
The file descriptors used in referencing the created sockets shall be returned in socket_vector[0] and socket_vector[1].
- socketpair.04
The socketpair() function takes the following arguments:
- socketpair.04.01 (struct)
domain Specifies the communications domain in which the sockets are to be created.
- socketpair.04.02 (struct)
type Specifies the type of sockets to be created.
- socketpair.04.03
protocol
- socketpair.04.03.01 (struct)
Specifies a particular protocol to be used with the sockets.
- socketpair.04.03.02 (struct)
Specifying a protocol of 0 causes socketpair() to use an unspecified default protocol appropriate for the requested socket type.
- socketpair.04.04 (struct)
socket_vector Specifies a 2-integer array to hold the file descriptors of the created socket pair.
- socketpair.05
The type argument specifies the socket type, which determines the semantics of communications over the socket. The following socket types are defined; implementations may specify additional socket types:
- socketpair.05.01 (struct)
SOCK_STREAM Provides sequenced, reliable, bidirectional, connection-mode byte streams, and may provide a transmission mechanism for out-of-band data.
- socketpair.05.02 (struct)
SOCK_DGRAM Provides datagrams, which are connectionless-mode, unreliable messages of fixed maximum length.
- socketpair.05.03
SOCK_SEQPACKET
- socketpair.05.03.01 (struct)
Provides sequenced, reliable, bidirectional, connection-mode transmission paths for records.
- socketpair.05.03.02
A record can be sent using one or more output operations and received using one or more input operations, but a single operation never transfers part of more than one record.
- socketpair.05.03.03
Record boundaries are visible to the receiver via the MSG_EOR flag.
- socketpair.06.01
If the protocol argument is non-zero, it shall specify a protocol that is supported by the address family.
- socketpair.06.02 (struct)
If the protocol argument is zero, the default protocol for this address family and type shall be used.
- socketpair.06.03
The protocols supported by the system are implementation-defined.
- socketpair.07
The process may need to have appropriate privileges to use the socketpair() function or to create some sockets.
- socketpair.08.01
Upon successful completion, this function shall return 0;
- socketpair.08.02
otherwise, -1 shall be returned and errno set to indicate the error.
- socketpair.09
The socketpair() function shall fail if:
- socketpair.09.01
[EAFNOSUPPORT] The implementation does not support the specified address family.
- socketpair.09.02
[EMFILE] No more file descriptors are available for this process.
- socketpair.09.03
[ENFILE] No more file descriptors are available for the system.
- socketpair.09.04
[EOPNOTSUPP] The specified protocol does not permit creation of socket pairs.
- socketpair.09.05
[EPROTONOSUPPORT] The protocol is not supported by the address family, or the protocol is not supported by the implementation.
- socketpair.09.06
[EPROTOTYPE] The socket type is not supported by the protocol.
- socketpair.10
The socketpair() function may fail if:
- socketpair.10.01
[EACCES] The process does not have appropriate privileges.
- socketpair.10.02
[ENOBUFS] Insufficient resources were available in the system to perform the operation.
- socketpair.10.03
[ENOMEM] Insufficient memory was available to fulfill the request.
- [+]system.host (20 / 13 / 0)
- [+]gethostid (1 / 1 / 0)
- gethostid.01
The gethostid() function shall retrieve a 32-bit identifier for the current host.
- [+]gethostname (5 / 5 / 0)
- gethostname.01
The gethostname() function shall return the standard host name for the current machine.
- gethostname.02
The returned name shall be null-terminated, except that if namelen is an insufficient length to hold the host name, then the returned name shall be truncated and it is unspecified whether the returned name is null-terminated.
- gethostname.03
Host names are limited to {HOST_NAME_MAX} bytes.
- gethostname.04.01
Upon successful completion, 0 shall be returned;
- gethostname.04.02
otherwise, -1 shall be returned.
- [+]sethostname (7 / 5 / 0)
- sethostname.01
If the process has appropriate privileges, the sethostname() function shall change the host name for the current macine.
- sethostname.02
The name shall point to a null-terminated string of at most len bytes that holds the new hostname.
- sethostname.03
If the symbol HOST_NAME_MAX is defined, or if sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, this value shall represent the maximum length of the new hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this value shall represent the maximum length for the new hostname. If none of these values are defined, the maximum length shall be the size of the nodename field of the utsname structure.
- sethostname.04.01
On success, 0 is returned.
- sethostname.04.02
On error, -1 is returned and the global variable errno is set appropriately.
- sethostname.05.01
[EINVAL] len is negative or larger than the maximum allowed size.
- sethostname.05.02
[EPERM] the process did not have appropriate privilege.
- [+]uname (7 / 2 / 0)
- uname.01
The uname() function shall store information identifying the current system in the structure pointed to by name.
- uname.01.01
The uname() function shall return a string naming the current system in the character array sysname.
- uname.01.02
Similarly, nodename shall contain the name of this node within an implementation-defined communications network.
- uname.01.03
The arrays release and version shall further identify the operating system.
- uname.01.04
The array machine shall contain a name that identifies the hardware that the system is running on.
- uname.01.05
The format of each member is implementation-defined.
- uname.08.01
Upon successful completion, a non-negative value shall be returned.
- uname.08.02
Otherwise, -1 shall be returned and errno set to indicate the error.
- [+]system.stat (26 / 8 / 0)
- [+]acct (10 / 3 / 0)
- acct.01
When filename is the name of an existing file, acct() turns accounting on and appends a record to filename for each terminating process.
- acct.02
When filename is NULL, acct() turns accounting off.
- acct.03.01
On success, 0 is returned.
- acct.03.02
On error, -1 is returned and the global variable errno is set appropriately.
- acct.04.01
[ENOSYS] BSD process accounting has not been enabled when the operating system kernel was compiled. The kernel configuration parameter controlling this feature is CONFIG_BSD_PROCESS_ACCT.
- acct.04.02
[ENOMEM] Out of memory.
- acct.04.03
[EPERM] The calling process has no permission to enable process accounting.
- acct.04.04
[EACCES] filename is not a regular file.
- acct.04.05
[EIO] Error writing to the filename.
- acct.04.06
[EUSERS] There are no more free file structures or we run out of memory.
- [+]clock (4 / 3 / 0)
- clock.01
The clock() function shall return the implementation's best approximation to the processor time used by the process since the beginning of an implementation-defined era related only to the process invocation.
- clock.02
To determine the time in seconds, the value returned by clock() should be divided by the value of the macro CLOCKS_PER_SEC.
- clock.03
CLOCKS_PER_SEC is defined to be one million in <time.h>.
- clock.04
If the processor time used is not available or its value cannot be represented, the function shall return the value ( clock_t)-1.
- [+]getloadavg (2 / 2 / 0)
- getloadavg.01
getloadavg() returns the number of processes in the system run queue averaged over various periods of time.
- getloadavg.02
Up to nelem samples are retrieved and assigned to successive elements of loadavg[].
- app.getloadavg.03
The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively.
- [+]times (10 / 0 / 0)
- times.01
The times() function shall fill the tms structure pointed to by buffer with time-accounting information.
Generalizes:
- times.02
- times.03
- times.04
- times.05
- times.06
- times.07
- times.08
- times.09
- times.10
- times.12
- times.02 (struct)
All times are measured in terms of the number of clock ticks used.
- times.03
The times of a terminated child process shall be included in the tms_cutime and tms_cstime elements of the parent when wait() or waitpid() returns the process ID of this terminated child.
- times.04
If a child process has not waited for its children, their times shall not be included in its times.
- times.05
The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process.
- times.06
The tms_stime structure member is the CPU time charged for execution by the system on behalf of the calling process.
- times.07
The tms_cutime structure member is the sum of the tms_utime and tms_cutime times of the child processes.
- times.08
The tms_cstime structure member is the sum of the tms_stime and tms_cstime times of the child processes.
- times.09
Upon successful completion, times() shall return the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, system start-up time).
- times.10
This point does not change from one invocation of times() within the process to another. The return value may overflow the possible range of type clock_t.
- times.12
If times() fails, (clock_t)-1 shall be returned and errno set to indicate the error.
- [+]system.sysconf (443 / 131 / 0)
- [+]__getpagesize (10 / 1 / 0)
- __getpagesize.01
__getpagesize() has the same specification as getpagesize()
- __getpagesize.sysconf.01
The implementation shall support all of the variables listed in the following table and may support others.
- __getpagesize.sysconf.01.95
_SC_PAGE_SIZE
- __getpagesize.sysconf.01.96
_SC_PAGESIZE
- __getpagesize.sysconf.02
If name is an invalid value, sysconf() shall return -1 and set errno to indicate the error.
- __getpagesize.sysconf.03
If the variable corresponding to name has no limit, sysconf() shall return -1 without changing the value of errno.
- __getpagesize.sysconf.04
The value returned shall not be more restrictive than the corresponding value described to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- __getpagesize.sysconf.05
The value shall not change during the lifetime of the calling process
- __getpagesize.sysconf.07
Otherwise, sysconf() shall return the current variable value on the system.
- __getpagesize.sysconf.09
[XSI] except that sysconf(_SC_OPEN_MAX) may return different values before and after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit.
- __getpagesize.sysconf.10
The sysconf() function shall fail if:
- app.__getpagesize.sysconf.06
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- [+]__sysconf (134 / 6 / 0)
- __sysconf.11
__sysconf() gets configuration information at runtime.
- __sysconf.12
__sysconf() is weak alias to sysconf().
- __sysconf.13
__sysconf() has the same specification as sysconf().
- __sysconf.sysconf.01
The implementation shall support all of the variables listed in the following table and may support others.
- __sysconf.sysconf.01.01
_SC_AIO_LISTIO_MAX
- __sysconf.sysconf.01.02
_SC_AIO_MAX
- __sysconf.sysconf.01.03
_SC_AIO_PRIO_DELTA_MAX
- __sysconf.sysconf.01.04
_SC_ARG_MAX
- __sysconf.sysconf.01.05
_SC_ATEXIT_MAX
- __sysconf.sysconf.01.06
_SC_BC_BASE_MAX
- __sysconf.sysconf.01.07
_SC_BC_DIM_MAX
- __sysconf.sysconf.01.08
_SC_BC_SCALE_MAX
- __sysconf.sysconf.01.09
_SC_BC_STRING_MAX
- __sysconf.sysconf.01.10
_SC_CHILD_MAX
- __sysconf.sysconf.01.100
_SC_THREAD_THREADS_MAX
- __sysconf.sysconf.01.101
_SC_RE_DUP_MAX
- __sysconf.sysconf.01.102
_SC_RTSIG_MAX
- __sysconf.sysconf.01.103
_SC_SEM_NSEMS_MAX
- __sysconf.sysconf.01.104
_SC_SEM_VALUE_MAX
- __sysconf.sysconf.01.105
_SC_SIGQUEUE_MAX
- __sysconf.sysconf.01.106
_SC_STREAM_MAX
- __sysconf.sysconf.01.107
_SC_SYMLOOP_MAX
- __sysconf.sysconf.01.108
_SC_TIMER_MAX
- __sysconf.sysconf.01.109
_SC_TTY_NAME_MAX
- __sysconf.sysconf.01.11
_SC_CLK_TCK
- __sysconf.sysconf.01.110
_SC_TZNAME_MAX
- __sysconf.sysconf.01.111
_SC_XBS5_ILP32_OFF32 (LEGACY)
- __sysconf.sysconf.01.112
_SC_XBS5_ILP32_OFFBIG (LEGACY)
- __sysconf.sysconf.01.113
_SC_XBS5_LP64_OFF64 (LEGACY)
- __sysconf.sysconf.01.114
_SC_XBS5_LPBIG_OFFBIG (LEGACY)
- __sysconf.sysconf.01.115
_SC_XOPEN_CRYPT
- __sysconf.sysconf.01.116
_SC_XOPEN_ENH_I18N
- __sysconf.sysconf.01.117
_SC_XOPEN_LEGACY
- __sysconf.sysconf.01.118
_SC_XOPEN_REALTIME
- __sysconf.sysconf.01.119
_SC_XOPEN_REALTIME_THREADS
- __sysconf.sysconf.01.12
_SC_COLL_WEIGHTS_MAX
- __sysconf.sysconf.01.120
_SC_XOPEN_SHM
- __sysconf.sysconf.01.121
_SC_XOPEN_STREAMS
- __sysconf.sysconf.01.122
_SC_XOPEN_UNIX
- __sysconf.sysconf.01.123
_SC_XOPEN_VERSION
- __sysconf.sysconf.01.13
_SC_DELAYTIMER_MAX
- __sysconf.sysconf.01.14
_SC_EXPR_NEST_MAX
- __sysconf.sysconf.01.15
_SC_HOST_NAME_MAX
- __sysconf.sysconf.01.16
_SC_IOV_MAX
- __sysconf.sysconf.01.17
_SC_LINE_MAX
- __sysconf.sysconf.01.18
_SC_LOGIN_NAME_MAX
- __sysconf.sysconf.01.19
_SC_NGROUPS_MAX
- __sysconf.sysconf.01.20
_SC_GETGR_R_SIZE_MAX
- __sysconf.sysconf.01.21
_SC_GETPW_R_SIZE_MAX
- __sysconf.sysconf.01.22
_SC_MQ_OPEN_MAX
- __sysconf.sysconf.01.23
_SC_MQ_PRIO_MAX
- __sysconf.sysconf.01.24
_SC_OPEN_MAX
- __sysconf.sysconf.01.25
_SC_ADVISORY_INFO
- __sysconf.sysconf.01.26
_SC_BARRIERS
- __sysconf.sysconf.01.27
_SC_ASYNCHRONOUS_IO
- __sysconf.sysconf.01.28
_SC_CLOCK_SELECTION
- __sysconf.sysconf.01.29
_SC_CPUTIME
- __sysconf.sysconf.01.30
_SC_FSYNC
- __sysconf.sysconf.01.31
_SC_IPV6
- __sysconf.sysconf.01.32
_SC_JOB_CONTROL
- __sysconf.sysconf.01.33
_SC_MAPPED_FILES
- __sysconf.sysconf.01.34
_SC_MEMLOCK
- __sysconf.sysconf.01.35
_SC_MEMLOCK_RANGE
- __sysconf.sysconf.01.36
_SC_MEMORY_PROTECTION
- __sysconf.sysconf.01.37
_SC_MESSAGE_PASSING
- __sysconf.sysconf.01.38
_SC_MONOTONIC_CLOCK
- __sysconf.sysconf.01.39
_SC_PRIORITIZED_IO
- __sysconf.sysconf.01.40
_SC_PRIORITY_SCHEDULING
- __sysconf.sysconf.01.41
_SC_RAW_SOCKETS
- __sysconf.sysconf.01.42
_SC_READER_WRITER_LOCKS
- __sysconf.sysconf.01.43
_SC_REALTIME_SIGNALS
- __sysconf.sysconf.01.44
_SC_REGEXP
- __sysconf.sysconf.01.45
_SC_SAVED_IDS
- __sysconf.sysconf.01.46
_SC_SEMAPHORES
- __sysconf.sysconf.01.47
_SC_SHARED_MEMORY_OBJECTS
- __sysconf.sysconf.01.48
_SC_SHELL
- __sysconf.sysconf.01.49
_SC_SPAWN
- __sysconf.sysconf.01.50
_SC_SPIN_LOCKS
- __sysconf.sysconf.01.51
_SC_SPORADIC_SERVER
- __sysconf.sysconf.01.52
_SC_SS_REPL_MAX
- __sysconf.sysconf.01.53
_SC_SYNCHRONIZED_IO
- __sysconf.sysconf.01.54
_SC_THREAD_ATTR_STACKADDR
- __sysconf.sysconf.01.55
_SC_THREAD_ATTR_STACKSIZE
- __sysconf.sysconf.01.56
_SC_THREAD_CPUTIME
- __sysconf.sysconf.01.57
_SC_THREAD_PRIO_INHERIT
- __sysconf.sysconf.01.58
_SC_THREAD_PRIO_PROTECT
- __sysconf.sysconf.01.59
_SC_THREAD_PRIORITY_SCHEDULING
- __sysconf.sysconf.01.60
_SC_THREAD_PROCESS_SHARED
- __sysconf.sysconf.01.61
_SC_THREAD_SAFE_FUNCTIONS
- __sysconf.sysconf.01.62
_SC_THREAD_SPORADIC_SERVER
- __sysconf.sysconf.01.63
_SC_THREADS
- __sysconf.sysconf.01.64
_SC_TIMEOUTS
- __sysconf.sysconf.01.65
_SC_TIMERS
- __sysconf.sysconf.01.66
_SC_TRACE
- __sysconf.sysconf.01.67
_SC_TRACE_EVENT_FILTER
- __sysconf.sysconf.01.68
_SC_TRACE_EVENT_NAME_MAX
- __sysconf.sysconf.01.69
_SC_TRACE_INHERIT
- __sysconf.sysconf.01.70
_SC_TRACE_LOG
- __sysconf.sysconf.01.71
_SC_TRACE_NAME_MAX
- __sysconf.sysconf.01.72
_SC_TRACE_SYS_MAX
- __sysconf.sysconf.01.73
_SC_TRACE_USER_EVENT_MAX
- __sysconf.sysconf.01.74
_SC_TYPED_MEMORY_OBJECTS
- __sysconf.sysconf.01.75
_SC_VERSION
- __sysconf.sysconf.01.76
_SC_V6_ILP32_OFF32
- __sysconf.sysconf.01.77
_SC_V6_ILP32_OFFBIG
- __sysconf.sysconf.01.78
_SC_V6_LP64_OFF64
- __sysconf.sysconf.01.79
_SC_V6_LPBIG_OFFBIG
- __sysconf.sysconf.01.80
_SC_2_C_BIND
- __sysconf.sysconf.01.81
_SC_2_C_DEV
- __sysconf.sysconf.01.82
_SC_2_CHAR_TERM
- __sysconf.sysconf.01.83
_SC_2_FORT_DEV
- __sysconf.sysconf.01.84
_SC_2_FORT_RUN
- __sysconf.sysconf.01.85
_SC_2_LOCALEDEF
- __sysconf.sysconf.01.86
_SC_2_PBS
- __sysconf.sysconf.01.87
_SC_2_PBS_ACCOUNTING
- __sysconf.sysconf.01.88
_SC_2_PBS_CHECKPOINT
- __sysconf.sysconf.01.89
_SC_2_PBS_LOCATE
- __sysconf.sysconf.01.90
_SC_2_PBS_MESSAGE
- __sysconf.sysconf.01.91
_SC_2_PBS_TRACK
- __sysconf.sysconf.01.92
_SC_2_SW_DEV
- __sysconf.sysconf.01.93
_SC_2_UPE
- __sysconf.sysconf.01.94
_SC_2_VERSION
- __sysconf.sysconf.01.95
_SC_PAGE_SIZE
- __sysconf.sysconf.01.96
_SC_PAGESIZE
- __sysconf.sysconf.01.97
_SC_THREAD_DESTRUCTOR_ITERATIONS
- __sysconf.sysconf.01.98
_SC_THREAD_KEYS_MAX
- __sysconf.sysconf.01.99
_SC_THREAD_STACK_MIN
- __sysconf.sysconf.02
If name is an invalid value, sysconf() shall return -1 and set errno to indicate the error.
- __sysconf.sysconf.03
If the variable corresponding to name has no limit, sysconf() shall return -1 without changing the value of errno.
- __sysconf.sysconf.04
The value returned shall not be more restrictive than the corresponding value described to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- __sysconf.sysconf.05
The value shall not change during the lifetime of the calling process
- __sysconf.sysconf.07
Otherwise, sysconf() shall return the current variable value on the system.
- __sysconf.sysconf.08
A value of -1 shall be an invalid "_SC..." value for sysconf().
- __sysconf.sysconf.09
[XSI] except that sysconf(_SC_OPEN_MAX) may return different values before and after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit.
- __sysconf.sysconf.10
The sysconf() function shall fail if:
- __sysconf.sysconf.10.01
[EINVAL] The value of the name argument is invalid.
- app.__sysconf.sysconf.06
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- [+]confstr (39 / 2 / 0)
- confstr.01
The implementation shall support the following name values, defined in <unistd.h>.
- confstr.01.01
_CS_PATH
- confstr.01.02
_CS_POSIX_V6_ILP32_OFF32_CFLAGS
- confstr.01.03
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS
- confstr.01.04
_CS_POSIX_V6_ILP32_OFF32_LIBS
- confstr.01.05
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
- confstr.01.06
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
- confstr.01.07
_CS_POSIX_V6_ILP32_OFFBIG_LIBS
- confstr.01.08
_CS_POSIX_V6_LP64_OFF64_CFLAGS
- confstr.01.09
_CS_POSIX_V6_LP64_OFF64_LDFLAGS
- confstr.01.10
_CS_POSIX_V6_LP64_OFF64_LIBS
- confstr.01.11
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
- confstr.01.12
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
- confstr.01.13
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS
- confstr.01.14
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
- confstr.01.15
_CS_XBS5_ILP32_OFF32_CFLAGS (LEGACY)
- confstr.01.16
_CS_XBS5_ILP32_OFF32_LDFLAGS (LEGACY)
- confstr.01.17
_CS_XBS5_ILP32_OFF32_LIBS (LEGACY)
- confstr.01.18
_CS_XBS5_ILP32_OFF32_LINTFLAGS (LEGACY)
- confstr.01.19
_CS_XBS5_ILP32_OFFBIG_CFLAGS (LEGACY)
- confstr.01.20
_CS_XBS5_ILP32_OFFBIG_LDFLAGS (LEGACY)
- confstr.01.21
_CS_XBS5_ILP32_OFFBIG_LIBS (LEGACY)
- confstr.01.22
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS (LEGACY)
- confstr.01.23
_CS_XBS5_LP64_OFF64_CFLAGS (LEGACY)
- confstr.01.24
_CS_XBS5_LP64_OFF64_LDFLAGS (LEGACY)
- confstr.01.25
_CS_XBS5_LP64_OFF64_LIBS (LEGACY)
- confstr.01.26
_CS_XBS5_LP64_OFF64_LINTFLAGS (LEGACY)
- confstr.01.27
_CS_XBS5_LPBIG_OFFBIG_CFLAGS (LEGACY)
- confstr.01.28
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS (LEGACY)
- confstr.01.29
_CS_XBS5_LPBIG_OFFBIG_LIBS (LEGACY)
- confstr.01.30
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS (LEGACY)
- confstr.02
It may support others
- confstr.03
If len is not 0, and if name has a configuration-defined value, confstr() shall copy that value into the len-byte buffer pointed to by buf.
- confstr.04.01
If the string to be returned is longer than len bytes, including the terminating null, then confstr() shall truncate the string to len-1 bytes and null-terminate the result.
- confstr.04.02
If this return value is greater than len, the string returned in buf is truncated.
- app.confstr.05
The application can detect that the string was truncated by comparing the value returned by confstr() with len.
- confstr.06
If len is 0 and buf is a null pointer, then confstr() shall still return the integer value as defined below, but shall not return a string.
- app.confstr.07
If len is 0 but buf is not a null pointer, the result is unspecified.
- app.confstr.08
If the implementation supports the POSIX shell option, the string stored in buf after a call to:confstr(_CS_PATH, buf, sizeof(buf))can be used as a value of the PATH environment variable that accesses all of the standard utilities of IEEE Std 1003.1-2001, if the return value is less than or equal to sizeof( buf).
- confstr.09
If name has a configuration-defined value, confstr() shall return the size of buffer that would be needed to hold the entire configuration-defined value including the terminating null.
- confstr.10
If name is invalid, confstr() shall return 0 and set errno to indicate the error.
- confstr.11
If name does not have a configuration-defined value, confstr() shall return 0 and leave errno unchanged.
- confstr.12
The confstr() function shall fail if:
- confstr.12.01
[EINVAL] The value of the name argument is invalid.
- [+]fpathconf (55 / 1 / 0)
- fpathconf.01
The fpathconf() and pathconf() functions shall determine the current value of a configurable limit or option (variable) that is associated with a file or directory.
- fpathconf.02
Implementations shall support all of the variables listed in the following table
- fpathconf.02.01
_PC_FILESIZEBITS
- fpathconf.02.02
_PC_LINK_MAX
- fpathconf.02.03
_PC_MAX_CANON
- fpathconf.02.04
_PC_MAX_INPUT
- fpathconf.02.05
_PC_NAME_MAX
- fpathconf.02.06
_PC_PATH_MAX
- fpathconf.02.07
_PC_PIPE_BUF
- fpathconf.02.08
_PC_2_SYMLINKS
- fpathconf.02.09
_PC_ALLOC_SIZE_MIN
- fpathconf.02.10
_PC_REC_INCR_XFER_SIZE
- fpathconf.02.11
_PC_REC_MAX_XFER_SIZE
- fpathconf.02.12
_PC_REC_MIN_XFER_SIZE
- fpathconf.02.13
_PC_REC_XFER_ALIGN
- fpathconf.02.14
_PC_SYMLINK_MAX
- fpathconf.02.15
_PC_CHOWN_RESTRICTED
- fpathconf.02.16
_PC_NO_TRUNC
- fpathconf.02.17
_PC_VDISABLE
- fpathconf.02.18
_PC_ASYNC_IO
- fpathconf.02.19
_PC_PRIO_IO
- fpathconf.02.20
_PC_SYNC_IO
- fpathconf.03.01
If path or fildes refers to a directory, the value returned shall apply to the directory itself.
- fpathconf.03.01.01
1
- fpathconf.03.02
If path or fildes does not refer to a terminal file, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- fpathconf.03.02.01
2
- fpathconf.03.02.02
2
- fpathconf.03.02.03
2
- fpathconf.03.03
If path or fildes refers to a directory, the value returned shall apply to filenames within the directory.
- fpathconf.03.03.01
3,4
- fpathconf.03.03.02
3,4
- fpathconf.03.03.03
3,4
- fpathconf.03.04
If path or fildes does not refer to a directory, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- fpathconf.03.04.01
3,4
- fpathconf.03.04.02
3,4
- fpathconf.03.04.03
3,4
- fpathconf.03.04.04
4,5
- fpathconf.03.04.05
4
- fpathconf.03.04.06
4,9
- fpathconf.03.05
If path or fildes refers to a directory, the value returned shall be the maximum length of a relative pathname when the specified directory is the working directory.
- fpathconf.03.05.04
4,5
- fpathconf.03.06
If path refers to a FIFO, or fildes refers to a pipe or FIFO, the value returned shall apply to the referenced object. If path or fildes refers to a directory, the value returned shall apply to any FIFO that exists or can be created within the directory. If path or fildes refers to any other type of file, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- fpathconf.03.06.01
6
- fpathconf.03.07
If path or fildes refers to a directory, the value returned shall apply to any files, other than directories, that exist or can be created within the directory.
- fpathconf.03.07.01
7
- fpathconf.03.08
If path or fildes refers to a directory, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- fpathconf.03.08.01
8
- fpathconf.03.08.02
8
- fpathconf.03.08.03
8
- fpathconf.03.09
If path or fildes refers to a directory, the value returned shall be the maximum length of the string that a symbolic link in that directory can contain.
- fpathconf.03.09.01
4,9
- fpathconf.03.10
If path or fildes des does not refer to a regular file, it is unspecified whether an implementation supports an association of the variable name with the specified file. If an implementation supports such an association for other than a regular file, the value returned is unspecified.
- fpathconf.03.10.01
10
- fpathconf.03.10.02
10
- fpathconf.03.10.03
10
- fpathconf.03.10.04
10
- fpathconf.03.10.05
10
- fpathconf.04.01
If name is an invalid value, both pathconf() and fpathconf() shall return -1 and set errno to indicate the error.
- fpathconf.04.02
If the implementation needs to use fildes to determine the value of name and the implementation does not support the association of name with the file specified by fildes, or if fildes is an invalid file descriptor, fpathconf() shall return -1 and set errno to indicate the error.
- fpathconf.04.03
Otherwise, pathconf() or fpathconf() shall return the current variable value for the file or directory without changing errno.
- fpathconf.05
If the variable corresponding to name has no limit for the path or file descriptor, both pathconf() and fpathconf() shall return -1 without changing errno.
- fpathconf.06
The value returned shall not be more restrictive than the corresponding value available to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- app.fpathconf.07
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- fpathconf.08
The fpathconf() function shall fail if:
- fpathconf.08.01
[EINVAL] The value of name is not valid.
- fpathconf.09
The fpathconf() function may fail if:
- fpathconf.09.01
[EBADF] The fildes argument is not a valid file descriptor.
- fpathconf.09.02
[EINVAL] The implementation does not support an association of the variable name with the specified file.
- fpathconf.12
and may support others.
- [+]getpagesize (12 / 2 / 0)
- getpagesize.11
The getpagesize() function returns the current page size.
- getpagesize.12
The getpagesize() function is equivalent to sysconf(_SC_PAGE_SIZE) and sysconf(_SC_PAGESIZE).
- getpagesize.13
The getpagesize() function returns the current page size.
- getpagesize.sysconf.01
The implementation shall support all of the variables listed in the following table and may support others.
- getpagesize.sysconf.01.95
_SC_PAGE_SIZE
- getpagesize.sysconf.01.96
_SC_PAGESIZE
- getpagesize.sysconf.02
If name is an invalid value, sysconf() shall return -1 and set errno to indicate the error.
- getpagesize.sysconf.03
If the variable corresponding to name has no limit, sysconf() shall return -1 without changing the value of errno.
- getpagesize.sysconf.04
The value returned shall not be more restrictive than the corresponding value described to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- getpagesize.sysconf.05
The value shall not change during the lifetime of the calling process
- getpagesize.sysconf.07
Otherwise, sysconf() shall return the current variable value on the system.
- getpagesize.sysconf.09
[XSI] except that sysconf(_SC_OPEN_MAX) may return different values before and after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit.
- getpagesize.sysconf.10
The sysconf() function shall fail if:
- app.getpagesize.sysconf.06
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- [+]pathconf (62 / 1 / 0)
- pathconf.01
The fpathconf() and pathconf() functions shall determine the current value of a configurable limit or option (variable) that is associated with a file or directory.
- pathconf.02
Implementations shall support all of the variables listed in the following table
- pathconf.02.01
_PC_FILESIZEBITS
- pathconf.02.02
_PC_LINK_MAX
- pathconf.02.03
_PC_MAX_CANON
- pathconf.02.04
_PC_MAX_INPUT
- pathconf.02.05
_PC_NAME_MAX
- pathconf.02.06
_PC_PATH_MAX
- pathconf.02.07
_PC_PIPE_BUF
- pathconf.02.08
_PC_2_SYMLINKS
- pathconf.02.09
_PC_ALLOC_SIZE_MIN
- pathconf.02.10
_PC_REC_INCR_XFER_SIZE
- pathconf.02.11
_PC_REC_MAX_XFER_SIZE
- pathconf.02.12
_PC_REC_MIN_XFER_SIZE
- pathconf.02.13
_PC_REC_XFER_ALIGN
- pathconf.02.14
_PC_SYMLINK_MAX
- pathconf.02.15
_PC_CHOWN_RESTRICTED
- pathconf.02.16
_PC_NO_TRUNC
- pathconf.02.17
_PC_VDISABLE
- pathconf.02.18
_PC_ASYNC_IO
- pathconf.02.19
_PC_PRIO_IO
- pathconf.02.20
_PC_SYNC_IO
- pathconf.03.01
If path or fildes refers to a directory, the value returned shall apply to the directory itself.
- pathconf.03.01.01
1
- pathconf.03.02
If path or fildes does not refer to a terminal file, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- pathconf.03.02.01
2
- pathconf.03.02.02
2
- pathconf.03.02.03
2
- pathconf.03.03
If path or fildes refers to a directory, the value returned shall apply to filenames within the directory.
- pathconf.03.03.01
3,4
- pathconf.03.03.02
3,4
- pathconf.03.03.03
3,4
- pathconf.03.04
If path or fildes does not refer to a directory, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- pathconf.03.04.01
3,4
- pathconf.03.04.02
3,4
- pathconf.03.04.03
3,4
- pathconf.03.04.04
4,5
- pathconf.03.04.05
4
- pathconf.03.04.06
4,9
- pathconf.03.05
If path or fildes refers to a directory, the value returned shall be the maximum length of a relative pathname when the specified directory is the working directory.
- pathconf.03.05.04
4,5
- pathconf.03.06
If path refers to a FIFO, or fildes refers to a pipe or FIFO, the value returned shall apply to the referenced object. If path or fildes refers to a directory, the value returned shall apply to any FIFO that exists or can be created within the directory. If path or fildes refers to any other type of file, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- pathconf.03.06.01
6
- pathconf.03.07
If path or fildes refers to a directory, the value returned shall apply to any files, other than directories, that exist or can be created within the directory.
- pathconf.03.07.01
7
- pathconf.03.08
If path or fildes refers to a directory, it is unspecified whether an implementation supports an association of the variable name with the specified file.
- pathconf.03.08.01
8
- pathconf.03.08.02
8
- pathconf.03.08.03
8
- pathconf.03.09
If path or fildes refers to a directory, the value returned shall be the maximum length of the string that a symbolic link in that directory can contain.
- pathconf.03.09.01
4,9
- pathconf.03.10
If path or fildes des does not refer to a regular file, it is unspecified whether an implementation supports an association of the variable name with the specified file. If an implementation supports such an association for other than a regular file, the value returned is unspecified.
- pathconf.03.10.01
10
- pathconf.03.10.02
10
- pathconf.03.10.03
10
- pathconf.03.10.04
10
- pathconf.03.10.05
10
- pathconf.04.01
If name is an invalid value, both pathconf() and fpathconf() shall return -1 and set errno to indicate the error.
- pathconf.04.02
If the implementation needs to use path to determine the value of name and the implementation does not support the association of name with the file specified by path, or if the process did not have appropriate privileges to query the file specified by path, or path does not exist, pathconf() shall return -1 and set errno to indicate the error.
- pathconf.04.03
Otherwise, pathconf() or fpathconf() shall return the current variable value for the file or directory without changing errno.
- pathconf.05
If the variable corresponding to name has no limit for the path or file descriptor, both pathconf() and fpathconf() shall return -1 without changing errno.
- pathconf.06
The value returned shall not be more restrictive than the corresponding value available to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- app.pathconf.07
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- pathconf.08
The pathconf() function shall fail if:
- pathconf.08.01
[EINVAL] The value of name is not valid.
- pathconf.08.02
[ELOOP] A loop exists in symbolic links encountered during resolution of the path argument.
- pathconf.09
The pathconf() function may fail if:
- pathconf.09.01
[EACCES] Search permission is denied for a component of the path prefix.
- pathconf.09.02
[EINVAL] The implementation does not support an association of the variable name with the specified file.
- pathconf.09.03
[ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.
- pathconf.09.04
[ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- pathconf.09.05
[ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}.
- pathconf.09.06
[ENOENT] A component of path does not name an existing file or path is an empty string.
- pathconf.09.07
[ENOTDIR] A component of the path prefix is not a directory.
- pathconf.12
and may support others.
- pathconf.addntl_bhvr.01
A value of -1 shall be an invalid "_PC_..." value for pathconf().
- [+]sysconf (131 / 118 / 0)
- sysconf.01
The implementation shall support all of the variables listed in the following table and may support others.
- sysconf.01.01
_SC_AIO_LISTIO_MAX
- sysconf.01.02
_SC_AIO_MAX
- sysconf.01.03
_SC_AIO_PRIO_DELTA_MAX
- sysconf.01.04
_SC_ARG_MAX
- sysconf.01.05
_SC_ATEXIT_MAX
- sysconf.01.06
_SC_BC_BASE_MAX
- sysconf.01.07
_SC_BC_DIM_MAX
- sysconf.01.08
_SC_BC_SCALE_MAX
- sysconf.01.09
_SC_BC_STRING_MAX
- sysconf.01.10
_SC_CHILD_MAX
- sysconf.01.100
_SC_THREAD_THREADS_MAX
- sysconf.01.101
_SC_RE_DUP_MAX
- sysconf.01.102
_SC_RTSIG_MAX
- sysconf.01.103
_SC_SEM_NSEMS_MAX
- sysconf.01.104
_SC_SEM_VALUE_MAX
- sysconf.01.105
_SC_SIGQUEUE_MAX
- sysconf.01.106
_SC_STREAM_MAX
- sysconf.01.107
_SC_SYMLOOP_MAX
- sysconf.01.108
_SC_TIMER_MAX
- sysconf.01.109
_SC_TTY_NAME_MAX
- sysconf.01.11
_SC_CLK_TCK
- sysconf.01.110
_SC_TZNAME_MAX
- sysconf.01.111
_SC_XBS5_ILP32_OFF32 (LEGACY)
- sysconf.01.112
_SC_XBS5_ILP32_OFFBIG (LEGACY)
- sysconf.01.113
_SC_XBS5_LP64_OFF64 (LEGACY)
- sysconf.01.114
_SC_XBS5_LPBIG_OFFBIG (LEGACY)
- sysconf.01.115
_SC_XOPEN_CRYPT
- sysconf.01.116
_SC_XOPEN_ENH_I18N
- sysconf.01.117
_SC_XOPEN_LEGACY
- sysconf.01.118
_SC_XOPEN_REALTIME
- sysconf.01.119
_SC_XOPEN_REALTIME_THREADS
- sysconf.01.12
_SC_COLL_WEIGHTS_MAX
- sysconf.01.120
_SC_XOPEN_SHM
- sysconf.01.121
_SC_XOPEN_STREAMS
- sysconf.01.122
_SC_XOPEN_UNIX
- sysconf.01.123
_SC_XOPEN_VERSION
- sysconf.01.13
_SC_DELAYTIMER_MAX
- sysconf.01.14
_SC_EXPR_NEST_MAX
- sysconf.01.15
_SC_HOST_NAME_MAX
- sysconf.01.16
_SC_IOV_MAX
- sysconf.01.17
_SC_LINE_MAX
- sysconf.01.18
_SC_LOGIN_NAME_MAX
- sysconf.01.19
_SC_NGROUPS_MAX
- sysconf.01.20
_SC_GETGR_R_SIZE_MAX
- sysconf.01.21
_SC_GETPW_R_SIZE_MAX
- sysconf.01.22
_SC_MQ_OPEN_MAX
- sysconf.01.23
_SC_MQ_PRIO_MAX
- sysconf.01.24
_SC_OPEN_MAX
- sysconf.01.25
_SC_ADVISORY_INFO
- sysconf.01.26
_SC_BARRIERS
- sysconf.01.27
_SC_ASYNCHRONOUS_IO
- sysconf.01.28
_SC_CLOCK_SELECTION
- sysconf.01.29
_SC_CPUTIME
- sysconf.01.30
_SC_FSYNC
- sysconf.01.31
_SC_IPV6
- sysconf.01.32
_SC_JOB_CONTROL
- sysconf.01.33
_SC_MAPPED_FILES
- sysconf.01.34
_SC_MEMLOCK
- sysconf.01.35
_SC_MEMLOCK_RANGE
- sysconf.01.36
_SC_MEMORY_PROTECTION
- sysconf.01.37
_SC_MESSAGE_PASSING
- sysconf.01.38
_SC_MONOTONIC_CLOCK
- sysconf.01.39
_SC_PRIORITIZED_IO
- sysconf.01.40
_SC_PRIORITY_SCHEDULING
- sysconf.01.41
_SC_RAW_SOCKETS
- sysconf.01.42
_SC_READER_WRITER_LOCKS
- sysconf.01.43
_SC_REALTIME_SIGNALS
- sysconf.01.44
_SC_REGEXP
- sysconf.01.45
_SC_SAVED_IDS
- sysconf.01.46
_SC_SEMAPHORES
- sysconf.01.47
_SC_SHARED_MEMORY_OBJECTS
- sysconf.01.48
_SC_SHELL
- sysconf.01.49
_SC_SPAWN
- sysconf.01.50
_SC_SPIN_LOCKS
- sysconf.01.51
_SC_SPORADIC_SERVER
- sysconf.01.52
_SC_SS_REPL_MAX
- sysconf.01.53
_SC_SYNCHRONIZED_IO
- sysconf.01.54
_SC_THREAD_ATTR_STACKADDR
- sysconf.01.55
_SC_THREAD_ATTR_STACKSIZE
- sysconf.01.56
_SC_THREAD_CPUTIME
- sysconf.01.57
_SC_THREAD_PRIO_INHERIT
- sysconf.01.58
_SC_THREAD_PRIO_PROTECT
- sysconf.01.59
_SC_THREAD_PRIORITY_SCHEDULING
- sysconf.01.60
_SC_THREAD_PROCESS_SHARED
- sysconf.01.61
_SC_THREAD_SAFE_FUNCTIONS
- sysconf.01.62
_SC_THREAD_SPORADIC_SERVER
- sysconf.01.63
_SC_THREADS
- sysconf.01.64
_SC_TIMEOUTS
- sysconf.01.65
_SC_TIMERS
- sysconf.01.66
_SC_TRACE
- sysconf.01.67
_SC_TRACE_EVENT_FILTER
- sysconf.01.68
_SC_TRACE_EVENT_NAME_MAX
- sysconf.01.69
_SC_TRACE_INHERIT
- sysconf.01.70
_SC_TRACE_LOG
- sysconf.01.71
_SC_TRACE_NAME_MAX
- sysconf.01.72
_SC_TRACE_SYS_MAX
- sysconf.01.73
_SC_TRACE_USER_EVENT_MAX
- sysconf.01.74
_SC_TYPED_MEMORY_OBJECTS
- sysconf.01.75
_SC_VERSION
- sysconf.01.76
_SC_V6_ILP32_OFF32
- sysconf.01.77
_SC_V6_ILP32_OFFBIG
- sysconf.01.78
_SC_V6_LP64_OFF64
- sysconf.01.79
_SC_V6_LPBIG_OFFBIG
- sysconf.01.80
_SC_2_C_BIND
- sysconf.01.81
_SC_2_C_DEV
- sysconf.01.82
_SC_2_CHAR_TERM
- sysconf.01.83
_SC_2_FORT_DEV
- sysconf.01.84
_SC_2_FORT_RUN
- sysconf.01.85
_SC_2_LOCALEDEF
- sysconf.01.86
_SC_2_PBS
- sysconf.01.87
_SC_2_PBS_ACCOUNTING
- sysconf.01.88
_SC_2_PBS_CHECKPOINT
- sysconf.01.89
_SC_2_PBS_LOCATE
- sysconf.01.90
_SC_2_PBS_MESSAGE
- sysconf.01.91
_SC_2_PBS_TRACK
- sysconf.01.92
_SC_2_SW_DEV
- sysconf.01.93
_SC_2_UPE
- sysconf.01.94
_SC_2_VERSION
- sysconf.01.95
_SC_PAGE_SIZE
- sysconf.01.96
_SC_PAGESIZE
- sysconf.01.97
_SC_THREAD_DESTRUCTOR_ITERATIONS
- sysconf.01.98
_SC_THREAD_KEYS_MAX
- sysconf.01.99
_SC_THREAD_STACK_MIN
- sysconf.02
If name is an invalid value, sysconf() shall return -1 and set errno to indicate the error.
- sysconf.03
If the variable corresponding to name has no limit, sysconf() shall return -1 without changing the value of errno.
- sysconf.04
The value returned shall not be more restrictive than the corresponding value described to the application when it was compiled with the implementation's <limits.h> or <unistd.h>.
- sysconf.05
The value shall not change during the lifetime of the calling process
- app.sysconf.06
If the variable corresponding to name is dependent on an unsupported option, the results are unspecified.
- sysconf.07
Otherwise, sysconf() shall return the current variable value on the system.
- sysconf.08
A value of -1 shall be an invalid "_SC..." value for sysconf().
- sysconf.09
[XSI] except that sysconf(_SC_OPEN_MAX) may return different values before and after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit.
- sysconf.10
The sysconf() function shall fail if:
- sysconf.10.01
[EINVAL] The value of the name argument is invalid.
- [+]system.user.account (70 / 0 / 0)
- [+]endutent (1 / 0 / 0)
- endutent.01
endutent() closes the utmp file.
- [+]endutxent (2 / 0 / 0)
- endutxent.01
The endutxent() function shall close the user accounting database.
- app.endutxent.05
These functions need not be reentrant.
- endutxent.06
The endutxent() and setutxent() functions shall not return a value.
- [+]getutent (3 / 0 / 0)
- getutent.01
The getutent() function shall read the next entry from the user accounting database.
- getutent.06.01
Upon successful completion, getutent() shall return a pointer to a utmp structure containing a copy of the requested entry in the user accounting database.
- getutent.06.02
Otherwise, a null pointer shall be returned.
- app.getutent.07
The return value may point to a static area which is overwritten by a subsequent call to getutent().
- [+]getutent_r (3 / 0 / 0)
- getutent_r.01
The getutent_r() function is a reentrant version of the getutent() function.
- app.getutent_r.02
On entry, buffer should point to a user supplied buffer to which the next entry in the database will be copied, and result should point to a location where the result will be stored.
- getutent_r.06.01
On success, getutent_r() shall return 0 and set the location referenced by result to a pointer to buffer.
- getutent_r.06.02
Otherwise, getutent_r() shall return -1 and set the location referenced by result to NULL.
- [+]getutxent (5 / 0 / 0)
- getutxent.01
The getutxent() function shall read the next entry from the user accounting database.
- getutxent.02
If the database is not already open, it shall open it.
- getutxent.03
If it reaches the end of the database, it shall fail.
- app.getutxent.05
These functions need not be reentrant.
- getutxent.06.01
Upon successful completion, getutxent(), getutxid(), and getutxline() shall return a pointer to a utmpx structure containing a copy of the requested entry in the user accounting database.
- getutxent.06.02
Otherwise, a null pointer shall be returned.
- [+]getutxid (6 / 0 / 0)
- getutxid.01
The getutxid() function shall search forward from the current point in the database.
- getutxid.01.01
If the ut_type value of the utmpx structure pointed to by id is BOOT_TIME, OLD_TIME, or NEW_TIME, then it shall stop when it finds an entry with a matching ut_type value.
- getutxid.01.02
If the ut_type value is INIT_PROCESS, LOGIN_PROCESS, USER_PROCESS, or DEAD_PROCESS, then it shall stop when it finds an entry whose type is one of these four and whose ut_id member matches the ut_id member of the utmpx structure pointed to by id.
- getutxid.03
If the end of the database is reached without a match, getutxid() shall fail.
- getutxid.04
The getutxid() or getutxline() function may cache data.
- app.getutxid.05
These functions need not be reentrant.
- getutxid.06.01
Upon successful completion, getutxent(), getutxid(), and getutxline() shall return a pointer to a utmpx structure containing a copy of the requested entry in the user accounting database.
- getutxid.06.02
Otherwise, a null pointer shall be returned.
- app.getutxid.07
The return value may point to a static area which is overwritten by a subsequent call to getutxid() or getutxline().
- [+]getutxline (5 / 0 / 0)
- getutxline.01
The getutxline() function shall search forward from the current point in the database until it finds an entry of the type LOGIN_PROCESS or USER_PROCESS which also has a ut_line value matching that in the utmpx structure pointed to by line.
- getutxline.03
If the end of the database is reached without a match, getutxline() shall fail.
- getutxline.04
The getutxid() or getutxline() function may cache data.
- app.getutxline.05
These functions need not be reentrant.
- getutxline.06.01
Upon successful completion, getutxent(), getutxid(), and getutxline() shall return a pointer to a utmpx structure containing a copy of the requested entry in the user accounting database.
- getutxline.06.02
Otherwise, a null pointer shall be returned.
- app.getutxline.07
The return value may point to a static area which is overwritten by a subsequent call to getutxid() or getutxline().
- [+]login (11 / 0 / 0)
- login.01
The login() function shall update the user accounting databases.
- login.02
The ut parameter shall reference a utmp structure for all fields except the following:
- login.02.01
The ut_type field shall be set to USER_PROCESS.
- login.02.02
The ut_pid field shall be set to the process identifier for the current process.
- login.02.03
The ut_line field shall be set to the name of the controlling terminal device.
- login.02.03.01.error
The name shall be found by examining the device associated with the standard input, output and error streams in sequence, until one associated with a terminal device is found. If none of these streams refers to a terminal device, the ut_line field shall be set to "???".
- login.02.03.01.input
The name shall be found by examining the device associated with the standard input, output and error streams in sequence, until one associated with a terminal device is found. If none of these streams refers to a terminal device, the ut_line field shall be set to "???".
- login.02.03.01.notfound
The name shall be found by examining the device associated with the standard input, output and error streams in sequence, until one associated with a terminal device is found. If none of these streams refers to a terminal device, the ut_line field shall be set to "???".
- login.02.03.01.output
The name shall be found by examining the device associated with the standard input, output and error streams in sequence, until one associated with a terminal device is found. If none of these streams refers to a terminal device, the ut_line field shall be set to "???".
- login.02.03.02.final
If the terminal device is in the /dev directory hierarchy, the ut_line field shall not contain the leading "/dev/", otherwise it shall be set to the final component of the pathname of the device.
- login.02.03.02.sub_dev
If the terminal device is in the /dev directory hierarchy, the ut_line field shall not contain the leading "/dev/", otherwise it shall be set to the final component of the pathname of the device.
- login.02.03.03.notsmaller
If the user accounting database imposes a limit on the size of the ut_line field, it shall truncate the name, but any such limit shall not be smaller than UT_LINESIZE (including a terminating null character).
- login.02.03.03.truncate
If the user accounting database imposes a limit on the size of the ut_line field, it shall truncate the name, but any such limit shall not be smaller than UT_LINESIZE (including a terminating null character).
- [+]logout (8 / 0 / 0)
- logout.01
Given the device line, the logout() function shall search the user accounting database which is read by getutent() for an entry with the corresponding line, and with the type of USER_PROCESS.
- logout.02
If a corresponding entry is located, it shall be updated as follows:
- logout.02.01
The ut_name field shall be set to zeroes (UT_NAMESIZE NUL bytes).
- logout.02.02
The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL bytes).
- logout.02.03
The ut_tv shall be set to the current time of day.
- logout.02.04
The ut_type field shall be set to DEAD_PROCESS.
- logout.06.01
On success, the logout() function shall return non-zero.
- logout.06.02.noentry
Zero is returned if there was no entry to remove, or if the utmp file could not be opened or updated.
- logout.06.02.perm
Zero is returned if there was no entry to remove, or if the utmp file could not be opened or updated.
- [+]logwtmp (14 / 0 / 0)
- logwtmp.01
If the process has permission to update the user accounting databases, the logwtmp() function shall append a record to the user accounting database that records all logins and logouts.
- logwtmp.02
The record to be appended shall be constructed as follows:
- logwtmp.02.01.01
The ut_line field shall be initialized from line.
- logwtmp.02.01.02.notsmaller
If the user accounting database imposes a limit on the size of the ut_line field, it shall truncate the value, but any such limit shall not be smaller than UT_LINESIZE (including a terminating null character).
- logwtmp.02.01.02.truncate
If the user accounting database imposes a limit on the size of the ut_line field, it shall truncate the value, but any such limit shall not be smaller than UT_LINESIZE (including a terminating null character).
- logwtmp.02.02.01
The ut_name field shall be initialized from name.
- logwtmp.02.02.02.notsmaller
If the user accounting database imposes a limit on the size of the ut_name field, it shall truncate the value, but any such limit shall not be smaller than UT_NAMESIZE (including a terminating null character).
- logwtmp.02.02.02.truncate
If the user accounting database imposes a limit on the size of the ut_name field, it shall truncate the value, but any such limit shall not be smaller than UT_NAMESIZE (including a terminating null character).
- logwtmp.02.03.01
The ut_host field shall be initialized from host.
- logwtmp.02.03.02.notsmaller
If the user accounting database imposes a limit on the size of the ut_host field, it shall truncate the value, but any such limit shall not be smaller than UT_HOSTSIZE (including a terminating null character).
- logwtmp.02.03.02.truncate
If the user accounting database imposes a limit on the size of the ut_host field, it shall truncate the value, but any such limit shall not be smaller than UT_HOSTSIZE (including a terminating null character).
- logwtmp.02.04.01
If the name parameter does not refer to an empty string (i.e. ""), the ut_type field shall be set to USER_PROCESS;
- logwtmp.02.04.02
otherwise the ut_type field shall be set to DEAD_PROCESS.
- logwtmp.02.05
The ut_id field shall be set to the process identifier for the current process.
- logwtmp.02.06
The ut_tv field shall be set to the current time of day.
- [+]pututxline (8 / 0 / 0)
- pututxline.01
If the process has appropriate privileges, the pututxline() function shall write out the structure into the user accounting database.
- pututxline.02
It shall use getutxid() to search for a record that satisfies the request.
- pututxline.03.01
If this search succeeds, then the entry shall be replaced.
- pututxline.03.02
Otherwise, a new entry shall be made at the end of the user accounting database.
- pututxline.04
The implicit read done by pututxline() (if it finds that it is not already at the correct place in the user accounting database) shall not modify the static structure returned by getutxent(), getutxid(), or getutxline(), if the application has modified this structure and passed the pointer back to pututxline().
- pututxline.06.01
Upon successful completion, pututxline() shall return a pointer to a utmpx structure containing a copy of the entry added to the user accounting database.
- pututxline.06.02
Otherwise, a null pointer shall be returned.
- pututxline.08
The pututxline() function may fail if:
- pututxline.08.01
[EPERM] The process does not have appropriate privileges.
- [+]setutent (1 / 0 / 0)
- setutent.01
The setutent() function shall reset the user accounting database such that the next call to getutent() shall return the first record in the database.
- [+]setutxent (2 / 0 / 0)
- setutxent.01
The setutxent() function shall reset the input to the beginning of the database.
- app.setutxent.05
These functions need not be reentrant.
- setutxent.06
The endutxent() and setutxent() functions shall not return a value.
- [+]utmpname (1 / 0 / 0)
- utmpname.01
The utmpname() function shall cause the user accounting database used by the getutent(), getutent_r(), getutxent(), getutxid(), getutxline(), and pututxline() functions to be that named by dbname, instead of the system default database.
- [+]system.user.group (64 / 19 / 0)
- [+]endgrent (2 / 1 / 0)
- endgrent.01
The endgrent() function may be called to close the group database when processing is complete.
- endgrent.02
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- [+]getgrent (8 / 4 / 0)
- getgrent.01
When first called, getgrent() shall return a pointer to a group structure containing the first entry in the group database.
- getgrent.02
Thereafter, it shall return a pointer to a group structure containing the next group structure in the group database, so successive calls may be used to search the entire database.
- getgrent.03
An implementation that provides extended security controls may impose further implementation-defined restrictions on accessing the group database. In particular, the system may deny the existence of some or all of the group database entries associated with groups other than those groups associated with the caller and may omit users other than the caller from the list of members of groups in database entries that are returned.
- getgrent.04
The getgrent() function shall return a null pointer on end-of-file or an error and errno may be set to indicate the error.
- getgrent.05
The getgrent() function may fail if:
- getgrent.05.01
[EINTR] A signal was caught during the operation.
- getgrent.05.02
[EIO] An I/O error has occurred.
- getgrent.05.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getgrent.05.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getgrgid (10 / 2 / 0)
- getgrgid.01
The getgrgid() function shall search the group database for an entry with a matching gid.
- getgrgid.02
The getgrgid() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getgrgid.03
Upon successful completion, getgrgid() shall return a pointer to a struct group with the structure defined in <grp.h> with a matching entry if one is found.
- getgrgid.04.01
The getgrgid() function shall return a null pointer if either the requested entry was not found
- getgrgid.04.02
or an error occurred.
- getgrgid.04.03
On error, errno shall be set to indicate the error.
- getgrgid.10
The getgrgid() and getgrgid_r() functions may fail if:
- getgrgid.10.01
[EIO] An I/O error has occurred.
- getgrgid.10.02
[EINTR] A signal was caught during getgrgid().
- getgrgid.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getgrgid.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getgrgid_r (12 / 3 / 0)
- getgrgid_r.01
The getgrgid_r() function shall update the group structure pointed to by grp and store a pointer to that structure at the location pointed to by result.
- getgrgid_r.02
The structure shall contain an entry from the group database with a matching gid.
- getgrgid_r.03
Storage referenced by the group structure is allocated from the memory provided with the buffer parameter, which is bufsize bytes in size.
- getgrgid_r.04
The maximum size needed for this buffer can be determined with the {_SC_GETGR_R_SIZE_MAX} sysconf() parameter.
- getgrgid_r.05
A NULL pointer shall be returned at the location pointed to by result on error or if the requested entry is not found.
- getgrgid_r.06.01
If successful, the getgrgid_r() function shall return zero;
- getgrgid_r.06.02
otherwise, an error number shall be returned to indicate the error.
- getgrgid_r.07
The getgrgid_r() function may fail if:
- getgrgid_r.07.01
[ERANGE] [TSF] Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting group structure.
- getgrgid_r.10
The getgrgid() and getgrgid_r() functions may fail if:
- getgrgid_r.10.01
[EIO] An I/O error has occurred.
- getgrgid_r.10.02
[EINTR] A signal was caught during getgrgid().
- getgrgid_r.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getgrgid_r.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getgrnam (8 / 2 / 0)
- getgrnam.01
The getgrnam() function shall search the group database for an entry with a matching name.
- getgrnam.02
The getgrnam() function shall return a pointer to a struct group with the structure defined in <grp.h> with a matching entry if one is found.
- getgrnam.03
The getgrnam() function shall return a null pointer if either the requested entry was not found, or an error occurred
- getgrnam.04
. On error, errno shall be set to indicate the error.
- getgrnam.10
The getgrnam() and getgrnam_r() functions may fail if:
- getgrnam.10.01
[EIO] An I/O error has occurred.
- getgrnam.10.02
[EINTR] A signal was caught during getgrnam().
- getgrnam.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getgrnam.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getgrnam_r (13 / 4 / 0)
- getgrnam_r.01
The getgrnam_r() function shall update the group structure pointed to by grp and store a pointer to that structure at the location pointed to by result.
- getgrnam_r.02
The structure shall contain an entry from the group database with a matching gid or name.
- getgrnam_r.03
Storage referenced by the group structure is allocated from the memory provided with the buffer parameter, which is bufsize bytes in size.
- getgrnam_r.04
The maximum size needed for this buffer can be determined with the {_SC_GETGR_R_SIZE_MAX} sysconf() parameter.
- getgrnam_r.05.01
A NULL pointer is returned at the location pointed to by result on error
- getgrnam_r.05.02
or if the requested entry is not found.
- getgrnam_r.06.01
If successful, the getgrnam_r() function shall return zero;
- getgrnam_r.06.02
otherwise, an error number shall be returned to indicate the error.
- getgrnam_r.10
The getgrnam() and getgrnam_r() functions may fail if:
- getgrnam_r.10.01
[EIO] An I/O error has occurred.
- getgrnam_r.10.02
[EINTR] A signal was caught during getgrnam().
- getgrnam_r.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getgrnam_r.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- getgrnam_r.11
The getgrnam_r() function may fail if:
- getgrnam_r.11.01
[ERANGE] [TSF] Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting group structure.
- [+]getgrouplist (10 / 2 / 0)
- getgrouplist.01
The getgrouplist() function shall fill in the array groups with the supplementary groups for the user specified by user.
- getgrouplist.02
On entry, ngroups shall refer to an integer containing the maximum number of gid_t members in the groups array.
- getgrouplist.03
The group group shall also be included.
- getgrouplist.04
On success, the value referred to by ngroups shall be updated to contain the number of gid_t objects copied.
- getgrouplist.05.01
On success, if there was sufficient room to copy all the supplementatry group identifiers to the array identified by groups, getgrouplist() shall return the number of gid_t objects copied,
- getgrouplist.05.02
and the value referenced by ngroups shall be updated.
- getgrouplist.06.01
If there was not sufficient room to copy all the supplementary group identifiers, grouplist() shall return -1,
- getgrouplist.06.02
and update the value referenced by ngroups to the number actually copied.
- getgrouplist.07.01
If user does not refer to a valid user on the system, getgrouplist() shall return 0,
- getgrouplist.07.02
and set the value referenced by ngroups to 0.
- [+]setgrent (1 / 1 / 0)
- setgrent.01
The setgrent() function shall rewind the group database to allow repeated searches.
- [+]system.user.user (51 / 21 / 0)
- [+]endpwent (3 / 1 / 0)
- endpwent.01
The endpwent() function may be called to close the user database when processing is complete.
- endpwent.05
An implementation that provides extended security controls may impose further implementation-defined restrictions on accessing the user database. In particular, the system may deny the existence of some or all of the user database entries associated with users other than the caller.
- endpwent.07
The getpwent(), setpwent(), and endpwent() functions may fail if:
- endpwent.07.01
[EIO] An I/O error has occurred.
- [+]getpwent (8 / 4 / 0)
- getpwent.01
The getpwent() function shall return a pointer to a structure containing the broken-out fields of an entry in the user database. Each entry in the user database contains a passwd structure. When first called, getpwent() shall return a pointer to a passwd structure containing the first entry in the user database.
- getpwent.02
Thereafter, it shall return a pointer to a passwd structure containing the next entry in the user database. Successive calls can be used to search the entire user database.
- getpwent.03
If an end-of-file or an error is encountered on reading, getpwent() shall return a null pointer.
- getpwent.04
The getpwent() function shall return a null pointer on end-of-file or error.
- getpwent.05
An implementation that provides extended security controls may impose further implementation-defined restrictions on accessing the user database. In particular, the system may deny the existence of some or all of the user database entries associated with users other than the caller.
- getpwent.07
The getpwent(), setpwent(), and endpwent() functions may fail if:
- getpwent.07.01
[EIO] An I/O error has occurred.
- getpwent.08
In addition, getpwent() and setpwent() may fail if:
- getpwent.08.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getpwent.08.02
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getpwnam (9 / 4 / 0)
- getpwnam.01
The getpwnam() function shall search the user database for an entry with a matching name.
- app.getpwnam.02
Applications wishing to check for error situations should set errno to 0 before calling getpwnam().
- getpwnam.03
If getpwnam() returns a null pointer and errno is non-zero, an error occurred.
- getpwnam.04
The getpwnam() function shall return a pointer to a struct passwd with the structure as defined in <pwd.h> with a matching entry if found.
- getpwnam.05
The getpwnam() and getpwnam_r() functions may fail if:
- getpwnam.05.01
[EIO] An I/O error has occurred.
- getpwnam.05.02
[EINTR] A signal was caught during getpwnam().
- getpwnam.05.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getpwnam.05.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- getpwnam.06
A null pointer shall be returned if the requested entry is not found, or an error occurs.
- getpwnam.07
On error, errno shall be set to indicate the error.
- [+]getpwnam_r (9 / 4 / 0)
- getpwnam_r.01
The getpwnam_r() function shall update the passwd structure pointed to by pwd and store a pointer to that structure at the location pointed to by result. The structure shall contain an entry from the user database with a matching name. Storage referenced by the structure is allocated from the memory provided with the buffer parameter, which is bufsize bytes in size. The maximum size needed for this buffer can be determined with the {_SC_GETPW_R_SIZE_MAX} sysconf() parameter.
- getpwnam_r.02
A NULL pointer shall be returned at the location pointed to by result on error or if the requested entry is not found.
- getpwnam_r.03.01
If successful, the getpwnam_r() function shall return zero
- getpwnam_r.03.02
otherwise, an error number shall be returned to indicate the error.
- getpwnam_r.05
The getpwnam() and getpwnam_r() functions may fail if:
- getpwnam_r.05.01
[EIO] An I/O error has occurred.
- getpwnam_r.05.02
[EINTR] A signal was caught during getpwnam().
- getpwnam_r.05.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getpwnam_r.05.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- getpwnam_r.06
The getpwnam_r() function may fail if:
- getpwnam_r.06.01
[ERANGE] [TSF] Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting passwd structure.
- [+]getpwuid (9 / 4 / 0)
- getpwuid.01
The getpwuid() function shall search the user database for an entry with a matching uid.
- app.getpwuid.02
Applications wishing to check for error situations should set errno to 0 before calling getpwuid().
- getpwuid.03
If getpwuid() returns a null pointer and errno is set to non-zero, an error occurred.
- getpwuid.04
The getpwuid() function shall return a pointer to a struct passwd with the structure as defined in <pwd.h> with a matching entry if found.
- getpwuid.05
On error, errno shall be set to indicate the error.
- getpwuid.06
A null pointer shall be returned if the requested entry is not found, or an error occurs.
- getpwuid.10
The getpwuid() and getpwuid_r() functions may fail if:
- getpwuid.10.01
[EIO] An I/O error has occurred.
- getpwuid.10.02
[EINTR] A signal was caught during getpwuid().
- getpwuid.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getpwuid.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]getpwuid_r (9 / 3 / 0)
- getpwuid_r.01
The getpwuid_r() function shall update the passwd structure pointed to by pwd and store a pointer to that structure at the location pointed to by result. The structure shall contain an entry from the user database with a matching uid. Storage referenced by the structure is allocated from the memory provided with the buffer parameter, which is bufsize bytes in size. The maximum size needed for this buffer can be determined with the {_SC_GETPW_R_SIZE_MAX} sysconf() parameter.
- getpwuid_r.02
A NULL pointer shall be returned at the location pointed to by result on error or if the requested entry is not found.
- getpwuid_r.03.01
If successful, the getpwuid_r() function shall return zero
- getpwuid_r.03.02
otherwise, an error number shall be returned to indicate the error.
- getpwuid_r.10
The getpwuid() and getpwuid_r() functions may fail if:
- getpwuid_r.10.01
[EIO] An I/O error has occurred.
- getpwuid_r.10.02
[EINTR] A signal was caught during getpwuid().
- getpwuid_r.10.03
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- getpwuid_r.10.04
[ENFILE] The maximum allowable number of files is currently open in the system.
- getpwuid_r.11
The getpwuid_r() function may fail if:
- getpwuid_r.11.01
[ERANGE] [TSF] Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting passwd structure.
- [+]setpwent (4 / 1 / 0)
- setpwent.01
The setpwent() function effectively rewinds the user database to allow repeated searches.
- setpwent.07
The getpwent(), setpwent(), and endpwent() functions may fail if:
- setpwent.07.01
[EIO] An I/O error has occurred.
- setpwent.08
In addition, getpwent() and setpwent() may fail if:
- setpwent.08.01
[EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process.
- setpwent.08.02
[ENFILE] The maximum allowable number of files is currently open in the system.
- [+]time.clock (53 / 27 / 0)
- [+]clock_getcpuclockid (7 / 4 / 0)
- clock_getcpuclockid.01
The clock_getcpuclockid() function shall return the clock ID of the CPU-time clock of the process specified by pid. If the process described by pid exists and the calling process has permission, the clock ID of this clock shall be returned in clock_id.
- app.clock_getcpuclockid.01
If _POSIX_CPUTIME is defined, implementations shall support clock ID values obtained by invoking clock_getcpuclockid(), which represent the CPU-time clock of a given process.
- clock_getcpuclockid.02
If pid is zero, the clock_getcpuclockid() function shall return the clock ID of the CPU-time clock of the process making the call, in clock_id.
- clock_getcpuclockid.03
The conditions under which one process has permission to obtain the CPU-time clock ID of other processes are implementation-defined.
- clock_getcpuclockid.04.01
Upon successful completion, clock_getcpuclockid() shall return zero
- clock_getcpuclockid.04.02
otherwise, an error number shall be returned to indicate the error
- clock_getcpuclockid.05
The clock_getcpuclockid() function shall fail if:
- clock_getcpuclockid.05.01
[EPERM] The requesting process does not have permission to access the CPU-time clock for the process.
- clock_getcpuclockid.06
The clock_getcpuclockid() function may fail if:
- clock_getcpuclockid.06.01
[ESRCH] No process can be found corresponding to the process specified by pid.
- [+]clock_getres (5 / 5 / 0)
- app.clock_getres.01
All implementations shall support a clock_id of CLOCK_REALTIME as defined in <time.h>. This clock represents the realtime clock for the system.
- clock_getres.01.01
The clock_getres() function shall return the resolution of any clock.
If the argument res is not NULL, the resolution of the specified clock shall be stored in the location pointed to by res.
- clock_getres.01.02
If res is NULL, the clock resolution is not returned.
- app.clock_getres.03
If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system.
- app.clock_getres.04
Implementations shall also support the special clockid_t value CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions.
- app.clock_getres.06
Implementations shall also support the special clockid_t value CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the calling thread when invoking one of the clock_*() or timer_*() functions.
- clock_getres.08.01
A return value of 0 shall indicate that the call succeeded.
- clock_getres.08.02
A return value of -1 shall indicate that an error occurred, and errno shall be set to indicate the error.
- clock_getres.09
The clock_getres(), clock_gettime(), and clock_settime() functions shall fail if:
- clock_getres.09.01
[EINVAL] The clock_id argument does not specify a known clock.
- [+]clock_gettime (9 / 4 / 0)
- app.clock_gettime.01
All implementations shall support a clock_id of CLOCK_REALTIME as defined in <time.h>. This clock represents the realtime clock for the system.
- clock_gettime.01
The clock_gettime() function shall return the current value tp for the specified clock, clock_id.
- clock_gettime.02
For this clock, the values returned by clock_gettime() and specified by clock_settime() represent the amount of time (in seconds and nanoseconds) since the Epoch.
- clock_gettime.03
For this clock, the value returned by clock_gettime() represents the amount of time (in seconds and nanoseconds) since an unspecified point in the past (for example, system start-up time, or the Epoch).
- app.clock_gettime.03
If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system.
- app.clock_gettime.04
Implementations shall also support the special clockid_t value CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions.
- clock_gettime.04
This point does not change after system start-up time.
- clock_gettime.05
For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() represent the amount of execution time of the process associated with the clock.
- clock_gettime.06
For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() shall represent the amount of execution time of the thread associated with the clock.
- app.clock_gettime.06
Implementations shall also support the special clockid_t value CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the calling thread when invoking one of the clock_*() or timer_*() functions.
- clock_gettime.08.01
A return value of 0 shall indicate that the call succeeded.
- clock_gettime.08.02
A return value of -1 shall indicate that an error occurred, and errno shall be set to indicate the error.
- clock_gettime.09
The clock_getres(), clock_gettime(), and clock_settime() functions shall fail if:
- clock_gettime.09.01
[EINVAL] The clock_id argument does not specify a known clock.
- [+]clock_nanosleep (18 / 9 / 0)
- app.clock_nanosleep.01
All implementations shall support a clock_id of CLOCK_REALTIME as defined in <time.h>. This clock represents the realtime clock for the system.
- clock_nanosleep.01
If the flag TIMER_ABSTIME is not set in the flags argument, the clock_nanosleep() function shall cause the current thread to be suspended from execution until either the time interval specified by the rqtp argument has elapsed, or a signal is delivered to the calling thread and its action is to invoke a signal-catching function, or the process is terminated.
- clock_nanosleep.02
The clock used to measure the time shall be the clock specified by clock_id.
- clock_nanosleep.03
If the flag TIMER_ABSTIME is set in the flags argument, the clock_nanosleep() function shall cause the current thread to be suspended from execution until either the time value of the clock specified by clock_id reaches the absolute time specified by the rqtp argument, or a signal is delivered to the calling thread and its action is to invoke a signal-catching function, or the process is terminated.
- app.clock_nanosleep.03
If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system.
- clock_nanosleep.04
If, at the time of the call, the time value specified by rqtp is less than or equal to the time value of the specified clock, then clock_nanosleep() shall return immediately and the calling process shall not be suspended.
- app.clock_nanosleep.04
Implementations shall also support the special clockid_t value CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions.
- clock_nanosleep.05
The suspension time caused by this function may be longer than requested
- clock_nanosleep.05.01
because the argument value is rounded up to an integer multiple of the sleep resolution
- clock_nanosleep.05.02
because of the scheduling of other activity by the system
- clock_nanosleep.06
But, except for the case of being interrupted by a signal, the suspension time for the relative clock_nanosleep() function (that is, with the TIMER_ABSTIME flag not set) shall not be less than the time interval specified by rqtp, as measured by the corresponding clock.
- app.clock_nanosleep.06
Implementations shall also support the special clockid_t value CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the calling thread when invoking one of the clock_*() or timer_*() functions.
- clock_nanosleep.07
The suspension for the absolute clock_nanosleep() function (that is, with the TIMER_ABSTIME flag set) shall be in effect at least until the value of the corresponding clock reaches the absolute time specified by rqtp, except for the case of being interrupted by a signal.
- clock_nanosleep.08
The use of the clock_nanosleep() function shall have no effect on the action or blockage of any signal.
- clock_nanosleep.09
It is unspecified whether clock_id values of other CPU-time clocks are allowed.
- clock_nanosleep.10.01
If the clock_nanosleep() function returns because the requested time has elapsed, its return value shall be zero.
- clock_nanosleep.10.02
If the clock_nanosleep() function returns because it has been interrupted by a signal, it shall return the corresponding error value.
If clock_nanosleep() fails, it shall return the corresponding error value.
- clock_nanosleep.11.01
For the relative clock_nanosleep() function, if the rmtp argument is non-NULL, the timespec structure referenced by it shall be updated to contain the amount of time remaining in the interval (the requested time minus the time actually slept).
- clock_nanosleep.11.02
If the rmtp argument is NULL, the remaining time is not returned.
- clock_nanosleep.11.03
The absolute clock_nanosleep() function has no effect on the structure referenced by rmtp.
- clock_nanosleep.12
The clock_nanosleep() function shall fail if:
- clock_nanosleep.12.01
[EINTR] The clock_nanosleep() function was interrupted by a signal.
- clock_nanosleep.12.02
[EINVAL] The rqtp argument specified a nanosecond value less than zero or greater than or equal to 1000 million; or the TIMER_ABSTIME flag was specified in flags and the rqtp argument is outside the range for the clock specified by clock_id; or the clock_id argument does not specify a known clock, or specifies the CPU-time clock of the calling thread.
The clock_nanosleep() function shall fail if the clock_id argument refers to the CPU-time clock of the calling thread.
- clock_nanosleep.12.03
[ENOTSUP] The clock_id argument specifies a clock for which clock_nanosleep() is not supported, such as a CPU-time clock.
- [+]clock_settime (14 / 5 / 0)
- clock_settime.01
The clock_settime() function shall set the specified clock, clock_id, to the value specified by tp.
- app.clock_settime.01
All implementations shall support a clock_id of CLOCK_REALTIME as defined in <time.h>. This clock represents the realtime clock for the system.
- app.clock_settime.02
For this clock, the values returned by clock_gettime() and specified by clock_settime() represent the amount of time (in seconds and nanoseconds) since the Epoch.
- clock_settime.02
Time values that are between two consecutive non-negative integer multiples of the resolution of the specified clock shall be truncated down to the smaller multiple of the resolution.
If the time argument of clock_settime() is not a multiple of res, then the value is truncated to a multiple of res.The clock_gettime() function shall return the current value tp for the specified clock, clock_id.The clock_settime() function shall set the specified clock, clock_id, to the value specified by tp. Time values that are between two consecutive non-negative integer multiples of the resolution of the specified clock shall be truncated down to the smaller multiple of the resolution.A clock may be system-wide (that is, visible to all processes) or per-process (measuring time that is meaningful only within a process). All implementations shall support a clock_id of CLOCK_REALTIME as defined in <time.h>. This clock represents the realtime clock for the system. For this clock, the values returned by clock_gettime() and specified by clock_settime() represent the amount of time (in seconds and nanoseconds) since the Epoch. An implementation may also support additional clocks. The interpretation of time values for these clocks is unspecified.If the value of the CLOCK_REALTIME clock is set via clock_settime(), the new value of the clock shall be used to determine the time of expiration for absolute time services based upon the CLOCK_REALTIME clock. This applies to the time at which armed absolute timers expire. If the absolute time requested at the invocation of such a time service is before the new value of the clock, the time service shall expire immediately as if the clock had reached the requested time normally.Setting the value of the CLOCK_REALTIME clock via clock_settime() shall have no effect on threads that are blocked waiting for a relative time service based upon this clock, including the nanosleep() function; nor on the expiration of relative timers based upon this clock. Consequently, these time services shall expire when the requested relative interval elapses, independently of the new or old value of the clock.[MON] If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system. For this clock, the value returned by clock_gettime() represents the amount of time (in seconds and nanoseconds) since an unspecified point in the past (for example, system start-up time, or the Epoch). This point does not change after system start-up time. The value of the CLOCK_MONOTONIC clock cannot be set via clock_settime(). This function shall fail if it is invoked with a clock_id argument of CLOCK_MONOTONIC. The effect of setting a clock via clock_settime() on armed per-process timers associated with a clock other than CLOCK_REALTIME is implementation-defined.[CS] If the value of the CLOCK_REALTIME clock is set via clock_settime(), the new value of the clock shall be used to determine the time at which the system shall awaken a thread blocked on an absolute clock_nanosleep() call based upon the CLOCK_REALTIME clock. If the absolute time requested at the invocation of such a time service is before the new value of the clock, the call shall return immediately as if the clock had reached the requested time normally.Setting the value of the CLOCK_REALTIME clock via clock_settime() shall have no effect on any thread that is blocked on a relative clock_nanosleep() call. Consequently, the call shall return when the requested relative interval elapses, independently of the new or old value of the clock. The appropriate privilege to set a particular clock is implementation-defined.[CPT] If _POSIX_CPUTIME is defined, implementations shall support clock ID values obtained by invoking clock_getcpuclockid(), which represent the CPU-time clock of a given process. Implementations shall also support the special clockid_t value CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions. For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() represent the amount of execution time of the process associated with the clock. Changing the value of a CPU-time clock via clock_settime() shall have no effect on the behavior of the sporadic server scheduling policy (see Scheduling Policies ). [TCT] If _POSIX_THREAD_CPUTIME is defined, implementations shall support clock ID values obtained by invoking pthread_getcpuclockid(), which represent the CPU-time clock of a given thread. Implementations shall also support the special clockid_t value CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the calling thread when invoking one of the clock_*() or timer_*() functions. For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() shall represent the amount of execution time of the thread associated with the clock. Changing the value of a CPU-time clock via clock_settime() shall have no effect on the behavior of the sporadic server scheduling policy (see Scheduling Policies ). RETURN VALUEA return value of 0 shall indicate that the call succeeded. A return value of -1 shall indicate that an error occurred, and errno shall be set to indicate the error.ERRORSThe clock_getres(), clock_gettime(), and clock_settime() functions shall fail if:[EINVAL] The clock_id argument does not specify a known clock. The clock_settime() function shall fail if:[EINVAL] The tp argument to clock_settime() is outside the range for the given clock ID. [EINVAL] The tp argument specified a nanosecond value less than zero or greater than or equal to 1000 million. [EINVAL] [MON] The value of the clock_id argument is CLOCK_MONOTONIC. The clock_settime() function may fail if:[EPERM] The requesting process does not have the appropriate privilege to set the specified clock. The following sections are informative.EXAMPLESNone.APPLICATION USAGEThese functions are part of the Timers option and need not be available on all implementations.Note that the absolute value of the monotonic clock is meaningless (because its origin is arbitrary), and thus there is no need to set it. Furthermore, realtime applications can rely on the fact that the value of this clock is never set and, therefore, that time intervals measured with this clock will not be affected by calls to clock_settime().RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSOclock_getcpuclockid(), clock_nanosleep(), ctime(), mq_timedreceive(), mq_timedsend(), nanosleep(), pthread_mutex_timedlock(), sem_timedwait(), time(), timer_create(), timer_getoverrun(), the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with the POSIX Realtime Extension.Issue 6The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the Timers option.The APPLICATION USAGE section is added.The following changes were made to align with the IEEE P1003.1a draft standard:Clarification is added of the effect of resetting the clock resolution.CPU-time clocks and the clock_getcpuclockid() function are added for alignment with IEEE Std 1003.1d-1999.The following changes are added for alignment with IEEE Std 1003.1j-2000:The DESCRIPTION is updated as follows:The value returned by clock_gettime() for CLOCK_MONOTONIC is specified.The clock_settime() function failing for CLOCK_MONOTONIC is specified.The effects of clock_settime() on the clock_nanosleep() function with respect to CLOCK_REALTIME are specified.An [EINVAL] error is added to the ERRORS section, indicating that clock_settime() fails for CLOCK_MONOTONIC.The APPLICATION USAGE section notes that the CLOCK_MONOTONIC clock need not and shall not be set by clock_settime() since the absolute value of the CLOCK_MONOTONIC clock is meaningless.The clock_nanosleep(), mq_timedreceive(), mq_timedsend(), pthread_mutex_timedlock(), sem_timedwait(), timer_create(), and timer_settime() functions are added to the SEE ALSO section.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- clock_settime.03
If the value of the CLOCK_REALTIME clock is set via clock_settime(), the new value of the clock shall be used to determine the time of expiration for absolute time services based upon the CLOCK_REALTIME clock. This applies to the time at which armed absolute timers expire.
If the value of the CLOCK_REALTIME clock is set via clock_settime(), the new value of the clock shall be used to determine the time at which the system shall awaken a thread blocked on an absolute clock_nanosleep() call based upon the CLOCK_REALTIME clock.
- app.clock_settime.03
If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system.
- clock_settime.04
If the absolute time requested at the invocation of such a time service is before the new value of the clock, the time service shall expire immediately as if the clock had reached the requested time normally.
If the absolute time requested at the invocation of such a time service is before the new value of the clock, the call shall return immediately as if the clock had reached the requested time normally
- app.clock_settime.04
Implementations shall also support the special clockid_t value CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the calling process when invoking one of the clock_*() or timer_*() functions.
- app.clock_settime.05
For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() represent the amount of execution time of the process associated with the clock.
- clock_settime.05
Setting the value of the CLOCK_REALTIME clock via clock_settime() shall have no effect on threads that are blocked waiting for a relative time service based upon this clock, including the nanosleep() function; nor on the expiration of relative timers based upon this clock. Consequently, these time services shall expire when the requested relative interval elapses, independently of the new or old value of the clock.
Setting the value of the CLOCK_REALTIME clock via clock_settime() shall have no effect on any thread that is blocked on a relative clock_nanosleep() call. Consequently, the call shall return when the requested relative interval elapses, independently of the new or old value of the clock.
- clock_settime.06
The effect of setting a clock via clock_settime() on armed per-process timers associated with a clock other than CLOCK_REALTIME is implementation-defined.
- app.clock_settime.06
Implementations shall also support the special clockid_t value CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the calling thread when invoking one of the clock_*() or timer_*() functions.
- clock_settime.07
The appropriate privilege to set a particular clock is implementation-defined.
- app.clock_settime.07
For these clock IDs, the values returned by clock_gettime() and specified by clock_settime() shall represent the amount of execution time of the thread associated with the clock.
- clock_settime.08.01
A return value of 0 shall indicate that the call succeeded.
- clock_settime.08.02
A return value of -1 shall indicate that an error occurred, and errno shall be set to indicate the error.
- clock_settime.09
The clock_getres(), clock_gettime(), and clock_settime() functions shall fail if:
- clock_settime.09.01
[EINVAL] The clock_id argument does not specify a known clock.
- clock_settime.10
The clock_settime() function shall fail if:
- clock_settime.10.01
[EINVAL] The tp argument to clock_settime() is outside the range for the given clock ID.
- clock_settime.10.02
[EINVAL] The tp argument specified a nanosecond value less than zero or greater than or equal to 1000 million.
- clock_settime.10.03
[EINVAL] [MON] The value of the clock_id argument is CLOCK_MONOTONIC.
- clock_settime.11
The clock_settime() function may fail if:
- clock_settime.11.01
[EPERM] The requesting process does not have the appropriate privilege to set the specified clock.
- [+]time.conversion (31 / 22 / 2)
- [+]asctime (3 / 2 / 1)
- asctime.01 (failed)
The asctime() function shall convert the broken-down time in the structure pointed to by timeptr into a string in the form:Sun Sep 16 01:03:52 1973\n\0using the equivalent of the following algorithm:char *asctime(const struct tm *timeptr){ static char wday_name[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static char mon_name[12][3] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static char result[26];
sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", wday_name[timeptr->tm_wday], mon_name[timeptr->tm_mon], timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, 1900 + timeptr->tm_year); return result;}
- asctime.02.01
Upon successful completion, asctime() shall return a pointer to the string.
- asctime.02.02
If the function is unsuccessful, it shall return NULL.
- [+]asctime_r (3 / 2 / 1)
- app.asctime_r.01
the user-supplied buffer pointed to by buf (which shall contain at least 26 bytes)
- asctime_r.01 (failed)
The asctime() function shall convert the broken-down time in the structure pointed to by timeptr into a string in the form:Sun Sep 16 01:03:52 1973\n\0using the equivalent of the following algorithm:char *asctime(const struct tm *timeptr){ static char wday_name[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static char mon_name[12][3] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static char result[26];
sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", wday_name[timeptr->tm_wday], mon_name[timeptr->tm_mon], timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, 1900 + timeptr->tm_year); return result;}
The asctime_r() function shall convert the broken-down time in the structure pointed to by tm into a string (of the same form as that returned by asctime())
- asctime_r.02.01
Upon successful completion, asctime_r() shall return a pointer to a character string containing the date and time. This string is pointed to by the argument buf.
- asctime_r.02.02
If the function is unsuccessful, it shall return NULL.
- [+]ctime (3 / 2 / 0)
- ctime.01
The ctime() function shall convert the time pointed to by clock, representing time in seconds since the Epoch, to local time in the form of a string. It shall be equivalent to:asctime(localtime(clock))
- ctime.02.01
The ctime() function shall return the pointer returned by asctime() with that broken-down time as an argument.
- ctime.02.02
When an error is encountered, a null pointer shall be returned.
- [+]ctime_r (3 / 2 / 0)
- ctime_r.01
The ctime() function shall convert the time pointed to by clock, representing time in seconds since the Epoch, to local time in the form of a string. It shall be equivalent to:asctime(localtime(clock))
The ctime_r() function shall convert the calendar time pointed to by clock to local time in exactly the same form as ctime()
- app.ctime_r.01
the array pointed to by buf (which shall be at least 26 bytes in size)
- ctime_r.02.01
Upon successful completion, ctime_r() shall return a pointer to the string pointed to by buf.
- ctime_r.02.02
When an error is encountered, a null pointer shall be returned.
- [+]gmtime (4 / 3 / 0)
- gmtime.01
The gmtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as Coordinated Universal Time (UTC).
- gmtime.02.01
Upon successful completion, the gmtime() function shall return a pointer to a struct tm.
- gmtime.02.02
If an error is detected, gmtime() shall return a null pointer [CX] and set errno to indicate the error.
- gmtime.03
The gmtime() [TSF] and gmtime_r() functions shall fail if:
- gmtime.03.01
[EOVERFLOW] [CX] The result cannot be represented.
- [+]gmtime_r (4 / 3 / 0)
- gmtime_r.01
The gmtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as Coordinated Universal Time (UTC).
The same relationship shall apply for gmtime_r().
- gmtime_r.02.01
Upon successful completion, gmtime_r() shall return the address of the structure pointed to by the argument result.
- gmtime_r.02.02
If an error is detected, gmtime_r() shall return a null pointer and set errno to indicate the error.
- gmtime_r.03
The gmtime() [TSF] and gmtime_r() functions shall fail if:
- gmtime_r.03.01
[EOVERFLOW] [CX] The result cannot be represented.
- [+]localtime (4 / 3 / 0)
- localtime.01
The localtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as a local time. The function corrects for the timezone and any seasonal time adjustments.
- localtime.02.01
Upon successful completion, the localtime() function shall return a pointer to the broken-down time structure.
- localtime.02.02
If an error is detected, localtime() shall return a null pointer [CX] and set errno to indicate the error.
- localtime.03
The localtime() [TSF] and localtime_r() functions shall fail if:
- localtime.03.01
[EOVERFLOW] [CX] The result cannot be represented.
- [+]localtime_r (4 / 3 / 0)
- localtime_r.01
The localtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as a local time. The function corrects for the timezone and any seasonal time adjustments.
The same relationship shall apply for localtime_r().
- localtime_r.02.01
Upon successful completion, localtime_r() shall return a pointer to the structure pointed to by the argument result.
- localtime_r.02.02
If an error is detected, localtime_r() shall return a null pointer and set errno to indicate the error.
- localtime_r.03
The localtime() [TSF] and localtime_r() functions shall fail if:
- localtime_r.03.01
[EOVERFLOW] [CX] The result cannot be represented.
- [+]mktime (3 / 2 / 0)
- mktime.02.01
The mktime() function shall return the specified time since the Epoch encoded as a value of type time_t.
The mktime() function shall convert the broken-down time, expressed as local time, in the structure pointed to by timeptr, into a time since the Epoch value with the same encoding as that of the values returned by time().
- mktime.02.02
If the time since the Epoch cannot be represented, the function shall return the value (time_t)-1 [CX] and may set errno to indicate the error.
- mktime.03
The mktime() function may fail if:
- mktime.03.01
[EOVERFLOW] [CX] The result cannot be represented.
- [+]time.time (29 / 13 / 1)
- [+]adjtime (7 / 3 / 0)
- adjtime.01
adjtime() makes small adjustments to the system time as returned by gettimeofday()(2), advancing or retarding it by the time specified by the timeval delta.
- adjtime.01.01
If delta is negative, the clock is slowed down by incrementing it more slowly than normal until the correction is complete.
- adjtime.01.02
If delta is positive, a larger increment than normal is used.
- adjtime.02
A time correction from an earlier call to adjtime() may not be finished when adjtime() is called again. If olddelta is non-NULL, the structure pointed to will contain, upon return, the number of microseconds still to be corrected from the earlier call.
- adjtime.03.01
On success, 0 is returned.
- adjtime.03.02
On error, -1 is returned and the global variable errno is set appropriately.
- adjtime.04
Errors
- adjtime.04.01
[EFAULT] An argument points outside the process's allocated address space.
- adjtime.04.02
[EPERM] The process does not have appropriate privilege.
Appropriate privilege is required to adjust the system time.
- [+]difftime (1 / 1 / 0)
- difftime.01
The difftime() function shall compute the difference between two calendar times (as returned by time()): time1- time0.
The difftime() function shall return the difference expressed in seconds as a type double.
- [+]ftime (3 / 1 / 0)
- ftime.01
The ftime() function shall set the time and millitm members of the timeb structure pointed to by tp to contain the seconds and milliseconds portions, respectively, of the current time in seconds since the Epoch.
- ftime.02.01
Upon successful completion, the ftime() function shall return 0
- ftime.02.02
otherwise, -1 shall be returned
- [+]gettimeofday (2 / 1 / 0)
- app.gettimeofday.01
If tzp is not a null pointer, the behavior is unspecified.
- gettimeofday.01
The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp.
- gettimeofday.02
The gettimeofday() function shall return 0 and no value shall be reserved to indicate an error.
- [+]stime (5 / 4 / 1)
- stime.01
If the process has appropriate privilege, the stime() function shall set the system's idea of the time and date. Time, referenced by t, is measured in seconds from the epoch (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970).
- stime.02.01
On success, stime() shall return 0.
- stime.02.02
Otherwise, stime() shall return -1 and errno shall be set to indicate the error.
- stime.03
Errors
- stime.03.01
[EPERM] The process does not have appropriate privilege.
- stime.03.02 (failed)
[EINVAL] t is a null pointer.
- [+]time (5 / 3 / 0)
- time.01
The time() function shall return the value of time [CX] in seconds since the Epoch.
- time.02
The tloc argument points to an area where the return value is also stored. If tloc is a null pointer, no value is stored.
- time.03.01
Upon successful completion, time() shall return the value of time.
- time.03.02
Otherwise, (time_t)-1 shall be returned.
- time.time.01
Thus, the time is always a monotonically increasing function.
- [+]tzset (6 / 0 / 0)
- tzset.01
The tzset() function shall use the value of the environment variable TZ to set time conversion information used by ctime() , localtime() , mktime() , and strftime().
- tzset.01.01
The tzset() function shall set the external variable tzname as follows:tzname[0] = "std";tzname[1] = "dst";where std and dst are as described in the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables.
- tzset.01.02
The tzset() function also shall set the external variable daylight to 0 if Daylight Savings Time conversions should never be applied for the timezone in use; otherwise, non-zero.
- tzset.01.03
The external variable timezone shall be set to the difference, in seconds, between Coordinated Universal Time (UTC) and local standard time.
- tzset.02
If TZ is absent from the environment, implementation-defined default timezone information shall be used.
- tzset.02.01
The tzset() function shall set the external variable tzname as follows:tzname[0] = "std";tzname[1] = "dst";where std and dst are as described in the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 8, Environment Variables.
- tzset.02.02
The tzset() function also shall set the external variable daylight to 0 if Daylight Savings Time conversions should never be applied for the timezone in use; otherwise, non-zero.
- tzset.02.03
The external variable timezone shall be set to the difference, in seconds, between Coordinated Universal Time (UTC) and local standard time.
- [+]time.timer (96 / 49 / 0)
- [+]alarm (5 / 2 / 0)
- alarm.01
The alarm() function shall cause the system to generate a SIGALRM signal for the process after the number of realtime seconds specified by seconds have elapsed.
- app.alarm.01
[XSI] Interactions between alarm() and any of setitimer(), ualarm(), or usleep() are unspecified.
- alarm.02
If seconds is 0, a pending alarm request, if any, is canceled.
- alarm.03
Alarm requests are not stacked; only one SIGALRM generation can be scheduled in this manner. If the SIGALRM signal has not yet been generated, the call shall result in rescheduling the time at which the SIGALRM signal is generated.
- alarm.04.01
If there is a previous alarm() request with time remaining, alarm() shall return a non-zero value that is the number of seconds until the previous request would have generated a SIGALRM signal.
- alarm.04.02
Otherwise, alarm() shall return 0.
- [+]getitimer (4 / 4 / 0)
- getitimer.01
The getitimer() function shall store the current value of the timer specified by which into the structure pointed to by value.
- getitimer.06.01
Upon successful completion, getitimer() or setitimer() shall return 0;
- getitimer.06.02
otherwise, -1 shall be returned and errno set to indicate the error
- getitimer.08
The getitimer() and setitimer() functions may fail if:
- getitimer.08.01
[EINVAL] The which argument is not recognized.
- [+]nanosleep (11 / 5 / 0)
- nanosleep.01
The nanosleep() function shall cause the current thread to be suspended from execution until either the time interval specified by the rqtp argument has elapsed or a signal is delivered to the calling thread, and its action is to invoke a signal-catching function or to terminate the process.
- nanosleep.05
The suspension time may be longer than requested
- nanosleep.05.01
because the argument value is rounded up to an integer multiple of the sleep resolution
- nanosleep.05.02
because of the scheduling of other activity by the system.
- nanosleep.06
But, except for the case of being interrupted by a signal, the suspension time shall not be less than the time specified by rqtp, as measured by the system clock CLOCK_REALTIME.
- nanosleep.08
The use of the nanosleep() function has no effect on the action or blockage of any signal.
- nanosleep.10.01
If the nanosleep() function returns because the requested time has elapsed, its return value shall be zero.
- nanosleep.10.02
If the nanosleep() function returns because it has been interrupted by a signal, it shall return a value of -1 and set errno to indicate the interruption.
If nanosleep() fails, it shall return a value of -1 and set errno to indicate the error.
- nanosleep.11.01
If the rmtp argument is non-NULL, the timespec structure referenced by it is updated to contain the amount of time remaining in the interval (the requested time minus the time actually slept).
- nanosleep.11.02
If the rmtp argument is NULL, the remaining time is not returned.
- nanosleep.12
The nanosleep() function shall fail if:
- nanosleep.12.01
[EINTR] The nanosleep() function was interrupted by a signal.
- nanosleep.12.02
[EINVAL] The rqtp argument specified a nanosecond value less than zero or greater than or equal to 1000 million.
- [+]setitimer (14 / 10 / 0)
- setitimer.01
The setitimer() function shall
- setitimer.01.01
set the timer specified by which to the value specified in the structure pointed to by value
- setitimer.01.02
if ovalue is not a null pointer, store the previous value of the timer in the structure pointed to by ovalue
- app.setitimer.01
The interaction between setitimer() and any of alarm(), sleep(), or usleep() is unspecified.
- setitimer.02.01
If it_value is non-zero, it shall indicate the time to the next timer expiration.
- setitimer.02.02
Setting it_value to 0 shall disable a timer, regardless of the value of it_interval.
- setitimer.03.01
If it_interval is non-zero, it shall specify a value to be used in reloading it_value when the timer expires.
- setitimer.03.02
Setting it_interval to 0 shall disable a timer after its next expiration (assuming it_value is non-zero).
- setitimer.04
Implementations may place limitations on the granularity of timer values. For each interval timer, if the requested timer value requires a finer granularity than the implementation supports, the actual timer value shall be rounded up to the next supported value.
- setitimer.05
An XSI-conforming implementation provides each process with at least three interval timers, which are indicated by the which argument:
- setitimer.05.01
ITIMER_REAL Decrements in real time. A SIGALRM signal is delivered when this timer expires.
- setitimer.05.02
ITIMER_VIRTUAL Decrements in process virtual time. It runs only when the process is executing. A SIGVTALRM signal is delivered when it expires.
- setitimer.05.03
ITIMER_PROF Decrements both in process virtual time and when the system is running on behalf of the process. It is designed to be used by interpreters in statistically profiling the execution of interpreted programs. Each time the ITIMER_PROF timer expires, the SIGPROF signal is delivered.
- setitimer.06.01
Upon successful completion, getitimer() or setitimer() shall return 0;
- setitimer.06.02
otherwise, -1 shall be returned and errno set to indicate the error
- setitimer.07
The setitimer() function shall fail if:
- setitimer.07.01
[EINVAL] The value argument is not in canonical form. (In canonical form, the number of microseconds is a non-negative integer less than 1000000 and the number of seconds is a non-negative integer.)
- setitimer.08
The getitimer() and setitimer() functions may fail if:
- setitimer.08.01
[EINVAL] The which argument is not recognized.
- [+]sleep (4 / 3 / 0)
- app.sleep.01
Interactions between sleep() and any of setitimer(), ualarm(), or usleep() are unspecified.
- sleep.01
The sleep() function shall cause the calling thread to be suspended from execution until either the number of realtime seconds specified by the argument seconds has elapsed or a signal is delivered to the calling thread and its action is to invoke a signal-catching function or to terminate the process.
- sleep.05.02
The suspension time may be longer than requested due to the scheduling of other activity by the system.
- sleep.10.01
If sleep() returns because the requested time has elapsed, the value returned shall be 0.
- sleep.10.02
If sleep() returns due to delivery of a signal, the return value shall be the "unslept" amount (the requested time minus the time actually slept) in seconds.
- [+]timer_create (15 / 8 / 0)
- app.timer_create.01.01
Each implementation shall define a set of clocks that can be used as timing bases for per-process timers.
- app.timer_create.01.02
All implementations shall support a clock_id of CLOCK_REALTIME.
- app.timer_create.01.03
If the Monotonic Clock option is supported, implementations shall support a clock_id of CLOCK_MONOTONIC.
- app.timer_create.01.04
If _POSIX_CPUTIME is defined, implementations shall support clock_id values representing the CPU-time clock of the calling process.
- app.timer_create.01.05
If _POSIX_THREAD_CPUTIME is defined, implementations shall support clock_id values representing the CPU-time clock of the calling thread.
- timer_create.01
The timer_create() function shall create a per-process timer using the specified clock, clock_id, as the timing base.
The particular clock, clock_id, is defined in <time.h>.
- timer_create.02
The timer_create() function shall return, in the location referenced by timerid, a timer ID of type timer_t used to identify the timer in timer requests.
- timer_create.03
This timer ID shall be unique within the calling process until the timer is deleted.
- timer_create.04
The timer whose ID is returned shall be in a disarmed state upon return from timer_create().
- timer_create.05.01
The evp argument, if non-NULL, points to a sigevent structure. This structure, allocated by the application, defines the asynchronous notification to occur as specified in Signal Generation and Delivery when the timer expires.
- timer_create.05.02
If the evp argument is NULL, the effect is as if the evp argument pointed to a sigevent structure with the sigev_notify member having the value SIGEV_SIGNAL, the sigev_signo having a default signal number, and the sigev_value member having the value of the timer ID.
- timer_create.06
It is implementation-defined whether a timer_create() function will succeed if the value defined by clock_id corresponds to the CPU-time clock of a process or thread different from the process or thread invoking the function.
- timer_create.07
If evp->sigev_sigev_notify is SIGEV_THREAD and sev->sigev_notify_attributes is not NULL, if the attribute pointed to by sev->sigev_notify_attributes has a thread stack address specified by a call to pthread_attr_setstack() or pthread_attr_setstackaddr(), the results are unspecified if the signal is generated more than once.
- timer_create.08.01
If the call succeeds, timer_create() shall return zero and update the location referenced by timerid to a timer_t, which can be passed to the per-process timer calls.
- timer_create.08.02
If an error occurs, the function shall return a value of -1 and set errno to indicate the error.
- timer_create.08.03
The value of timerid is undefined if an error occurs.
- timer_create.09
The timer_create() function shall fail if:
- timer_create.09.01
[EAGAIN] The system lacks sufficient signal queuing resources to honor the request.
- timer_create.09.02
[EAGAIN] The calling process has already created all of the timers it is allowed by this implementation.
- timer_create.09.03
[EINVAL] The specified clock ID is not defined.
- timer_create.09.04
[ENOTSUP] [CPT|TCT] The implementation does not support the creation of a timer attached to the CPU-time clock that is specified by clock_id and associated with a process or thread different from the process or thread invoking timer_create().
- [+]timer_delete (6 / 3 / 0)
- timer_delete.01
The timer_delete() function deletes the specified timer, timerid, previously created by the timer_create() function.
- timer_delete.02
If the timer is armed when timer_delete() is called, the behavior shall be as if the timer is automatically disarmed before removal.
- timer_delete.03
The disposition of pending signals for the deleted timer is unspecified.
- timer_delete.04.01
If successful, the timer_delete() function shall return a value of zero.
- timer_delete.04.02
Otherwise, the function shall return a value of -1 and set errno to indicate the error.
- timer_delete.05
The timer_delete() function may fail if:
- timer_delete.05.01
[EINVAL] The timer ID specified by timerid is not a valid timer ID.
- [+]timer_getoverrun (8 / 1 / 0)
- timer_getoverrun.01
When a timer expiration signal is delivered to or accepted by a process, if the implementation supports the Realtime Signals Extension, the timer_getoverrun() function shall return the timer expiration overrun count for the specified timer.
- timer_getoverrun.02
The overrun count returned contains the number of extra timer expirations that occurred between the time the signal was generated (queued) and when it was delivered or accepted, up to but not including an implementation-defined maximum of {DELAYTIMER_MAX}.
- timer_getoverrun.03
If the number of such extra expirations is greater than or equal to {DELAYTIMER_MAX}, then the overrun count shall be set to {DELAYTIMER_MAX}.
- timer_getoverrun.04
The value returned by timer_getoverrun() shall apply to the most recent expiration signal delivery or acceptance for the timer.
- timer_getoverrun.05
If no expiration signal has been delivered for the timer, or if the Realtime Signals Extension is not supported, the return value of timer_getoverrun() is unspecified.
- timer_getoverrun.06.01
If the timer_getoverrun() function succeeds, it shall return the timer expiration overrun count as explained above.
- timer_getoverrun.06.02
If an error occurs for any of these functions, the value -1 shall be returned, and errno set to indicate the error.
- timer_getoverrun.08
These functions may fail if:
- timer_getoverrun.08.01
[EINVAL] The timerid argument does not correspond to an ID returned by timer_create() but not yet deleted by timer_delete().
- [+]timer_gettime (5 / 2 / 0)
- timer_gettime.01
The timer_gettime() function shall store the amount of time until the specified timer, timerid, expires and the reload value of the timer into the space pointed to by the value argument.
- timer_gettime.01.01
The it_value member of this structure shall contain the amount of time before the timer expires, or zero if the timer is disarmed.
- timer_gettime.01.02
The it_interval member of value shall contain the reload value last set by timer_settime().
- timer_gettime.06.01
If the timer_gettime() or timer_settime() functions succeed, a value of 0 shall be returned.
- timer_gettime.06.02
If an error occurs for any of these functions, the value -1 shall be returned, and errno set to indicate the error.
- timer_gettime.08
These functions may fail if:
- timer_gettime.08.01
[EINVAL] The timerid argument does not correspond to an ID returned by timer_create() but not yet deleted by timer_delete().
- [+]timer_settime (13 / 5 / 0)
- timer_settime.01.02
If the argument ovalue is not NULL, the timer_settime() function shall store, in the location referenced by ovalue, a value representing the previous amount of time before the timer would have expired, or zero if the timer was disarmed, together with the previous timer reload value. Timers shall not expire before their scheduled time.
- timer_settime.02.01
The timer_settime() function shall set the time until the next expiration of the timer specified by timerid from the it_value member of the value argument and arm the timer if the it_value member of value is non-zero. If the specified timer was already armed when timer_settime() is called, this call shall reset the time until next expiration to the value specified.
- timer_settime.02.02
If the it_value member of value is zero, the timer shall be disarmed.
- timer_settime.03
The reload value of the timer shall be set to the value specified by the it_interval member of value. When a timer is armed with a non-zero it_interval, a periodic (or repetitive) timer is specified.
- timer_settime.04
Time values that are between two consecutive non-negative integer multiples of the resolution of the specified timer shall be rounded up to the larger multiple of the resolution. Quantization error shall not cause the timer to expire earlier than the rounded time value.
- timer_settime.06.01
If the timer_gettime() or timer_settime() functions succeed, a value of 0 shall be returned.
- timer_settime.06.02
If an error occurs for any of these functions, the value -1 shall be returned, and errno set to indicate the error.
- timer_settime.07
The timer_settime() function shall fail if:
- timer_settime.07.01
[EINVAL] A value structure specified a nanosecond value less than zero or greater than or equal to 1000 million, and the it_value member of that structure did not specify zero seconds and nanoseconds.
- timer_settime.08
These functions may fail if:
- timer_settime.08.01
[EINVAL] The timerid argument does not correspond to an ID returned by timer_create() but not yet deleted by timer_delete().
- timer_settime.09.01
If the flag TIMER_ABSTIME is not set in the argument flags, timer_settime() shall behave as if the time until next expiration is set to be equal to the interval specified by the it_value member of value. That is, the timer shall expire in it_value nanoseconds from when the call is made.
- timer_settime.09.02
If the flag TIMER_ABSTIME is set in the argument flags, timer_settime() shall behave as if the time until next expiration is set to be equal to the difference between the absolute time specified by the it_value member of value and the current value of the clock associated with timerid. That is, the timer shall expire when the clock reaches the value specified by the it_value member of value. If the specified time has already passed, the function shall succeed and the expiration notification shall be made.
- timer_settime.10
The timer_settime() function may fail if:
- timer_settime.10.01
[EINVAL] The it_interval member of value is not zero and the timer was created with notification by creation of a new thread ( sigev_sigev_notify was SIGEV_THREAD) and a fixed stack address has been set in the thread attribute pointed to by sigev_notify_attributes.
- timer_settime.11
The effect of disarming or resetting a timer with pending expiration notifications is unspecified.
- [+]ualarm (6 / 3 / 0)
- app.ualarm.01
Interactions between ualarm() and any of the following are unspecified:alarm()nanosleep()setitimer()timer_create()timer_delete()timer_getoverrun()timer_gettime()timer_settime()sleep()
- ualarm.01
The ualarm() function shall cause the SIGALRM signal to be generated for the calling process after the number of realtime microseconds specified by the useconds argument has elapsed.
- ualarm.03
Alarm requests are not stacked; only one SIGALRM generation can be scheduled in this manner. If the SIGALRM signal has not yet been generated, the call shall result in rescheduling the time at which the SIGALRM signal is generated.
- ualarm.04.01
The ualarm() function shall return the number of microseconds remaining from the previous ualarm() call.
- ualarm.04.02
If no timeouts are pending or if ualarm() has not previously been called, ualarm() shall return 0.
- ualarm.05
When the interval argument is non-zero, repeated timeout notification occurs with a period in microseconds specified by the interval argument.
- ualarm.06
Implementations may place limitations on the granularity of timer values. For each interval timer, if the requested timer value requires a finer granularity than the implementation supports, the actual timer value shall be rounded up to the next supported value.
- [+]usleep (5 / 3 / 0)
- app.usleep.01
Interactions between usleep() and any of the following are unspecified:nanosleep()setitimer()timer_create()timer_delete()timer_getoverrun()timer_gettime()timer_settime()ualarm()sleep()
- usleep.01
The usleep() function shall cause the calling thread to be suspended from execution until either the number of realtime microseconds specified by the argument useconds has elapsed or a signal is delivered to the calling thread and its action is to invoke a signal-catching function or to terminate the process.
If the value of useconds is 0, then the call has no effect.
- usleep.05.02
The suspension time may be longer than requested due to the scheduling of other activity by the system.
- usleep.10.01
Upon successful completion, usleep() shall return 0
- usleep.10.02
otherwise, it shall return -1 and set errno to indicate the error
- usleep.12
The usleep() function may fail if:
- usleep.12.02
[EINVAL] The time interval specified one million or more microseconds.
The useconds argument shall be less than one million.
- [+]util.assert (363 / 89 / 2)
- [+]__assert_fail (8 / 8 / 0)
- __assert_fail.01
The __assert_fail() function shall print
- __assert_fail.01.01
the given file filename
- __assert_fail.01.02
line line number
- __assert_fail.01.03
function function name
- __assert_fail.01.04
a message
- __assert_fail.01.05
on the standard error stream
- __assert_fail.01.06
in an unspecified format
- __assert_fail.02
abort program execution via the abort() function
- __assert_fail.03
If function is NULL, __assert_fail() shall omit information about the function
- [+]err (60 / 11 / 0)
- err.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- err.03.01
ordinary characters, which are simply copied to the output stream
- err.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.err.03
The results are undefined if there are insufficient arguments for the format.
- err.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.err.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- app.err.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- err.05.02
If an output error was encountered, these functions shall return a negative value.
- app.err.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- err.06
In addition, all forms of fprintf() may fail if:
- err.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- err.06.02
[EINVAL] [XSI] There are insufficient arguments.
- err.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- err.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- err.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- err.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- err.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- err.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- err.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- err.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- err.11.04
An optional length modifier that specifies the size of the argument.
- err.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.err.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.err.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- err.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- err.12.01
In this case an argument of type int supplies the field width or precision.
- err.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- err.12.03
A negative precision is taken as if the precision were omitted.
- err.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- err.13
The flag characters and their meanings are:
- err.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- err.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- err.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- err.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- err.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- err.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.err.13
The flag characters and their meanings are:
- app.err.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.err.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.err.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.err.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- err.14
The length modifiers and their meanings are:
- err.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- err.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- err.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- err.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- err.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- err.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- err.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- err.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.err.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.err.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.err.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- err.15
The conversion specifiers and their meanings are:
- err.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- err.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- err.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- err.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- err.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- err.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- err.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- err.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- err.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- err.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- err.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- err.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- err.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- err.15.14
C [XSI] Equivalent to lc.
- err.15.15
S [XSI] Equivalent to ls.
- err.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- err.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- err.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- err.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- err.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- err.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- err.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- err.41
The err() function shall display a formatted error message on the standard error stream
- err.42
First, err() shall write the last component of the program name, a colon character, and a space character
- err.43
If fmt is non-NULL, it shall be used as a format string for the printf() family of functions, and err() shall write the formatted message, a colon character, and a space
- err.44
Finally, the error message string affiliated with the current value of the global variable errno shall be written, followed by a newline character
- err.45
The err() function shall not return
- err.46
the program shall terminate with the exit value of eval.
- [+]error (62 / 8 / 0)
- error.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- error.03.01
ordinary characters, which are simply copied to the output stream
- error.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.error.03
The results are undefined if there are insufficient arguments for the format.
- error.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.error.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- app.error.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- error.05.02
If an output error was encountered, these functions shall return a negative value.
- error.06
In addition, all forms of fprintf() may fail if:
- error.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- error.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.error.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- error.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- error.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- error.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- error.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.error.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.error.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- error.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- error.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- error.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- error.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- error.11.04
An optional length modifier that specifies the size of the argument.
- error.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- error.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- error.12.01
In this case an argument of type int supplies the field width or precision.
- error.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- error.12.03
A negative precision is taken as if the precision were omitted.
- error.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- error.13
The flag characters and their meanings are:
- error.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- error.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- error.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- error.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- error.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- error.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.error.13
The flag characters and their meanings are:
- app.error.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.error.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.error.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.error.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- error.14
The length modifiers and their meanings are:
- error.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- error.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- error.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- error.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- error.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- error.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- error.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- error.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- error.15
The conversion specifiers and their meanings are:
- error.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- error.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- error.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- error.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- error.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- error.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- error.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- error.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- error.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- error.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- error.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- error.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- error.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- error.15.14
C [XSI] Equivalent to lc.
- error.15.15
S [XSI] Equivalent to ls.
- error.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.error.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.error.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.error.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- error.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- error.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- error.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- error.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- error.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- error.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- error.41
error() shall print a message to standard error
- error.42
error() shall build the message from the following elements in their specified order
- error.42.01
the program name
- error.42.02
the colon and space characters, then the result of using the printf-style format and the optional arguments
- error.42.03
if errnum is nonzero, error() shall add the colon and space characters, then the result of strerror(errnum)
- error.42.04
a newline
- error.43.01
If the application has provided a function named error_print_progname(), error() shall call this to supply the program name
- error.43.02
otherwise, error() uses the content of the global variable program_name
- error.44
If exitstatus is nonzero, error() shall call exit(exitstatus).
- [+]errx (60 / 7 / 1)
- app.errx.03
The results are undefined if there are insufficient arguments for the format.
- errx.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- errx.03.01
ordinary characters, which are simply copied to the output stream
- errx.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.errx.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- errx.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.errx.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- errx.05.02
If an output error was encountered, these functions shall return a negative value.
- errx.06
In addition, all forms of fprintf() may fail if:
- errx.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- errx.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.errx.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- errx.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- errx.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- errx.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- errx.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- errx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- errx.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- errx.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- errx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- errx.11.04
An optional length modifier that specifies the size of the argument.
- errx.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.errx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.errx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- errx.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- errx.12.01
In this case an argument of type int supplies the field width or precision.
- errx.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- errx.12.03
A negative precision is taken as if the precision were omitted.
- errx.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.errx.13
The flag characters and their meanings are:
- app.errx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.errx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.errx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- errx.13
The flag characters and their meanings are:
- errx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- errx.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- errx.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- errx.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- errx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- errx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- errx.14
The length modifiers and their meanings are:
- errx.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- errx.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- errx.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- errx.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- errx.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- errx.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- errx.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- errx.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.errx.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- app.errx.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.errx.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.errx.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- errx.15
The conversion specifiers and their meanings are:
- errx.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- errx.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- errx.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- errx.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- errx.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- errx.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- errx.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- errx.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- errx.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- errx.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- errx.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- errx.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- errx.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- errx.15.14
C [XSI] Equivalent to lc.
- errx.15.15
S [XSI] Equivalent to ls.
- errx.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- errx.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- errx.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- errx.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- errx.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- errx.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- errx.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- errx.41 (failed)
The errx() function shall display a formatted error message on the standard error stream
- errx.42
The last component of the program name, a colon character, and a space shall be output
- errx.43
If fmt is non-NULL, it shall be used as the format string for the printf() family of functions, and the formatted error message, a colon character, and a space shall be output
- errx.44
The output shall be followed by a newline character
- errx.45
errx() does not return
- errx.46
errx() does not return, but shall exit with the value of eval
- [+]verrx (57 / 7 / 1)
- app.verrx.03
The results are undefined if there are insufficient arguments for the format.
- verrx.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- verrx.03.01
ordinary characters, which are simply copied to the output stream
- verrx.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- verrx.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.verrx.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- app.verrx.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- verrx.05.02
If an output error was encountered, these functions shall return a negative value.
- app.verrx.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- verrx.06
In addition, all forms of fprintf() may fail if:
- verrx.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- verrx.06.02
[EINVAL] [XSI] There are insufficient arguments.
- verrx.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- verrx.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- verrx.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- verrx.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.verrx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.verrx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- verrx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- verrx.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- verrx.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- verrx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- verrx.11.04
An optional length modifier that specifies the size of the argument.
- verrx.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- verrx.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- verrx.12.01
In this case an argument of type int supplies the field width or precision.
- verrx.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- verrx.12.03
A negative precision is taken as if the precision were omitted.
- verrx.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- verrx.13
The flag characters and their meanings are:
- verrx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- verrx.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- verrx.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- verrx.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- verrx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- verrx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.verrx.13
The flag characters and their meanings are:
- app.verrx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.verrx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.verrx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- verrx.14
The length modifiers and their meanings are:
- verrx.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- verrx.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- verrx.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- verrx.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- verrx.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- verrx.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- verrx.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- verrx.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.verrx.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- app.verrx.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.verrx.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.verrx.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- verrx.15
The conversion specifiers and their meanings are:
- verrx.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- verrx.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- verrx.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- verrx.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- verrx.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- verrx.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- verrx.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- verrx.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- verrx.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- verrx.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- verrx.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- verrx.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- verrx.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- verrx.15.14
C [XSI] Equivalent to lc.
- verrx.15.15
S [XSI] Equivalent to ls.
- verrx.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- verrx.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- verrx.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- verrx.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- verrx.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- verrx.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- verrx.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- verrx.41 (failed)
The verrx() shall behave as errx() except that instead of being called with a variable number of arguments, it is called with an argument list as defined by <stdarg.h>.
- verrx.45
verrx() does not return
- verrx.46
verrx() does not return, but exits with the value of eval
- [+]warn (58 / 24 / 0)
- app.warn.03
The results are undefined if there are insufficient arguments for the format.
- warn.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- warn.03.01
ordinary characters, which are simply copied to the output stream
- warn.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- warn.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.warn.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- warn.05.02
If an output error was encountered, these functions shall return a negative value.
- app.warn.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.warn.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- warn.06
In addition, all forms of fprintf() may fail if:
- warn.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- warn.06.02
[EINVAL] [XSI] There are insufficient arguments.
- warn.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- warn.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- warn.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- warn.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.warn.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.warn.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- warn.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- warn.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- warn.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- warn.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- warn.11.04
An optional length modifier that specifies the size of the argument.
- warn.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- warn.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- warn.12.01
In this case an argument of type int supplies the field width or precision.
- warn.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- warn.12.03
A negative precision is taken as if the precision were omitted.
- warn.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.warn.13
The flag characters and their meanings are:
- app.warn.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.warn.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.warn.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- warn.13
The flag characters and their meanings are:
- warn.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- warn.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- warn.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- warn.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- warn.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- warn.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- warn.14
The length modifiers and their meanings are:
- warn.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- warn.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- warn.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- warn.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- warn.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- warn.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- warn.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- warn.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.warn.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- warn.15
The conversion specifiers and their meanings are:
- warn.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warn.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warn.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warn.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warn.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- warn.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- warn.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warn.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warn.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warn.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- warn.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- warn.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- warn.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- warn.15.14
C [XSI] Equivalent to lc.
- warn.15.15
S [XSI] Equivalent to ls.
- warn.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.warn.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.warn.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.warn.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- warn.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- warn.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- warn.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- warn.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- warn.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- warn.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- warn.41
The warn() function shall display a formatted error message on the standard error stream.
- warn.42
The output shall consist of the last component of the program name, a colon character, and a space character.
- warn.43
If fmt is non-NULL, it shall be used as a format string for the printf() family of functions, and the formatted message, a colon character, and a space are written to stderr.
- warn.44
Finally, the error message string affiliated with the current value of the global variable errno shall be written to stderr, followed by a newline character.
- [+]warnx (58 / 24 / 0)
- warnx.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- warnx.03.01
ordinary characters, which are simply copied to the output stream
- warnx.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.warnx.03
The results are undefined if there are insufficient arguments for the format.
- app.warnx.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- warnx.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.warnx.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- warnx.05.02
If an output error was encountered, these functions shall return a negative value.
- app.warnx.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- warnx.06
In addition, all forms of fprintf() may fail if:
- warnx.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- warnx.06.02
[EINVAL] [XSI] There are insufficient arguments.
- warnx.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- warnx.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- warnx.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- warnx.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.warnx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.warnx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- warnx.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- warnx.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- warnx.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- warnx.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- warnx.11.04
An optional length modifier that specifies the size of the argument.
- warnx.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- warnx.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- warnx.12.01
In this case an argument of type int supplies the field width or precision.
- warnx.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- warnx.12.03
A negative precision is taken as if the precision were omitted.
- warnx.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- warnx.13
The flag characters and their meanings are:
- warnx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- warnx.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- warnx.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- warnx.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- warnx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- warnx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.warnx.13
The flag characters and their meanings are:
- app.warnx.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.warnx.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.warnx.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- warnx.14
The length modifiers and their meanings are:
- warnx.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- warnx.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- warnx.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- warnx.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- warnx.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- warnx.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- warnx.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- warnx.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.warnx.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- warnx.15
The conversion specifiers and their meanings are:
- warnx.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warnx.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warnx.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warnx.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- warnx.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- warnx.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- warnx.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warnx.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warnx.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- warnx.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- warnx.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- warnx.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- warnx.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- warnx.15.14
C [XSI] Equivalent to lc.
- warnx.15.15
S [XSI] Equivalent to ls.
- warnx.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.warnx.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.warnx.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.warnx.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- warnx.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- warnx.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- warnx.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- warnx.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- warnx.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- warnx.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- warnx.41
The warnx() function shall display a formatted error message on the standard error stream.
- warnx.42
The last component of the program name, a colon character, and a space shall be output.
- warnx.43
If fmt is non-NULL, it shall be used as the format string for the printf() family of functions, and the formatted error message, a colon character, and a space shall be output.
- warnx.44
The output shall be followed by a newline character.
- [+]util.bit (2 / 2 / 0)
- [+]ffs (1 / 1 / 0)
- ffs.01
The ffs() function shall find the first bit set (beginning with the least significant bit) in i, and return the index of that bit. Bits are numbered starting at one (the least significant bit).
The ffs() function shall return the index of the first bit set. If i is 0, then ffs() shall return 0.
- [+]toascii (1 / 1 / 0)
- toascii.01
The toascii() function shall convert its argument into a 7-bit ASCII character.
- toascii.01.01
The toascii() function shall return the value (c &0x7f).
- [+]util.compress (394 / 0 / 0)
- [+]adler32 (5 / 0 / 0)
- adler32.01
The adler32() function shall compute a running Adler-32 checksum (as described in RFC 1950: ZLIB Compressed Data Format Specication).
- adler32.02
On entry, adler is the previous value for the checksum, and buf shall point to an array of len bytes of data to be added to this checksum.
- adler32.03
The adler32() function shall return the new checksum.
- adler32.04
If buf is NULL (or Z_NULL), adler32() shall return the initial checksum.
- adler32.05
The adler32() function shall return the new checksum value.
- [+]compress (9 / 0 / 0)
- compress.01
The compress() function shall attempt to compress sourceLen bytes of data in the buffer source, placing the result in the buffer dest.
- compress.02
On entry, destLen should point to a value describing the size of the dest buffer
- compress.03
The application should ensure that this value be at least (sourceLen ? 1.001) + 12.
- compress.04
On successful exit, the variable referenced by destLen shall be updated to hold the length of compressed data in dest.
- compress.05
The compress() function is equivalent to compress2() with a level of Z_DEFAULT_LEVEL.
- compress.06
On success, compress() shall return Z_OK.
- compress.07
Otherwise, compress() shall return a value to indicate the error.
- compress.08
On error, compress() shall return a value as described below:
- compress.08.01
[Z_BUF_ERROR] The buffer dest was not large enough to hold the compressed data.
- compress.08.02
[Z_MEM_ERROR] Insufficient memory.
- [+]compress2 (13 / 0 / 0)
- compress2.01
The compress2() function shall attempt to compress sourceLen bytes of data in the buffer source, placing the result in the buffer dest, at the level described by level.
- compress2.02
The level supplied shall be a value between 0 and 9, or the value Z_DEFAULT_COMPRESSION.
- compress2.03
A level of 1 requests the highest speed, while a level of 9 requests the highest compression.
- compress2.04
A level of 0 indicates that no compression should be used, and the output shall be the same as the input.
- compress2.05
On entry, destLen should point to a value describing the size of the dest buffer.
- compress2.06
The application should ensure that this value be at least (sourceLen ? 1.001) + 12.
- compress2.07
On successful exit, the variable referenced by destLen shall be updated to hold the length of compressed data in dest.
- compress2.08
The compress() function is equivalent to compress2() with a level of Z_DEFAULT_LEVEL.
- compress2.09
On success, compress2() shall return Z_OK.
- compress2.10
Otherwise, compress2() shall return a value to indicate the error.
- compress2.11
On error, compress2() shall return a value as described below:
- compress2.11.01
[Z_BUF_ERROR] The buffer dest was not large enough to hold the compressed data.
- compress2.11.02
[Z_MEM_ERROR] Insufficient memory.
- compress2.11.03
[Z_STREAM_ERROR] The level was not Z_DEFAULT_LEVEL, or was not between 0 and 9.
- [+]compressBound (4 / 0 / 0)
- compressBound.01
The compressBound() function shall estimate the size of buffer required to compress sourceLen bytes of data using the compress() or compress2() functions.
- compressBound.02
If successful, the value returned shall be an upper bound for the size of buffer required to compress sourceLen bytes of data, using the parameters stored in stream, in a single call to compress() or compress2().
- compressBound.03
The compressBound() shall return a value representing the upper bound of an array to allocate to hold the compressed data in a single call to compress() or compress2().
- compressBound.04
This function may return a conservative value that may be larger than sourceLen.
- [+]crc32 (5 / 0 / 0)
- crc32.01
The crc32() function shall compute a running Cyclic Redundancy Check checksum, as defined in ITU-T V.42.
- crc32.02
On entry, crc is the previous value for the checksum, and buf shall point to an array of len bytes of data to be added to this checksum.
- crc32.03
The crc32() function shall return the new checksum.
- crc32.04
If buf is NULL (or Z_NULL), crc32() shall return the initial checksum.
- crc32.05
The crc32() function shall return the new checksum value.
- [+]deflate (31 / 0 / 0)
- deflate.01
The deflate() function shall attempt to compress data until either the input buffer is empty or the output buffer is full.
- deflate.02
The stream references a z_stream structure.
- deflate.03
Before the first call to deflate(), this structure should have been initialized by a call to deflateInit2_().
- deflate.04
In addition, the stream input and output buffers should have been initialized as follows:
- deflate.04.01
next_in should point to the data to be compressed.
- deflate.04.02
avail_in should contain the number of bytes of data in the buffer referenced by next_in.
- deflate.04.03
next_out should point to a buffer where compressed data may be placed.
- deflate.04.04
avail_out should contain the size in bytes of the buffer referenced by next_out
- deflate.05
The deflate() function shall perform one or both of the following actions:
- deflate.05.01
Compress input data from next_in and update next_in, avail_in and total_in to reflect the data that has been compressed.
- deflate.05.02
Fill the output buffer referenced by next_out, and update next_out, avail_out and total_out to reflect the compressed data that has been placed there. If flush is not Z_NO_FLUSH, and avail_out indicates that there is still space in output buffer, this action shall always occur (see below for further details).
- deflate.06
The deflate() function shall return when either avail_in reaches zero (indicating that all the input data has been compressed), or avail_out reaches zero (indicating that the output buffer is full).
- deflate.07
On success, the deflate() function shall set the adler field of the stream to the adler32() checksum of all the input data compressed so far (represented by total_in).
- deflate.08
If the deflate() function shall attempt to determine the type of input data, and set field data_type in stream to Z_ASCII if the majority of the data bytes fall within the ASCII (ISO 646) printable character range. Otherwise, it shall set data_type to Z_BINARY.This data type is informational only, and does not affect the compression algorithm.
- deflate.11
The parameter flush determines when compressed bits are added to the output buffer in next_out.
- deflate.12
If flush is Z_NO_FLUSH, deflate() may return with some data pending output, and not yet added to the output buffer.
- deflate.13
If flush is Z_SYNC_FLUSH
- deflate.13.01
deflate() shall flush all pending output to next_out
- deflate.13.02
align the output to a byte boundary
- deflate.14
A synchronization point is generated in the output.
- deflate.15
If flush is Z_FULL_FLUSH
- deflate.15.01
all output shall be flushed, as for Z_SYNC_FLUSH
- deflate.15.02
the compression state shall be reset
- deflate.16
A synchronization point is generated in the output.
- deflate.17
If flush is set to Z_FINISH
- deflate.17.01
all pending input shall be processed
- deflate.17.02
deflate() shall return with Z_STREAM_END if there is sufficient space in the output buffer at next_out, as indicated by avail_out
- deflate.18
If deflate() is called with flush set to Z_FINISH and there is insufficient space to store the compressed data, and no other error has occurred during compression
- deflate.18.01
deflate() shall return Z_OK
- deflate.18.02
the application should call deflate() again with flush unchanged, and having updated next_out and avail_out
- deflate.19
If all the compression is to be done in a single step
- deflate.19.01
if avail_out is set to at least the value returned by deflateBound()
- deflate.19.01.01
deflate() may be called with flush set to Z_FINISH immediately after the stream has been initialized
- deflate.20
unless flush was set to Z_FINISH and there was sufficient space in the output buffer to compress all of the input data
- deflate.20.01
On success, deflate() shall return Z_OK
- deflate.21
In this case, deflate() shall return Z_STREAM_END
- deflate.22
On error, deflate() shall return a value to indicate the error.
- deflate.23
On error, deflate() shall return a value as described below, and set the msg field of stream to point to a string describing the error:
- deflate.23.01
[Z_BUF_ERROR] No progress is possible; either avail_in or avail_out was zero.
- deflate.23.02
[Z_MEM_ERROR] Insufficient memory.
- deflate.23.03
[Z_STREAM_ERROR] The state (as represented in stream) is inconsistent, or stream was NULL.
- [+]deflateBound (5 / 0 / 0)
- deflateBound.01
The deflateBound() function shall estimate the size of buffer required to compress sourceLen bytes of data.
- deflateBound.02
If successful, the value returned shall be an upper bound for the size of buffer required to compress sourceLen bytes of data, using the parameters stored in stream, in a single call to deflate() with flush set to Z_FINISH.
- deflateBound.03
On entry, stream should have been initialized via a call to deflateInit_() or deflateInit2_().
- deflateBound.04
The deflateBound() shall return a value representing the upper bound of an array to allocate to hold the compressed data in a single call to deflate().
- deflateBound.05
If the stream is not correctly initialized, or is NULL, then deflateBound() may return a conservative value that may be larger than sourceLen.
- [+]deflateCopy (7 / 0 / 0)
- deflateCopy.01
The deflateCopy() function shall copy the compression state information in source to the uninitialized z_stream structure referenced by dest.
- deflateCopy.02
On successful return, dest will be an exact copy of the stream referenced by source.
- deflateCopy.03
The input and output buffer pointers in next_in and next_out will reference the same data.
- deflateCopy.04
On success, deflateCopy() shall return Z_OK.
- deflateCopy.05
Otherwise it shall return a value less than zero to indicate the error.
- deflateCopy.06
On error, deflateCopy() shall return a value as described below:
- deflateCopy.06.01
[Z_STREAM_ERROR] The state in source is inconsistent, or either source or dest was NULL.
- deflateCopy.06.02
[Z_MEM_ERROR] Insufficient memory available.
- [+]deflateEnd (6 / 0 / 0)
- deflateEnd.01
The deflateEnd() function shall free all allocated state information referenced by stream. All pending output is discarded, and unprocessed input is ignored.
- deflateEnd.02
On success, deflateEnd() shall return
- deflateEnd.02.01
Z_OK
- deflateEnd.02.02
Z_DATA_ERROR if there was pending output discarded or input unprocessed
- deflateEnd.03
Otherwise it shall return Z_STREAM_ERROR to indicate the error.
- deflateEnd.04
On error, deflateEnd() shall return Z_STREAM_ERROR.
- deflateEnd.04.01
The following conditions shall be treated as an error:
- deflateEnd.04.01.01
The state in stream is inconsistent or inappropriate.
- deflateEnd.04.01.02
stream is NULL.
- [+]deflateInit2_ (25 / 0 / 0)
- deflateInit2_.01
The deflateInit2_() function shall initialize the compression system.
- deflateInit2_.02
On entry, strm shall refer to a user supplied z_stream object (a z_stream_s structure).
- deflateInit2_.03
The following fields shall be set on entry:
- deflateInit2_.03.01
zalloc a pointer to an alloc_func function, used to allocate state information. If this is NULL, a default allocation function will be used.
- deflateInit2_.03.02
zfree a pointer to a free_func function, used to free memory allocated by the zalloc function. If this is NULL a default free function will be used.
- deflateInit2_.03.03
opaque If alloc_func is not NULL, opaque is a user supplied pointer to data that will be passed to the alloc_func and free_func functions.
- deflateInit2_.04
If the version requested is not compatible with the version implemented, or if the size of the z_stream_s structure provided in stream_size does not match the size in the library implementation, deflateInit2_() shall fail, and return Z_VERSION_ERROR.
- deflateInit2_.05
The level supplied shall be a value between 0 and 9, or the value Z_DEFAULT_COMPRESSION.
- deflateInit2_.06
A level of 1 requests the highest speed, while a level of 9 requests the highest compression.
- deflateInit2_.07
A level of 0 indicates that no compression should be used, and the output shall be the same as the input.
- deflateInit2_.08
The method selects the compression algorithm to use. LSB conforming implementation shall support the Z_DEFLATED method, and may support other implementation defined methods.
- deflateInit2_.09
The windowBits parameter shall be a base 2 logarithm of the window size to use, and shall be a value between 8 and 15.
- deflateInit2_.10
A smaller value will use less memory, but will result in a poorer compression ratio, while a higher value will give better compression but utilize more memory.
- deflateInit2_.11
The memLevel parameter specifies how much memory to use for the internal state.
- deflateInit2_.12
The value of memLevel shall be between 1 and MAX_MEM_LEVEL.
- deflateInit2_.13
Smaller values use less memory but are slower, while higher values use more memory to gain compression speed.
- deflateInit2_.14
The strategy parameter selects the compression strategy to use:
- deflateInit2_.14.01
Z_DEFAULT_STRATEGY use the system default compression strategy. Z_DEFAULT_STRATEGY is particularly appropriate for text data.
- deflateInit2_.14.02
Z_FILTERED use a compression strategy tuned for data consisting largely of small values with a fairly random distribution. Z_FILTERED uses more Huffman encoding and less string matching than Z_DEFAULT_STRATEGY.
- deflateInit2_.14.03
Z_HUFFMAN_ONLY force Huffman encoding only, with no string match.
- deflateInit2_.15
The deflateInit2_() function is not in the source standard; it is only in the binary standard. Source applications should use the deflateInit2() macro.
- deflateInit2_.16
On success, the deflateInit2_() function shall return Z_OK.
- deflateInit2_.17
Otherwise, deflateInit2_() shall return a value as described below to indicate the error.
- deflateInit2_.18
On error, deflateInit2_() shall return one of the following error indicators:
- deflateInit2_.18.01
[Z_STREAM_ERROR] Invalid parameter.
- deflateInit2_.18.02
[Z_MEM_ERROR] Insufficient memory available.
- deflateInit2_.18.03
[Z_VERSION_ERROR] The version requested is not compatible with the library version, or the z_stream size differs from that used by the library.
- deflateInit2_.19
In addition, the msg field of the strm may be set to an error message.
- [+]deflateInit_ (18 / 0 / 0)
- deflateInit_.01
The deflateInit_() function shall initialize the compression system.
- deflateInit_.02
On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure).
- deflateInit_.03
The following fields shall be set on entry:
- deflateInit_.03.01
zalloc a pointer to an alloc_func function, used to allocate state information. If this is NULL, a default allocation function will be used.
- deflateInit_.03.02
zfree a pointer to a free_func function, used to free memory allocated by the zalloc function. If this is NULL a default free function will be used.
- deflateInit_.03.03
opaque If alloc_func is not NULL, opaque is a user supplied pointer to data that will be passed to the alloc_func and free_func functions.
- deflateInit_.04
deflateInit_() shall fail, and return Z_VERSION_ERROR
- deflateInit_.04.01
If the version requested is not compatible with the version implemented
- deflateInit_.04.02
if the size of the z_stream_s structure provided in stream_size does not match the size in the library implementation
- deflateInit_.05
The level supplied shall be a value between 0 and 9, or the value Z_DEFAULT_COMPRESSION
- deflateInit_.06
A level of 1 requests the highest speed, while a level of 9 requests the highest compression
- deflateInit_.07
A level of 0 indicates that no compression should be used, and the output shall be the same as the input
- deflateInit_.08
The deflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the deflateInit() macro.
- deflateInit_.09
The deflateInit_() function is equivalent to deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, version, stream_size);
- deflateInit_.09.01
deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, version, stream_size);
- deflateInit_.10
On success, the deflateInit_() function shall return Z_OK.
- deflateInit_.11
Otherwise, deflateInit_() shall return a value as described below to indicate the error.
- deflateInit_.12
On error, deflateInit_() shall return one of the following error indicators:
- deflateInit_.12.01
[Z_STREAM_ERROR] Invalid parameter.
- deflateInit_.12.02
[Z_MEM_ERROR] Insufficient memory available.
- deflateInit_.12.03
[Z_VERSION_ERROR] The version requested is not compatible with the library version, or the z_stream size differs from that used by the library.
- deflateInit_.13
In addition, the msg field of the stream may be set to an error message.
- [+]deflateParams (15 / 0 / 0)
- deflateParams.01
The deflateParams() function shall dynamically alter the compression parameters for the compression stream object stream.
- deflateParams.02
On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure), already initialized via a call to deflateInit_() or deflateInit2_().
- deflateParams.03
The level supplied shall be a value between 0 and 9, or the value Z_DEFAULT_COMPRESSION.
- deflateParams.04
A level of 1 requests the highest speed, while a level of 9 requests the highest compression.
- deflateParams.05
A level of 0 indicates that no compression should be used, and the output shall be the same as the input.
- deflateParams.06
If the compression level is altered by deflateParams(), and some data has already been compressed with this stream (i.e. total_in is not zero), and the new level requires a different underlying compression method, then stream shall be flushed by a call to deflate().
- deflateParams.07
The strategy parameter selects the compression strategy to use:
- deflateParams.07.01
Z_DEFAULT_STRATEGY use the system default compression strategy. Z_DEFAULT_STRATEGY is particularly appropriate for text data.
- deflateParams.07.02
Z_FILTERED use a compression strategy tuned for data consisting largely of small values with a fairly random distribution. Z_FILTERED uses more Huffman encoding and less string matching than Z_DEFAULT_STRATEGY.
- deflateParams.07.03
Z_HUFFMAN_ONLY force Huffman encoding only, with no string match.
- deflateParams.08
On success, the deflateParams() function shall return Z_OK.
- deflateParams.09
Otherwise, deflateParams() shall return a value as described below to indicate the error
- deflateParams.10
On error, deflateParams() shall return one of the following error indicators:
- deflateParams.10.01
[Z_STREAM_ERROR] Invalid parameter.
- deflateParams.10.02
[Z_MEM_ERROR] Insufficient memory available.
- deflateParams.10.03
[Z_BUF_ERROR] Insufficient space in stream to flush the current output.
- deflateParams.11
In addition, the msg field of the strm may be set to an error message.
- [+]deflateReset (6 / 0 / 0)
- deflateReset.01
The deflateReset() function shall reset all state associated with stream.
- deflateReset.02
All pending output shall be discarded, and the counts of processed bytes (total_in and total_out) shall be reset to zero.
- deflateReset.03
On success, deflateReset() shall return Z_OK.
- deflateReset.04
Otherwise it shall return Z_STREAM_ERROR to indicate the error.
- deflateReset.05
On error, deflateReset() shall return Z_STREAM_ERROR.
- deflateReset.05.01
The following conditions shall be treated as an error:
- deflateReset.05.01.01
The state in stream is inconsistent or inappropriate.
- deflateReset.05.01.02
stream is NULL.
- [+]deflateSetDictionary (7 / 0 / 0)
- deflateSetDictionary.01
The deflateSetDictionary() function shall initialize the compression dictionary associated with stream using the dictlen bytes referenced by dictionary.
- deflateSetDictionary.02
The implementation may silently use a subset of the provided dictionary if the dictionary cannot fit in the current window associated with stream (see deflateInit2_()).
- app.deflateSetDictionary.03
The application should ensure that the dictionary is sorted such that the most commonly used strings occur at the end of the dictionary.
- deflateSetDictionary.04
If the dictionary is successfully set, the Adler32 checksum of the entire provided dictionary shall be stored in the adler member of stream.
- app.deflateSetDictionary.05
This value may be used by the decompression system to select the correct dictionary.
- app.deflateSetDictionary.06
The compression and decompression systems must use the same dictionary.
- deflateSetDictionary.07
stream shall reference an initialized compression stream, with total_in zero (i.e. no data has been compressed since the stream was initialized).
- deflateSetDictionary.08
On success, deflateSetDictionary() shall return Z_OK.
- deflateSetDictionary.09
Otherwise it shall return Z_STREAM_ERROR to indicate an error.
- deflateSetDictionary.10
On error, deflateSetDictionary() shall return a value as described below:
- deflateSetDictionary.10.01
[Z_STREAM_ERROR] The state in stream is inconsistent, or stream was NULL.
- [+]get_crc_table (3 / 0 / 0)
- get_crc_table.01
Generate tables for a byte-wise 32-bit CRC calculation based on the polynomial: x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1
- get_crc_table.02
In a multi-threaded application, get_crc_table() should be called by one thread to initialize the tables before any other thread calls any libz function.
- get_crc_table.03
The get_crc_table() function shall return a pointer to the first of a set of tables used internally to calculate CRC-32 values (see crc32()).
- [+]gzclose (8 / 0 / 0)
- gzclose.01
The gzclose() function shall close the compressed file stream file.
- gzclose.02
If file was open for writing, gzclose() shall first flush any pending output. Any state information allocated shall be freed.
- gzclose.03
On success, gzclose() shall return Z_OK.
- gzclose.04
Otherwise, gzclose() shall return an error value as described below.
- gzclose.05
On error, gzclose() may set the global variable errno to indicate the error.
- gzclose.05.01
[Z_STREAM_ERROR] file was NULL (or Z_NULL), or did not refer to an open compressed file stream.
- gzclose.05.02
[Z_ERRNO] An error occurred in the underlying base libraries, and the application should check errno for further information.
- gzclose.05.03
[Z_BUF_ERROR] no compression progress is possible during buffer flush (see deflate()).
- gzclose.06
The gzclose() shall return a value other than Z_OK on error.
- [+]gzdopen (8 / 0 / 0)
- gzdopen.01
The gzdopen() function shall attempt to associate the open file referenced by fd with a gzFile object.
- gzdopen.02
The mode argument is based on that of fopen(), but the mode parameter may also contain the following characters:
- gzdopen.02.01
digit set the compression level to digit. A low value (e.g. 1) means high speed, while a high value (e.g. 9) means high compression. A compression level of 0 (zero) means no compression. See defaultInit2_() for further details.
- gzdopen.02.02
[fhR] set the compression strategy to [fhR]. The letter f corresponds to filtered data, the letter h corresponds to Huffman only compression, and the letter R corresponds to Run Length Encoding. See defaultInit2_() for further details.
- gzdopen.03
If fd refers to an uncompressed file, and mode refers to a read mode, gzdopen() shall attempt to open the file and return a gzFile object suitable for reading directly from the file without any decompression.
- gzdopen.04
If mode is NULL, or if mode does not contain one of r, w, or a, gzdopen() shall return Z_NULL, and need not set any other error condition.
- gzdopen.05
On success, gzdopen() shall return a gzFile object.
- gzdopen.06
On failure, gzdopen() shall return Z_NULL and may set errno accordingly.
- gzdopen.07
On error, gzdopen() may set the global variable errno to indicate the error.
- [+]gzeof (3 / 0 / 0)
- gzeof.01
The gzeof() function shall test the compressed file stream file for end of file.
- gzeof.02
If file was open for reading and end of file has been reached, gzeof() shall return 1.
- gzeof.03
Otherwise, gzeof() shall return 0.
- [+]gzerror (5 / 0 / 0)
- gzerror.01
The gzerror() function shall return a string describing the last error to have occurred associated with the open compressed file stream referred to by file.
- gzerror.02
It shall also set the location referenced by errnum to an integer value that further identifies the error.
- gzerror.03
The gzerror() function shall return a string that describes the last error associated with the given file compressed file stream. This string shall have the format "%s: %s", with the name of the file, followed by a colon, a space, and the description of the error.
- gzerror.04
If the compressed file stream was opened by a call to gzdopen(), the format of the filename is unspecified.
- gzerror.05
It is unspecified if the string returned is determined by the setting of the LC_MESSAGES category in the current locale.
- [+]gzflush (11 / 0 / 0)
- gzflush.01
The gzflush() function shall flush pending output to the compressed file stream identified by file, which must be open for writing.
- gzflush.02
The parameter flush determines which compressed bits are added to the output file.
- gzflush.02.01
If flush is Z_NO_FLUSH, gzflush() may return with some data pending output, and not yet written to the file.
- gzflush.02.02
If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending output to file and align the output to a byte boundary. There may still be data pending compression that is not flushed.
- gzflush.02.03
If flush is Z_FULL_FLUSH, all output shall be flushed, as for Z_SYNC_FLUSH, and the compression state shall be reset. There may still be data pending compression that is not flushed.
- gzflush.02.04
If flush is set to Z_FINISH, all pending uncompressed data shall be compressed and all output shall be flushed.
- gzflush.03
On success, gzflush() shall return the value Z_OK.
- gzflush.04
Otherwise gzflush() shall return a value to indicate the error, and may set the error number associated with the compressed file stream file.
- gzflush.05
On error, gzwrite() shall return an error value, and may set the error number associated with the stream identified by file to indicate the error. Applications may use gzerror() to access this error value.
- gzflush.05.01
[Z_ERRNO] An underlying base library function has indicated an error. The global variable errno may be examined for further information.
- gzflush.05.02
[Z_STREAM_ERROR] The stream is invalid, is not open for writing, or is in an invalid state.
- gzflush.05.03
[Z_BUF_ERROR] no compression progress is possible (see deflate()).
- gzflush.05.04
[Z_MEM_ERROR] Insufficient memory available to compress.
- [+]gzgetc (5 / 0 / 0)
- gzgetc.01
The gzgetc() function shall read the next single character from the compressed file stream referenced by file, which shall have been opened in a read mode (see gzopen() and gzdopen()).
- gzgetc.02
On success, gzgetc() shall return the uncompressed character read
- gzgetc.03
otherwise, on end of file or error, gzgetc() shall return -1.
- gzgetc.04
On end of file or error, gzgetc() shall return -1.
- gzgetc.05
Further information can be found by calling gzerror() with a pointer to the compressed file stream.
- [+]gzgets (9 / 0 / 0)
- gzgets.01
The gzgets() function shall attempt to read data from the compressed file stream file, uncompressing it into buf until either len-1 bytes have been inserted into buf, or until a newline character has been uncompressed into buf.
- gzgets.02
A null byte shall be appended to the uncompressed data.
- gzgets.03
The file shall have been opened in for reading (see gzopen() and gzdopen()).
- gzgets.04
On success, gzgets() shall return a pointer to buf.
- gzgets.05
Otherwise, gzgets() shall return Z_NULL.
- app.gzgets.06
Applications may examine the cause using gzerror().
- gzgets.07
On error, gzgets() shall return Z_NULL.
- gzgets.08
The following conditions shall always be treated as an error:
- gzgets.08.01
file is NULL, or does not refer to a file open for reading
- gzgets.08.02
buf is NULL;
- gzgets.08.03
len is less than or equal to zero.
- [+]gzopen (8 / 0 / 0)
- gzopen.01
The gzopen() function shall open the compressed file named by path.
- gzopen.02
The mode argument is based on that of fopen(), but the mode parameter may also contain the following characters:
- gzopen.02.01
digit set the compression level to digit. A low value (e.g. 1) means high speed, while a high value (e.g. 9) means high compression. A compression level of 0 (zero) means no compression. See defaultInit2_() for further details.
- gzopen.02.02
[fhR] set the compression strategy to [fhR]. The letter f corresponds to filtered data, the letter h corresponds to Huffman only compression, and the letter R corresponds to Run Length Encoding. See defaultInit2_() for further details.
- gzopen.03
If path refers to an uncompressed file, and mode refers to a read mode, gzopen() shall attempt to open the file and return a gzFile object suitable for reading directly from the file without any decompression.
- gzopen.04
If path or mode is NULL, or if mode does not contain one of r, w, or a, gzopen() shall return Z_NULL, and need not set any other error condition.
- app.gzopen.05
The gzFile object is also referred to as a compressed file stream.
- gzopen.06
On success, gzopen() shall return a gzFile object (also known as a compressed file stream).
- gzopen.07
On failure, gzopen() shall return Z_NULL and may set errno accordingly.
- gzopen.08
On error, gzopen() may set the global variable errno to indicate the error.
- [+]gzprintf (8 / 0 / 0)
- gzprintf.01
The gzprintf() function shall format data as for fprintf(), and write the resulting string to the compressed file stream file.
- gzprintf.02
The gzprintf() function shall return the number of uncompressed bytes actually written, or a value less than or equal to 0 in the event of an error.
- gzprintf.03
If file is NULL, or refers to a compressed file stream that has not been opened for writing, gzprintf() shall return Z_STREAM_ERROR.
- gzprintf.04
Otherwise, errors are as for gzwrite().
- gzprintf.gzwrite.08
On error, gzwrite() shall set the error number associated with the stream identified by file to indicate the error.
- gzprintf.gzwrite.08.01
[Z_ERRNO] An underlying base library function has indicated an error. The global variable errno may be examined for further information.
- gzprintf.gzwrite.08.02
[Z_STREAM_ERROR] The stream is invalid, is not open for writing, or is in an invalid state.
- gzprintf.gzwrite.08.03
[Z_BUF_ERROR] no compression progress is possible (see deflate()).
- gzprintf.gzwrite.08.04
[Z_MEM_ERROR] Insufficient memory available to compress.
- app.gzprintf.gzwrite.09
Applications should use gzerror() to access this error value.
- [+]gzputc (4 / 0 / 0)
- gzputc.01
The gzputc() function shall write the single character c, converted from integer to unsigned character, to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()).
- gzputc.02
On success, gzputc() shall return the value written
- gzputc.03
otherwise gzputc() shall return -1.
- gzputc.04
On error, gzputc() shall return -1.
- [+]gzputs (10 / 0 / 0)
- gzputs.01
The gzputs() function shall write the null terminated string s to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()).
- gzputs.02
The terminating null character shall not be written.
- gzputs.03
The gzputs() function shall return the number of uncompressed bytes actually written.
- gzputs.04
On success, gzputs() shall return the number of uncompressed bytes actually written to file.
- gzputs.05
On error gzputs() shall return a value less than or equal to 0.
- app.gzputs.06
Applications may examine the cause using gzerror().
- gzputs.07
On error, gzputs() shall set the error number associated with the stream identified by file to indicate the error.
- gzputs.07.01
[Z_ERRNO] An underlying base library function has indicated an error. The global variable errno may be examined for further information.
- gzputs.07.02
[Z_STREAM_ERROR] The stream is invalid, is not open for writing, or is in an invalid state.
- gzputs.07.03
[Z_BUF_ERROR] no compression progress is possible (see deflate()).
- gzputs.07.04
[Z_MEM_ERROR] Insufficient memory available to compress.
- app.gzputs.08
Applications should use gzerror() to access this error value.
- gzputs.09
If file is NULL, gzputs() shall return Z_STREAM_ERR.
- [+]gzread (12 / 0 / 0)
- gzread.01
The gzread() function shall read data from the compressed file referenced by file, which shall have been opened in a read mode (see gzopen() and gzdopen()). The gzread() function shall read data from file, and uncompress it into buf
- gzread.02
At most, len bytes of uncompressed data shall be copied to buf.
- gzread.03
If the file is not compressed, gzread() shall simply copy data from file to buf without alteration.
- gzread.04
On success, gzread() shall return the number of bytes decompressed into buf.
- gzread.05
If gzread() returns 0, either the end-of-file has been reached or an underlying read error has occurred.
- app.gzread.06
Applications should use gzerror() or gzeof() to determine which occurred.
- gzread.07
On other errors, gzread() shall return a value less than 0 and and applications may examine the cause using gzerror().
- gzread.08
On error, gzread() shall set the error number associated with the stream identified by file to indicate the error.
- gzread.08.01
[Z_ERRNO] An underlying base library function has indicated an error. The global variable errno may be examined for further information.
- gzread.08.02
[Z_STREAM_END] End of file has been reached on input.
- gzread.08.03
[Z_DATA_ERROR] A CRC error occurred when reading data; the file is corrupt.
- gzread.08.04
[Z_STREAM_ERROR] The stream is invalid, or is in an invalid state.
- gzread.08.05
[Z_NEED_DICT] A dictionary is needed (see inflateSetDictionary()).
- gzread.08.06
[Z_MEM_ERROR] Insufficient memory available to decompress.
- app.gzread.09
Applications should use gzerror() to access this error value.
- [+]gzrewind (5 / 0 / 0)
- gzrewind.01
The gzrewind() function shall set the starting position for the next read on compressed file stream file to the beginning of file. file must be open for reading.
- gzrewind.02
gzrewind() is equivalent to (int)gzseek(file, 0L, SEEK_SET).
- gzrewind.02.01
(int)gzseek(file, 0L, SEEK_SET)
- gzrewind.03
On success, gzrewind() shall return 0.
- gzrewind.04
On error, gzrewind() shall return -1, and may set the error value for file accordingly.
- gzrewind.05
On error, gzrewind() shall return -1, indicating that file is NULL, or does not represent an open compressed file stream, or represents a compressed file stream that is open for writing and is not currently at the beginning of file.
- [+]gzseek (13 / 0 / 0)
- gzseek.01
The gzseek() function shall set the file-position indicator for the compressed file stream file.
- app.gzseek.02
The file-position indicator controls where the next read or write operation on the compressed file stream shall take place.
- gzseek.03
The offset indicates a byte offset in the uncompressed data.
- gzseek.04
The whence parameter may be one of:
- gzseek.04.01
SEEK_SET the offset is relative to the start of the uncompressed data.
- gzseek.04.02
SEEK_CUR the offset is relative to the current positition in the uncompressed data.
- gzseek.05
If the file is open for writing, the new offset must be greater than or equal to the current offset.
- gzseek.05.01
In this case, gzseek() shall compress a sequence of null bytes to fill the gap from the previous offset to the new offset.
- gzseek.06
On success, gzseek() shall return the resulting offset in the file expressed as a byte position in the uncompressed data stream.
- gzseek.07
On error, gzseek() shall return -1, and may set the error value for file accordingly.
- gzseek.08
On error, gzseek() shall return -1.
- gzseek.09
The following conditions shall always result in an error:
- gzseek.09.01
file is NULL
- gzseek.09.02
file does not represent an open compressed file stream.
- gzseek.09.03
file refers to a compressed file stream that is open for writing, and the newly computed offset is less than the current offset.
- gzseek.09.04
The newly computed offset is less than zero.
- gzseek.09.05
whence is not one of the supported values.
- [+]gzsetparams (12 / 0 / 0)
- gzsetparams.01
The gzsetparams() function shall set the compression level and compression strategy on the compressed file stream referenced by file
- gzsetparams.02
The compressed file stream shall have been opened in a write mode
- gzsetparams.03
The level and strategy are as defined in deflateInit2_.
- gzsetparams.04
If there is any data pending writing, it shall be flushed before the parameters are updated.
- gzsetparams.05
The level supplied shall be a value between 0 and 9, or the value Z_DEFAULT_COMPRESSION.
- gzsetparams.06
A level of 1 requests the highest speed, while a level of 9 requests the highest compression.
- gzsetparams.07
A level of 0 indicates that no compression should be used, and the output shall be the same as the input.
- gzsetparams.07.01
[Z_STREAM_ERROR] Invalid parameter, or file not open for writing.
- gzsetparams.07.02
[Z_BUF_ERROR] An internal inconsistency was detected while flushing the previous buffer.
- gzsetparams.08
On success, the gzsetparams() function shall return Z_OK.
- gzsetparams.14
The strategy parameter selects the compression strategy to use:
- gzsetparams.14.01
Z_DEFAULT_STRATEGY use the system default compression strategy. Z_DEFAULT_STRATEGY is particularly appropriate for text data.
- gzsetparams.14.02
Z_FILTERED use a compression strategy tuned for data consisting largely of small values with a fairly random distribution. Z_FILTERED uses more Huffman encoding and less string matching than Z_DEFAULT_STRATEGY.
- gzsetparams.14.03
Z_HUFFMAN_ONLY force Huffman encoding only, with no string match.
- [+]gztell (6 / 0 / 0)
- gztell.01
The gztell() function shall return the starting position for the next read or write operation on compressed file stream file.
- gztell.02
This position represents the number of bytes from the beginning of file in the uncompressed data.
- gztell.03
gztell() is equivalent to gzseek(file, 0L, SEEK_SET).
- gztell.03.01
gzseek(file, 0L, SEEK_SET)
- gztell.04
gztell() shall return the current offset in the file expressed as a byte position in the uncompressed data stream.
- gztell.05
On error, gztell() shall return -1, and may set the error value for file accordingly.
- gztell.06
On error, gztell() shall return -1, indicating that file is NULL, or does not represent an open compressed file stream.
- [+]gzwrite (10 / 0 / 0)
- gzwrite.01
The gzwrite() function shall write data to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()).
- gzwrite.02
On entry, buf shall point to a buffer containing lenbytes of uncompressed data.
- gzwrite.03
The gzwrite() function shall compress this data and write it to file.
- gzwrite.04
The gzwrite() function shall return the number of uncompressed bytes actually written.
- gzwrite.05
On success, gzwrite() shall return the number of uncompressed bytes actually written to file.
- gzwrite.06
On error gzwrite() shall return a value less than or equal to 0.
- app.gzwrite.07
Applications may examine the cause using gzerror().
- gzwrite.08
On error, gzwrite() shall set the error number associated with the stream identified by file to indicate the error.
- gzwrite.08.01
[Z_ERRNO] An underlying base library function has indicated an error. The global variable errno may be examined for further information.
- gzwrite.08.02
[Z_STREAM_ERROR] The stream is invalid, is not open for writing, or is in an invalid state.
- gzwrite.08.03
[Z_BUF_ERROR] no compression progress is possible (see deflate()).
- gzwrite.08.04
[Z_MEM_ERROR] Insufficient memory available to compress.
- app.gzwrite.09
Applications should use gzerror() to access this error value.
- [+]inflate (23 / 0 / 0)
- inflate.01
The inflate() function shall attempt to decompress data until either the input buffer is empty or the output buffer is full.
- app.inflate.02
The stream references a z_stream structure.
- inflate.03
Before the first call to inflate(), this structure should have been initialized by a call to inflateInit2_().
- inflate.04
In addition, the stream input and output buffers should have been initialized as follows:
- inflate.04.01
next_in should point to the data to be decompressed.
- inflate.04.02
avail_in should contain the number of bytes of data in the buffer referenced by next_in.
- inflate.04.03
next_out should point to a buffer where decompressed data may be placed.
- inflate.04.04
avail_out should contain the size in bytes of the buffer referenced by next_out
- inflate.05
The inflate() function shall perform one or both of the following actions:
- inflate.05.01
Decompress input data from next_in and update next_in, avail_in and total_in to reflect the data that has been decompressed.
- inflate.05.02
Fill the output buffer referenced by next_out, and update next_out, avail_out, and total_out to reflect the decompressed data that has been placed there. If flush is not Z_NO_FLUSH, and avail_out indicates that there is still space in output buffer, this action shall always occur (see below for further details).
- inflate.06
The inflate() function shall return when either avail_in reaches zero (indicating that all the input data has been compressed), or avail_out reaches zero (indicating that the output buffer is full).
- inflate.07
On success, the inflate() function shall set the adler field of the stream to the Adler-32 checksum of all the input data compressed so far (represented by total_in).
- inflate.08
The parameter flush determines when uncompressed bytes are added to the output buffer in next_out.
- inflate.08.01
If flush is Z_NO_FLUSH, inflate() may return with some data pending output, and not yet added to the output buffer.
- inflate.08.02
If flush is Z_SYNC_FLUSH, inflate() shall flush all pending output to next_out, and update next_out and avail_out accordingly.
- inflate.08.03
If flush is set to Z_BLOCK, inflate() shall stop adding data to the output buffer if and when the next compressed block boundary is reached (see RFC 1951: DEFLATE Compressed Data Format Specification).
- inflate.08.04.01
If flush is set to Z_FINISH, all of the compressed input shall be decompressed and added to the output.
- inflate.08.04.02
If there is insufficient output space (i.e. the compressed input data uncompresses to more than avail_out bytes), then inflate() shall fail and return Z_BUF_ERROR.
- inflate.09
On success, inflate() shall return
- inflate.09.01
Z_OK if decompression progress has been made
- inflate.09.02
Z_STREAM_END if all of the input data has been decompressed and there was sufficient space in the output buffer to store the uncompressed result.
- inflate.10
On error, inflate() shall return a value to indicate the error.
- inflate.11
On success, inflate() shall set the adler to the Adler-32 checksum of the output produced so far (i.e. total_out bytes).
- inflate.12
On error, inflate() shall return a value as described below, and may set the msg field of stream to point to a string describing the error:
- inflate.12.01
[Z_BUF_ERROR] No progress is possible; either avail_in or avail_out was zero.
- inflate.12.02
[Z_MEM_ERROR] Insufficient memory.
- inflate.12.03
[Z_STREAM_ERROR] The state (as represented in stream) is inconsistent, or stream was NULL.
- inflate.12.04
[Z_NEED_DICT] A preset dictionary is required. The adler field shall be set to the Adler-32 checksum of the dictionary chosen by the compressor.
- [+]inflateEnd (6 / 0 / 0)
- inflateEnd.01
The inflateEnd() function shall free all allocated state information referenced by stream. All pending output is discarded, and unprocessed input is ignored.
- inflateEnd.02
On success, inflateEnd() shall return Z_OK.
- inflateEnd.03
Otherwise it shall return Z_STREAM_ERROR to indicate the error.
- inflateEnd.04
On error, inflateEnd() shall return Z_STREAM_ERROR.
- inflateEnd.04.01
The following conditions shall be treated as an error:
- inflateEnd.04.01.01
The state in stream is inconsistent.
- inflateEnd.04.01.02
stream is NULL.
- inflateEnd.04.01.03
The zfree function pointer is NULL.
- [+]inflateInit2_ (14 / 0 / 0)
- inflateInit2_.01
The inflateInit2_() function shall initialize the decompression system.
- app.inflateInit2_.02
On entry, strm shall refer to a user supplied z_stream object (a z_stream_s structure).
- inflateInit2_.03
The following fields shall be set on entry:
- inflateInit2_.03.01
zalloc a pointer to an alloc_func function, used to allocate state information. If this is NULL, a default allocation function will be used.
- inflateInit2_.03.02
zfree a pointer to a free_func function, used to free memory allocated by the zalloc function. If this is NULL a default free function will be used.
- inflateInit2_.03.03
opaque If alloc_func is not NULL, opaque is a user supplied pointer to data that will be passed to the alloc_func and free_func functions.
- inflateInit2_.04
If the version requested is not compatible with the version implemented, or if the size of the z_stream_s structure provided in stream_size does not match the size in the library implementation, inflateInit2_() shall fail, and return Z_VERSION_ERROR.
- inflateInit2_.05
The windowBits parameter shall be a base 2 logarithm of the maximum window size to use, and shall be a value between 8 and 15.
- inflateInit2_.06
If the input data was compressed with a larger window size, subsequent attempts to decompress this data will fail with Z_DATA_ERROR, rather than try to allocate a larger window.
- inflateInit2_.07
The inflateInit2_() function is not in the source standard; it is only in the binary standard. Source applications should use the inflateInit2() macro.
- inflateInit2_.08
On success, the inflateInit2_() function shall return Z_OK.
- inflateInit2_.09
Otherwise, inflateInit2_() shall return a value as described below to indicate the error.
- inflateInit2_.10
On error, inflateInit2_() shall return one of the following error indicators:
- inflateInit2_.10.01
[Z_STREAM_ERROR] Invalid parameter.
- inflateInit2_.10.02
[Z_MEM_ERROR] Insufficient memory available.
- inflateInit2_.10.03
[Z_VERSION_ERROR] The version requested is not compatible with the library version, or the z_stream size differs from that used by the library.
- inflateInit2_.11
In addition, the msg field of the strm may be set to an error message.
- [+]inflateInit_ (13 / 0 / 0)
- inflateInit_.01
The inflateInit_() function shall initialize the decompression system.
- app.inflateInit_.02
On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure).
- inflateInit_.03
The following fields shall be set on entry:
- inflateInit_.03.01
zalloc a pointer to an alloc_func function, used to allocate state information. If this is NULL, a default allocation function will be used.
- inflateInit_.03.02
zfree a pointer to a free_func function, used to free memory allocated by the zalloc function. If this is NULL a default free function will be used.
- inflateInit_.03.03
opaque If alloc_func is not NULL, opaque is a user supplied pointer to data that will be passed to the alloc_func and free_func functions.
- inflateInit_.04
If the version requested is not compatible with the version implemented, or if the size of the z_stream_s structure provided in stream_size does not match the size in the library implementation, inflateInit_() shall fail, and return Z_VERSION_ERROR.
- inflateInit_.05
The inflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the inflateInit() macro.
- inflateInit_.06
The inflateInit_() shall be equivalent to inflateInit2_(strm, DEF_WBITS, version, stream_size);
- inflateInit_.06.01
inflateInit2_(strm, DEF_WBITS, version, stream_size);
- inflateInit_.07
On success, the inflateInit_() function shall return Z_OK.
- inflateInit_.08
Otherwise, inflateInit_() shall return a value as described below to indicate the error.
- inflateInit_.09
On error, inflateInit_() shall return one of the following error indicators:
- inflateInit_.09.01
[Z_STREAM_ERROR] Invalid parameter.
- inflateInit_.09.02
[Z_MEM_ERROR] Insufficient memory available.
- inflateInit_.09.03
[Z_VERSION_ERROR] The version requested is not compatible with the library version, or the z_stream size differs from that used by the library.
- inflateInit_.10
In addition, the msg field of the strm may be set to an error message.
- [+]inflateReset (6 / 0 / 0)
- inflateReset.01
The inflateReset() function shall reset all state associated with stream.
- inflateReset.02
All pending output shall be discarded, and the counts of processed bytes (total_in and total_out) shall be reset to zero.
- inflateReset.03
On success, inflateReset() shall return Z_OK.
- inflateReset.04
Otherwise it shall return Z_STREAM_ERROR to indicate the error.
- inflateReset.05
On error, inflateReset() shall return Z_STREAM_ERROR.
- inflateReset.05.01
The following conditions shall be treated as an error:
- inflateReset.05.01.01
The state in stream is inconsistent or inappropriate.
- inflateReset.05.01.02
stream is NULL.
- [+]inflateSetDictionary (7 / 0 / 0)
- inflateSetDictionary.01
The inflateSetDictionary() function shall initialize the decompression dictionary associated with stream using the dictlen bytes referenced by dictionary.
- app.inflateSetDictionary.02
The inflateSetDictionary() function should be called immediately after a call to inflate() has failed with return value Z_NEED_DICT.
- inflateSetDictionary.03
The dictionary must have the same Adler-32 checksum as the dictionary used for the compression (see deflateSetDictionary()).
- inflateSetDictionary.04
stream shall reference an initialized decompression stream, with total_in zero (i.e. no data has been decompressed since the stream was initialized).
- inflateSetDictionary.05
On success, inflateSetDictionary() shall return Z_OK.
- inflateSetDictionary.06
Otherwise it shall return a value as indicated below.
- inflateSetDictionary.07
On error, inflateSetDictionary() shall return a value as described below:
- inflateSetDictionary.07.01
[Z_STREAM_ERROR] The state in stream is inconsistent, or stream was NULL.
- inflateSetDictionary.07.02
[Z_DATA_ERROR] The Adler-32 checksum of the supplied dictionary does not match that used for the compression.
- [+]inflateSync (7 / 0 / 0)
- inflateSync.01
The inflateSync() function shall advance through the compressed data in stream, skipping any invalid compressed data, until the next full flush point is reached, or all input is exhausted.
- inflateSync.02
No output is placed in next_out.
- inflateSync.03
On success, inflateSync() shall return Z_OK, and update the next_in,, avail_in, and, total_in fields of stream to reflect the number of bytes of compressed data that have been skipped.
- inflateSync.04
Otherwise, inflateSync() shall return a value as described below to indicate the error.
- inflateSync.05
On error, inflateSync() shall return a value as described below:
- inflateSync.05.01
[Z_STREAM_ERROR] The state (as represented in stream) is inconsistent, or stream was NULL.
- inflateSync.05.02
[Z_BUF_ERROR] There is no data available to skip over.
- inflateSync.05.03
[Z_DATA_ERROR] No sync point was found.
- [+]inflateSyncPoint (5 / 0 / 0)
- inflateSyncPoint.01
The inflateSyncPoint() function shall return a non-zero calue if the compressed data stream referenced by stream is at a synchronization point.
- inflateSyncPoint.02
If the compressed data in stream is at a synchronization point (see deflate() with a flush level of Z_SYNC_FLUSH or Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero value, other than Z_STREAM_ERROR.
- inflateSyncPoint.03
Otherwise, if the stream is valid, inflateSyncPoint() shall return 0.
- inflateSyncPoint.04
If stream is invalid, or in an invalid state, inflateSyncPoint() shall return Z_STREAM_ERROR to indicate the error.
- inflateSyncPoint.05
On error, inflateSyncPoint() shall return a value as described below:
- inflateSyncPoint.05.01
[Z_STREAM_ERROR] The state (as represented in stream) is inconsistent, or stream was NULL.
- [+]uncompress (9 / 0 / 0)
- uncompress.01
The uncompress() function shall attempt to uncompress sourceLen bytes of data in the buffer source, placing the result in the buffer dest.
- uncompress.02
On entry, destLen should point to a value describing the size of the dest buffer.
- uncompress.03
The application should ensure that this value is large enough to hold the entire uncompressed data.
- uncompress.04
On successful exit, the variable referenced by destLen shall be updated to hold the length of uncompressed data in dest.
- uncompress.05
On success, uncompress() shall return Z_OK.
- uncompress.06
Otherwise, uncompress() shall return a value to indicate the error.
- uncompress.07
On error, uncompress() shall return a value as described below:
- uncompress.07.01
[Z_BUF_ERROR] The buffer dest was not large enough to hold the uncompressed data.
- uncompress.07.02
[Z_MEM_ERROR] Insufficient memory.
- uncompress.07.03
[Z_DATA_ERROR] The compressed data (referenced by source) was corrupted.
- [+]zError (5 / 0 / 0)
- zError.01
The zError() function shall return the string identifying the error associated with err.
- zError.02
This allows for conversion from error code to string for functions such as compress() and uncompress(), that do not always set the string version of an error.
- zError.03
The zError() function shall return
- zError.03.01
a the string identifying the error associated with err
- zError.03.02
NULL if err is not a valid error code.
- zError.04
It is unspecified if the string returned is determined by the setting of the LC_MESSAGES category in the current locale.
- [+]zlibVersion (3 / 0 / 0)
- zlibVersion.01
The zlibVersion() function shall return the string identifying the interface version at the time the library was built.
- zlibVersion.02
Applications should compare the value returned from zlibVersion() with the macro constant ZLIB_VERSION for compatibility.
- zlibVersion.03
The zlibVersion() function shall return a the string identifying the version of the library currently implemented.
- [+]util.conversion.strint (405 / 362 / 0)
- [+]__strtol_internal (27 / 25 / 0)
- __strtol_internal.01
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- __strtol_internal.02
First, they decompose the input string into three parts:
- __strtol_internal.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- __strtol_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __strtol_internal.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- __strtol_internal.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- __strtol_internal.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __strtol_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __strtol_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __strtol_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __strtol_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __strtol_internal.05.02
only letters whose ascribed values are less than that of base are permitted.
- __strtol_internal.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __strtol_internal.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- __strtol_internal.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- __strtol_internal.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- __strtol_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __strtol_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __strtol_internal.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtol_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __strtol_internal.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtol_internal.15
The strtol() function shall not change the setting of errno if successful.
- __strtol_internal.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- __strtol_internal.17
Upon successful completion, these functions shall return the converted value, if any.
- __strtol_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __strtol_internal.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- __strtol_internal.20
These functions shall fail if:
- __strtol_internal.20.01
[ERANGE] The value to be returned is not representable.
- __strtol_internal.21
These functions may fail if:
- __strtol_internal.21.01
[EINVAL] [CX] The value of base is not supported.
- app.__strtol_internal.30
__group shall be 0 or the behavior of __strtol_internal() is undefined.
- __strtol_internal.30
__strtol_internal(__nptr, __endptr, __base, 0) has the same specification as strtol(__nptr, __endptr, __base).
- [+]__strtoll_internal (27 / 25 / 0)
- __strtoll_internal.01
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- __strtoll_internal.02
First, they decompose the input string into three parts:
- __strtoll_internal.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- __strtoll_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __strtoll_internal.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- __strtoll_internal.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- __strtoll_internal.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __strtoll_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __strtoll_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __strtoll_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __strtoll_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __strtoll_internal.05.02
only letters whose ascribed values are less than that of base are permitted.
- __strtoll_internal.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __strtoll_internal.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- __strtoll_internal.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- __strtoll_internal.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- __strtoll_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __strtoll_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __strtoll_internal.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoll_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __strtoll_internal.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoll_internal.15
The strtol() function shall not change the setting of errno if successful.
- __strtoll_internal.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- __strtoll_internal.17
Upon successful completion, these functions shall return the converted value, if any.
- __strtoll_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __strtoll_internal.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- __strtoll_internal.20
These functions shall fail if:
- __strtoll_internal.20.01
[ERANGE] The value to be returned is not representable.
- __strtoll_internal.21
These functions may fail if:
- __strtoll_internal.21.01
[EINVAL] [CX] The value of base is not supported.
- __strtoll_internal.30
__strtoll_internal(__nptr, __endptr, __base, 0) has the same specification as strtoll(__nptr, __endptr, __base).
- app.__strtoll_internal.30
__group shall be 0 or the behavior of __strtoll_internal() is undefined.
- [+]__strtoul_internal (28 / 26 / 0)
- __strtoul_internal.01
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- __strtoul_internal.02
First, they decompose the input string into three parts:
- __strtoul_internal.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- __strtoul_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __strtoul_internal.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- __strtoul_internal.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- __strtoul_internal.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __strtoul_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __strtoul_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __strtoul_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __strtoul_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __strtoul_internal.05.02
only letters whose ascribed values are less than that of base are permitted.
- __strtoul_internal.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __strtoul_internal.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- __strtoul_internal.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- __strtoul_internal.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- __strtoul_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __strtoul_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __strtoul_internal.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoul_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __strtoul_internal.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoul_internal.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- __strtoul_internal.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- __strtoul_internal.17
Upon successful completion, these functions shall return the converted value, if any.
- __strtoul_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __strtoul_internal.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- __strtoul_internal.20
These functions shall fail if:
- __strtoul_internal.20.01
[EINVAL] [CX] The value of base is not supported.
- __strtoul_internal.20.02
[ERANGE] The value to be returned is not representable.
- __strtoul_internal.21
These functions may fail if:
- __strtoul_internal.21.01
[EINVAL] [CX] No conversion could be performed.
- app.__strtoul_internal.30
__group shall be 0 or the behavior of __strtoul_internal() is undefined.
- __strtoul_internal.30
__strtoul_internal(__nptr, __endptr, __base, 0) has the same specification as strtoul(__nptr, __endptr, __base).
- [+]__strtoull_internal (28 / 26 / 0)
- __strtoull_internal.01
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- __strtoull_internal.02
First, they decompose the input string into three parts:
- __strtoull_internal.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- __strtoull_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __strtoull_internal.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- __strtoull_internal.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- __strtoull_internal.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __strtoull_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __strtoull_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __strtoull_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __strtoull_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __strtoull_internal.05.02
only letters whose ascribed values are less than that of base are permitted.
- __strtoull_internal.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __strtoull_internal.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- __strtoull_internal.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- __strtoull_internal.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- __strtoull_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __strtoull_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __strtoull_internal.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoull_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __strtoull_internal.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtoull_internal.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- __strtoull_internal.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- __strtoull_internal.17
Upon successful completion, these functions shall return the converted value, if any.
- __strtoull_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __strtoull_internal.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- __strtoull_internal.20
These functions shall fail if:
- __strtoull_internal.20.01
[EINVAL] [CX] The value of base is not supported.
- __strtoull_internal.20.02
[ERANGE] The value to be returned is not representable.
- __strtoull_internal.21
These functions may fail if:
- __strtoull_internal.21.01
[EINVAL] [CX] No conversion could be performed.
- __strtoull_internal.30
__strtoull_internal(__nptr, __endptr, __base, 0) has the same specification as strtoull(__nptr, __endptr, __base).
- app.__strtoull_internal.30
__group shall be 0 or the behavior of __strtoull_internal() is undefined.
- [+]a64l (13 / 12 / 0)
- a64l.01
These functions maintain numbers stored in radix-64 ASCII characters.
- a64l.02
This is a notation by which 32-bit integers can be represented by up to six characters;
- a64l.03
each character represents a digit in radix-64 notation.
- a64l.04
If the type long contains more than 32 bits, only the low-order 32 bits shall be used for these operations.
- a64l.05
The characters used to represent digits are '.' (dot) for 0, '/' for 1, '0' through '9' for [2,11], 'A' through 'Z' for [12,37], and 'a' through 'z' for [38,63].
- a64l.06
The a64l() function shall take a pointer to a radix-64 representation, in which the first digit is the least significant, and return the corresponding long value.
- a64l.07
If the string pointed to by s contains more than six characters, a64l() shall use the first six.
- a64l.08
If the first six characters of the string contain a null terminator, a64l() shall use only characters preceding the null terminator.
- a64l.09
The a64l() function shall scan the character string from left to right with the least significant digit on the left, decoding each character as a 6-bit radix-64 number
- a64l.10
If the type long contains more than 32 bits, the resulting value is sign-extended.
- a64l.11
The behavior of a64l() is unspecified if s is a null pointer or the string pointed to by s was not generated by a previous call to l64a().
- a64l.12
Upon successful completion, a64l() shall return the long value resulting from conversion of the input string.
- a64l.13
If a string pointed to by s is an empty string, a64l() shall return 0L.
- [+]atoi (13 / 13 / 0)
- atoi.001
The call atoi(str) shall be equivalent to:(int) strtol(str, (char **)NULL, 10)
- atoi.002
except that the handling of errors may differ.
- atoi.003
If the value cannot be represented, the behavior is undefined.
- atoi.004
The atoi() function shall return the converted value if the value can be represented.
- atoi.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- atoi.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- atoi.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- atoi.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- atoi.05.02
only letters whose ascribed values are less than that of base are permitted.
- atoi.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- atoi.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- atoi.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- atoi.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- [+]atol (13 / 13 / 0)
- atol.001
The call atol(str) shall be equivalent to:strtol(str, (char **)NULL, 10)
- atol.002
except that the handling of errors may differ.
- atol.003
If the value cannot be represented, the behavior is undefined.
- atol.004
These functions shall return the converted value if the value can be represented.
- atol.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- atol.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- atol.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- atol.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- atol.05.02
only letters whose ascribed values are less than that of base are permitted.
- atol.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- atol.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- atol.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- atol.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- [+]atoll (13 / 13 / 0)
- atoll.001
The call atoll(str) shall be equivalent to:strtoll(nptr, (char **)NULL, 10)
- atoll.002
except that the handling of errors may differ.
- atoll.003
If the value cannot be represented, the behavior is undefined.
- atoll.004
These functions shall return the converted value if the value can be represented.
- atoll.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- atoll.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- atoll.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- atoll.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- atoll.05.02
only letters whose ascribed values are less than that of base are permitted.
- atoll.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- atoll.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- atoll.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- atoll.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- [+]l64a (11 / 11 / 0)
- l64a.01
These functions maintain numbers stored in radix-64 ASCII characters.
- l64a.02
This is a notation by which 32-bit integers can be represented by up to six characters;
- l64a.03
each character represents a digit in radix-64 notation.
- l64a.04
If the type long contains more than 32 bits, only the low-order 32 bits shall be used for these operations.
- l64a.05
The characters used to represent digits are '.' (dot) for 0, '/' for 1, '0' through '9' for [2,11], 'A' through 'Z' for [12,37], and 'a' through 'z' for [38,63].
- l64a.06
The l64a() function shall take a long argument and return a pointer to the corresponding radix-64 representation.
- l64a.07
The behavior of l64a() is unspecified if value is negative.
- l64a.08
The value returned by l64a() may be a pointer into a static buffer. Subsequent calls to l64a() may overwrite the buffer.
- l64a.09
The l64a() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- l64a.10
The l64a() function shall return a pointer to the radix-64 representation.
- l64a.11
If value is 0L, l64a() shall return a pointer to an empty string.
- [+]strtoimax (26 / 24 / 0)
- strtoimax.01
These functions shall be equivalent to the strtol(), strtoll(), strtoul(), and strtoull() functions, except that the initial portion of the string shall be converted to intmax_t and uintmax_t representation, respectively.
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- strtoimax.02
First, they decompose the input string into three parts:
- strtoimax.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoimax.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoimax.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- strtoimax.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- strtoimax.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoimax.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoimax.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoimax.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoimax.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoimax.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoimax.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoimax.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoimax.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoimax.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoimax.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoimax.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoimax.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoimax.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoimax.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoimax.15
The strtol() function shall not change the setting of errno if successful.
- strtoimax.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- strtoimax.17
These functions shall return the converted value, if any.
Upon successful completion, these functions shall return the converted value, if any.
- strtoimax.18
If no conversion could be performed, zero shall be returned.
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoimax.19
If the correct value is outside the range of representable values, {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return type and sign of the value, if any), and errno shall be set to [ERANGE].
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- strtoimax.20
These functions shall fail if:
- strtoimax.20.01
[ERANGE] The value to be returned is not representable.
[ERANGE] The value to be returned is not representable.
- strtoimax.21
These functions may fail if:
- strtoimax.21.01
[EINVAL] The value of base is not supported.
[EINVAL] [CX] The value of base is not supported.
- [+]strtol (26 / 24 / 0)
- strtol.01
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- strtol.02
First, they decompose the input string into three parts:
- strtol.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtol.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtol.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- strtol.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- strtol.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtol.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtol.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtol.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtol.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtol.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtol.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtol.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtol.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtol.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtol.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtol.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtol.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtol.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtol.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtol.15
The strtol() function shall not change the setting of errno if successful.
- strtol.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- strtol.17
Upon successful completion, these functions shall return the converted value, if any.
- strtol.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtol.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- strtol.20
These functions shall fail if:
- strtol.20.01
[ERANGE] The value to be returned is not representable.
- strtol.21
These functions may fail if:
- strtol.21.01
[EINVAL] [CX] The value of base is not supported.
- [+]strtoll (26 / 24 / 0)
- strtoll.01
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- strtoll.02
First, they decompose the input string into three parts:
- strtoll.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoll.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoll.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- strtoll.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- strtoll.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoll.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoll.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoll.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoll.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoll.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoll.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoll.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoll.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoll.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoll.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoll.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoll.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoll.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoll.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoll.15
The strtol() function shall not change the setting of errno if successful.
- strtoll.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- strtoll.17
Upon successful completion, these functions shall return the converted value, if any.
- strtoll.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoll.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- strtoll.20
These functions shall fail if:
- strtoll.20.01
[ERANGE] The value to be returned is not representable.
- strtoll.21
These functions may fail if:
- strtoll.21.01
[EINVAL] [CX] The value of base is not supported.
- [+]strtoq (36 / 25 / 0)
- strtoq.01
These functions shall convert the initial portion of the string pointed to by str to a type long and long long representation, respectively.
- strtoq.02
First, they decompose the input string into three parts:
- strtoq.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoq.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoq.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string.
- strtoq.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- strtoq.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoq.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoq.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoq.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoq.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoq.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoq.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoq.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoq.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoq.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoq.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoq.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoq.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoq.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoq.14
If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoq.15
The strtol() function shall not change the setting of errno if successful.
- strtoq.16
Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol() or strtoll(), then check errno.
- strtoq.17
Upon successful completion, these functions shall return the converted value, if any.
- strtoq.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoq.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- strtoq.20
These functions shall fail if:
- strtoq.20.01
[ERANGE] The value to be returned is not representable.
- strtoq.21
These functions may fail if:
- strtoq.21.01
[EINVAL] [CX] The value of base is not supported.
- strtoq.31
strtoq() converts the string nptr to a quadt value.
- app.strtoq.31
The conversion is done according to the given base, which shall be between 2 and 36 inclusive, or be the special value 0.
- strtoq.32
nptr may begin with an arbitrary amount of white space (as determined by isspace()), followed by a single optional + or - sign character.
- strtoq.33.01
If base is 0 or 16, the string may then include a 0x prefix, and the number will be read in base 16
- strtoq.33.02
otherwise, a 0 base is taken as 10 (decimal), unless the next character is 0
- strtoq.33.03
in which case it is taken as 8 (octal)
- strtoq.34
The remainder of the string is converted to a long value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter A in either upper or lower case represents 10, B represents 11, and so forth, with Z representing 35.)
- strtoq.35.01
strtoq() returns the result of the conversion, unless the value would underflow or overflow.
- strtoq.35.02
If an underflow occurs, strtoq() returns QUAD_MIN.
- strtoq.35.03
If an overflow occurs, strtoq() returns QUAD_MAX.
- strtoq.36
- strtoq.36.01
[ERANGE] The given string was out of range; the value converted has been clamped.
- [+]strtoul (27 / 25 / 0)
- strtoul.01
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- strtoul.02
First, they decompose the input string into three parts:
- strtoul.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoul.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoul.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtoul.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- strtoul.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoul.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoul.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoul.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoul.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoul.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoul.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoul.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoul.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoul.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoul.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoul.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoul.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoul.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoul.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoul.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- strtoul.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- strtoul.17
Upon successful completion, these functions shall return the converted value, if any.
- strtoul.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoul.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- strtoul.20
These functions shall fail if:
- strtoul.20.01
[EINVAL] [CX] The value of base is not supported.
- strtoul.20.02
[ERANGE] The value to be returned is not representable.
- strtoul.21
These functions may fail if:
- strtoul.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]strtoull (27 / 25 / 0)
- strtoull.01
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- strtoull.02
First, they decompose the input string into three parts:
- strtoull.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoull.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoull.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtoull.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- strtoull.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoull.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoull.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoull.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoull.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoull.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoull.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoull.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoull.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoull.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoull.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoull.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoull.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoull.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoull.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoull.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- strtoull.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- strtoull.17
Upon successful completion, these functions shall return the converted value, if any.
- strtoull.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoull.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- strtoull.20
These functions shall fail if:
- strtoull.20.01
[EINVAL] [CX] The value of base is not supported.
- strtoull.20.02
[ERANGE] The value to be returned is not representable.
- strtoull.21
These functions may fail if:
- strtoull.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]strtoumax (27 / 25 / 0)
- strtoumax.01
These functions shall be equivalent to the strtol(), strtoll(), strtoul(), and strtoull() functions, except that the initial portion of the string shall be converted to intmax_t and uintmax_t representation, respectively.
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- strtoumax.02
First, they decompose the input string into three parts:
- strtoumax.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtoumax.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtoumax.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtoumax.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- strtoumax.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtoumax.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtoumax.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtoumax.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtoumax.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtoumax.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtoumax.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtoumax.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtoumax.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtoumax.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtoumax.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtoumax.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtoumax.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoumax.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtoumax.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtoumax.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- strtoumax.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- strtoumax.17
These functions shall return the converted value, if any.
Upon successful completion, these functions shall return the converted value, if any.
- strtoumax.18
If no conversion could be performed, zero shall be returned.
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtoumax.19
If the correct value is outside the range of representable values, {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return type and sign of the value, if any), and errno shall be set to [ERANGE].
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- strtoumax.20
These functions shall fail if:
- strtoumax.20.01
[ERANGE] The value to be returned is not representable.
[EINVAL] [CX] The value of base is not supported.
- strtoumax.20.02
[ERANGE] The value to be returned is not representable.
- strtoumax.21
These functions may fail if:
- strtoumax.21.01
[EINVAL] The value of base is not supported.
[EINVAL] [CX] No conversion could be performed.
- [+]strtouq (37 / 26 / 0)
- strtouq.01
These functions shall convert the initial portion of the string pointed to by str to a type unsigned long and unsigned long long representation, respectively.
- strtouq.02
First, they decompose the input string into three parts:
- strtouq.02.01
An initial, possibly empty, sequence of white-space characters (as specified by isspace())
- strtouq.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- strtouq.02.03
A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtouq.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- strtouq.04
If the value of base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- strtouq.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- strtouq.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- strtouq.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- strtouq.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- strtouq.05.02
only letters whose ascribed values are less than that of base are permitted.
- strtouq.06
If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- strtouq.07
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character that is of the expected form.
- strtouq.08
The subject sequence shall contain no characters if the input string is empty or consists entirely of white-space characters, or if the first non-white-space character is other than a sign or a permissible letter or digit.
- strtouq.09
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit shall be interpreted as an integer constant.
- strtouq.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- strtouq.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- strtouq.12
A pointer to the final string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtouq.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- strtouq.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtouq.15
[CX] The strtoul() function shall not change the setting of errno if successful.
- strtouq.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtoul() or strtoull(), then check errno.
- strtouq.17
Upon successful completion, these functions shall return the converted value, if any.
- strtouq.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- strtouq.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
- strtouq.20
These functions shall fail if:
- strtouq.20.01
[EINVAL] [CX] The value of base is not supported.
- strtouq.20.02
[ERANGE] The value to be returned is not representable.
- strtouq.21
These functions may fail if:
- strtouq.21.01
[EINVAL] [CX] No conversion could be performed.
- strtouq.31
strtouq() converts the string nptr to an unsigned long long value.
- app.strtouq.31
The conversion is done according to the given base, which shall be between 2 and 36 inclusive, or be the special value 0.
- strtouq.32
nptr may begin with an arbitrary amount of white space (as determined by isspace()), followed by a single optional + or - sign character.
- strtouq.33.01
If base is 0 or 16, the string may then include a 0x prefix, and the number will be read in base 16
- strtouq.33.02
otherwise, a 0 base is taken as 10 (decimal), unless the next character is 0
- strtouq.33.03
in which case it is taken as 8 (octal)
- strtouq.34
The remainder of the string is converted to an unsigned long value in the obvious manner, stopping at the end of the string or at the first character that does not produce a valid digit in the given base. (In bases above 10, the letter A in either upper or lower case represents 10, B represents 11, and so forth, with Z representing 35.)
- strtouq.35.01
On success, strtouq() returns either the result of the conversion
- strtouq.35.02
if there was a leading minus sign, the negation of the result of the conversion, unless the original (non-negated) value would overflow
- strtouq.35.03
In the case of an overflow the function returns UQUAD_MAX and the global variable errno is set to ERANGE.
- strtouq.36
- strtouq.36.01
[ERANGE] The given string was out of range; the value converted has been clamped.
- [+]util.conversion.strreal (165 / 151 / 0)
- [+]__strtod_internal (20 / 18 / 0)
- app.__strtod_internal.25
__group shall be 0 or the behavior of __strtod_internal() is undefined.
- __strtod_internal.26
__strtod_internal(__nptr, __endptr, 0)() has the same specification as strtod(__nptr, __endptr)().
- __strtod_internal.strtod.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- __strtod_internal.strtod.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __strtod_internal.strtod.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- __strtod_internal.strtod.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- __strtod_internal.strtod.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- __strtod_internal.strtod.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- __strtod_internal.strtod.05
The subject sequence contains no characters if the input string is not of the expected form.
- __strtod_internal.strtod.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- __strtod_internal.strtod.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- __strtod_internal.strtod.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __strtod_internal.strtod.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __strtod_internal.strtod.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __strtod_internal.strtod.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtod_internal.strtod.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __strtod_internal.strtod.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtod_internal.strtod.14
[CX] The strtod() function shall not change the setting of errno if successful.
- __strtod_internal.strtod.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- __strtod_internal.strtod.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __strtod_internal.strtod.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __strtod_internal.strtod.18
These functions shall fail if:
- __strtod_internal.strtod.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- __strtod_internal.strtod.19
These functions may fail if:
- __strtod_internal.strtod.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]__strtof_internal (20 / 18 / 0)
- app.__strtof_internal.25
__group shall be 0 or the behavior of __strtof_internal() is undefined.
- __strtof_internal.26
__strtof_internal(__nptr, __endptr, 0)() has the same specification as strtof(__nptr, __endptr)().
- __strtof_internal.strtof.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- __strtof_internal.strtof.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __strtof_internal.strtof.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- __strtof_internal.strtof.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- __strtof_internal.strtof.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- __strtof_internal.strtof.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- __strtof_internal.strtof.05
The subject sequence contains no characters if the input string is not of the expected form.
- __strtof_internal.strtof.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- __strtof_internal.strtof.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- __strtof_internal.strtof.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __strtof_internal.strtof.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __strtof_internal.strtof.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __strtof_internal.strtof.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtof_internal.strtof.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __strtof_internal.strtof.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtof_internal.strtof.14
[CX] The strtod() function shall not change the setting of errno if successful.
- __strtof_internal.strtof.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- __strtof_internal.strtof.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __strtof_internal.strtof.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __strtof_internal.strtof.18
These functions shall fail if:
- __strtof_internal.strtof.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- __strtof_internal.strtof.19
These functions may fail if:
- __strtof_internal.strtof.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]__strtold_internal (20 / 18 / 0)
- app.__strtold_internal.25
__group shall be 0 or the behavior of __strtold_internal() is undefined.
- __strtold_internal.26
__strtold_internal(__nptr, __endptr, 0) has the same specification as strtold(__nptr, __endptr).
- __strtold_internal.strtold.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- __strtold_internal.strtold.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __strtold_internal.strtold.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- __strtold_internal.strtold.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- __strtold_internal.strtold.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- __strtold_internal.strtold.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- __strtold_internal.strtold.05
The subject sequence contains no characters if the input string is not of the expected form.
- __strtold_internal.strtold.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- __strtold_internal.strtold.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- __strtold_internal.strtold.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __strtold_internal.strtold.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __strtold_internal.strtold.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __strtold_internal.strtold.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtold_internal.strtold.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __strtold_internal.strtold.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __strtold_internal.strtold.14
[CX] The strtod() function shall not change the setting of errno if successful.
- __strtold_internal.strtold.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- __strtold_internal.strtold.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __strtold_internal.strtold.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __strtold_internal.strtold.18
These functions shall fail if:
- __strtold_internal.strtold.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- __strtold_internal.strtold.19
These functions may fail if:
- __strtold_internal.strtold.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]atof (16 / 14 / 0)
- atof.16
The call atof(str) shall be equivalent to:strtod(str,(char **)NULL),except that the handling of errors may differ.
The atof() function shall return the converted value if the value can be represented.
Generalizes:
- &atof.16
- atof.strtod.01.01
- atof.strtod.01.02
- atof.strtod.02
- atof.strtod.03
- atof.strtod.04
- atof.strtod.05
- atof.strtod.06
- atof.strtod.07
- atof.strtod.08
- atof.strtod.09
- atof.strtod.10
- atof.strtod.11
- atof.strtod.12
- atof.strtod.13
- atof.strtod.14
- atof.strtod.15
- app.atof.17
If the value cannot be represented, the behavior is undefined.
- atof.strtod.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- atof.strtod.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- atof.strtod.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- atof.strtod.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- atof.strtod.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- atof.strtod.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- atof.strtod.05
The subject sequence contains no characters if the input string is not of the expected form.
- atof.strtod.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- atof.strtod.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- atof.strtod.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- atof.strtod.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- atof.strtod.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- atof.strtod.11
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- atof.strtod.12
[CX] The strtod() function shall not change the setting of errno if successful.
- atof.strtod.13
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- atof.strtod.14
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- atof.strtod.15
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- [+]ecvt (10 / 9 / 0)
- ecvt.01
The ecvt(), fcvt(), and gcvt() functions shall convert floating-point numbers to null-terminated strings.
Generalizes:
- ecvt.02
- ecvt.03
- ecvt.04
- ecvt.05
- ecvt.06
- ecvt.07
- ecvt.08.01
- ecvt.08.02
- ecvt.12
- ecvt.02
The ecvt() function shall convert value to a null-terminated string of ndigit digits (where ndigit is reduced to an unspecified limit determined by the precision of a double) and return a pointer to the string.
- ecvt.03
The high-order digit shall be non-zero, unless the value is 0.
- ecvt.04
The low-order digit shall be rounded in an implementation-defined manner.
- ecvt.05
The position of the radix character relative to the beginning of the string shall be stored in the integer pointed to by decpt (negative means to the left of the returned digits).
- ecvt.06
If value is zero, it is unspecified whether the integer pointed to by decpt would be 0 or 1.
- ecvt.07
The radix character shall not be included in the returned string.
- ecvt.08.01
If the sign of the result is negative, the integer pointed to by sign shall be non-zero;
- ecvt.08.02
otherwise, it shall be 0.
- app.ecvt.09
If the converted value is out of range or is not representable, the contents of the returned string are unspecified.
- app.ecvt.11
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- ecvt.12
The ecvt() and fcvt() functions shall return a pointer to a null-terminated string of digits.
- app.ecvt.13
The return values from ecvt() and fcvt() may point to static data which may be overwritten by subsequent calls to these functions.
- [+]fcvt (11 / 10 / 0)
- fcvt.01
The ecvt(), fcvt(), and gcvt() functions shall convert floating-point numbers to null-terminated strings.
Generalizes:
- fcvt.02.01
- fcvt.02.02
- fcvt.03
- fcvt.04
- fcvt.05
- fcvt.06
- fcvt.07
- fcvt.08.01
- fcvt.08.02
- fcvt.12
- fcvt.02.01
The fcvt() function shall be equivalent to ecvt(), except that ndigit specifies the number of digits desired after the radix character.
- fcvt.02.02
The total number of digits in the result string is restricted to an unspecified limit as determined by the precision of a double.
- fcvt.03
The high-order digit shall be non-zero, unless the value is 0.
- fcvt.04
The low-order digit shall be rounded in an implementation-defined manner.
- fcvt.05
The position of the radix character relative to the beginning of the string shall be stored in the integer pointed to by decpt (negative means to the left of the returned digits).
- fcvt.06
If value is zero, it is unspecified whether the integer pointed to by decpt would be 0 or 1.
- fcvt.07
The radix character shall not be included in the returned string.
- fcvt.08.01
If the sign of the result is negative, the integer pointed to by sign shall be non-zero;
- fcvt.08.02
otherwise, it shall be 0.
- app.fcvt.09
If the converted value is out of range or is not representable, the contents of the returned string are unspecified.
- app.fcvt.11
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- fcvt.12
The ecvt() and fcvt() functions shall return a pointer to a null-terminated string of digits.
- app.fcvt.13
The return values from ecvt() and fcvt() may point to static data which may be overwritten by subsequent calls to these functions.
- [+]gcvt (11 / 10 / 0)
- gcvt.01
The ecvt(), fcvt(), and gcvt() functions shall convert floating-point numbers to null-terminated strings.
Generalizes:
- gcvt.02
- gcvt.03
- gcvt.04
- gcvt.05
- gcvt.06
- gcvt.07
- gcvt.08
- gcvt.09
- gcvt.10
- gcvt.12
- gcvt.02
The gcvt() function shall convert value to a null-terminated string (similar to that of the %g conversion specification format of printf()) in the array pointed to by buf and shall return buf.
- gcvt.03
It shall produce ndigit significant digits (limited to an unspecified value determined by the precision of a double) in the %f conversion specification format of printf() if possible, or the %e conversion specification format of printf() (scientific notation) otherwise.
- gcvt.04
A minus sign shall be included in the returned string if value is less than 0.
- gcvt.05
A radix character shall be included in the returned string if value is not a whole number.
- gcvt.06
Trailing zeros shall be suppressed where value is not a whole number.
- gcvt.07
The radix character is determined by the current locale.
- gcvt.08
If setlocale() has not been called successfully, the default locale, POSIX, is used.
- gcvt.09
The default locale specifies a period ( '.' ) as the radix character.
- gcvt.10
The LC_NUMERIC category determines the value of the radix character within the current locale.
- app.gcvt.11
These functions need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- gcvt.12
The gcvt() function shall return buf.
- [+]strtod (19 / 18 / 0)
- strtod.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- strtod.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- strtod.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- strtod.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtod.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- strtod.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- strtod.05
The subject sequence contains no characters if the input string is not of the expected form.
- strtod.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- strtod.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- strtod.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- strtod.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- strtod.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- strtod.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtod.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- strtod.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtod.14
[CX] The strtod() function shall not change the setting of errno if successful.
- strtod.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- strtod.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- strtod.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- strtod.18
These functions shall fail if:
- strtod.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- strtod.19
These functions may fail if:
- strtod.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]strtof (19 / 18 / 0)
- strtof.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- strtof.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- strtof.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- strtof.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtof.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- strtof.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- strtof.05
The subject sequence contains no characters if the input string is not of the expected form.
- strtof.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- strtof.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- strtof.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- strtof.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- strtof.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- strtof.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtof.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- strtof.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtof.14
[CX] The strtod() function shall not change the setting of errno if successful.
- strtof.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- strtof.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- strtof.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- strtof.18
These functions shall fail if:
- strtof.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- strtof.19
These functions may fail if:
- strtof.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]strtold (19 / 18 / 0)
- strtold.01
These functions shall convert the initial portion of the string pointed to by nptr to double, float, and long double representation, respectively. First, they decompose the input string into three parts:
- strtold.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- strtold.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the value resulting from the conversion is correctly rounded.
- strtold.02
An initial, possibly empty, sequence of white-space characters (as specified by isspace()) A subject sequence interpreted as a floating-point constant or representing infinity or NaN A final string of one or more unrecognized characters, including the terminating null byte of the input string
- strtold.03
subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent part One of INF or INFINITY, ignoring case One of NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:n-char-sequence:
digit
nondigit
n-char-sequence digit
n-char-sequence nondigit
- strtold.04
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form.
- strtold.05
The subject sequence contains no characters if the input string is not of the expected form.
- strtold.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of characters starting with the first digit or the decimal-point character (whichever occurs first) shall be interpreted as a floating constant of the C language, except that the radix character shall be used in place of a period
- strtold.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero is assumed to follow the last digit in the string.
- strtold.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- strtold.09
A character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- strtold.10
A character sequence NAN or NAN(n-char-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- strtold.11
A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtold.12
[CX] The radix character is defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- strtold.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- strtold.14
[CX] The strtod() function shall not change the setting of errno if successful.
- strtold.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned, and errno may be set to [EINVAL].
- strtold.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- strtold.17
If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- strtold.18
These functions shall fail if:
- strtold.18.01
[ERANGE] The value to be returned would cause overflow [CX] or underflow.
- strtold.19
These functions may fail if:
- strtold.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]util.conversion.token (31 / 27 / 0)
- [+]__strtok_r (8 / 6 / 0)
- __strtok_r.01
__strtok_r() has the same specification as strtok_r().
- __strtok_r.03
In the first call to strtok_r(), s points to a null-terminated string, sep to a null-terminated string of separator characters, and the value pointed to by lasts is ignored.
- __strtok_r.04
The strtok_r() function shall return a pointer to the first character of the first token, write a null character into s immediately following the returned token, and update the pointer to which lasts points.
- __strtok_r.05
In subsequent calls, s is a NULL pointer and lasts shall be unchanged from the previous call so that subsequent calls shall move through the string s, returning successive tokens until no tokens remain.
- __strtok_r.06
The separator string sep may be different from call to call.
- __strtok_r.07
When no token remains in s, a NULL pointer shall be returned.
- __strtok_r.08
The strtok_r() function shall return a pointer to the token found,
- __strtok_r.09
or a NULL pointer when no token is found.
- [+]strsep (4 / 4 / 0)
- strsep.01
If stringp is NULL, strsep() shall return NULL and do nothing else.
- strsep.02
If stringp is non-NULL, strsep() shall find the first token in the string referenced by stringp, where tokens are delimited by characters in the string delim. This token shall be terminated with a \0 character by overwriting the delimiter, and stringp shall be updated to point past the token.
- strsep.03
In case no delimiter was found, the token is taken to be the entire string referenced by stringp, and the location referenced by stringp is made NULL.
- strsep.04
strsep() shall return a pointer to the beginning of the token.
- [+]strtok (12 / 12 / 0)
- strtok.02
The first call in the sequence has s1 as its first argument, and is followed by calls with a null pointer as their first argument.
- strtok.03
The separator string pointed to by s2 may be different from call to call.
- strtok.04
The first call in the sequence searches the string pointed to by s1 for the first byte that is not contained in the current separator string pointed to by s2.
- strtok.05
If no such byte is found, then there are no tokens in the string pointed to by s1 and strtok() shall return a null pointer.
- strtok.06
If such a byte is found, it is the start of the first token.
- strtok.07
The strtok() function then searches from there for a byte that is contained in the current separator string.
- strtok.08
If no such byte is found, the current token extends to the end of the string pointed to by s1, and subsequent searches for a token shall return a null pointer.
- strtok.09
If such a byte is found, it is overwritten by a null byte, which terminates the current token.
- strtok.10
The strtok() function saves a pointer to the following byte, from which the next search for a token shall start.
- strtok.11
Each subsequent call, with a null pointer as the value of the first argument, starts searching from the saved pointer and behaves as described above.
- strtok.13
Upon successful completion, strtok() shall return a pointer to the first byte of a token.
- strtok.14
Otherwise, if there is no token, strtok() shall return a null pointer.
- [+]strtok_r (7 / 5 / 0)
- strtok_r.03
In the first call to strtok_r(), s points to a null-terminated string, sep to a null-terminated string of separator characters, and the value pointed to by lasts is ignored.
- strtok_r.04
The strtok_r() function shall return a pointer to the first character of the first token, write a null character into s immediately following the returned token, and update the pointer to which lasts points.
- strtok_r.05
In subsequent calls, s is a NULL pointer and lasts shall be unchanged from the previous call so that subsequent calls shall move through the string s, returning successive tokens until no tokens remain.
- strtok_r.06
The separator string sep may be different from call to call.
- strtok_r.07
When no token remains in s, a NULL pointer shall be returned.
- strtok_r.08
The strtok_r() function shall return a pointer to the token found,
- strtok_r.09
or a NULL pointer when no token is found.
- [+]util.conversion.wchar (188 / 10 / 0)
- [+]btowc (5 / 0 / 0)
- btowc.01
The btowc() function shall determine whether c constitutes a valid (one-byte) character in the initial shift state.
- btowc.02
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- btowc.03
The btowc() function shall return WEOF if c has the value EOF
- btowc.04
or if (unsigned char) c does not constitute a valid (one-byte) character in the initial shift state.
- btowc.05
Otherwise, it shall return the wide-character representation of that character.
- [+]mblen (15 / 0 / 0)
- mblen.01
If s is not a null pointer, mblen() shall determine the number of bytes constituting the character pointed to by s.
- mblen.02
Except that the shift state of mbtowc() is not affected, it shall be equivalent to:
- mblen.02.child
mbtowc((wchar_t *)0, s, n);
- mblen.03
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls mblen().
- mblen.04
The behavior of this function is affected by the LC_CTYPE category of the current locale.
- mblen.05
For a state-dependent encoding, this function shall be placed into its initial state by a call for which its character pointer argument, s, is a null pointer.
- mblen.06
Subsequent calls with s as other than a null pointer shall cause the internal state of the function to be altered as necessary.
- mblen.07
A call with s as a null pointer shall cause this function to return a non-zero value if encodings have state dependency, and 0 otherwise.
- mblen.08
If the implementation employs special bytes to change the shift state, these bytes shall not produce separate wide-character codes, but shall be grouped with an adjacent character.
- mblen.09
Changing the LC_CTYPE category causes the shift state of this function to be unspecified.
- mblen.10
If s is a null pointer, mblen() shall return a non-zero or 0 value, if character encodings, respectively, do or do not have state-dependent encodings.
- mblen.11
If s is not a null pointer, mblen() shall either return 0 (if s points to the null byte),
- mblen.12
or return the number of bytes that constitute the character (if the next n or fewer bytes form a valid character),
- mblen.13
In no case shall the value returned be greater than n or the value of the {MB_CUR_MAX} macro.
- mblen.14
The mblen() function may fail if:
- mblen.14.01
[EILSEQ] [XSI] Invalid character sequence is detected.
- mblen.15
or return -1 (if they do not form a valid character) [CX] and may set errno to indicate the error.
- [+]mbrlen (11 / 1 / 0)
- mbrlen.01
If s is not a null pointer, mbrlen() shall determine the number of bytes constituting the character pointed to by s. It shall be equivalent to:mbstate_t internal;mbrtowc(NULL, s, n, ps != NULL ? ps : &internal);
- mbrlen.02
If ps is a null pointer, the mbrlen() function shall use its own internal mbstate_t object, which is initialized at program start-up to the initial conversion state.
- mbrlen.03
Otherwise, the mbstate_t object pointed to by ps shall be used to completely describe the current conversion state of the associated character sequence
- mbrlen.04
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls mbrlen().
- mbrlen.05
The behavior of this function is affected by the LC_CTYPE category of the current locale.
- mbrlen.06
The mbrlen() function shall return the first of the following that applies:
- mbrlen.06.01
0 If the next n or fewer bytes complete the character that corresponds to the null wide character.
- mbrlen.06.02
positive If the next n or fewer bytes complete a valid character; the value returned shall be the number of bytes that complete the character.
- mbrlen.06.03
(size_t)-2 If the next n bytes contribute to an incomplete but potentially valid character, and all n bytes have been processed. When n has at least the value of the {MB_CUR_MAX} macro, this case can only occur if s points at a sequence of redundant shift sequences (for implementations with state-dependent encodings).
- mbrlen.06.04
(size_t)-1 If an encoding error occurs, in which case the next n or fewer bytes do not contribute to a complete and valid character. In this case, [EILSEQ] shall be stored in errno and the conversion state is undefined.
- mbrlen.07
The mbrlen() function may fail if:
- mbrlen.07.01
[EINVAL] ps points to an object that contains an invalid conversion state.
- mbrlen.07.02
[EILSEQ] Invalid character sequence is detected.
- [+]mbrtowc (15 / 1 / 0)
- mbrtowc.01
If s is a null pointer, the mbrtowc() function shall be equivalent to the call:mbrtowc(NULL, "", 1, ps)In this case, the values of the arguments pwc and n are ignored.
- mbrtowc.02
If s is not a null pointer, the mbrtowc() function shall inspect at most n bytes beginning at the byte pointed to by s to determine the number of bytes needed to complete the next character (including any shift sequences).
- mbrtowc.03
If the function determines that the next character is completed, it shall determine the value of the corresponding wide character
- mbrtowc.04
and then, if pwc is not a null pointer, shall store that value in the object pointed to by pwc.
- mbrtowc.05
If the corresponding wide character is the null wide character, the resulting state described shall be the initial conversion state.
- mbrtowc.06
If ps is a null pointer, the mbrtowc() function shall use its own internal mbstate_t object, which shall be initialized at program start-up to the initial conversion state.
- mbrtowc.07
Otherwise, the mbstate_t object pointed to by ps shall be used to completely describe the current conversion state of the associated character sequence.
- mbrtowc.08
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls mbrtowc().
- mbrtowc.09
The behavior of this function is affected by the LC_CTYPE category of the current locale.
- mbrtowc.10
The mbrtowc() function shall return the first of the following that applies:
- mbrtowc.10.01
0 If the next n or fewer bytes complete the character that corresponds to the null wide character (which is the value stored).
- mbrtowc.10.02
between 1 and n inclusive If the next n or fewer bytes complete a valid character (which is the value stored); the value returned shall be the number of bytes that complete the character.
- mbrtowc.10.03
(size_t)-2 If the next n bytes contribute to an incomplete but potentially valid character, and all n bytes have been processed (no value is stored). When n has at least the value of the {MB_CUR_MAX} macro, this case can only occur if s points at a sequence of redundant shift sequences (for implementations with state-dependent encodings).
- mbrtowc.10.04
(size_t)-1 If an encoding error occurs, in which case the next n or fewer bytes do not contribute to a complete and valid character (no value is stored). In this case, [EILSEQ] shall be stored in errno and the conversion state is undefined.
- mbrtowc.11
The mbrtowc() function may fail if:
- mbrtowc.11.01
[EINVAL] [CX] ps points to an object that contains an invalid conversion state.
- mbrtowc.11.02
[EILSEQ] Invalid character sequence is detected.
- [+]mbsinit (4 / 0 / 0)
- mbsinit.01
If ps is not a null pointer, the mbsinit() function shall determine whether the object pointed to by ps describes an initial conversion state.
- mbsinit.02
The mbsinit() function shall return non-zero if ps is a null pointer, or if the pointed-to object describes an initial conversion state;
- mbsinit.03
otherwise, it shall return zero.
- mbsinit.04
If an mbstate_t object is altered by any of the functions described as "restartable", and is then used with a different character sequence, or in the other conversion direction, or with a different LC_CTYPE category setting than on earlier function calls, the behavior is undefined.
- [+]mbsnrtowcs (13 / 1 / 0)
- mbsnrtowcs.01
mbsnrtowcs() is like mbsrtowcs(), except that the number of bytes to be converted, starting at src, is limited to nms.
- mbsnrtowcs.02
If dest is not a NULL pointer, mbsnrtowcs() converts at most nms bytes from the multibyte string src to a wide-character string starting at dest.
- mbsnrtowcs.03
At most, len wide characters are written to dest.
- mbsnrtowcs.04
The state ps is updated.
- mbsnrtowcs.05
The conversion is effectively performed by repeatedly calling: mbrtowc(dest, *src, n, ps)where n is some positive number, as long as this call succeeds, and then incrementing dest by one and src by the number of bytes consumed.
- mbsnrtowcs.06
The conversion can stop for three reasons:
- mbsnrtowcs.06.01
An invalid multibyte sequence has been encountered. In this case src is left pointing to the invalid multibyte sequence, (size_t)(-1) is returned, and errno is set to EILSEQ.
- mbsnrtowcs.06.02
The nms limit forces a stop, or len non-L'\0' wide characters have been stored at dest. In this case, src is left pointing to the next multibyte sequence to be converted, and the number of wide characters written to dest is returned.
- mbsnrtowcs.06.03
The multibyte string has been completely converted, including the terminating '\0' (which has the side effect of bringing back ps to the initial state). In this case, src is set to NULL, and the number of wide characters written to dest, excluding the terminating L'\0' character, is returned.
- mbsnrtowcs.07
If dest is NULL, len is ignored, and the conversion proceeds as above, except that the converted wide characters are not written out to memory, and that no destination length limit exists.
- mbsnrtowcs.08
In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to mbsnrtowcs() is used instead.
- mbsnrtowcs.09
The programmer shall ensure that there is room for at least len wide characters at dest.
- mbsnrtowcs.10
mbsnrtowcs() returns the number of wide characters that make up the converted part of the wide character string, not including the terminating null wide character.
- mbsnrtowcs.11
If an invalid multibyte sequence was encountered, (size_t)(-1) is returned, and the global variable errno is set to [EILSEQ].
- [+]mbsrtowcs (17 / 1 / 0)
- mbsrtowcs.01
The mbsrtowcs() function shall convert a sequence of characters, beginning in the conversion state described by the object pointed to by ps, from the array indirectly pointed to by src into a sequence of corresponding wide characters.
- mbsrtowcs.02
If dst is not a null pointer, the converted characters shall be stored into the array pointed to by dst.
- mbsrtowcs.03
Conversion continues up to and including a terminating null character, which shall also be stored.
- mbsrtowcs.04
Conversion shall stop early in either of the following cases:
- mbsrtowcs.04.01
A sequence of bytes is encountered that does not form a valid character.
- mbsrtowcs.04.02
len codes have been stored into the array pointed to by dst (and dst is not a null pointer).
- mbsrtowcs.05
Each conversion shall take place as if by a call to the mbrtowc() function.
- mbsrtowcs.06
If dst is not a null pointer, the pointer object pointed to by src shall be assigned either a null pointer (if conversion stopped due to reaching a terminating null character)
- mbsrtowcs.07
or the address just past the last character converted (if any).
- mbsrtowcs.08
If conversion stopped due to reaching a terminating null character, and if dst is not a null pointer, the resulting state described shall be the initial conversion state.
- mbsrtowcs.09
If ps is a null pointer, the mbsrtowcs() function shall use its own internal mbstate_t object, which is initialized at program start-up to the initial conversion state.
- mbsrtowcs.10
Otherwise, the mbstate_t object pointed to by ps shall be used to completely describe the current conversion state of the associated character sequence.
- mbsrtowcs.11
The implementation behaves as if no function defined in this volume of IEEE Std 1003.1-2001 calls mbsrtowcs().
- mbsrtowcs.12
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- mbsrtowcs.14
If the input conversion encounters a sequence of bytes that do not form a valid character, an encoding error occurs. In this case, the mbsrtowcs() function stores the value of the macro [EILSEQ] in errno and shall return (size_t)-1; the conversion state is undefined.
- mbsrtowcs.15
Otherwise, it shall return the number of characters successfully converted, not including the terminating null (if any).
- mbsrtowcs.16
The mbsrtowcs() function may fail if:
- mbsrtowcs.16.01
[EINVAL] [CX] ps points to an object that contains an invalid conversion state.
- mbsrtowcs.16.02
[EILSEQ] Invalid character sequence is detected.
- [+]mbstowcs (11 / 1 / 0)
- mbstowcs.01
The mbstowcs() function shall convert a sequence of characters that begins in the initial shift state from the array pointed to by s into a sequence of corresponding wide-character codes and shall store not more than n wide-character codes into the array pointed to by pwcs.
- mbstowcs.02
No characters that follow a null byte (which is converted into a wide-character code with value 0) shall be examined or converted.
- mbstowcs.03
Each character shall be converted as if by a call to mbtowc(), except that the shift state of mbtowc() is not affected.
- mbstowcs.04
No more than n elements shall be modified in the array pointed to by pwcs
- mbstowcs.05
If copying takes place between objects that overlap, the behavior is undefined.
- mbstowcs.06
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- mbstowcs.07
[XSI] If pwcs is a null pointer, mbstowcs() shall return the length required to convert the entire array regardless of the value of n, but no values are stored.
- mbstowcs.08
If an invalid character is encountered, mbstowcs() shall return (size_t)-1 [CX] and may set errno to indicate the error.
- mbstowcs.09
Otherwise, mbstowcs() shall return the number of the array elements modified [XSI] (or required if pwcs is null), not including a terminating 0 code, if any.
- mbstowcs.10
The array shall not be zero-terminated if the value returned is n.
- mbstowcs.11
The mbstowcs() function may fail if:
- mbstowcs.11.01
[EILSEQ] [XSI] Invalid byte sequence is detected.
- [+]mbtowc (18 / 1 / 0)
- mbtowc.01
If s is not a null pointer, mbtowc() shall determine the number of bytes that constitute the character pointed to by s.
- mbtowc.02
It shall then determine the wide-character code for the value of type wchar_t that corresponds to that character.
- mbtowc.03
(The value of the wide-character code corresponding to the null byte is 0.)
- mbtowc.04
If the character is valid and pwc is not a null pointer, mbtowc() shall store the wide-character code in the object pointed to by pwc.
- mbtowc.05
The behavior of this function is affected by the LC_CTYPE category of the current locale
- mbtowc.06
For a state-dependent encoding, this function is placed into its initial state by a call for which its character pointer argument, s, is a null pointer.
- mbtowc.07
Subsequent calls with s as other than a null pointer shall cause the internal state of the function to be altered as necessary.
- mbtowc.08
A call with s as a null pointer shall cause this function to return a non-zero value if encodings have state dependency, and 0 otherwise.
- mbtowc.09
If the implementation employs special bytes to change the shift state, these bytes shall not produce separate wide-character codes, but shall be grouped with an adjacent character.
- mbtowc.10
Changing the LC_CTYPE category causes the shift state of this function to be unspecified.
- mbtowc.11
At most n bytes of the array pointed to by s shall be examined.
- mbtowc.12
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls mbtowc().
- mbtowc.13
If s is a null pointer, mbtowc() shall return a non-zero or 0 value, if character encodings, respectively, do or do not have state-dependent encodings.
- mbtowc.14
If s is not a null pointer, mbtowc() shall either return 0 (if s points to the null byte)
- mbtowc.15
or return the number of bytes that constitute the converted character (if the next n or fewer bytes form a valid character),
- mbtowc.16
or return -1 [CX] and may set errno to indicate the error (if they do not form a valid character).
- mbtowc.17
In no case shall the value returned be greater than n or the value of the {MB_CUR_MAX} macro.
- mbtowc.18
The mbtowc() function may fail if:
- mbtowc.18.01
[EILSEQ] [XSI] Invalid character sequence is detected.
- [+]wcrtomb (16 / 1 / 0)
- wcrtomb.01
If s is a null pointer, the wcrtomb() function shall be equivalent to the call:wcrtomb(buf, L'\0', ps)where buf is an internal buffer.
- wcrtomb.02
If s is not a null pointer, the wcrtomb() function shall determine the number of bytes needed to represent the character that corresponds to the wide character given by wc (including any shift sequences),
- wcrtomb.03
and store the resulting bytes in the array whose first element is pointed to by s.
- wcrtomb.04
At most {MB_CUR_MAX} bytes are stored.
- wcrtomb.05
If wc is a null wide character, a null byte shall be stored, preceded by any shift sequence needed to restore the initial shift state.
- wcrtomb.06
The resulting state described shall be the initial conversion state.
- wcrtomb.07
If ps is a null pointer, the wcrtomb() function shall use its own internal mbstate_t object, which is initialized at program start-up to the initial conversion state.
- wcrtomb.08
Otherwise, the mbstate_t object pointed to by ps shall be used to completely describe the current conversion state of the associated character sequence.
- wcrtomb.09
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls wcrtomb().
- wcrtomb.10
[CX] If the application uses any of the _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS functions, the application shall ensure that the wcrtomb() function is called with a non-NULL ps argument.
- wcrtomb.11
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- wcrtomb.12
The wcrtomb() function shall return the number of bytes stored in the array object (including any shift sequences).
- wcrtomb.13
When wc is not a valid wide character, an encoding error shall occur.
- wcrtomb.14
In this case, the function shall store the value of the macro [EILSEQ] in errno and shall return (size_t)-1; the conversion state shall be undefined.
- wcrtomb.15
The wcrtomb() function may fail if:
- wcrtomb.15.01
[EINVAL] [CX] ps points to an object that contains an invalid conversion state.
- wcrtomb.15.02
[EILSEQ] Invalid wide-character code is detected.
- [+]wcsnrtombs (13 / 1 / 0)
- wcsnrtombs.01
wcsnrtombs() is like wcsrtombs(), except that the number of wide characters to be converted, starting at src, is limited to nwc.
- wcsnrtombs.02
If dest is not a NULL pointer, wcsnrtombs() converts at most nwc wide characters from the wide-character string src to a multibyte string starting at dest
- wcsnrtombs.03
At most len bytes are written to dest.
- wcsnrtombs.04
The state ps is updated.
- wcsnrtombs.05
The conversion is effectively performed by repeatedly calling: wcrtomb(dest, *src, ps)as long as this call succeeds, and then incrementing dest by the number of bytes written and src by 1.
- wcsnrtombs.06
The conversion can stop for three reasons:
- wcsnrtombs.06.01
A wide character has been encountered that cannot be represented as a multibyte sequence (according to the current locale). In this case src is left pointing to the invalid wide character, (size_t)(-1) is returned, and errno is set to EILSEQ.
- wcsnrtombs.06.02
nws wide characters have been converted without encountering a null wide character code, or the length limit forces a stop. In this case, src is left pointing to the next wide character to be converted, and the number bytes written to dest is returned.
- wcsnrtombs.06.03
The wide-character string has been completely converted, including the terminating null wide character code (which has the side effect of bringing back ps to the initial state). In this case, src is set to NULL, and the number of bytes written to dest, excluding the terminating null wide character code, is returned.
- wcsnrtombs.07
If dest is NULL, len is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that no destination length limit exists.
- wcsnrtombs.08
In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to wcsnrtombs() is used instead.
- wcsnrtombs.09
The programmer shall ensure that there is room for at least len bytes at dest.
- wcsnrtombs.10
wcsnrtombs() returns the number of bytes that make up the converted part of multibyte sequence, not including the terminating null wide character code
- wcsnrtombs.11
If a wide character was encountered which could not be converted, (size_t)(-1) is returned, and the global variable errno set to [EILSEQ].
- [+]wcsrtombs (19 / 1 / 0)
- wcsrtombs.01
The wcsrtombs() function shall convert a sequence of wide characters from the array indirectly pointed to by src into a sequence of corresponding characters, beginning in the conversion state described by the object pointed to by ps.
- wcsrtombs.02
If dst is not a null pointer, the converted characters shall then be stored into the array pointed to by dst.
- wcsrtombs.03
Conversion continues up to and including a terminating null wide character, which shall also be stored.
- wcsrtombs.04
Conversion shall stop earlier in the following cases:
- wcsrtombs.04.01
When a code is reached that does not correspond to a valid character
- wcsrtombs.04.02
When the next character would exceed the limit of len total bytes to be stored in the array pointed to by dst (and dst is not a null pointer)
- wcsrtombs.05
Each conversion shall take place as if by a call to the wcrtomb() function.
- wcsrtombs.06
If dst is not a null pointer, the pointer object pointed to by src shall be assigned either a null pointer (if conversion stopped due to reaching a terminating null wide character)
- wcsrtombs.07
or the address just past the last wide character converted (if any).
- wcsrtombs.08
If conversion stopped due to reaching a terminating null wide character, the resulting state described shall be the initial conversion state.
- wcsrtombs.09
If ps is a null pointer, the wcsrtombs() function shall use its own internal mbstate_t object, which is initialized at program start-up to the initial conversion state.
- wcsrtombs.10
Otherwise, the mbstate_t object pointed to by ps shall be used to completely describe the current conversion state of the associated character sequence.
- wcsrtombs.11
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls wcsrtombs().
- wcsrtombs.12
[CX] If the application uses any of the _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS functions, the application shall ensure that the wcsrtombs() function is called with a non-NULL ps argument.
- wcsrtombs.13
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- wcsrtombs.14
If conversion stops because a code is reached that does not correspond to a valid character, an encoding error occurs.
- wcsrtombs.15
In this case, the wcsrtombs() function shall store the value of the macro [EILSEQ] in errno and return (size_t)-1; the conversion state is undefined.
- wcsrtombs.16
Otherwise, it shall return the number of bytes in the resulting character sequence, not including the terminating null (if any).
- wcsrtombs.17
The wcsrtombs() function may fail if:
- wcsrtombs.17.01
[EINVAL] [CX] ps points to an object that contains an invalid conversion state.
- wcsrtombs.17.02
[EILSEQ] A wide-character code does not correspond to a valid character.
- [+]wcstombs (11 / 1 / 0)
- wcstombs.01
The wcstombs() function shall convert the sequence of wide-character codes that are in the array pointed to by pwcs into a sequence of characters that begins in the initial shift state and store these characters into the array pointed to by s, stopping if a character would exceed the limit of n total bytes or if a null byte is stored.
- wcstombs.02
Each wide-character code shall be converted as if by a call to wctomb(), except that the shift state of wctomb() shall not be affected.
- wcstombs.03
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- wcstombs.04
If copying takes place between objects that overlap, the behavior is undefined.
- wcstombs.05
[CX] If s is a null pointer, wcstombs() shall return the length required to convert the entire array regardless of the value of n, but no values are stored.
- wcstombs.06
The wcstombs() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- wcstombs.07
If a wide-character code is encountered that does not correspond to a valid character (of one or more bytes each), wcstombs() shall return (size_t)-1.
- wcstombs.08
Otherwise, wcstombs() shall return the number of bytes stored in the character array, not including any terminating null byte.
- wcstombs.09
The array shall not be null-terminated if the value returned is n.
- wcstombs.10
The wcstombs() function may fail if:
- wcstombs.10.01
[EILSEQ] [CX] A wide-character code does not correspond to a valid character.
- wcstombs.11
No more than n bytes shall be modified in the array pointed to by s.
- [+]wctob (4 / 0 / 0)
- wctob.01
The wctob() function shall determine whether c corresponds to a member of the extended character set whose character representation is a single byte when in the initial shift state.
- wctob.02
The behavior of this function shall be affected by the LC_CTYPE category of the current locale.
- wctob.03
The wctob() function shall return EOF if c does not correspond to a character with length one in the initial shift state.
- wctob.04
Otherwise, it shall return the single-byte representation of that character as an unsigned char converted to int.
- [+]wctomb (16 / 0 / 0)
- wctomb.01
The wctomb() function shall determine the number of bytes needed to represent the character corresponding to the wide-character code whose value is wchar (including any change in the shift state).
- wctomb.02
It shall store the character representation (possibly multiple bytes and any special bytes to change shift state) in the array object pointed to by s
- wctomb.03
(if s is not a null pointer)
- wctomb.04
At most {MB_CUR_MAX} bytes shall be stored.
- wctomb.05
If wchar is 0, a null byte shall be stored, preceded by any shift sequence needed to restore the initial shift state, and wctomb() shall be left in the initial shift state.
- wctomb.06
The behavior of this function is affected by the LC_CTYPE category of the current locale.
- wctomb.07
For a state-dependent encoding, this function shall be placed into its initial state by a call for which its character pointer argument, s, is a null pointer.
- wctomb.08
Subsequent calls with s as other than a null pointer shall cause the internal state of the function to be altered as necessary.
- wctomb.09
A call with s as a null pointer shall cause this function to return a non-zero value if encodings have state dependency, and 0 otherwise.
- wctomb.10
Changing the LC_CTYPE category causes the shift state of this function to be unspecified.
- wctomb.11
The wctomb() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- wctomb.12
The implementation shall behave as if no function defined in this volume of IEEE Std 1003.1-2001 calls wctomb().
- wctomb.13
If s is a null pointer, wctomb() shall return a non-zero or 0 value, if character encodings, respectively, do or do not have state-dependent encodings.
- wctomb.14
If s is not a null pointer, wctomb() shall return -1 if the value of wchar does not correspond to a valid character,
- wctomb.15
or return the number of bytes that constitute the character corresponding to the value of wchar.
- wctomb.16
In no case shall the value returned be greater than the value of the {MB_CUR_MAX} macro.
- [+]util.conversion.wstrint (276 / 256 / 0)
- [+]__wcstol_internal (28 / 26 / 0)
- __wcstol_internal.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to long, long long, unsigned long, and unsigned long long representation, respectively.
- __wcstol_internal.02
First, they shall decompose the input string into three parts:
- __wcstol_internal.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- __wcstol_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __wcstol_internal.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- __wcstol_internal.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- __wcstol_internal.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __wcstol_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __wcstol_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __wcstol_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __wcstol_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __wcstol_internal.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- __wcstol_internal.06
If the value of base is 16, the wide-character code representations of 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __wcstol_internal.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form.
- __wcstol_internal.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
- __wcstol_internal.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- __wcstol_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __wcstol_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __wcstol_internal.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstol_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __wcstol_internal.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstol_internal.15
[CX] These functions shall not change the setting of errno if successful.
- __wcstol_internal.16
Since 0, {LONG_MIN} or {LLONG_MIN} and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call wcstol() or wcstoll(), then check errno.
- __wcstol_internal.17
Upon successful completion, these functions shall return the converted value, if any.
- __wcstol_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- __wcstol_internal.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- __wcstol_internal.20
These functions shall fail if:
- __wcstol_internal.20.01
[EINVAL] [CX] The value of base is not supported.
- __wcstol_internal.20.02
[ERANGE] The value to be returned is not representable.
- __wcstol_internal.21
These functions may fail if:
- __wcstol_internal.21.01
[EINVAL] [CX] No conversion could be performed.
- app.__wcstol_internal.30
group shall be 0 or the behavior of __wcstol_internal() is undefined.
- __wcstol_internal.30
__wcstol_internal(nptr, endptr, base, 0) shall behave as wcstol(nptr, endptr, base) as specified by ISO POSIX (2003).
- [+]__wcstoul_internal (28 / 26 / 0)
- __wcstoul_internal.01
The wcstoul() and wcstoull() functions shall convert the initial portion of the wide-character string pointed to by nptr to unsigned long and unsigned long long representation, respectively.
- __wcstoul_internal.02
First, they shall decompose the input wide-character string into three parts:
- __wcstoul_internal.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- __wcstoul_internal.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- __wcstoul_internal.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- __wcstoul_internal.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- __wcstoul_internal.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- __wcstoul_internal.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- __wcstoul_internal.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- __wcstoul_internal.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- __wcstoul_internal.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- __wcstoul_internal.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- __wcstoul_internal.06
If the value of base is 16, the wide-character codes 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- __wcstoul_internal.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form.
- __wcstoul_internal.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
- __wcstoul_internal.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- __wcstoul_internal.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- __wcstoul_internal.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- __wcstoul_internal.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstoul_internal.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- __wcstoul_internal.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstoul_internal.15
[CX] The wcstoul() function shall not change the setting of errno if successful.
- __wcstoul_internal.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and 0 is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call wcstoul() or wcstoull(), then check errno.
- __wcstoul_internal.17
Upon successful completion, the wcstoul() and wcstoull() functions shall return the converted value, if any.
- __wcstoul_internal.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- __wcstoul_internal.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} respectively shall be returned and errno set to [ERANGE].
- __wcstoul_internal.20
These functions shall fail if:
- __wcstoul_internal.20.01
[EINVAL] [CX] The value of base is not supported.
- __wcstoul_internal.20.02
[ERANGE] The value to be returned is not representable.
- __wcstoul_internal.21
These functions may fail if:
- __wcstoul_internal.21.01
[EINVAL] [CX] No conversion could be performed.
- __wcstoul_internal.30
__wcstoul_internal(nptr, endptr, base, 0)() shall behave as wcstoul(nptr, endptr, base)() as specified by ISO POSIX (2003).
- app.__wcstoul_internal.30
group shall be 0 or the behavior of __wcstoul_internal() is undefined.
- [+]wcstoimax (27 / 25 / 0)
- wcstoimax.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to long, long long, unsigned long, and unsigned long long representation, respectively.
These functions shall be equivalent to the wcstol(), wcstoll(), wcstoul(), and wcstoull() functions, respectively, except that the initial portion of the wide string shall be converted to intmax_t and uintmax_t representation, respectively.
- wcstoimax.02
First, they shall decompose the input string into three parts:
- wcstoimax.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoimax.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoimax.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoimax.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- wcstoimax.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoimax.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoimax.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoimax.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoimax.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoimax.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoimax.06
If the value of base is 16, the wide-character code representations of 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoimax.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form.
- wcstoimax.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
- wcstoimax.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoimax.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoimax.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoimax.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoimax.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoimax.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoimax.15
[CX] These functions shall not change the setting of errno if successful.
- wcstoimax.16
Since 0, {LONG_MIN} or {LLONG_MIN} and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call wcstol() or wcstoll(), then check errno.
- wcstoimax.17
Upon successful completion, these functions shall return the converted value, if any.
These functions shall return the converted value, if any.
- wcstoimax.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
If no conversion could be performed, zero shall be returned.
- wcstoimax.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
If the correct value is outside the range of representable values, {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return type and sign of the value, if any), and errno shall be set to [ERANGE].
- wcstoimax.20
These functions shall fail if:
- wcstoimax.20.01
[EINVAL] [CX] The value of base is not supported.
[EINVAL] The value of base is not supported.
- wcstoimax.20.02
[ERANGE] The value to be returned is not representable.
[ERANGE] The value to be returned is not representable.
- wcstoimax.21
These functions may fail if:
- wcstoimax.21.01
[EINVAL] [CX] No conversion could be performed.
[EINVAL] No conversion could be performed.
- [+]wcstol (27 / 25 / 0)
- wcstol.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to long, long long, unsigned long, and unsigned long long representation, respectively.
- wcstol.02
First, they shall decompose the input string into three parts:
- wcstol.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstol.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstol.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstol.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- wcstol.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstol.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstol.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstol.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstol.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstol.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstol.06
If the value of base is 16, the wide-character code representations of 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstol.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form.
- wcstol.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
- wcstol.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstol.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstol.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstol.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstol.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstol.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstol.15
[CX] These functions shall not change the setting of errno if successful.
- wcstol.16
Since 0, {LONG_MIN} or {LLONG_MIN} and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call wcstol() or wcstoll(), then check errno.
- wcstol.17
Upon successful completion, these functions shall return the converted value, if any.
- wcstol.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstol.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- wcstol.20
These functions shall fail if:
- wcstol.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstol.20.02
[ERANGE] The value to be returned is not representable.
- wcstol.21
These functions may fail if:
- wcstol.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstoll (27 / 25 / 0)
- wcstoll.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to long, long long, unsigned long, and unsigned long long representation, respectively.
- wcstoll.02
First, they shall decompose the input string into three parts:
- wcstoll.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoll.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoll.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoll.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- wcstoll.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoll.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoll.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoll.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoll.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoll.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoll.06
If the value of base is 16, the wide-character code representations of 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoll.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form.
- wcstoll.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
- wcstoll.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoll.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoll.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoll.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoll.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoll.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoll.15
[CX] These functions shall not change the setting of errno if successful.
- wcstoll.16
Since 0, {LONG_MIN} or {LLONG_MIN} and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call wcstol() or wcstoll(), then check errno.
- wcstoll.17
Upon successful completion, these functions shall return the converted value, if any.
- wcstoll.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstoll.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- wcstoll.20
These functions shall fail if:
- wcstoll.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstoll.20.02
[ERANGE] The value to be returned is not representable.
- wcstoll.21
These functions may fail if:
- wcstoll.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstoq (29 / 27 / 0)
- wcstoq.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to long, long long, unsigned long, and unsigned long long representation, respectively.
- wcstoq.02
First, they shall decompose the input string into three parts:
- wcstoq.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoq.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoq.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoq.03
Then they shall attempt to convert the subject sequence to an integer, and return the result.
- wcstoq.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoq.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoq.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoq.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoq.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoq.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoq.06
If the value of base is 16, the wide-character code representations of 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoq.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first non-white-space wide-character code that is of the expected form.
- wcstoq.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character code, or if the first non-white-space wide-character code is other than a sign or a permissible letter or digit.
- wcstoq.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoq.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoq.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoq.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoq.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoq.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoq.15
[CX] These functions shall not change the setting of errno if successful.
- wcstoq.16
Since 0, {LONG_MIN} or {LLONG_MIN} and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call wcstol() or wcstoll(), then check errno.
- wcstoq.17
Upon successful completion, these functions shall return the converted value, if any.
- wcstoq.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstoq.19
If the correct value is outside the range of representable values, {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned (according to the sign of the value), and errno set to [ERANGE].
- wcstoq.20
These functions shall fail if:
- wcstoq.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstoq.20.02
[ERANGE] The value to be returned is not representable.
- wcstoq.21
These functions may fail if:
- wcstoq.21.01
[EINVAL] [CX] No conversion could be performed.
- wcstoq.30
The wcstoq() function shall convert the initial portion of the wide string nptr to long long int representation.
- wcstoq.31
It is identical to wcstoll().
- [+]wcstoul (27 / 25 / 0)
- wcstoul.01
The wcstoul() and wcstoull() functions shall convert the initial portion of the wide-character string pointed to by nptr to unsigned long and unsigned long long representation, respectively.
- wcstoul.02
First, they shall decompose the input wide-character string into three parts:
- wcstoul.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoul.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoul.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoul.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- wcstoul.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoul.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoul.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoul.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoul.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoul.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoul.06
If the value of base is 16, the wide-character codes 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoul.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form.
- wcstoul.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
- wcstoul.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoul.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoul.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoul.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoul.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoul.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoul.15
[CX] The wcstoul() function shall not change the setting of errno if successful.
- wcstoul.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and 0 is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call wcstoul() or wcstoull(), then check errno.
- wcstoul.17
Upon successful completion, the wcstoul() and wcstoull() functions shall return the converted value, if any.
- wcstoul.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstoul.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} respectively shall be returned and errno set to [ERANGE].
- wcstoul.20
These functions shall fail if:
- wcstoul.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstoul.20.02
[ERANGE] The value to be returned is not representable.
- wcstoul.21
These functions may fail if:
- wcstoul.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstoull (27 / 25 / 0)
- wcstoull.01
The wcstoul() and wcstoull() functions shall convert the initial portion of the wide-character string pointed to by nptr to unsigned long and unsigned long long representation, respectively.
- wcstoull.02
First, they shall decompose the input wide-character string into three parts:
- wcstoull.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoull.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoull.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoull.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- wcstoull.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoull.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoull.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoull.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoull.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoull.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoull.06
If the value of base is 16, the wide-character codes 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoull.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form.
- wcstoull.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
- wcstoull.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoull.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoull.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoull.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoull.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoull.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoull.15
[CX] The wcstoul() function shall not change the setting of errno if successful.
- wcstoull.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and 0 is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call wcstoul() or wcstoull(), then check errno.
- wcstoull.17
Upon successful completion, the wcstoul() and wcstoull() functions shall return the converted value, if any.
- wcstoull.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstoull.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} respectively shall be returned and errno set to [ERANGE].
- wcstoull.20
These functions shall fail if:
- wcstoull.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstoull.20.02
[ERANGE] The value to be returned is not representable.
- wcstoull.21
These functions may fail if:
- wcstoull.21.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstoumax (27 / 25 / 0)
- wcstoumax.01
The wcstoul() and wcstoull() functions shall convert the initial portion of the wide-character string pointed to by nptr to unsigned long and unsigned long long representation, respectively.
These functions shall be equivalent to the wcstol(), wcstoll(), wcstoul(), and wcstoull() functions, respectively, except that the initial portion of the wide string shall be converted to intmax_t and uintmax_t representation, respectively.
- wcstoumax.02
First, they shall decompose the input wide-character string into three parts:
- wcstoumax.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstoumax.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstoumax.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstoumax.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- wcstoumax.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstoumax.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstoumax.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstoumax.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstoumax.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstoumax.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstoumax.06
If the value of base is 16, the wide-character codes 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstoumax.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form.
- wcstoumax.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
- wcstoumax.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstoumax.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstoumax.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstoumax.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoumax.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstoumax.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstoumax.15
[CX] The wcstoul() function shall not change the setting of errno if successful.
- wcstoumax.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and 0 is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call wcstoul() or wcstoull(), then check errno.
- wcstoumax.17
Upon successful completion, the wcstoul() and wcstoull() functions shall return the converted value, if any.
These functions shall return the converted value, if any.
- wcstoumax.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
If no conversion could be performed, zero shall be returned.
- wcstoumax.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} respectively shall be returned and errno set to [ERANGE].
If the correct value is outside the range of representable values, {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be returned (according to the return type and sign of the value, if any), and errno shall be set to [ERANGE].
- wcstoumax.20
These functions shall fail if:
- wcstoumax.20.01
[EINVAL] [CX] The value of base is not supported.
[EINVAL] The value of base is not supported.
- wcstoumax.20.02
[ERANGE] The value to be returned is not representable.
[ERANGE] The value to be returned is not representable.
- wcstoumax.21
These functions may fail if:
- wcstoumax.21.01
[EINVAL] [CX] No conversion could be performed.
[EINVAL] No conversion could be performed.
- [+]wcstouq (29 / 27 / 0)
- wcstouq.01
The wcstoul() and wcstoull() functions shall convert the initial portion of the wide-character string pointed to by nptr to unsigned long and unsigned long long representation, respectively.
- wcstouq.02
First, they shall decompose the input wide-character string into three parts:
- wcstouq.02.01
An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())
- wcstouq.02.02
A subject sequence interpreted as an integer represented in some radix determined by the value of base
- wcstouq.02.03
A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstouq.03
Then they shall attempt to convert the subject sequence to an unsigned integer, and return the result.
- wcstouq.04
If base is 0, the expected form of the subject sequence is that of a decimal constant, octal constant, or hexadecimal constant, any of which may be preceded by a '+' or '-' sign.
- wcstouq.04.01
A decimal constant begins with a non-zero digit, and consists of a sequence of decimal digits.
- wcstouq.04.02
An octal constant consists of the prefix '0' optionally followed by a sequence of the digits '0' to '7' only.
- wcstouq.04.03
A hexadecimal constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters 'a' (or 'A' ) to 'f' (or 'F' ) with values 10 to 15 respectively.
- wcstouq.05.01
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an integer with the radix specified by base, optionally preceded by a '+' or '-' sign, but not including an integer suffix. The letters from 'a' (or 'A' ) to 'z' (or 'Z' ) inclusive are ascribed the values 10 to 35;
- wcstouq.05.02
only letters whose ascribed values are less than that of base shall be permitted.
- wcstouq.06
If the value of base is 16, the wide-character codes 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present.
- wcstouq.07
The subject sequence is defined as the longest initial subsequence of the input wide-character string, starting with the first wide-character code that is not white space and is of the expected form.
- wcstouq.08
The subject sequence contains no wide-character codes if the input wide-character string is empty or consists entirely of white-space wide-character codes, or if the first wide-character code that is not white space is other than a sign or a permissible letter or digit.
- wcstouq.09
If the subject sequence has the expected form and base is 0, the sequence of wide-character codes starting with the first digit shall be interpreted as an integer constant.
- wcstouq.10
If the subject sequence has the expected form and the value of base is between 2 and 36, it shall be used as the base for conversion, ascribing to each letter its value as given above.
- wcstouq.11
If the subject sequence begins with a minus sign, the value resulting from the conversion shall be negated.
- wcstouq.12
A pointer to the final wide-character string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstouq.13
In other than the C [CX] or POSIX locales, other implementation-defined subject sequences may be accepted.
- wcstouq.14
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstouq.15
[CX] The wcstoul() function shall not change the setting of errno if successful.
- wcstouq.16
Since 0, {ULONG_MAX}, and {ULLONG_MAX} are returned on error and 0 is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call wcstoul() or wcstoull(), then check errno.
- wcstouq.17
Upon successful completion, the wcstoul() and wcstoull() functions shall return the converted value, if any.
- wcstouq.18
If no conversion could be performed, 0 shall be returned [CX] and errno may be set to indicate the error.
- wcstouq.19
If the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} respectively shall be returned and errno set to [ERANGE].
- wcstouq.20
These functions shall fail if:
- wcstouq.20.01
[EINVAL] [CX] The value of base is not supported.
- wcstouq.20.02
[ERANGE] The value to be returned is not representable.
- wcstouq.21
These functions may fail if:
- wcstouq.21.01
[EINVAL] [CX] No conversion could be performed.
- wcstouq.30
The wcstouq() function shall convert the initial portion of the wide string nptr to unsigned long long int representation.
- wcstouq.31
It is identical to wcstoull().
- [+]util.conversion.wstrreal (117 / 108 / 0)
- [+]__wcstod_internal (20 / 18 / 0)
- __wcstod_internal.30
__wcstod_internal(nptr, endptr, 0) shall behave as wcstod(nptr, endptr) as specified by ISO POSIX (2003).
- app.__wcstod_internal.30
group shall be 0 or the behavior of __wcstod_internal() is undefined.
- __wcstod_internal.wcstod.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- __wcstod_internal.wcstod.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __wcstod_internal.wcstod.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- __wcstod_internal.wcstod.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- __wcstod_internal.wcstod.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- __wcstod_internal.wcstod.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- __wcstod_internal.wcstod.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- __wcstod_internal.wcstod.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- __wcstod_internal.wcstod.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- __wcstod_internal.wcstod.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __wcstod_internal.wcstod.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __wcstod_internal.wcstod.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __wcstod_internal.wcstod.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstod_internal.wcstod.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __wcstod_internal.wcstod.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstod_internal.wcstod.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- __wcstod_internal.wcstod.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __wcstod_internal.wcstod.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __wcstod_internal.wcstod.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __wcstod_internal.wcstod.18
The wcstod() function shall fail if:
- __wcstod_internal.wcstod.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- __wcstod_internal.wcstod.19
The wcstod() function may fail if:
- __wcstod_internal.wcstod.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]__wcstof_internal (20 / 18 / 0)
- __wcstof_internal.30
__wcstof_internal(nptr, endptr, 0) shall behave as wcstof(nptr, endptr) as specified in ISO POSIX (2003).
- app.__wcstof_internal.30
group shall be 0 or the behavior of __wcstof_internal() is undefined.
- __wcstof_internal.wcstof.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- __wcstof_internal.wcstof.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __wcstof_internal.wcstof.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- __wcstof_internal.wcstof.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- __wcstof_internal.wcstof.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- __wcstof_internal.wcstof.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- __wcstof_internal.wcstof.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- __wcstof_internal.wcstof.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- __wcstof_internal.wcstof.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- __wcstof_internal.wcstof.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __wcstof_internal.wcstof.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __wcstof_internal.wcstof.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __wcstof_internal.wcstof.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstof_internal.wcstof.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __wcstof_internal.wcstof.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstof_internal.wcstof.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- __wcstof_internal.wcstof.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __wcstof_internal.wcstof.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __wcstof_internal.wcstof.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __wcstof_internal.wcstof.18
The wcstod() function shall fail if:
- __wcstof_internal.wcstof.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- __wcstof_internal.wcstof.19
The wcstod() function may fail if:
- __wcstof_internal.wcstof.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]__wcstold_internal (20 / 18 / 0)
- __wcstold_internal.30
__wcstold_internal(nptr, endptr, 0) shall behave as wcstold(nptr, endptr) as specified by ISO POSIX (2003).
- app.__wcstold_internal.30
group shall be 0 or the behavior of __wcstold_internal() is undefined.
- __wcstold_internal.wcstold.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- __wcstold_internal.wcstold.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- __wcstold_internal.wcstold.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- __wcstold_internal.wcstold.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- __wcstold_internal.wcstold.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- __wcstold_internal.wcstold.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- __wcstold_internal.wcstold.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- __wcstold_internal.wcstold.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- __wcstold_internal.wcstold.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- __wcstold_internal.wcstold.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- __wcstold_internal.wcstold.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- __wcstold_internal.wcstold.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- __wcstold_internal.wcstold.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstold_internal.wcstold.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- __wcstold_internal.wcstold.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- __wcstold_internal.wcstold.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- __wcstold_internal.wcstold.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- __wcstold_internal.wcstold.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- __wcstold_internal.wcstold.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- __wcstold_internal.wcstold.18
The wcstod() function shall fail if:
- __wcstold_internal.wcstold.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- __wcstold_internal.wcstold.19
The wcstod() function may fail if:
- __wcstold_internal.wcstold.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstod (19 / 18 / 0)
- wcstod.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- wcstod.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- wcstod.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- wcstod.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstod.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- wcstod.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- wcstod.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- wcstod.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- wcstod.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- wcstod.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- wcstod.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- wcstod.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- wcstod.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstod.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- wcstod.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstod.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- wcstod.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- wcstod.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- wcstod.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- wcstod.18
The wcstod() function shall fail if:
- wcstod.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- wcstod.19
The wcstod() function may fail if:
- wcstod.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstof (19 / 18 / 0)
- wcstof.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- wcstof.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- wcstof.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- wcstof.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstof.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- wcstof.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- wcstof.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- wcstof.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- wcstof.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- wcstof.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- wcstof.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- wcstof.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- wcstof.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstof.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- wcstof.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstof.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- wcstof.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- wcstof.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- wcstof.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- wcstof.18
The wcstod() function shall fail if:
- wcstof.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- wcstof.19
The wcstod() function may fail if:
- wcstof.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]wcstold (19 / 18 / 0)
- wcstold.01
These functions shall convert the initial portion of the wide-character string pointed to by nptr to double, float, and long double representation, respectively.
- wcstold.01.01
Then they shall attempt to convert the subject sequence to a floating-point number, and return the result.
- wcstold.01.02
If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the conversion shall be rounded in an implementation-defined manner.
- wcstold.02
First, they shall decompose the input wide-character string into three parts:An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace())A subject sequence interpreted as a floating-point constant or representing infinity or NaNA final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of the input wide-character string
- wcstold.03
The expected form of the subject sequence is an optional plus or minus sign, then one of the following: A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent partA 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent partOne of INF or INFINITY, or any other wide string equivalent except for caseOne of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:n-wchar-sequence: digit nondigit n-wchar-sequence digit n-wchar-sequence nondigit
- wcstold.04
The subject sequence is defined as the longest initial subsequence of the input wide string, starting with the first non-white-space wide character, that is of the expected form.
- wcstold.05
The subject sequence contains no wide characters if the input wide string is not of the expected form.
- wcstold.06 (struct)
If the subject sequence has the expected form for a floating-point number, the sequence of wide characters starting with the first digit or the radix character (whichever occurs first) shall be interpreted as a floating constant according to the rules of the C language, except that the radix character shall be used in place of a period,
- wcstold.07
and that if neither an exponent part nor a radix character appears in a decimal floating-point number, or if a binary exponent part does not appear in a hexadecimal floating-point number, an exponent part of the appropriate type with value zero shall be assumed to follow the last digit in the string.
- wcstold.08
If the subject sequence begins with a minus sign, the sequence shall be interpreted as negated.
- wcstold.09
A wide-character sequence INF or INFINITY shall be interpreted as an infinity, if representable in the return type, else as if it were a floating constant that is too large for the range of the return type.
- wcstold.10
A wide-character sequence NAN or NAN(n-wchar-sequenceopt) shall be interpreted as a quiet NaN, if supported in the return type, else as if it were a subject sequence part that does not have the expected form;
- wcstold.11
A pointer to the final wide string shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstold.12
[CX] The radix character shall be as defined in the program's locale (category LC_NUMERIC ). In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- wcstold.13
If the subject sequence is empty or does not have the expected form, no conversion shall be performed; the value of nptr shall be stored in the object pointed to by endptr, provided that endptr is not a null pointer.
- wcstold.14
[CX] The wcstod() function shall not change the setting of errno if successful.
- wcstold.15
Upon successful completion, these functions shall return the converted value. If no conversion could be performed, 0 shall be returned [CX] and errno may be set to [EINVAL].
- wcstold.16
If the correct value is outside the range of representable values, ?HUGE_VAL, ?HUGE_VALF, or ?HUGE_VALL shall be returned (according to the sign of the value), and errno shall be set to [ERANGE].
- wcstold.17
If the correct value would cause underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].
- wcstold.18
The wcstod() function shall fail if:
- wcstold.18.01
[ERANGE] The value to be returned would cause overflow or underflow.
- wcstold.19
The wcstod() function may fail if:
- wcstold.19.01
[EINVAL] [CX] No conversion could be performed.
- [+]util.conversion.wtoken (13 / 13 / 0)
- [+]wcstok (13 / 13 / 0)
- wcstok.01
A sequence of calls to wcstok() shall break the wide-character string pointed to by ws1 into a sequence of tokens, each of which shall be delimited by a wide-character code from the wide-character string pointed to by ws2.
- app.wcstok.02
The ptr argument points to a caller-provided wchar_t pointer into which the wcstok() function shall store information necessary for it to continue scanning the same wide-character string.
- wcstok.03
The first call in the sequence has ws1 as its first argument, and is followed by calls with a null pointer as their first argument.
- wcstok.04
The separator string pointed to by ws2 may be different from call to call.
- wcstok.05
The first call in the sequence shall search the wide-character string pointed to by ws1 for the first wide-character code that is not contained in the current separator string pointed to by ws2.
- wcstok.06
If no such wide-character code is found, then there are no tokens in the wide-character string pointed to by ws1 and wcstok() shall return a null pointer.
- wcstok.07
If such a wide-character code is found, it shall be the start of the first token.
- wcstok.08
The wcstok() function shall then search from there for a wide-character code that is contained in the current separator string.
- wcstok.09
If no such wide-character code is found, the current token extends to the end of the wide-character string pointed to by ws1, and subsequent searches for a token shall return a null pointer.
- wcstok.10
If such a wide-character code is found, it shall be overwritten by a null wide character, which terminates the current token.
- wcstok.11
The wcstok() function shall save a pointer to the following wide-character code, from which the next search for a token shall start.
- wcstok.12
Each subsequent call, with a null pointer as the value of the first argument, shall start searching from the saved pointer and behave as described above.
- app.wcstok.13
The implementation shall behave as if no function calls wcstok().
- wcstok.14
Upon successful completion, the wcstok() function shall return a pointer to the first wide-character code of a token.
- wcstok.15
Otherwise, if there is no token, wcstok() shall return a null pointer.
- [+]util.crypt (33 / 29 / 0)
- [+]crypt (10 / 9 / 0)
- crypt.01
The crypt() function is a string encoding function. The algorithm is implementation-defined.
- crypt.02
The key argument points to a string to be encoded.
- crypt.03
The salt argument is a string chosen from the set:
- crypt.03.child
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 zA B C D E F G H I J K L M N O P Q R S T U V W X Y Z0 1 2 3 4 5 6 7 8 9 . /
- crypt.04
The first two characters of this string may be used to perturb the encoding algorithm.
- crypt.05
The return value of crypt() points to static data that is overwritten by each call.
- crypt.06
The crypt() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- crypt.07
Upon successful completion, crypt() shall return a pointer to the encoded string.
- crypt.08
The first two characters of the returned value shall be those of the salt argument.
- crypt.09
Otherwise, it shall return a null pointer and set errno to indicate the error.
- crypt.10
The crypt() function shall fail if:
- crypt.10.01
[ENOSYS] The functionality is not supported on this implementation.
- [+]encrypt (13 / 11 / 0)
- encrypt.01
The encrypt() function shall provide access to an implementation-defined encoding algorithm.
- encrypt.02
The key generated by setkey() is used to encrypt the string block with encrypt().
- encrypt.03
The block argument to encrypt() shall be an array of length 64 bytes containing only the bytes with values of 0 and 1.
- encrypt.04
The array is modified in place to a similar array using the key set by setkey().
- encrypt.05
If edflag is 0, the argument is encoded.
- encrypt.06
If edflag is 1, the argument may be decoded (see the APPLICATION USAGE section);
- encrypt.07
if the argument is not decoded, errno shall be set to [ENOSYS].
- encrypt.08
The encrypt() function shall not change the setting of errno if successful.
- encrypt.09
An application wishing to check for error situations should set errno to 0 before calling encrypt().
- encrypt.10
If errno is non-zero on return, an error has occurred.
- encrypt.11
The encrypt() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- encrypt.12
The encrypt() function shall not return a value.
- encrypt.13
The encrypt() function shall fail if:
- encrypt.13.01
[ENOSYS] The functionality is not supported on this implementation.
- [+]setkey (10 / 9 / 0)
- setkey.01
The setkey() function provides access to an implementation-defined encoding algorithm.
- setkey.02
The argument of setkey() is an array of length 64 bytes containing only the bytes with numerical value of 0 and 1.
- setkey.03
If this string is divided into groups of 8, the low-order bit in each group is ignored; this gives a 56-bit key which is used by the algorithm.
- setkey.04
This is the key that shall be used with the algorithm to encode a string block passed to encrypt().
- setkey.05
The setkey() function shall not change the setting of errno if successful.
- setkey.06
An application wishing to check for error situations should set errno to 0 before calling setkey().
- setkey.07
If errno is non-zero on return, an error has occurred.
- setkey.08
The setkey() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- setkey.09
No values are returned.
- setkey.10
The setkey() function shall fail if:
- setkey.10.01
[ENOSYS] The functionality is not supported on this implementation.
- [+]util.dl (46 / 7 / 1)
- [+]dladdr (9 / 3 / 0)
- app.dladdr.lsb.04
The behavior of dladdr() is only specified in dynamically linked programs.
- dladdr.lsb.01
The dladdr() function shall query the dynamic linker for information about the shared object containing the address addr.
Generalizes:
- dladdr.lsb.02.01
- dladdr.lsb.02.02
- dladdr.lsb.02.03.01
- dladdr.lsb.02.03.02
- dladdr.lsb.02.04.01
- dladdr.lsb.02.04.02
- dladdr.lsb.03
- dladdr.lsb.05
- dladdr.lsb.06
- dladdr.lsb.02
The information shall be returned in the user supplied data structure referenced by dlip.
- dladdr.lsb.02.01
The pathname of the shared object containing the address
- dladdr.lsb.02.02
The base address at which the shared object is mapped into the address space of the calling process.
- dladdr.lsb.02.03
dli_sname
- dladdr.lsb.02.03.01
The name of the nearest runtime symbol with value less than or equal to addr. Where possible, the symbol name shall be returned as it would appear in C source code.
- dladdr.lsb.02.03.02
If no symbol with a suitable value is found,both this field and dli_saddr shall be set to NULL.
- dladdr.lsb.02.04
dli_saddr
- dladdr.lsb.02.04.01
The address of the symbol returned in dli_sname. This address has type "pointer to type", where type is the type of the symbol dli_sname.
- dladdr.lsb.02.04.02
If no symbol with a suitable value is found,both this field and dli_saddr shall be set to NULL.
- dladdr.lsb.03 (struct)
The structure shall contain at least the following members:
- dladdr.lsb.05
On success, dladdr() shall return non-zero, and the structure referenced by dlip shall be filled in as described.
- dladdr.lsb.06
Otherwise, dladdr() shall return zero, and the cause of the error can be fetched with dlerror().
- [+]dlclose (4 / 0 / 0)
- dlclose.01
The dlclose() function shall inform the system that the object referenced by a handle returned from a previous dlopen() invocation is no longer needed by the application.
Generalizes:
- dlclose.04
- dlclose.05
- dlclose.06
- dlclose.07
- app.dlclose.02
Once an object has been closed using dlclose() an application should assume that its symbols are no longer available to dlsym().
- app.dlclose.03
All objects loaded automatically as a result of invoking dlopen() on the referenced object shall also be closed if this is the last reference to it.
- dlclose.04
The only restriction on such a removal is that no object shall be removed to which references have been relocated, until or unless all such references are removed.
- dlclose.05
If the referenced object was successfully closed, dlclose() shall return 0.
- dlclose.06
If the object could not be closed, or if handle does not refer to an open object, dlclose() shall return a non-zero value.
- dlclose.07 (struct)
More detailed diagnostic information shall be available through dlerror().
- [+]dlerror (5 / 4 / 0)
- dlerror.01
The dlerror() function shall return a null-terminated character string (with no trailing <newline>) that describes the last error that occurred during dynamic linking processing.
- dlerror.02
If no dynamic linking errors have occurred since the last invocation of dlerror(), dlerror() shall return NULL.
- dlerror.03
Thus, invoking dlerror() a second time, immediately following a prior invocation, shall result in NULL being returned.
- app.dlerror.04
The dlerror() function need not be reentrant.
- dlerror.05
If successful, dlerror() shall return a null-terminated character string;
- dlerror.06
otherwise, NULL shall be returned.
Generalizes:
- [+]dlopen (21 / 0 / 0)
- dlopen.01
The dlopen() function shall make an executable object file specified by file available to the calling program.
Generalizes:
- &dlopen.07
- dlopen.02
- dlopen.03
- dlopen.04
- dlopen.06.01
- dlopen.06.02
- dlopen.07
- dlopen.08
- dlopen.09.01
- dlopen.09.02.01
- dlopen.09.02.02
- dlopen.12
- dlopen.13.02
- dlopen.14
- dlopen.15
- dlopen.16
- dlopen.17
- dlopen.18
- dlopen.19
- dlopen.20
- dlopen.lsb.01
- dlopen.lsb.02.01
- dlopen.lsb.02.02
- dlopen.lsb.02.04
- dlopen.lsb.03
- dlopen.02
Note that some implementations permit the construction of dependencies between such objects that are embedded within files. In such cases, a dlopen() operation shall load such dependencies in addition to the object referenced by file.
- dlopen.03 (struct)
Implementations may also impose specific constraints on the construction of programs that can employ dlopen() and its related services.
- dlopen.04
A successful dlopen() shall return a handle which the caller may use on subsequent calls to dlsym() and dlclose().
- app.dlopen.05 (struct)
The value of this handle should not be interpreted in any way by the caller.
- dlopen.06
The file argument is used to construct a pathname to the object file.
- dlopen.06.01
If file contains a slash character, the file argument is used as the pathname for the file.
- dlopen.06.02
Otherwise, file is used in an implementation-defined manner to yield a pathname.
Generalizes:
- dlopen.lsb.02.01
- dlopen.lsb.02.02
- dlopen.lsb.02.04
- dlopen.07
If the value of file is 0, dlopen() shall provide a handle on a global symbol object.
In addition, symbol lookup using dlopen(0, mode) and an associated dlsym() allows objects loaded with this mode to be searched.
- dlopen.08
Only a single copy of an object file is brought into the address space, even if dlopen() is invoked multiple times in reference to the file, and even if different pathnames are used to reference the file.
- dlopen.09
The mode parameter describes how dlopen() shall operate upon file with respect to the processing of relocations and the scope of visibility of the symbols provided within file.
- dlopen.09.01
The mode parameter governs when these relocations take place and may have the following values:
- dlopen.09.02
To determine the scope of visibility for the symbols loaded with a dlopen() invocation, the mode parameter should be a bitwise-inclusive OR with one of the following values:
- dlopen.09.02.01
RTLD_GLOBAL The object's symbols shall be made available for the relocation processing of any other object.
- dlopen.09.02.02
RTLD_LOCAL The object's symbols shall not be made available for the relocation processing of any other object.
- dlopen.12 (struct)
If neither RTLD_GLOBAL nor RTLD_LOCAL are specified, then the default behavior is unspecified.
- dlopen.13
If a file is specified in multiple dlopen() invocations, mode is interpreted at each invocation.
- dlopen.13.02
that once RTLD_GLOBAL has been specified the object shall maintain the RTLD_GLOBAL status regardless of any previous or future specification of RTLD_LOCAL, as long as the object remains in the address space (see dlclose())
- dlopen.14
the definition first loaded (including definitions from the image file and any dependent objects loaded with it) has priority over objects added later (via dlopen()).
- dlopen.15
Dependency ordering uses a breadth-first order starting with a given object, then all of its dependencies, then any dependents of those, iterating until all dependencies are satisfied.
- dlopen.16
When an object is first made accessible via dlopen() it and its dependent objects are added in dependency order. Once all the objects are added, relocations are performed using load order. Note that if an object or its dependencies had been previously loaded, the load and dependency orders may yield different resolutions.
- dlopen.17 (struct)
The precise manner in which an implementation constructs the set of exported symbols for a dlopen() object is specified by that implementation.
- dlopen.18
If file cannot be found, cannot be opened for reading, is not of an appropriate object format for processing by dlopen(), or if an error occurs during the process of loading file or relocating its symbolic references, dlopen() shall return NULL.
- dlopen.19 (struct)
More detailed diagnostic information shall be available through dlerror().
- dlopen.20
Any object loaded by dlopen() that requires relocations against global symbols can reference the symbols in the original process image file, any objects loaded at program start-up, from the object itself as well as any other object included in the same dlopen() invocation, and any objects that were loaded in any dlopen() invocation and which specified the RTLD_GLOBAL flag.
- dlopen.lsb.01
The dlopen() function shall behave as specified in ISO POSIX (2003),
Generalizes:
- &dlopen.07
- dlopen.01
- dlopen.02
- dlopen.03
- dlopen.04
- dlopen.06.01
- dlopen.06.02
- dlopen.07
- dlopen.08
- dlopen.09.01
- dlopen.09.02.01
- dlopen.09.02.02
- dlopen.12
- dlopen.13.02
- dlopen.14
- dlopen.15
- dlopen.16
- dlopen.17
- dlopen.18
- dlopen.19
- dlopen.20
- dlopen.lsb.02
If the file argument does not contain a slash character, then the system shall look for a library of that name in at least the following directories, and use the first one which is found:
- dlopen.lsb.02.01
The directories specified by the DT_RPATH dynamic entry.
- dlopen.lsb.02.02
The directories specified in the LD_LIBRARY_PATH environment variable (which is a colon separated list of pathnames).
- dlopen.lsb.02.04
A set of directories sufficient to contain the libraries specified in this standard.
- dlopen.lsb.03
This step shall be skipped for setuid and setgid executables.
- [+]dlsym (7 / 0 / 1)
- dlsym.01
The dlsym() function shall obtain the address of a symbol defined within an object made accessible through a dlopen() call.
Generalizes:
- &dlsym.lsb.01
- dlsym.02
- dlsym.03
- dlsym.04
- dlsym.05
- dlsym.06
- dlsym.07
- dlsym.08
- dlsym.lsb.01
- dlsym.lsb.02
- dlsym.02 (struct)
The handle argument is the value returned from a call to dlopen() (and which has not since been released via a call to dlclose()), and name is the symbol's name as a character string.
- dlsym.03 (failed)
The dlsym() function shall search for the named symbol in all objects loaded automatically as a result of loading the object referenced by handle (see dlopen()).
- dlsym.04
Load ordering is used in dlsym() operations upon the global symbol object.
- dlsym.05
The symbol resolution algorithm used shall be dependency order as described in dlopen().
- dlsym.06 (struct)
The RTLD_DEFAULT and RTLD_NEXT flags are reserved for future use.
- dlsym.07
If handle does not refer to a valid object opened by dlopen(), or if the named symbol cannot be found within any of the objects associated with handle, dlsym() shall return NULL.
- dlsym.08 (struct)
More detailed diagnostic information shall be available through dlerror().
- dlsym.lsb.01
Specifies the next object after this one that defines name. This one refers to the object containing the invocation of dlsym(). The next object is the one found upon the application of a load order symbol resolution algorithm (see dlopen()). The next object is either one of global scope (because it was introduced as part of the original process image or because it was added with a dlopen() operation including the RTLD_GLOBAL flag), or is an object that was included in the same dlopen() operation that loaded this one.
The value RTLD_NEXT, which is reserved for future use shall be available, with the behavior as described in ISO POSIX (2003).
- dlsym.lsb.02
dlsym() is as specified in the ISO POSIX (2003),
Generalizes:
- &dlsym.lsb.01
- dlsym.01
- dlsym.02
- dlsym.03
- dlsym.04
- dlsym.05
- dlsym.06
- dlsym.07
- dlsym.08
- [+]util.float (401 / 222 / 27)
- [+]__finite (3 / 0 / 0)
- __finite.03
__finite() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for __finite() is known to be double.
Generalizes:
- __finite.isfinite.01
- __finite.isfinite.02
- __finite.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- __finite.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]__finitef (3 / 0 / 0)
- __finitef.03
__finitef() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for __finitef() is known to be float.
Generalizes:
- __finitef.isfinite.01
- __finitef.isfinite.02
- __finitef.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- __finitef.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]__finitel (3 / 0 / 0)
- __finitel.03
__finitel() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for __finitel() is known to be long double.
Generalizes:
- __finitel.isfinite.01
- __finitel.isfinite.02
- __finitel.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- __finitel.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]__fpclassify (3 / 0 / 0)
- __fpclassify.30
__fpclassify() has the same specification as fpclassify() in ISO POSIX (2003), except that the argument type for __fpclassify() is known to be double.
Generalizes:
- __fpclassify.fpclassify.01
- __fpclassify.fpclassify.02
- __fpclassify.fpclassify.01
The fpclassify() macro shall classify its argument value as NaN, infinite, normal, subnormal, zero, or into another implementation-defined category.
- __fpclassify.fpclassify.02
The fpclassify() macro shall return the value of the number classification macro appropriate to the value of its argument.
- [+]__fpclassifyf (3 / 0 / 0)
- __fpclassifyf.30
__fpclassifyf() has the same specification as fpclassifyf() in ISO POSIX (2003), except that the argument type for __fpclassifyf() is known to be float.
Generalizes:
- __fpclassifyf.fpclassify.01
- __fpclassifyf.fpclassify.02
- __fpclassifyf.fpclassify.01
The fpclassify() macro shall classify its argument value as NaN, infinite, normal, subnormal, zero, or into another implementation-defined category.
- __fpclassifyf.fpclassify.02
The fpclassify() macro shall return the value of the number classification macro appropriate to the value of its argument.
- [+]__isinf (3 / 0 / 0)
- __isinf.30
__isinf() has the same specification as isinf() in ISO POSIX (2003), except that the argument type for __isinf() is known to be double.
Generalizes:
- __isinf.isinf.01
- __isinf.isinf.02
- __isinf.isinf.01
The isinf() macro shall determine whether its argument value is an infinity (positive or negative).
- __isinf.isinf.02
The isinf() macro shall return a non-zero value if and only if its argument has an infinite value.
- [+]__isinff (3 / 0 / 0)
- __isinff.30
__isinff() has the same specification as isinf() in ISO POSIX (2003) except that the argument type for __isinff() is known to be float.
Generalizes:
- __isinff.isinf.01
- __isinff.isinf.02
- __isinff.isinf.01
The isinf() macro shall determine whether its argument value is an infinity (positive or negative).
- __isinff.isinf.02
The isinf() macro shall return a non-zero value if and only if its argument has an infinite value.
- [+]__isinfl (3 / 0 / 0)
- __isinfl.30
__isinfl() has the same specification as isinf() in the ISO POSIX (2003), except that the argument type for __isinfl() is known to be long double.
Generalizes:
- __isinfl.isinf.01
- __isinfl.isinf.02
- __isinfl.isinf.01
The isinf() macro shall determine whether its argument value is an infinity (positive or negative).
- __isinfl.isinf.02
The isinf() macro shall return a non-zero value if and only if its argument has an infinite value.
- [+]__isnan (3 / 0 / 0)
- __isnan.30
__isnan() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnan() is known to be double.
Generalizes:
- __isnan.isnan.01
- __isnan.isnan.02
- __isnan.isnan.01
The isnan() macro shall determine whether its argument value is a NaN.
- __isnan.isnan.02
The isnan() macro shall return a non-zero value if and only if its argument has a NaN value.
- [+]__isnanf (3 / 0 / 0)
- __isnanf.30
__isnanf() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnanf() is known to be float.
Generalizes:
- __isnanf.isnan.01
- __isnanf.isnan.02
- __isnanf.isnan.01
The isnan() macro shall determine whether its argument value is a NaN.
- __isnanf.isnan.02
The isnan() macro shall return a non-zero value if and only if its argument has a NaN value.
- [+]__isnanl (3 / 0 / 0)
- __isnanl.30
__isnanl() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnanl() is known to be long double.
Generalizes:
- __isnanl.isnan.01
- __isnanl.isnan.02
- __isnanl.isnan.01
The isnan() macro shall determine whether its argument value is a NaN.
- __isnanl.isnan.02
The isnan() macro shall return a non-zero value if and only if its argument has a NaN value.
- [+]__signbit (3 / 0 / 0)
- __signbit.03
__signbit() has the same specification as signbit() in ISO POSIX (2003), except that the argument type for __signbit() is known to be long double.
Generalizes:
- __signbit.signbit.01
- __signbit.signbit.02
- __signbit.signbit.01
The signbit() macro shall determine whether the sign of its argument value is negative.
- __signbit.signbit.02
The signbit() macro shall return a non-zero value if and only if the sign of its argument value is negative.
- [+]__signbitf (3 / 0 / 0)
- __signbitf.03
__signbitf() has the same specification as signbit() in ISO POSIX (2003), except that the argument type for __signbitf() is known to be float.
Generalizes:
- __signbitf.signbit.01
- __signbitf.signbit.02
- __signbitf.signbit.01
The signbit() macro shall determine whether the sign of its argument value is negative.
- __signbitf.signbit.02
The signbit() macro shall return a non-zero value if and only if the sign of its argument value is negative.
- [+]finite (3 / 0 / 0)
- finite.03
finite() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for finite() is known to be double.
Generalizes:
- finite.isfinite.01
- finite.isfinite.02
- finite.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- finite.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]finitef (3 / 0 / 0)
- finitef.03
finitef() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for finitef() is known to be float.
Generalizes:
- finitef.isfinite.01
- finitef.isfinite.02
- finitef.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- finitef.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]finitel (3 / 0 / 0)
- finitel.03
finitel() has the same specification as isfinite() in ISO POSIX (2003), except that the argument type for finitel() is known to be long double.
Generalizes:
- finitel.isfinite.01
- finitel.isfinite.02
- finitel.isfinite.01
The isfinite() macro shall determine whether its argument has a finite value (zero, subnormal, or normal, and not infinite or NaN).
- finitel.isfinite.02
The isfinite() macro shall return a non-zero value if and only if its argument has a finite value.
- [+]frexp (4 / 4 / 0)
- frexp.01
These functions shall break a floating-point number num into a normalized fraction and an integral power of 2.
- frexp.01.01 (struct)
The integer exponent shall be stored in the int object pointed to by exp.
- frexp.01.02
For finite arguments, these functions shall return the value x, such that x has a magnitude in the interval [?,1) or 0, and num equals x times 2 raised to the power *exp.
- frexp.02
[MX] If num is NaN, a NaN shall be returned, and the value of *exp is unspecified.
- frexp.03
If num is ?0, ?0 shall be returned, and the value of *exp shall be 0.
- frexp.04
If num is ?Inf, num shall be returned, and the value of *exp is unspecified.
- [+]frexpf (4 / 4 / 0)
- frexpf.01
These functions shall break a floating-point number num into a normalized fraction and an integral power of 2.
- frexpf.01.01 (struct)
The integer exponent shall be stored in the int object pointed to by exp.
- frexpf.01.02
For finite arguments, these functions shall return the value x, such that x has a magnitude in the interval [?,1) or 0, and num equals x times 2 raised to the power *exp.
- frexpf.02
[MX] If num is NaN, a NaN shall be returned, and the value of *exp is unspecified.
- frexpf.03
If num is ?0, ?0 shall be returned, and the value of *exp shall be 0.
- frexpf.04
If num is ?Inf, num shall be returned, and the value of *exp is unspecified.
- [+]frexpl (4 / 4 / 0)
- frexpl.01
These functions shall break a floating-point number num into a normalized fraction and an integral power of 2.
- frexpl.01.01 (struct)
The integer exponent shall be stored in the int object pointed to by exp.
- frexpl.01.02
For finite arguments, these functions shall return the value x, such that x has a magnitude in the interval [?,1) or 0, and num equals x times 2 raised to the power *exp.
- frexpl.02
[MX] If num is NaN, a NaN shall be returned, and the value of *exp is unspecified.
- frexpl.03
If num is ?0, ?0 shall be returned, and the value of *exp shall be 0.
- frexpl.04
If num is ?Inf, num shall be returned, and the value of *exp is unspecified.
- [+]ilogb (11 / 5 / 0)
- ilogb.01
These functions shall return the exponent part of their argument x.
Generalizes:
- ilogb.02
- ilogb.03
- ilogb.04
- ilogb.05
- ilogb.06
- ilogb.07
- ilogb.08
- ilogb.09
- ilogb.10.01.01
- ilogb.10.01.02
- ilogb.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ilogb.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ilogb.04
Upon successful completion, these functions shall return the exponent part of x as a signed integer value.
- ilogb.05
If x is 0, [XSI] a domain error shall occur, and the value FP_ILOGB0 shall be returned.
- ilogb.06
If x is ?Inf, [XSI] a domain error shall occur, and the value {INT_MAX} shall be returned.
- ilogb.07
If x is a NaN, [XSI] a domain error shall occur, and the value FP_ILOGBNAN shall be returned.
- ilogb.08
[XSI] If the correct value is greater than {INT_MAX}, {INT_MAX} shall be returned and a domain error shall occur.
- ilogb.09
If the correct value is less than {INT_MIN}, {INT_MIN} shall be returned and a domain error shall occur.
- ilogb.10
These functions shall fail if:
- ilogb.10.01
Domain Error [XSI] The x argument is zero, NaN, or ?Inf, or the correct value is not representable as an integer.
- ilogb.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- ilogb.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]ilogbf (11 / 5 / 0)
- ilogbf.01
These functions shall return the exponent part of their argument x.
Generalizes:
- ilogbf.02
- ilogbf.03
- ilogbf.04
- ilogbf.05
- ilogbf.06
- ilogbf.07
- ilogbf.08
- ilogbf.09
- ilogbf.10.01.01
- ilogbf.10.01.02
- ilogbf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ilogbf.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ilogbf.04
Upon successful completion, these functions shall return the exponent part of x as a signed integer value.
- ilogbf.05
If x is 0, [XSI] a domain error shall occur, and the value FP_ILOGB0 shall be returned.
- ilogbf.06
If x is ?Inf, [XSI] a domain error shall occur, and the value {INT_MAX} shall be returned.
- ilogbf.07
If x is a NaN, [XSI] a domain error shall occur, and the value FP_ILOGBNAN shall be returned.
- ilogbf.08
[XSI] If the correct value is greater than {INT_MAX}, {INT_MAX} shall be returned and a domain error shall occur.
- ilogbf.09
If the correct value is less than {INT_MIN}, {INT_MIN} shall be returned and a domain error shall occur.
- ilogbf.10
These functions shall fail if:
- ilogbf.10.01
Domain Error [XSI] The x argument is zero, NaN, or ?Inf, or the correct value is not representable as an integer.
- ilogbf.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- ilogbf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]ilogbl (11 / 5 / 0)
- ilogbl.01
These functions shall return the exponent part of their argument x.
Generalizes:
- ilogbl.02
- ilogbl.03
- ilogbl.04
- ilogbl.05
- ilogbl.06
- ilogbl.07
- ilogbl.08
- ilogbl.09
- ilogbl.10.01.01
- ilogbl.10.01.02
- ilogbl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ilogbl.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ilogbl.04
Upon successful completion, these functions shall return the exponent part of x as a signed integer value.
- ilogbl.05
If x is 0, [XSI] a domain error shall occur, and the value FP_ILOGB0 shall be returned.
- ilogbl.06
If x is ?Inf, [XSI] a domain error shall occur, and the value {INT_MAX} shall be returned.
- ilogbl.07
If x is a NaN, [XSI] a domain error shall occur, and the value FP_ILOGBNAN shall be returned.
- ilogbl.08
[XSI] If the correct value is greater than {INT_MAX}, {INT_MAX} shall be returned and a domain error shall occur.
- ilogbl.09
If the correct value is less than {INT_MIN}, {INT_MIN} shall be returned and a domain error shall occur.
- ilogbl.10
These functions shall fail if:
- ilogbl.10.01
Domain Error [XSI] The x argument is zero, NaN, or ?Inf, or the correct value is not representable as an integer.
- ilogbl.10.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- ilogbl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- [+]ldexp (14 / 8 / 0)
- ldexp.01
These functions shall compute the quantity x * 2 exp.
- ldexp.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ldexp.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ldexp.04
Upon successful completion, these functions shall return x multiplied by 2, raised to the power exp.
- ldexp.05
If these functions would cause overflow, a range error shall occur and ldexp(), ldexpf(), and ldexpl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x), respectively.
- ldexp.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- ldexp.07
[MX] If x is NaN, a NaN shall be returned.
- ldexp.08
If x is ?0 or ?Inf, x shall be returned.
- ldexp.09
If exp is 0, x shall be returned.
- ldexp.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- ldexp.11
These functions shall fail if:
- ldexp.11.01
Range Error The result overflows.
- ldexp.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexp.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- ldexp.12
These functions may fail if:
- ldexp.12.01
Range Error The result underflows.
- ldexp.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexp.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]ldexpf (14 / 8 / 0)
- ldexpf.01
These functions shall compute the quantity x * 2 exp.
- ldexpf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ldexpf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ldexpf.04
Upon successful completion, these functions shall return x multiplied by 2, raised to the power exp.
- ldexpf.05
If these functions would cause overflow, a range error shall occur and ldexp(), ldexpf(), and ldexpl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x), respectively.
- ldexpf.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- ldexpf.07
[MX] If x is NaN, a NaN shall be returned.
- ldexpf.08
If x is ?0 or ?Inf, x shall be returned.
- ldexpf.09
If exp is 0, x shall be returned.
- ldexpf.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- ldexpf.11
These functions shall fail if:
- ldexpf.11.01
Range Error The result overflows.
- ldexpf.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexpf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- ldexpf.12
These functions may fail if:
- ldexpf.12.01
Range Error The result underflows.
- ldexpf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexpf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]ldexpl (14 / 8 / 0)
- ldexpl.01
These functions shall compute the quantity x * 2 exp.
- ldexpl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- ldexpl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- ldexpl.04
Upon successful completion, these functions shall return x multiplied by 2, raised to the power exp.
- ldexpl.05
If these functions would cause overflow, a range error shall occur and ldexp(), ldexpf(), and ldexpl() shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x), respectively.
- ldexpl.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- ldexpl.07
[MX] If x is NaN, a NaN shall be returned.
- ldexpl.08
If x is ?0 or ?Inf, x shall be returned.
- ldexpl.09
If exp is 0, x shall be returned.
- ldexpl.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- ldexpl.11
These functions shall fail if:
- ldexpl.11.01
Range Error The result overflows.
- ldexpl.11.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexpl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- ldexpl.12
These functions may fail if:
- ldexpl.12.01
Range Error The result underflows.
- ldexpl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- ldexpl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]logb (9 / 5 / 1)
- logb.01
These functions shall compute the exponent of x, which is the integral part of logr |x|, as a signed floating-point value, for non-zero x, where r is the radix of the machine's floating-point arithmetic, which is the value of FLT_RADIX defined in the <float.h> header.
Generalizes:
- logb.02
- logb.03
- logb.04
- logb.05
- logb.06
- logb.07
- logb.08.01.01
- logb.08.01.02
- logb.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- logb.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- logb.04
Upon successful completion, these functions shall return the exponent of x.
- logb.05
If x is ?0, a pole error shall occur and logb(), logbf(), and logbl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- logb.06
[MX] If x is NaN, a NaN shall be returned.
- logb.07
If x is ?Inf, +Inf shall be returned.
- logb.08
These functions shall fail if:
- logb.08.01
Pole Error The value of x is ?0.
- logb.08.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- logb.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]logbf (9 / 5 / 1)
- logbf.01
These functions shall compute the exponent of x, which is the integral part of logr |x|, as a signed floating-point value, for non-zero x, where r is the radix of the machine's floating-point arithmetic, which is the value of FLT_RADIX defined in the <float.h> header.
Generalizes:
- logbf.02
- logbf.03
- logbf.04
- logbf.05
- logbf.06
- logbf.07
- logbf.08.01.01
- logbf.08.01.02
- logbf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- logbf.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- logbf.04
Upon successful completion, these functions shall return the exponent of x.
- logbf.05
If x is ?0, a pole error shall occur and logb(), logbf(), and logbl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- logbf.06
[MX] If x is NaN, a NaN shall be returned.
- logbf.07
If x is ?Inf, +Inf shall be returned.
- logbf.08
These functions shall fail if:
- logbf.08.01
Pole Error The value of x is ?0.
- logbf.08.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- logbf.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]logbl (9 / 5 / 1)
- logbl.01
These functions shall compute the exponent of x, which is the integral part of logr |x|, as a signed floating-point value, for non-zero x, where r is the radix of the machine's floating-point arithmetic, which is the value of FLT_RADIX defined in the <float.h> header.
Generalizes:
- logbl.02
- logbl.03
- logbl.04
- logbl.05
- logbl.06
- logbl.07
- logbl.08.01.01
- logbl.08.01.02
- logbl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- logbl.03
On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- logbl.04
Upon successful completion, these functions shall return the exponent of x.
- logbl.05
If x is ?0, a pole error shall occur and logb(), logbf(), and logbl() shall return -HUGE_VAL, -HUGE_VALF, and -HUGE_VALL, respectively.
- logbl.06
[MX] If x is NaN, a NaN shall be returned.
- logbl.07
If x is ?Inf, +Inf shall be returned.
- logbl.08
These functions shall fail if:
- logbl.08.01
Pole Error The value of x is ?0.
- logbl.08.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- logbl.08.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.
- [+]nextafter (13 / 8 / 2)
- nextafter.01
The nextafter(), nextafterf(), and nextafterl() functions shall compute the next representable floating-point value following x in the direction of y.
Generalizes:
- nextafter.02
- nextafter.03
- nextafter.04
- nextafter.05
- nextafter.06
- nextafter.07
- nextafter.08
- nextafter.09
- nextafter.10.01.01
- nextafter.10.01.02
- nextafter.10.02.01
- nextafter.10.02.02
- nextafter.02
The nextafter(), nextafterf(), and nextafterl() functions shall return y if x equals y.
- nextafter.03
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nextafter.04
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nextafter.05
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nextafter.06
If x== y, y (of the type x) shall be returned.
- nextafter.07
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nextafter.08
[MX] If x or y is NaN, a NaN shall be returned.
- nextafter.09
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nextafter.10
These functions shall fail if:
- nextafter.10.01
Range Error The correct value overflows.
- nextafter.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafter.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nextafter.10.02
Range Error [MX] The correct value is subnormal or underflows.
- nextafter.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafter.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]nextafterf (13 / 8 / 2)
- nextafterf.01
The nextafter(), nextafterf(), and nextafterl() functions shall compute the next representable floating-point value following x in the direction of y.
Generalizes:
- nextafterf.02
- nextafterf.03
- nextafterf.04
- nextafterf.05
- nextafterf.06
- nextafterf.07
- nextafterf.08
- nextafterf.09
- nextafterf.10.01.01
- nextafterf.10.01.02
- nextafterf.10.02.01
- nextafterf.10.02.02
- nextafterf.02
The nextafter(), nextafterf(), and nextafterl() functions shall return y if x equals y.
- nextafterf.03
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nextafterf.04
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nextafterf.05
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nextafterf.06
If x== y, y (of the type x) shall be returned.
- nextafterf.07
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nextafterf.08
[MX] If x or y is NaN, a NaN shall be returned.
- nextafterf.09
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nextafterf.10
These functions shall fail if:
- nextafterf.10.01
Range Error The correct value overflows.
- nextafterf.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafterf.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nextafterf.10.02
Range Error [MX] The correct value is subnormal or underflows.
- nextafterf.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafterf.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]nextafterl (13 / 8 / 2)
- nextafterl.01
The nextafter(), nextafterf(), and nextafterl() functions shall compute the next representable floating-point value following x in the direction of y.
Generalizes:
- nextafterl.02
- nextafterl.03
- nextafterl.04
- nextafterl.05
- nextafterl.06
- nextafterl.07
- nextafterl.08
- nextafterl.09
- nextafterl.10.01.01
- nextafterl.10.01.02
- nextafterl.10.02.01
- nextafterl.10.02.02
- nextafterl.02
The nextafter(), nextafterf(), and nextafterl() functions shall return y if x equals y.
- nextafterl.03
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nextafterl.04
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nextafterl.05
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nextafterl.06
If x== y, y (of the type x) shall be returned.
- nextafterl.07
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nextafterl.08
[MX] If x or y is NaN, a NaN shall be returned.
- nextafterl.09
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nextafterl.10
These functions shall fail if:
- nextafterl.10.01
Range Error The correct value overflows.
- nextafterl.10.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafterl.10.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nextafterl.10.02
Range Error [MX] The correct value is subnormal or underflows.
- nextafterl.10.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nextafterl.10.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]nexttoward (12 / 7 / 2)
- nexttoward.01
The nexttoward(), nexttowardf(), and nexttowardl() functions shall be equivalent to the corresponding nextafter() functions, except that the second parameter shall have type long double and the functions shall return y converted to the type of the function if x equals y.
Generalizes:
- nexttoward.02
- nexttoward.03
- nexttoward.04
- nexttoward.05
- nexttoward.06
- nexttoward.07
- nexttoward.08
- nexttoward.09.01.01
- nexttoward.09.01.02
- nexttoward.09.02.01
- nexttoward.09.02.02
- nexttoward.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nexttoward.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nexttoward.04
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nexttoward.05
If x== y, y (of the type x) shall be returned.
- nexttoward.06
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nexttoward.07
[MX] If x or y is NaN, a NaN shall be returned.
- nexttoward.08
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nexttoward.09
These functions shall fail if:
- nexttoward.09.01
Range Error The correct value overflows.
- nexttoward.09.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttoward.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nexttoward.09.02
Range Error [MX] The correct value is subnormal or underflows.
- nexttoward.09.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttoward.09.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]nexttowardf (12 / 7 / 2)
- nexttowardf.01
The nexttoward(), nexttowardf(), and nexttowardl() functions shall be equivalent to the corresponding nextafter() functions, except that the second parameter shall have type long double and the functions shall return y converted to the type of the function if x equals y.
Generalizes:
- nexttowardf.02
- nexttowardf.03
- nexttowardf.04
- nexttowardf.05
- nexttowardf.06
- nexttowardf.07
- nexttowardf.08
- nexttowardf.09.01.01
- nexttowardf.09.01.02
- nexttowardf.09.02.01
- nexttowardf.09.02.02
- nexttowardf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nexttowardf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nexttowardf.04
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nexttowardf.05
If x== y, y (of the type x) shall be returned.
- nexttowardf.06
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nexttowardf.07
[MX] If x or y is NaN, a NaN shall be returned.
- nexttowardf.08
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nexttowardf.09
These functions shall fail if:
- nexttowardf.09.01
Range Error The correct value overflows.
- nexttowardf.09.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttowardf.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nexttowardf.09.02
Range Error [MX] The correct value is subnormal or underflows.
- nexttowardf.09.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttowardf.09.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]nexttowardl (12 / 7 / 2)
- nexttowardl.01
The nexttoward(), nexttowardf(), and nexttowardl() functions shall be equivalent to the corresponding nextafter() functions, except that the second parameter shall have type long double and the functions shall return y converted to the type of the function if x equals y.
Generalizes:
- nexttowardl.02
- nexttowardl.03
- nexttowardl.04
- nexttowardl.05
- nexttowardl.06
- nexttowardl.07
- nexttowardl.08
- nexttowardl.09.01.01
- nexttowardl.09.01.02
- nexttowardl.09.02.01
- nexttowardl.09.02.02
- nexttowardl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- nexttowardl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- nexttowardl.04
Upon successful completion, these functions shall return the next representable floating-point value following x in the direction of y.
- nexttowardl.05
If x== y, y (of the type x) shall be returned.
- nexttowardl.06
If x is finite and the correct function value would overflow, a range error shall occur and ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (with the same sign as x) shall be returned as appropriate for the return type of the function.
- nexttowardl.07
[MX] If x or y is NaN, a NaN shall be returned.
- nexttowardl.08
If x!= y and the correct function value is subnormal, zero, or underflows, a range error shall occur, and either the correct function value (if representable) or 0.0 shall be returned.
- nexttowardl.09
These functions shall fail if:
- nexttowardl.09.01
Range Error The correct value overflows.
- nexttowardl.09.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttowardl.09.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- nexttowardl.09.02
Range Error [MX] The correct value is subnormal or underflows.
- nexttowardl.09.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- nexttowardl.09.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalb (19 / 13 / 2)
- scalb.01
The scalb() function shall compute x*rn, where r is the radix of the machine's floating-point arithmetic. When r is 2, scalb() shall be equivalent to ldexp().
Generalizes:
- scalb.02
- scalb.03
- scalb.04
- scalb.05
- scalb.06
- scalb.07
- scalb.08
- scalb.09
- scalb.10
- scalb.11
- scalb.12
- scalb.13
- scalb.14.01.01
- scalb.14.01.02
- scalb.14.02.01
- scalb.14.02.02
- scalb.15.01.01
- scalb.15.02
- scalb.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalb.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalb.04
Upon successful completion, the scalb() function shall return x*rn.
- scalb.05
If x or n is NaN, a NaN shall be returned.
- scalb.06
If n is zero, x shall be returned.
- scalb.07
If x is ?Inf and n is not -Inf, x shall be returned.
- scalb.08
If x is ?0 and n is not +Inf, x shall be returned.
- scalb.09
If x is ?0 and n is +Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalb.10
If x is ?Inf and n is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalb.11
If the result would cause an overflow, a range error shall occur and ? HUGE_VAL (according to the sign of x) shall be returned.
- scalb.12
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalb.13
If the correct value would cause underflow, and is not representable, a range error may occur, and 0.0 shall be returned.
- scalb.14
The scalb() function shall fail if:
- scalb.14.01
Domain Error If x is zero and n is +Inf, or x is Inf and n is -Inf.
- scalb.14.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- scalb.14.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- scalb.14.02
Range Error The result would overflow.
- scalb.14.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalb.14.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalb.15
The scalb() function may fail if:
- scalb.15.01
Range Error The result underflows.
- scalb.15.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalb.15.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbf (19 / 13 / 2)
- scalbf.01
The scalb() function shall compute x*rn, where r is the radix of the machine's floating-point arithmetic. When r is 2, scalb() shall be equivalent to ldexp().
Generalizes:
- scalbf.02
- scalbf.03
- scalbf.04
- scalbf.05
- scalbf.06
- scalbf.07
- scalbf.08
- scalbf.09
- scalbf.10
- scalbf.11
- scalbf.12
- scalbf.13
- scalbf.14.01.01
- scalbf.14.01.02
- scalbf.14.02.01
- scalbf.14.02.02
- scalbf.15.01.01
- scalbf.15.02
- scalbf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbf.04
Upon successful completion, the scalb() function shall return x*rn.
- scalbf.05
If x or n is NaN, a NaN shall be returned.
- scalbf.06
If n is zero, x shall be returned.
- scalbf.07
If x is ?Inf and n is not -Inf, x shall be returned.
- scalbf.08
If x is ?0 and n is not +Inf, x shall be returned.
- scalbf.09
If x is ?0 and n is +Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalbf.10
If x is ?Inf and n is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalbf.11
If the result would cause an overflow, a range error shall occur and ? HUGE_VAL (according to the sign of x) shall be returned.
- scalbf.12
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbf.13
If the correct value would cause underflow, and is not representable, a range error may occur, and 0.0 shall be returned.
- scalbf.14
The scalb() function shall fail if:
- scalbf.14.01
Domain Error If x is zero and n is +Inf, or x is Inf and n is -Inf.
- scalbf.14.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- scalbf.14.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- scalbf.14.02
Range Error The result would overflow.
- scalbf.14.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbf.14.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbf.15
The scalb() function may fail if:
- scalbf.15.01
Range Error The result underflows.
- scalbf.15.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbf.15.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbl (19 / 13 / 2)
- scalbl.01
The scalb() function shall compute x*rn, where r is the radix of the machine's floating-point arithmetic. When r is 2, scalb() shall be equivalent to ldexp().
Generalizes:
- scalbl.02
- scalbl.03
- scalbl.04
- scalbl.05
- scalbl.06
- scalbl.07
- scalbl.08
- scalbl.09
- scalbl.10
- scalbl.11
- scalbl.12
- scalbl.13
- scalbl.14.01.01
- scalbl.14.01.02
- scalbl.14.02.01
- scalbl.14.02.02
- scalbl.15.01.01
- scalbl.15.02
- scalbl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbl.04
Upon successful completion, the scalb() function shall return x*rn.
- scalbl.05
If x or n is NaN, a NaN shall be returned.
- scalbl.06
If n is zero, x shall be returned.
- scalbl.07
If x is ?Inf and n is not -Inf, x shall be returned.
- scalbl.08
If x is ?0 and n is not +Inf, x shall be returned.
- scalbl.09
If x is ?0 and n is +Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalbl.10
If x is ?Inf and n is -Inf, a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned.
- scalbl.11
If the result would cause an overflow, a range error shall occur and ? HUGE_VAL (according to the sign of x) shall be returned.
- scalbl.12
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbl.13
If the correct value would cause underflow, and is not representable, a range error may occur, and 0.0 shall be returned.
- scalbl.14
The scalb() function shall fail if:
- scalbl.14.01
Domain Error If x is zero and n is +Inf, or x is Inf and n is -Inf.
- scalbl.14.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM].
- scalbl.14.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.
- scalbl.14.02
Range Error The result would overflow.
- scalbl.14.02.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbl.14.02.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbl.15
The scalb() function may fail if:
- scalbl.15.01
Range Error The result underflows.
- scalbl.15.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbl.15.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbln (14 / 9 / 1)
- scalbln.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
- scalbln.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbln.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbln.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalbln.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalbln.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalbln.07
[MX] If x is NaN, a NaN shall be returned.
- scalbln.08
If x is ?0 or ?Inf, x shall be returned.
- scalbln.09
If n is 0, x shall be returned.
- scalbln.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbln.11
These functions shall fail if:
- scalbln.11.01
Range Error The result overflows.
- scalbln.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbln.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbln.12
These functions may fail if:
- scalbln.12.01
Range Error The result underflows.
- scalbln.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbln.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalblnf (14 / 9 / 1)
- scalblnf.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
- scalblnf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalblnf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalblnf.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalblnf.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalblnf.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalblnf.07
[MX] If x is NaN, a NaN shall be returned.
- scalblnf.08
If x is ?0 or ?Inf, x shall be returned.
- scalblnf.09
If n is 0, x shall be returned.
- scalblnf.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalblnf.11
These functions shall fail if:
- scalblnf.11.01
Range Error The result overflows.
- scalblnf.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalblnf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalblnf.12
These functions may fail if:
- scalblnf.12.01
Range Error The result underflows.
- scalblnf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalblnf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalblnl (14 / 9 / 1)
- scalblnl.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
- scalblnl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalblnl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalblnl.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalblnl.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalblnl.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalblnl.07
[MX] If x is NaN, a NaN shall be returned.
- scalblnl.08
If x is ?0 or ?Inf, x shall be returned.
- scalblnl.09
If n is 0, x shall be returned.
- scalblnl.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalblnl.11
These functions shall fail if:
- scalblnl.11.01
Range Error The result overflows.
- scalblnl.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalblnl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalblnl.12
These functions may fail if:
- scalblnl.12.01
Range Error The result underflows.
- scalblnl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalblnl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbn (14 / 9 / 1)
- scalbn.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
Generalizes:
- scalbn.02
- scalbn.03
- scalbn.04
- scalbn.05
- scalbn.06
- scalbn.07
- scalbn.08
- scalbn.09
- scalbn.10
- scalbn.11.01.01
- scalbn.11.01.02
- scalbn.12.01.01
- scalbn.12.01.02
- scalbn.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbn.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbn.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalbn.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalbn.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalbn.07
[MX] If x is NaN, a NaN shall be returned.
- scalbn.08
If x is ?0 or ?Inf, x shall be returned.
- scalbn.09
If n is 0, x shall be returned.
- scalbn.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbn.11
These functions shall fail if:
- scalbn.11.01
Range Error The result overflows.
- scalbn.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbn.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbn.12
These functions may fail if:
- scalbn.12.01
Range Error The result underflows.
- scalbn.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbn.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbnf (14 / 9 / 1)
- scalbnf.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
Generalizes:
- scalbnf.02
- scalbnf.03
- scalbnf.04
- scalbnf.05
- scalbnf.06
- scalbnf.07
- scalbnf.08
- scalbnf.09
- scalbnf.10
- scalbnf.11.01.01
- scalbnf.11.01.02
- scalbnf.12.01.01
- scalbnf.12.01.02
- scalbnf.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbnf.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbnf.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalbnf.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalbnf.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalbnf.07
[MX] If x is NaN, a NaN shall be returned.
- scalbnf.08
If x is ?0 or ?Inf, x shall be returned.
- scalbnf.09
If n is 0, x shall be returned.
- scalbnf.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbnf.11
These functions shall fail if:
- scalbnf.11.01
Range Error The result overflows.
- scalbnf.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbnf.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbnf.12
These functions may fail if:
- scalbnf.12.01
Range Error The result underflows.
- scalbnf.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbnf.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]scalbnl (14 / 9 / 1)
- scalbnl.01
These functions shall compute x * FLT_RADIX n efficiently, not normally by computing FLT_RADIXn explicitly.
Generalizes:
- scalbnl.02
- scalbnl.03
- scalbnl.04
- scalbnl.05
- scalbnl.06
- scalbnl.07
- scalbnl.08
- scalbnl.09
- scalbnl.10
- scalbnl.11.01.01
- scalbnl.11.01.02
- scalbnl.12.01.01
- scalbnl.12.01.02
- scalbnl.02
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions.
- scalbnl.03
On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
- scalbnl.04
Upon successful completion, these functions shall return x * FLT_RADIX n.
- scalbnl.05
If the result would cause overflow, a range error shall occur and these functions shall return ?HUGE_VAL, ?HUGE_VALF, and ?HUGE_VALL (according to the sign of x) as appropriate for the return type of the function.
- scalbnl.06
If the correct value would cause underflow, and is not representable, a range error may occur, and [MX] either 0.0 (if supported), or an implementation-defined value shall be returned.
- scalbnl.07
[MX] If x is NaN, a NaN shall be returned.
- scalbnl.08
If x is ?0 or ?Inf, x shall be returned.
- scalbnl.09
If n is 0, x shall be returned.
- scalbnl.10
If the correct value would cause underflow, and is representable, a range error may occur and the correct value shall be returned.
- scalbnl.11
These functions shall fail if:
- scalbnl.11.01
Range Error The result overflows.
- scalbnl.11.01.01 (failed)
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbnl.11.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.
- scalbnl.12
These functions may fail if:
- scalbnl.12.01
Range Error The result underflows.
- scalbnl.12.01.01
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE].
- scalbnl.12.01.02
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.
- [+]significand (7 / 6 / 0)
- significand.01
The significand(), significandf(), significandl() functions return the mantissa of x scaled to the range [1,2).
- significand.02
The significand(), significandf(), significandl() functions are equivalent to the corresponding scalb(x, (double) -ilogb(x)), scalbf(x, (float) -ilogbf(x)), scalbl(x, (long double) -ilogbl(x)).
- significand.03
Functions shall return sig, where x := sig* 2**n
- significand.04
with 1 <= |sig| < 2.
- significand.05
if x is ?0, ?0 shall be returned.
- significand.06
if x is ?Inf, ?Inf shall be returned.
- significand.07
If x is NaN, a NaN shall be returned.
- [+]significandf (8 / 6 / 0)
- significandf.01
The significand(), significandf(), significandl() functions return the mantissa of x scaled to the range [1,2).
Generalizes:
- significandf.02
- significandf.03
- significandf.04
- significandf.05
- significandf.06
- significandf.07
- significandf.08
- significandf.02
The significand(), significandf(), significandl() functions are equivalent to the corresponding scalb(x, (double) -ilogb(x)), scalbf(x, (float) -ilogbf(x)), scalbl(x, (long double) -ilogbl(x)).
- significandf.03
The significandf() function is a single-precision version of significand().
- significandf.04
Functions shall return sig, where x := sig* 2**n
- significandf.05
with 1 <= |sig| < 2.
- significandf.06
if x is ?0, ?0 shall be returned.
- significandf.07
if x is ?Inf, ?Inf shall be returned.
- significandf.08
If x is NaN, a NaN shall be returned.
- [+]significandl (8 / 6 / 0)
- significandl.01
The significand(), significandf(), significandl() functions return the mantissa of x scaled to the range [1,2).
Generalizes:
- significandl.02
- significandl.03
- significandl.04
- significandl.05
- significandl.06
- significandl.07
- significandl.08
- significandl.02
The significand(), significandf(), significandl() functions are equivalent to the corresponding scalb(x, (double) -ilogb(x)), scalbf(x, (float) -ilogbf(x)), scalbl(x, (long double) -ilogbl(x)).
- significandl.03
The significandl() function is a double-precision version of significand().
- significandl.04
Functions shall return sig, where x := sig* 2**n
- significandl.05
with 1 <= |sig| < 2.
- significandl.06
if x is ?0, ?0 shall be returned.
- significandl.07
if x is ?Inf, ?Inf shall be returned.
- significandl.08
If x is NaN, a NaN shall be returned.
- [+]util.format.fmtmsg (41 / 11 / 0)
- [+]fmtmsg (41 / 11 / 0)
- fmtmsg.01
The fmtmsg() function shall display messages in a specified format instead of the traditional printf() function.
- fmtmsg.02
Based on a message's classification component, fmtmsg() shall write a formatted message either to standard error, to the console, or to both.
- fmtmsg.03
A formatted message consists of up to five components as defined below.
Generalizes:
- fmtmsg.05.01
- fmtmsg.05.05.01
- fmtmsg.05.06.01
- fmtmsg.05.06.02
- fmtmsg.05.07.01
- fmtmsg.05.07.02
- fmtmsg.05.07.03
- fmtmsg.05.08.01
- fmtmsg.05.08.02
- fmtmsg.05.09
- fmtmsg.06.01
- fmtmsg.06.02
- fmtmsg.07.01.01
- fmtmsg.07.01.02
- fmtmsg.07.01.03
- fmtmsg.07.01.04
- fmtmsg.07.01.05
- fmtmsg.08.01
- fmtmsg.08.02
- fmtmsg.09.01
- fmtmsg.09.02
- fmtmsg.09.03
- fmtmsg.10.01
- fmtmsg.10.02
- fmtmsg.04
The component classification is not part of a message displayed to the user, but defines the source of the message and directs the display of the formatted message.
- fmtmsg.05
classification
- fmtmsg.05.01
Contains the sum of identifying values constructed from the constants defined below.
- fmtmsg.05.05
Major Classifications
- fmtmsg.05.05.01
Identifies the source of the condition. Identifiers are: MM_HARD (hardware), MM_SOFT (software), and MM_FIRM (firmware).
- fmtmsg.05.06
Message Source Subclassifications
- fmtmsg.05.06.01
Identifies the type of software in which the problem is detected.
- fmtmsg.05.06.02
Identifiers are: MM_APPL (application), MM_UTIL (utility), and MM_OPSYS (operating system).
- fmtmsg.05.07
Display Subclassifications
- fmtmsg.05.07.01
Indicates where the message is to be displayed.
- fmtmsg.05.07.02
Identifiers are: MM_PRINT to display the message on the standard error stream, MM_CONSOLE to display the message on the system console.
- fmtmsg.05.07.03
One or both identifiers may be used.
- fmtmsg.05.08
Status Subclassifications
- fmtmsg.05.08.01
Indicates whether the application can recover from the condition.
- fmtmsg.05.08.02
Identifiers are: MM_RECOVER (recoverable) and MM_NRECOV (non-recoverable).
- fmtmsg.05.09
An additional identifier, MM_NULLMC, indicates that no classification component is supplied for the message.
- app.fmtmsg.05.02
Any one identifier from a subclass may be used in combination with a single identifier from a different subclass.
- app.fmtmsg.05.03
Two or more identifiers from the same subclass should not be used together, with the exception of identifiers from the display subclass.
- app.fmtmsg.05.04
Both display subclass identifiers may be used so that messages can be displayed to both standard error and the system console.
- app.fmtmsg.06.03
The first field is up to 10 bytes, the second is up to 14 bytes.
- fmtmsg.06
label
- fmtmsg.06.01
Identifies the source of the message.
- fmtmsg.06.02
The format is two fields separated by a colon.
- fmtmsg.07
severity
- fmtmsg.07.01
Indicates the seriousness of the condition. Identifiers for the levels of severity are:
- fmtmsg.07.01.01
MM_HALT Indicates that the application has encountered a severe fault and is halting. Produces the string "HALT".
- fmtmsg.07.01.02
MM_ERROR Indicates that the application has detected a fault. Produces the string "ERROR".
- fmtmsg.07.01.03
MM_WARNING Indicates a condition that is out of the ordinary, that might be a problem, and should be watched. Produces the string "WARNING".
- fmtmsg.07.01.04
MM_INFO Provides information about a condition that is not in error. Produces the string "INFO".
- fmtmsg.07.01.05
MM_NOSEV Indicates that no severity level is supplied for the message.
- fmtmsg.08
text
- fmtmsg.08.01
Describes the error condition that produced the message.
- fmtmsg.08.02
The character string is not limited to a specific size.
- app.fmtmsg.08.03
If the character string is empty, then the text produced is unspecified.
- fmtmsg.09
action
- fmtmsg.09.01
Describes the first step to be taken in the error-recovery process.
- fmtmsg.09.02
The fmtmsg() function precedes the action string with the prefix: "TO FIX:".
- fmtmsg.09.03
The action string is not limited to a specific size.
- fmtmsg.10
tag
- fmtmsg.10.01
An identifier that references on-line documentation for the message.
- fmtmsg.10.02
Suggested usage is that tag includes the label and a unique identifying number.
- fmtmsg.11
The MSGVERB environment variable (for message verbosity) shall determine for fmtmsg() which message components it is to select when writing messages to standard error.
- fmtmsg.12
The value of MSGVERB shall be a colon-separated list of optional keywords.
- fmtmsg.13
Valid keywords are: label, severity, text, action, and tag.
- fmtmsg.14
If MSGVERB contains a keyword for a component and the component's value is not the component's null value, fmtmsg() shall include that component in the message when writing the message to standard error.
- fmtmsg.15
If MSGVERB does not include a keyword for a message component, that component shall not be included in the display of the message.
- fmtmsg.16
The keywords may appear in any order.
- fmtmsg.17
If MSGVERB is not defined, if its value is the null string, if its value is not of the correct format, or if it contains keywords other than the valid ones listed above, fmtmsg() shall select all components.
- fmtmsg.18
MSGVERB shall determine which components are selected for display to standard error.
- fmtmsg.19
ll message components shall be included in console messages.
- fmtmsg.20
The fmtmsg() function shall return one of the following values:
- fmtmsg.20.01
MM_OK The function succeeded.
- fmtmsg.20.02
MM_NOTOK The function failed completely.
- fmtmsg.20.03
MM_NOMSG The function was unable to generate a message on standard error, but otherwise succeeded.
- fmtmsg.20.04
MM_NOCON The function was unable to generate a console message, but otherwise succeeded.
- [+]util.format.money (25 / 3 / 0)
- [+]strfmon (25 / 3 / 0)
- strfmon.01
The strfmon() function shall place characters into the array pointed to by s as controlled by the string pointed to by format.
Generalizes:
- strfmon.02
- strfmon.03.01
- strfmon.03.02
- strfmon.05
- strfmon.conversion.01
- strfmon.conversion.02
- strfmon.conversion.03
- strfmon.error.01
- strfmon.flags.01
- strfmon.flags.02
- strfmon.flags.03
- strfmon.flags.04
- strfmon.flags.05
- strfmon.locale.01
- strfmon.lprecision.01
- strfmon.lprecision.02
- strfmon.lprecision.03
- strfmon.lprecision.04
- strfmon.lprecision.05
- strfmon.lprecision.06
- strfmon.ret.01
- strfmon.ret.02
- strfmon.rprecision
- strfmon.width
- strfmon.02
No more than maxsize bytes are placed into the array.
- strfmon.03
The format is a character string, beginning and ending in its initial state, if any, that contains two types of objects:
- strfmon.03.01
plain characters, which are simply copied to the output stream
- strfmon.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments which are converted and formatted.
- app.strfmon.04
The results are undefined if there are insufficient arguments for the format.
- strfmon.05
If the format is exhausted while arguments remain, the excess arguments are simply ignored.
- app.strfmon.06
The application shall ensure that a conversion specification consists of the following sequence:A '%' characterOptional flagsOptional field widthOptional left precisionOptional right precisionA required conversion specifier character that determines the conversion to be performed
- strfmon.conversion
The conversion specifier characters and their meanings are:
- strfmon.conversion.01
i The double argument is formatted according to the locale's international currency format (for example, in the U.S.: USD 1,234.56). If the argument is ?Inf or NaN, the result of the conversion is unspecified.
- strfmon.conversion.02
n The double argument is formatted according to the locale's national currency format (for example, in the U.S.: $1,234.56). If the argument is ?Inf or NaN, the result of the conversion is unspecified.
- strfmon.conversion.03
% Convert to a '%' ; no argument is converted. The entire conversion specification shall be %%.
- strfmon.error
The strfmon() function shall fail if:
- strfmon.error.01
[E2BIG] Conversion stopped due to lack of space in the buffer.
- strfmon.flags
One or more of the following optional flags can be specified to control the conversion:
- strfmon.flags.01
=f An '=' followed by a single character f which is used as the numeric fill character. In order to work with precision or width counts, the fill character shall be a single byte character; if not, the behavior is undefined. The default numeric fill character is the <space>. This flag does not affect field width filling which always uses the <space>. This flag is ignored unless a left precision (see below) is specified.
- strfmon.flags.02
^ Do not format the currency amount with grouping characters. The default is to insert the grouping characters if defined for the current locale.
- strfmon.flags.03
+ or ( Specify the style of representing positive and negative currency amounts. Only one of '+' or '(' may be specified. If '+' is specified, the locale's equivalent of '+' and '-' are used (for example, in the U.S., the empty string if positive and '-' if negative). If '(' is specified, negative amounts are enclosed within parentheses. If neither flag is specified, the '+' style is used.
- strfmon.flags.04
! Suppress the currency symbol from the output conversion.
- strfmon.flags.05
- Specify the alignment. If this flag is present the result of the conversion is left-justified (padded to the right) rather than right-justified. This flag shall be ignored unless a field width (see below) is specified.
- strfmon.locale.01
The LC_MONETARY category of the program's locale affects the behavior of this function including the monetary radix character (which may be different from the numeric radix character affected by the LC_NUMERIC category), the grouping separator, the currency symbols, and formats. The international currency symbol should be conformant with the ISO 4217:2001 standard.
- app.strfmon.locale.02
If the value of maxsize is greater than {SSIZE_MAX}, the result is implementation-defined.
- strfmon.lprecision
#n
- strfmon.lprecision.01
A '#' followed by a decimal digit string n specifying a maximum number of digits expected to be formatted to the left of the radix character. This option can be used to keep the formatted output from multiple calls to the strfmon() function aligned in the same columns. It can also be used to fill unused positions with a special character as in "$***123.45". This option causes an amount to be formatted as if it has the number of digits specified by n.
- strfmon.lprecision.02
If more than n digit positions are required, this conversion specification is ignored.
- strfmon.lprecision.03
Digit positions in excess of those actually required are filled with the numeric fill character (see the =f flag above).
- strfmon.lprecision.04
If grouping has not been suppressed with the '^' flag, and it is defined for the current locale, grouping separators are inserted before the fill characters (if any) are added.
- strfmon.lprecision.05
Grouping separators are not applied to fill characters even if the fill character is a digit.
- strfmon.lprecision.06
To ensure alignment, any characters appearing before or after the number in the formatted output such as currency or sign symbols are padded as necessary with <space>s to make their positive and negative formats an equal length.
- strfmon.ret.01
If the total number of resulting bytes including the terminating null byte is not more than maxsize, strfmon() shall return the number of bytes placed into the array pointed to by s, not including the terminating null byte.
- strfmon.ret.02
Otherwise, -1 shall be returned, the contents of the array are unspecified, and errno shall be set to indicate the error.
- strfmon.rprecision
.p A period followed by a decimal digit string p specifying the number of digits after the radix character. If the value of the right precision p is 0, no radix character appears. If a right precision is not included, a default specified by the current locale is used. The amount being formatted is rounded to the specified number of digits prior to formatting.
- strfmon.width
w A decimal digit string w specifying a minimum field width in bytes in which the result of the conversion is right-justified (or left-justified if the flag '-' is specified). The default is 0.
- [+]util.format.printf (629 / 555 / 0)
- [+]asprintf (58 / 52 / 0)
- asprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- asprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- asprintf.03.01
ordinary characters, which are simply copied to the output stream
- asprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.asprintf.03
The results are undefined if there are insufficient arguments for the format.
- asprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.asprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- app.asprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- asprintf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- asprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- asprintf.06
In addition, all forms of fprintf() may fail if:
- asprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- asprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.asprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- asprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- asprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- asprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- asprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.asprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.asprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- asprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- asprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- asprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- asprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- asprintf.11.04
An optional length modifier that specifies the size of the argument.
- asprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- asprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- asprintf.12.01
In this case an argument of type int supplies the field width or precision.
- asprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- asprintf.12.03
A negative precision is taken as if the precision were omitted.
- asprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.asprintf.13
The flag characters and their meanings are:
- app.asprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.asprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.asprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- asprintf.13
The flag characters and their meanings are:
- asprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- asprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- asprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- asprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- asprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- asprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- asprintf.14
The length modifiers and their meanings are:
- asprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- asprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- asprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- asprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- asprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- asprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- asprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- asprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.asprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- asprintf.15
The conversion specifiers and their meanings are:
- asprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- asprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- asprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- asprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- asprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- asprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- asprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- asprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- asprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- asprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- asprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- asprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- asprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- asprintf.15.14
C [XSI] Equivalent to lc.
- asprintf.15.15
S [XSI] Equivalent to ls.
- asprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.asprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.asprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.asprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- asprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- asprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- asprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- asprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- asprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- asprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- asprintf.30
The asprintf() function shall behave as sprintf(), except that the output string shall be dynamically allocated space of sufficient length to hold the resulting string.
- asprintf.31
The address of this dynamically allocated string shall be stored in the location referenced by ptr.
- [+]fprintf (57 / 50 / 0)
- fprintf.01
The fprintf() function shall place output on the named output stream.
- fprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- fprintf.03.01
ordinary characters, which are simply copied to the output stream
- fprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.fprintf.03
The results are undefined if there are insufficient arguments for the format.
- app.fprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- fprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.fprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- fprintf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- fprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.fprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- fprintf.06
In addition, all forms of fprintf() may fail if:
- fprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- fprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- fprintf.07
The printf() and fprintf() functions may fail if:
- fprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- fprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- fprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- fprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- fprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- fprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- fprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- fprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- fprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- fprintf.11.04
An optional length modifier that specifies the size of the argument.
- fprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.fprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.fprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- fprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- fprintf.12.01
In this case an argument of type int supplies the field width or precision.
- fprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- fprintf.12.03
A negative precision is taken as if the precision were omitted.
- fprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.fprintf.13
The flag characters and their meanings are:
- app.fprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.fprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.fprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- fprintf.13
The flag characters and their meanings are:
- fprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- fprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- fprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- fprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- fprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- fprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- fprintf.14
The length modifiers and their meanings are:
- fprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- fprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- fprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- fprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- fprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- fprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- fprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- fprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.fprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- app.fprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.fprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.fprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- fprintf.15
The conversion specifiers and their meanings are:
- fprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- fprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- fprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- fprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- fprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- fprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- fprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- fprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- fprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- fprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- fprintf.15.14
C [XSI] Equivalent to lc.
- fprintf.15.15
S [XSI] Equivalent to ls.
- fprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- fprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- fprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- fprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- fprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- fprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- fprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]printf (57 / 50 / 0)
- printf.01
The printf() function shall place output on the standard output stream stdout.
- printf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- printf.03.01
ordinary characters, which are simply copied to the output stream
- printf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.printf.03
The results are undefined if there are insufficient arguments for the format.
- printf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.printf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- printf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- printf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.printf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.printf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- printf.06
In addition, all forms of fprintf() may fail if:
- printf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- printf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- printf.07
The printf() and fprintf() functions may fail if:
- printf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- printf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- printf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- printf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- printf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.printf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.printf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- printf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- printf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- printf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- printf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- printf.11.04
An optional length modifier that specifies the size of the argument.
- printf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- printf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- printf.12.01
In this case an argument of type int supplies the field width or precision.
- printf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- printf.12.03
A negative precision is taken as if the precision were omitted.
- printf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- printf.13
The flag characters and their meanings are:
- printf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- printf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- printf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- printf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- printf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- printf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.printf.13
The flag characters and their meanings are:
- app.printf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.printf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.printf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- printf.14
The length modifiers and their meanings are:
- printf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- printf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- printf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- printf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- printf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- printf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- printf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- printf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.printf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- printf.15
The conversion specifiers and their meanings are:
- printf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- printf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- printf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- printf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- printf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- printf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- printf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- printf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- printf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- printf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- printf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- printf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- printf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- printf.15.14
C [XSI] Equivalent to lc.
- printf.15.15
S [XSI] Equivalent to ls.
- printf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.printf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.printf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.printf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- printf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- printf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- printf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- printf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- printf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- printf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]snprintf (59 / 50 / 0)
- app.snprintf.01
it is the user's responsibility to ensure that enough space is available
- snprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- app.snprintf.02
If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined.
- snprintf.02
The snprintf() function shall be equivalent to sprintf(), with the addition of the n argument which states the size of the buffer referred to by s.
- snprintf.02.01
If n is zero, nothing shall be written and s may be a null pointer.
- snprintf.02.02
Otherwise, output bytes beyond the n-1st shall be discarded instead of being written to the array, and a null byte is written at the end of the bytes actually written into the array.
- app.snprintf.03
The results are undefined if there are insufficient arguments for the format.
- snprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- snprintf.03.01
ordinary characters, which are simply copied to the output stream
- snprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- snprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.snprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- snprintf.05.01
Upon successful completion, the snprintf() function shall return the number of bytes that would be written to s had n been sufficiently large excluding the terminating null byte.
If the value of n is zero on a call to snprintf(), nothing shall be written, the number of bytes that would have been written had n been sufficiently large excluding the terminating null shall be returned, and s may be a null pointer.
- snprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.snprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- snprintf.06
In addition, all forms of fprintf() may fail if:
- snprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- snprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.snprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- snprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- snprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- snprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- snprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- snprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- snprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- snprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- snprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- snprintf.11.04
An optional length modifier that specifies the size of the argument.
- snprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.snprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.snprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- snprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- snprintf.12.01
In this case an argument of type int supplies the field width or precision.
- snprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- snprintf.12.03
A negative precision is taken as if the precision were omitted.
- snprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.snprintf.13
The flag characters and their meanings are:
- app.snprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.snprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.snprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- snprintf.13
The flag characters and their meanings are:
- snprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- snprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- snprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- snprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- snprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- snprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.snprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- snprintf.14
The length modifiers and their meanings are:
- snprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- snprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- snprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- snprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- snprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- snprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- snprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- snprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- snprintf.15
The conversion specifiers and their meanings are:
- snprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- snprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- snprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- snprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- snprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- snprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- snprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- snprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- snprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- snprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- snprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- snprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- snprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- snprintf.15.14
C [XSI] Equivalent to lc.
- snprintf.15.15
S [XSI] Equivalent to ls.
- snprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.snprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.snprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.snprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- snprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- snprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- snprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- snprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- snprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- snprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- snprintf.19
The snprintf() function shall fail if:
- snprintf.19.01
[EOVERFLOW] [XSI] The value of n is greater than {INT_MAX} or the number of bytes needed to hold the output excluding the terminating null is greater than {INT_MAX}.
- [+]sprintf (56 / 50 / 0)
- app.sprintf.01
it is the user's responsibility to ensure that enough space is available
- sprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- app.sprintf.02
If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined.
- app.sprintf.03
The results are undefined if there are insufficient arguments for the format.
- sprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- sprintf.03.01
ordinary characters, which are simply copied to the output stream
- sprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- sprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.sprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- app.sprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- sprintf.05.01
Upon successful completion, the sprintf() function shall return the number of bytes written to s, excluding the terminating null byte.
- sprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- sprintf.06
In addition, all forms of fprintf() may fail if:
- sprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- sprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.sprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- sprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- sprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- sprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- sprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- sprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- sprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- sprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- sprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- sprintf.11.04
An optional length modifier that specifies the size of the argument.
- sprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.sprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.sprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- sprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- sprintf.12.01
In this case an argument of type int supplies the field width or precision.
- sprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- sprintf.12.03
A negative precision is taken as if the precision were omitted.
- sprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.sprintf.13
The flag characters and their meanings are:
- app.sprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.sprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.sprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- sprintf.13
The flag characters and their meanings are:
- sprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- sprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- sprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- sprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- sprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- sprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- sprintf.14
The length modifiers and their meanings are:
- sprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- sprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- sprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- sprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- sprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- sprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- sprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- sprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.sprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- app.sprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.sprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.sprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- sprintf.15
The conversion specifiers and their meanings are:
- sprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- sprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- sprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- sprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- sprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- sprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- sprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- sprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- sprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- sprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- sprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- sprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- sprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- sprintf.15.14
C [XSI] Equivalent to lc.
- sprintf.15.15
S [XSI] Equivalent to ls.
- sprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- sprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- sprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- sprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- sprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- sprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- sprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vasprintf (58 / 52 / 0)
- vasprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- app.vasprintf.03
The results are undefined if there are insufficient arguments for the format.
- vasprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vasprintf.03.01
ordinary characters, which are simply copied to the output stream
- vasprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.vasprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vasprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- vasprintf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- vasprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vasprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.vasprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vasprintf.06
In addition, all forms of fprintf() may fail if:
- vasprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vasprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vasprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vasprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vasprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vasprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vasprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vasprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vasprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vasprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vasprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vasprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vasprintf.11.04
An optional length modifier that specifies the size of the argument.
- vasprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- vasprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vasprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vasprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vasprintf.12.03
A negative precision is taken as if the precision were omitted.
- vasprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- vasprintf.13
The flag characters and their meanings are:
- vasprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vasprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vasprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vasprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vasprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vasprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vasprintf.13
The flag characters and their meanings are:
- app.vasprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vasprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vasprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vasprintf.14
The length modifiers and their meanings are:
- vasprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vasprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vasprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vasprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vasprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vasprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vasprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vasprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vasprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vasprintf.15
The conversion specifiers and their meanings are:
- vasprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vasprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vasprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vasprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vasprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vasprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vasprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vasprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vasprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vasprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vasprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vasprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vasprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vasprintf.15.14
C [XSI] Equivalent to lc.
- vasprintf.15.15
S [XSI] Equivalent to ls.
- vasprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vasprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vasprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vasprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vasprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vasprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vasprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vasprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vasprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vasprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vasprintf.30
The vasprintf() function shall write formatted output to a dynamically allocated string, and store the address of that string in the location referenced by ptr.
- vasprintf.31
It shall behave as asprintf(), except that instead of being called with a variable number of arguments, it is called with an argument list as defined by <stdarg.h>.
- [+]vdprintf (55 / 51 / 0)
- app.vdprintf.03
The results are undefined if there are insufficient arguments for the format.
- vdprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vdprintf.03.01
ordinary characters, which are simply copied to the output stream
- vdprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- vdprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.vdprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vdprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vdprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.vdprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vdprintf.06
In addition, all forms of fprintf() may fail if:
- vdprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vdprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vdprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vdprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vdprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vdprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vdprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vdprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vdprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vdprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vdprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vdprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vdprintf.11.04
An optional length modifier that specifies the size of the argument.
- vdprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- vdprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vdprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vdprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vdprintf.12.03
A negative precision is taken as if the precision were omitted.
- vdprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vdprintf.13
The flag characters and their meanings are:
- app.vdprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vdprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vdprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vdprintf.13
The flag characters and their meanings are:
- vdprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vdprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vdprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vdprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vdprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vdprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vdprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vdprintf.14
The length modifiers and their meanings are:
- vdprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vdprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vdprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vdprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vdprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vdprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vdprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vdprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- vdprintf.15
The conversion specifiers and their meanings are:
- vdprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vdprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vdprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vdprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vdprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vdprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vdprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vdprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vdprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vdprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vdprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vdprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vdprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vdprintf.15.14
C [XSI] Equivalent to lc.
- vdprintf.15.15
S [XSI] Equivalent to ls.
- vdprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vdprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vdprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vdprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vdprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vdprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vdprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vdprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vdprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vdprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vdprintf.30
The vdprintf() function shall behave as vfprintf(), except that vdprintf() shall write output to the file associated with the file descriptor specified by the fd argument, rather than place output on a stream (as defined by ISO POSIX (2003)).
- [+]vfprintf (57 / 50 / 0)
- vfprintf.01
The fprintf() function shall place output on the named output stream.
- vfprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vfprintf.03.01
ordinary characters, which are simply copied to the output stream
- vfprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.vfprintf.03
The results are undefined if there are insufficient arguments for the format.
- vfprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.vfprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vfprintf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- vfprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vfprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- vfprintf.06
In addition, all forms of fprintf() may fail if:
- vfprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vfprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.vfprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vfprintf.07
The printf() and fprintf() functions may fail if:
- vfprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- vfprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vfprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vfprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vfprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vfprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vfprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vfprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vfprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vfprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vfprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vfprintf.11.04
An optional length modifier that specifies the size of the argument.
- vfprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- vfprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vfprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vfprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vfprintf.12.03
A negative precision is taken as if the precision were omitted.
- vfprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- vfprintf.13
The flag characters and their meanings are:
- vfprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vfprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vfprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vfprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vfprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vfprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vfprintf.13
The flag characters and their meanings are:
- app.vfprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vfprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vfprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vfprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vfprintf.14
The length modifiers and their meanings are:
- vfprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vfprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vfprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vfprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vfprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vfprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vfprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vfprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vfprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vfprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vfprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vfprintf.15
The conversion specifiers and their meanings are:
- vfprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vfprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vfprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vfprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vfprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vfprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vfprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vfprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vfprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vfprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vfprintf.15.14
C [XSI] Equivalent to lc.
- vfprintf.15.15
S [XSI] Equivalent to ls.
- vfprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- vfprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vfprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vfprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vfprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vfprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vfprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vprintf (57 / 50 / 0)
- vprintf.01
The printf() function shall place output on the standard output stream stdout.
- app.vprintf.03
The results are undefined if there are insufficient arguments for the format.
- vprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vprintf.03.01
ordinary characters, which are simply copied to the output stream
- vprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.vprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- vprintf.05.01
Upon successful completion, the fprintf() and printf() functions shall return the number of bytes transmitted.
- vprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.vprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vprintf.06
In addition, all forms of fprintf() may fail if:
- vprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vprintf.07
The printf() and fprintf() functions may fail if:
- vprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- vprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vprintf.11.04
An optional length modifier that specifies the size of the argument.
- vprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- app.vprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vprintf.12.03
A negative precision is taken as if the precision were omitted.
- vprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vprintf.13
The flag characters and their meanings are:
- app.vprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vprintf.13
The flag characters and their meanings are:
- vprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vprintf.14
The length modifiers and their meanings are:
- vprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vprintf.15
The conversion specifiers and their meanings are:
- vprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vprintf.15.14
C [XSI] Equivalent to lc.
- vprintf.15.15
S [XSI] Equivalent to ls.
- vprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- vprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vsnprintf (59 / 50 / 0)
- app.vsnprintf.01
it is the user's responsibility to ensure that enough space is available
- vsnprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- vsnprintf.02
The snprintf() function shall be equivalent to sprintf(), with the addition of the n argument which states the size of the buffer referred to by s.
- vsnprintf.02.01
If n is zero, nothing shall be written and s may be a null pointer.
- vsnprintf.02.02
Otherwise, output bytes beyond the n-1st shall be discarded instead of being written to the array, and a null byte is written at the end of the bytes actually written into the array.
- app.vsnprintf.02
If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined.
- app.vsnprintf.03
The results are undefined if there are insufficient arguments for the format.
- vsnprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vsnprintf.03.01
ordinary characters, which are simply copied to the output stream
- vsnprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- vsnprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- app.vsnprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vsnprintf.05.01
Upon successful completion, the snprintf() function shall return the number of bytes that would be written to s had n been sufficiently large excluding the terminating null byte.
If the value of n is zero on a call to snprintf(), nothing shall be written, the number of bytes that would have been written had n been sufficiently large excluding the terminating null shall be returned, and s may be a null pointer.
- vsnprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vsnprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.vsnprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vsnprintf.06
In addition, all forms of fprintf() may fail if:
- vsnprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vsnprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vsnprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vsnprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vsnprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vsnprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vsnprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vsnprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vsnprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vsnprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vsnprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vsnprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vsnprintf.11.04
An optional length modifier that specifies the size of the argument.
- vsnprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- vsnprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vsnprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vsnprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vsnprintf.12.03
A negative precision is taken as if the precision were omitted.
- vsnprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vsnprintf.13
The flag characters and their meanings are:
- app.vsnprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vsnprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vsnprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vsnprintf.13
The flag characters and their meanings are:
- vsnprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vsnprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vsnprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vsnprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vsnprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vsnprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vsnprintf.14
The length modifiers and their meanings are:
- vsnprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vsnprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vsnprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vsnprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vsnprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vsnprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vsnprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vsnprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vsnprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vsnprintf.15
The conversion specifiers and their meanings are:
- vsnprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsnprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsnprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsnprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsnprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vsnprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vsnprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsnprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsnprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsnprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vsnprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vsnprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vsnprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vsnprintf.15.14
C [XSI] Equivalent to lc.
- vsnprintf.15.15
S [XSI] Equivalent to ls.
- vsnprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vsnprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vsnprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vsnprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vsnprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vsnprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vsnprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vsnprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vsnprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vsnprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vsnprintf.19
The snprintf() function shall fail if:
- vsnprintf.19.01
[EOVERFLOW] [XSI] The value of n is greater than {INT_MAX} or the number of bytes needed to hold the output excluding the terminating null is greater than {INT_MAX}.
- [+]vsprintf (56 / 50 / 0)
- app.vsprintf.01
it is the user's responsibility to ensure that enough space is available
- vsprintf.01
The sprintf() function shall place output followed by the null byte, '\0', in consecutive bytes starting at *s
- app.vsprintf.02
If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined.
- app.vsprintf.03
The results are undefined if there are insufficient arguments for the format.
- vsprintf.03
Each of these functions converts, formats, and prints its arguments under control of the format. The format is a character string, beginning and ending in its initial shift state, if any. The format is composed of zero or more directives:
- vsprintf.03.01
ordinary characters, which are simply copied to the output stream
- vsprintf.03.02
conversion specifications, each of which shall result in the fetching of zero or more arguments
- app.vsprintf.04
The format can contain either numbered argument conversion specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format string are undefined.
- vsprintf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but are otherwise ignored.
- vsprintf.05.01
Upon successful completion, the sprintf() function shall return the number of bytes written to s, excluding the terminating null byte.
- vsprintf.05.02
If an output error was encountered, these functions shall return a negative value.
- app.vsprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
- app.vsprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vsprintf.06
In addition, all forms of fprintf() may fail if:
- vsprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vsprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vsprintf.08
In format strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format string as many times as required.
- vsprintf.09
In format strings containing the % form of conversion specification, each conversion specification uses the first unused argument in the argument list.
- vsprintf.10
All forms of the fprintf() functions allow for the insertion of a language-dependent radix character in the output string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vsprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vsprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- app.vsprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vsprintf.11
Each conversion specification is introduced by the '%' character [XSI] or by the character sequence "%n$", after which the following appear in sequence:
- vsprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vsprintf.11.02
An optional minimum field width. If the converted value has fewer bytes than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vsprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s [XSI] and S conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as zero. If a precision appears with any other conversion specifier, the behavior is undefined.
- vsprintf.11.04
An optional length modifier that specifies the size of the argument.
- vsprintf.11.05
A conversion specifier character that indicates the type of conversion to be applied.
- vsprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vsprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vsprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vsprintf.12.03
A negative precision is taken as if the precision were omitted.
- vsprintf.12.04
In format strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vsprintf.13
The flag characters and their meanings are:
- app.vsprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- app.vsprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vsprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vsprintf.13
The flag characters and their meanings are:
- vsprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping characters. For other conversions the behavior is undefined. The non-monetary grouping character is used.
- vsprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion is right-justified if this flag is not specified.
- vsprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vsprintf.13.04
<space> If the first character of a signed conversion is not a sign or if a signed conversion results in no characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vsprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vsprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag is ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag is ignored. [XSI] If the '0' and '" flags both appear, the grouping characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vsprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vsprintf.14
The length modifiers and their meanings are:
- vsprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vsprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vsprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vsprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vsprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vsprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vsprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vsprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vsprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- app.vsprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vsprintf.15.02
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
- vsprintf.15
The conversion specifiers and their meanings are:
- vsprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd"; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision is 1. The result of converting zero with an explicit precision of zero shall be no characters.
- vsprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vsprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. The low-order digit shall be rounded in an implementation-defined manner. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan" ; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vsprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there is one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it is equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The low-order digit shall be rounded in an implementation-defined manner. The E conversion specifier shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit or a '#' flag is present. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vsprintf.15.10
c The int argument shall be converted to an unsigned char, and the resulting byte shall be written. If an l (ell) qualifier is present, the wint_t argument shall be converted as if by an ls conversion specification with no precision and an argument that points to a two-element array of type wchar_t, the first element of which contains the wint_t argument to the ls conversion specification and the second element contains a null wide character.
- vsprintf.15.11
s The argument shall be a pointer to an array of char. Bytes from the array shall be written up to (but not including) any terminating null byte. If the precision is specified, no more than that many bytes shall be written. If the precision is not specified or is greater than the size of the array, the application shall ensure that the array contains a null byte. If an l (ell) qualifier is present, the argument shall be a pointer to an array of type wchar_t. Wide characters from the array shall be converted to characters (each as if by a call to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted) up to and including a terminating null wide character. The resulting characters shall be written up to (but not including) the terminating null character (byte). If no precision is specified, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many characters (bytes) shall be written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the character sequence length given by the precision, the function would need to access a wide character one past the end of the array. In no case shall a partial character be written.
- vsprintf.15.12
p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner.
- vsprintf.15.13
n The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted.
- vsprintf.15.14
C [XSI] Equivalent to lc.
- vsprintf.15.15
S [XSI] Equivalent to ls.
- vsprintf.15.16
% Print a '%' character; no argument is converted. The complete conversion specification shall be %%.
- vsprintf.16
In no case shall a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vsprintf.17.01
For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the value shall be correctly rounded to a hexadecimal floating number with the given precision.
- vsprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vsprintf.18.01
For the e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vsprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vsprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]util.format.scanf (336 / 300 / 0)
- [+]fscanf (56 / 50 / 0)
- fscanf.01
The fscanf() function shall read from the named input stream.
- fscanf.02
The fscanf() functions shall execute each directive of the format in turn.
- app.fscanf.03
The result is undefined if there are insufficient arguments for the format.
- fscanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- fscanf.03.01
an ordinary character (neither '%' nor a white-space character)
- fscanf.03.02
a conversion specification
- fscanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.fscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- fscanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- fscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- fscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- fscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.fscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- fscanf.06
In addition, fscanf() may fail if:
- fscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- fscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- fscanf.07
If a directive fails, as detailed below, the function shall return.
- fscanf.08
Failures are described as
- fscanf.08.01
input failures (due to the unavailability of input bytes)
- fscanf.08.02
matching failures (due to inappropriate input)
- fscanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- fscanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- fscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- fscanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- fscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- fscanf.11.04
An option length modifier that specifies the size of the receiving object.
- fscanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- fscanf.11.06
An optional assignment-suppressing character '*'.
- fscanf.12
A directive that is an ordinary character shall be executed as follows:
- fscanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- fscanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- app.fscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.fscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- fscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- fscanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- fscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- fscanf.13.03
The first byte, if any, after the input item shall remain unread.
- fscanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- fscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- fscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- fscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.fscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- fscanf.14
The length modifiers and their meanings are:
- fscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- fscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- fscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- fscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- fscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- fscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- fscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- fscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- fscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.fscanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.fscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.fscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- fscanf.15
The following conversion specifiers are valid:
- fscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- fscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- fscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- fscanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- fscanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- fscanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- fscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- fscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- fscanf.15.12
C [XSI] Equivalent to lc.
- fscanf.15.13
S [XSI] Equivalent to ls.
- fscanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- fscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- fscanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- fscanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- fscanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]scanf (56 / 50 / 0)
- scanf.01
The scanf() function shall read from the standard input stream stdin.
- scanf.02
The fscanf() functions shall execute each directive of the format in turn.
- scanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- scanf.03.01
an ordinary character (neither '%' nor a white-space character)
- scanf.03.02
a conversion specification
- scanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.scanf.03
The result is undefined if there are insufficient arguments for the format.
- app.scanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- scanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- scanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- scanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- scanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.scanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- scanf.06
In addition, fscanf() may fail if:
- scanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- scanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- scanf.07
If a directive fails, as detailed below, the function shall return.
- scanf.08
Failures are described as
- scanf.08.01
input failures (due to the unavailability of input bytes)
- scanf.08.02
matching failures (due to inappropriate input)
- scanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- scanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- scanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- scanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- scanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- scanf.11.04
An option length modifier that specifies the size of the receiving object.
- scanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- scanf.11.06
An optional assignment-suppressing character '*'.
- scanf.12
A directive that is an ordinary character shall be executed as follows:
- scanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- scanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- scanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- scanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- scanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- scanf.13.03
The first byte, if any, after the input item shall remain unread.
- scanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- scanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- scanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- scanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.scanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.scanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- scanf.14
The length modifiers and their meanings are:
- scanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- scanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- scanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- scanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- scanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- scanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- scanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- scanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- scanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.scanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- scanf.15
The following conversion specifiers are valid:
- scanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- scanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- scanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- scanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- scanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- scanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- scanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- scanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- scanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- scanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- scanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- scanf.15.12
C [XSI] Equivalent to lc.
- scanf.15.13
S [XSI] Equivalent to ls.
- scanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- scanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- app.scanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.scanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.scanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- scanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- scanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- scanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]sscanf (56 / 50 / 0)
- sscanf.01
The sscanf() function shall read from the string s.
- sscanf.02
The fscanf() functions shall execute each directive of the format in turn.
- sscanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- sscanf.03.01
an ordinary character (neither '%' nor a white-space character)
- sscanf.03.02
a conversion specification
- sscanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.sscanf.03
The result is undefined if there are insufficient arguments for the format.
- sscanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- app.sscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- sscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- sscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- sscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.sscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- sscanf.06
In addition, fscanf() may fail if:
- sscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- sscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- sscanf.07
If a directive fails, as detailed below, the function shall return.
- sscanf.08
Failures are described as
- sscanf.08.01
input failures (due to the unavailability of input bytes)
- sscanf.08.02
matching failures (due to inappropriate input)
- sscanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- sscanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- sscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- sscanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- sscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- sscanf.11.04
An option length modifier that specifies the size of the receiving object.
- sscanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- sscanf.11.06
An optional assignment-suppressing character '*'.
- sscanf.12
A directive that is an ordinary character shall be executed as follows:
- sscanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- sscanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- app.sscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.sscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- sscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- sscanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- sscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- sscanf.13.03
The first byte, if any, after the input item shall remain unread.
- sscanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- sscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- sscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- sscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.sscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- sscanf.14
The length modifiers and their meanings are:
- sscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- sscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- sscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- sscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- sscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- sscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- sscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- sscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- sscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- sscanf.15
The following conversion specifiers are valid:
- sscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- sscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- sscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- sscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- sscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- sscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- sscanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- sscanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- sscanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- sscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- sscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- sscanf.15.12
C [XSI] Equivalent to lc.
- sscanf.15.13
S [XSI] Equivalent to ls.
- sscanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- sscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- app.sscanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.sscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.sscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- sscanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.Reaching the end of the string in sscanf() shall be equivalent to encountering end-of-file for fscanf().
- sscanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- sscanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vfscanf (56 / 50 / 0)
- vfscanf.01
The fscanf() function shall read from the named input stream.
- vfscanf.02
The fscanf() functions shall execute each directive of the format in turn.
- vfscanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- vfscanf.03.01
an ordinary character (neither '%' nor a white-space character)
- vfscanf.03.02
a conversion specification
- vfscanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.vfscanf.03
The result is undefined if there are insufficient arguments for the format.
- vfscanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- app.vfscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- app.vfscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vfscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vfscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vfscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- vfscanf.06
In addition, fscanf() may fail if:
- vfscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vfscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vfscanf.07
If a directive fails, as detailed below, the function shall return.
- vfscanf.08
Failures are described as
- vfscanf.08.01
input failures (due to the unavailability of input bytes)
- vfscanf.08.02
matching failures (due to inappropriate input)
- vfscanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- vfscanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vfscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vfscanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- vfscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vfscanf.11.04
An option length modifier that specifies the size of the receiving object.
- vfscanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vfscanf.11.06
An optional assignment-suppressing character '*'.
- vfscanf.12
A directive that is an ordinary character shall be executed as follows:
- vfscanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- vfscanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- app.vfscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.vfscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- vfscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- vfscanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- vfscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- vfscanf.13.03
The first byte, if any, after the input item shall remain unread.
- vfscanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vfscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- vfscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- vfscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.vfscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vfscanf.14
The length modifiers and their meanings are:
- vfscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vfscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vfscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vfscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vfscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vfscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vfscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vfscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vfscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vfscanf.15
The following conversion specifiers are valid:
- vfscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vfscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vfscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- vfscanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vfscanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- vfscanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- vfscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- vfscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vfscanf.15.12
C [XSI] Equivalent to lc.
- vfscanf.15.13
S [XSI] Equivalent to ls.
- vfscanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- vfscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- app.vfscanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.vfscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vfscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vfscanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- vfscanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- vfscanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vscanf (56 / 50 / 0)
- vscanf.01
The scanf() function shall read from the standard input stream stdin.
- vscanf.02
The fscanf() functions shall execute each directive of the format in turn.
- vscanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- vscanf.03.01
an ordinary character (neither '%' nor a white-space character)
- vscanf.03.02
a conversion specification
- vscanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.vscanf.03
The result is undefined if there are insufficient arguments for the format.
- app.vscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- vscanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- vscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.vscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vscanf.06
In addition, fscanf() may fail if:
- vscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vscanf.07
If a directive fails, as detailed below, the function shall return.
- vscanf.08
Failures are described as
- vscanf.08.01
input failures (due to the unavailability of input bytes)
- vscanf.08.02
matching failures (due to inappropriate input)
- vscanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- vscanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vscanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- vscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vscanf.11.04
An option length modifier that specifies the size of the receiving object.
- vscanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vscanf.11.06
An optional assignment-suppressing character '*'.
- vscanf.12
A directive that is an ordinary character shall be executed as follows:
- vscanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- vscanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- app.vscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.vscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- vscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- vscanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- vscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- vscanf.13.03
The first byte, if any, after the input item shall remain unread.
- vscanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- vscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- vscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.vscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vscanf.14
The length modifiers and their meanings are:
- vscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vscanf.15
The following conversion specifiers are valid:
- vscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- vscanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vscanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- vscanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- vscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- vscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vscanf.15.12
C [XSI] Equivalent to lc.
- vscanf.15.13
S [XSI] Equivalent to ls.
- vscanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- vscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- app.vscanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.vscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vscanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- vscanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- vscanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vsscanf (56 / 50 / 0)
- vsscanf.01
The sscanf() function shall read from the string s.
- vsscanf.02
The fscanf() functions shall execute each directive of the format in turn.
- app.vsscanf.03
The result is undefined if there are insufficient arguments for the format.
- vsscanf.03
The format is a character string, beginning and ending in its initial shift state, if any, composed of zero or more directives. Each directive is composed of one of the following:
- vsscanf.03.01
an ordinary character (neither '%' nor a white-space character)
- vsscanf.03.02
a conversion specification
- vsscanf.03.03
one or more white-space characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.vsscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"-but the two forms cannot be mixed within a single format string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- vsscanf.04
If the format is exhausted while arguments remain, the excess arguments shall be evaluated but otherwise ignored.
- app.vsscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vsscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vsscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vsscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- vsscanf.06
In addition, fscanf() may fail if:
- vsscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vsscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vsscanf.07
If a directive fails, as detailed below, the function shall return.
- vsscanf.08
Failures are described as
- vsscanf.08.01
input failures (due to the unavailability of input bytes)
- vsscanf.08.02
matching failures (due to inappropriate input)
- vsscanf.09
A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.
- vsscanf.10
The fscanf() function in all its forms shall allow detection of a language-dependent radix character in the input string. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vsscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vsscanf.11
Each conversion specification is introduced by the character '%' [XSI] or the character sequence "%n$", after which the following appear in sequence:
- vsscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vsscanf.11.04
An option length modifier that specifies the size of the receiving object.
- vsscanf.11.05
A conversion specifier character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vsscanf.11.06
An optional assignment-suppressing character '*'.
- vsscanf.12
A directive that is an ordinary character shall be executed as follows:
- vsscanf.12.01
the next byte shall be read from the input and compared with the byte that comprises the directive;
- vsscanf.12.02
the next byte shall be read from the input and compared with the byte that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent bytes shall remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive shall fail.
- vsscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- vsscanf.13.01
Input white-space characters (as specified by isspace()) shall be skipped, unless the conversion specification includes a [, c, C, or n conversion specifier.
- vsscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier. An input item shall be defined as the longest sequence of input bytes (up to any specified maximum field width, which may be measured in characters or bytes dependent on the conversion specifier) which is an initial subsequence of a matching sequence.
- vsscanf.13.03
The first byte, if any, after the input item shall remain unread.
- vsscanf.13.04
If the length of the input item is 0, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vsscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input bytes) shall be converted to a type appropriate to the conversion character.
- vsscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification fails; this condition is a matching failure.
- vsscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$".
- app.vsscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion character. A conversion specification shall be executed in the following steps.
- app.vsscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- app.vsscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vsscanf.14
The length modifiers and their meanings are:
- vsscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vsscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vsscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vsscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vsscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vsscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vsscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vsscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vsscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vsscanf.15
The following conversion specifiers are valid:
- vsscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vsscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vsscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vsscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vsscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vsscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.
- vsscanf.15.07
s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vsscanf.15.08
[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.
- vsscanf.15.09
c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.
- vsscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined.
- vsscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vsscanf.15.12
C [XSI] Equivalent to lc.
- vsscanf.15.13
S [XSI] Equivalent to ls.
- vsscanf.15.14
% Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- vsscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to a, e, f, g, and x, respectively.
- app.vsscanf.15
The following conversion specifiers are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of strtol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of strtoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of strtod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fscanf() family of functions shall recognize them as input.s Matches a sequence of bytes that are not white-space characters. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null character code, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of bytes from a set of expected bytes (the scanset). The normal skip over white-space characters shall be suppressed in this case. The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence and a terminating null byte, which shall be added automatically. If an l (ell) qualifier is present, the input is a sequence of characters that begins in the initial shift state. Each character in the sequence shall be converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent bytes in the format string up to and including the matching right square bracket ( ']' ). The bytes between the square brackets (the scanlist) comprise the scanset, unless the byte after the left square bracket is a circumflex ( '^' ), in which case the scanset contains all bytes that do not appear in the scanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the scanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the scanlist and is not the first character, nor the second where the first character is a '^', nor the last character, the behavior is implementation-defined.c Matches a sequence of bytes of the number specified by the field width (1 if no field width is present in the conversion specification). The application shall ensure that the corresponding argument is a pointer to the initial byte of an array of char, signed char, or unsigned char large enough to accept the sequence. No null byte is added. The normal skip over white-space characters shall be suppressed in this case. If an l (ell) qualifier is present, the input shall be a sequence of characters that begins in the initial shift state. Each character in the sequence is converted to a wide character as if by a call to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted. The application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the resulting sequence of wide characters. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion specification is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' character; no conversion or assignment occurs. The complete conversion specification shall be %%.
- app.vsscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vsscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which shall be written the number of bytes read from the input so far by this call to the fscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing character or a field width, the behavior is undefined.
- vsscanf.16
If end-of-file is encountered during input, conversion shall be terminated. If end-of-file occurs before any bytes matching the current conversion specification (except for %n ) have been read (other than leading white-space characters, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.Reaching the end of the string in sscanf() shall be equivalent to encountering end-of-file for fscanf().
- vsscanf.17
If conversion terminates on a conflicting input, the offending input is left unread in the input.
- vsscanf.18
Any trailing white space (including <newline>s) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]util.format.time (184 / 82 / 0)
- [+]getdate (53 / 40 / 0)
- getdate.01
The getdate() function shall convert a string representation of a date or time into a broken-down time.
Generalizes:
- getdate.02
- getdate.03
- getdate.04
- getdate.05
- getdate.06
- getdate.07.01
- getdate.07.02
- getdate.07.03
- getdate.07.04
- getdate.07.05
- getdate.07.06
- getdate.07.07
- getdate.07.08
- getdate.07.09
- getdate.07.10
- getdate.07.11
- getdate.07.12
- getdate.07.13
- getdate.07.14
- getdate.07.15
- getdate.07.16
- getdate.07.17
- getdate.07.18
- getdate.07.19
- getdate.07.20
- getdate.07.21
- getdate.07.22
- getdate.07.23
- getdate.07.24
- getdate.07.25
- getdate.07.26
- getdate.07.27
- getdate.08
- getdate.09
- getdate.11
- getdate.12
- getdate.13
- getdate.15.02
- getdate.15.03.01
- getdate.15.03.02
- getdate.15.04
- getdate.15.05
- getdate.17
- getdate.18.01
- getdate.18.02
- getdate.19.01
- getdate.19.02
- getdate.19.03
- getdate.19.04
- getdate.19.05
- getdate.19.06
- getdate.19.07
- getdate.19.08
- getdate.02
The external variable or macro getdate_err is used by getdate() to return error values.
- getdate.03
Templates are used to parse and interpret the input string.
Generalizes:
- getdate.07.01
- getdate.07.02
- getdate.07.03
- getdate.07.04
- getdate.07.05
- getdate.07.06
- getdate.07.07
- getdate.07.08
- getdate.07.09
- getdate.07.10
- getdate.07.11
- getdate.07.12
- getdate.07.13
- getdate.07.14
- getdate.07.15
- getdate.07.16
- getdate.07.17
- getdate.07.18
- getdate.07.19
- getdate.07.20
- getdate.07.21
- getdate.07.22
- getdate.07.23
- getdate.07.24
- getdate.07.25
- getdate.07.26
- getdate.07.27
- getdate.04
The templates are contained in a text file identified by the environment variable DATEMSK .
- getdate.05
The DATEMSK variable should be set to indicate the full pathname of the file that contains the templates.
- getdate.06
The first line in the template that matches the input specification is used for interpretation and conversion into the internal time format.
- getdate.07
The following conversion specifications shall be supported:
- getdate.07.01
%% Equivalent to %.
- getdate.07.02
%a Abbreviated weekday name.
- getdate.07.03
%A Full weekday name.
- getdate.07.04
%b Abbreviated month name.
- getdate.07.05
%B Full month name.
- getdate.07.06
%c Locale's appropriate date and time representation.
- getdate.07.07
%C Century number [00,99]; leading zeros are permitted but not required.
- getdate.07.08
%d Day of month [01,31]; the leading 0 is optional.
- getdate.07.09
%D Date as %m / %d / %y.
- getdate.07.10
%e Equivalent to %d.
- getdate.07.11
%h Abbreviated month name.
- getdate.07.12
%H Hour [00,23].
- getdate.07.13
%I Hour [01,12].
- getdate.07.14
%m Month number [01,12].
- getdate.07.15
%M Minute [00,59].
- getdate.07.16
%n Equivalent to <newline>.
- getdate.07.17
%p Locale's equivalent of either AM or PM.
- getdate.07.18
%r The locale's appropriate representation of time in AM and PM notation. In the POSIX locale, this shall be equivalent to %I : %M : %S %p.
- getdate.07.19
%R Time as %H : %M.
- getdate.07.20
%S Seconds [00,60]. The range goes to 60 (rather than stopping at 59) to allow positive leap seconds to be expressed. Since leap seconds cannot be predicted by any algorithm, leap second data must come from some external source.
- getdate.07.21
%t Equivalent to <tab>.
- getdate.07.22
%T Time as %H : %M : %S.
- getdate.07.23
%w Weekday number (Sunday = [0,6]).
- getdate.07.24
%x Locale's appropriate date representation.
- getdate.07.25
%X Locale's appropriate time representation.
- getdate.07.26
%y Year within century. When a century is not otherwise specified, values in the range [69,99] shall refer to years 1969 to 1999 inclusive, and values in the range [00,68] shall refer to years 2000 to 2068 inclusive.
- getdate.07.27
%Y Year as "ccyy" (for example, 2001).
- getdate.08
The match between the template and input specification performed by getdate() shall be case-insensitive.
- getdate.09
The month and weekday names can consist of any combination of upper and lowercase letters.
- getdate.11
Leading zeros are not necessary for the descriptors that allow leading zeros.
- getdate.12
However, at most two digits are allowed for those descriptors, including leading zeros.
- getdate.13
Extra whitespace in either the template file or in string shall be ignored.
- app.getdate.14
The results are undefined if the conversion specifications %c, %x, and %X include unsupported conversion specifications.
- getdate.15
The following rules apply for converting the input specification into the internal format:
- getdate.15.02
If only the weekday is given, the day chosen shall be the day, starting with today and moving into the future, which first matches the named day.
- getdate.15.03.01
If only the month (and no year) is given, the month chosen shall be the month, starting with the current month and moving into the future, which first matches the named month.
- getdate.15.03.02
The first day of the month shall be assumed if no day is given.
- getdate.15.04
If no hour, minute, and second are given, the current hour, minute, and second shall be assumed.
- getdate.15.05
If no date is given, the hour chosen shall be the hour, starting with the current hour and moving into the future, which first matches the named hour.
- app.getdate.16
If a conversion specification in the DATEMSK file does not correspond to one of the conversion specifications above, the behavior is unspecified.
- getdate.17 (struct)
The getdate() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getdate.18.01
Upon successful completion, getdate() shall return a pointer to a struct tm.
- getdate.18.02
Otherwise, it shall return a null pointer and set getdate_err to indicate the error.
- getdate.19
The getdate() function shall fail in the following cases, setting getdate_err to the value shown in the list below. Any changes to errno are unspecified.
- getdate.19.01
The DATEMSK environment variable is null or undefined.
- getdate.19.02
The template file cannot be opened for reading.
- getdate.19.03
Failed to get file status information.
- getdate.19.04
The template file is not a regular file.
- getdate.19.05
An I/O error is encountered while reading the template file.
- getdate.19.06
Memory allocation failed (not enough memory available).
- getdate.19.07
There is no line in the template that matches the input.
- getdate.19.08
Invalid input specification.
- [+]strftime (67 / 0 / 0)
- strftime.01
The strftime() function shall place bytes into the array pointed to by s as controlled by the string pointed to by format.
Generalizes:
- strftime.02
- strftime.03
- strftime.04
- strftime.05
- strftime.07
- strftime.08
- strftime.09
- strftime.11.01
- strftime.11.02
- strftime.11.03
- strftime.11.04
- strftime.11.05
- strftime.11.06
- strftime.11.07
- strftime.11.08
- strftime.11.09
- strftime.11.10
- strftime.11.11
- strftime.11.12
- strftime.11.13
- strftime.11.14
- strftime.11.15
- strftime.11.16
- strftime.11.17
- strftime.11.18
- strftime.11.19
- strftime.11.20
- strftime.11.21
- strftime.11.22
- strftime.11.23
- strftime.11.24
- strftime.11.25
- strftime.11.26
- strftime.11.27
- strftime.11.28
- strftime.11.29
- strftime.11.30
- strftime.11.31
- strftime.11.32
- strftime.11.33
- strftime.11.34
- strftime.11.35
- strftime.11.36
- strftime.11.37
- strftime.15
- strftime.16
- strftime.17.01
- strftime.17.02
- strftime.17.03
- strftime.17.04
- strftime.17.05
- strftime.17.06
- strftime.17.07
- strftime.17.08
- strftime.17.09
- strftime.17.10
- strftime.17.11
- strftime.17.12
- strftime.17.13
- strftime.17.14
- strftime.17.15
- strftime.17.16
- strftime.17.17
- strftime.17.18
- strftime.17.19
- strftime.18.01
- strftime.18.02
- strftime.18.03
- strftime.20.01
- strftime.20.02
- strftime.02
The format is a character string, beginning and ending in its initial shift state, if any.
- strftime.03 (struct)
The format string consists of zero or more conversion specifications and ordinary characters.
- strftime.04 (struct)
A conversion specification consists of a '%' character, possibly followed by an E or O modifier, and a terminating conversion specifier character that determines the conversion specification's behavior.
- strftime.05
All ordinary characters (including the terminating null byte) are copied unchanged into the array.
- app.strftime.06
If copying takes place between objects that overlap, the behavior is undefined.
- strftime.07
No more than maxsize bytes are placed into the array.
- strftime.08
Each conversion specifier is replaced by appropriate characters as described in the following list.
Generalizes:
- strftime.11.01
- strftime.11.02
- strftime.11.03
- strftime.11.04
- strftime.11.05
- strftime.11.06
- strftime.11.07
- strftime.11.08
- strftime.11.09
- strftime.11.10
- strftime.11.11
- strftime.11.12
- strftime.11.13
- strftime.11.14
- strftime.11.15
- strftime.11.16
- strftime.11.17
- strftime.11.18
- strftime.11.19
- strftime.11.20
- strftime.11.21
- strftime.11.22
- strftime.11.23
- strftime.11.24
- strftime.11.25
- strftime.11.26
- strftime.11.27
- strftime.11.28
- strftime.11.29
- strftime.11.30
- strftime.11.31
- strftime.11.32
- strftime.11.33
- strftime.11.34
- strftime.11.35
- strftime.11.36
- strftime.11.37
- strftime.17.01
- strftime.17.02
- strftime.17.03
- strftime.17.04
- strftime.17.05
- strftime.17.06
- strftime.17.07
- strftime.17.08
- strftime.17.09
- strftime.17.10
- strftime.17.11
- strftime.17.12
- strftime.17.13
- strftime.17.14
- strftime.17.15
- strftime.17.16
- strftime.17.17
- strftime.17.18
- strftime.17.19
- strftime.09 (struct)
The appropriate characters are determined using the LC_TIME category of the current locale and by the values of zero or more members of the broken-down time structure pointed to by timeptr, as specified in brackets in the description.
- app.strftime.10
If any of the specified values are outside the normal range, the characters stored are unspecified.
- strftime.11
The following conversion specifications are supported:
- strftime.11.01
%a Replaced by the locale's abbreviated weekday name. [ tm_wday]
- strftime.11.02
%A Replaced by the locale's full weekday name. [ tm_wday]
- strftime.11.03
%b Replaced by the locale's abbreviated month name. [ tm_mon]
- strftime.11.04
%B Replaced by the locale's full month name. [ tm_mon]
- strftime.11.05
%c Replaced by the locale's appropriate date and time representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- strftime.11.06
%C Replaced by the year divided by 100 and truncated to an integer, as a decimal number [00,99]. [ tm_year]
- strftime.11.07
%d Replaced by the day of the month as a decimal number [01,31]. [ tm_mday]
- strftime.11.08
%D Equivalent to %m / %d / %y. [ tm_mon, tm_mday, tm_year]
- strftime.11.09
%e Replaced by the day of the month as a decimal number [1,31]; a single digit is preceded by a space. [ tm_mday]
- strftime.11.10
%F Equivalent to %Y - %m - %d (the ISO 8601:2000 standard date format). [ tm_year, tm_mon, tm_mday]
- strftime.11.11
%g Replaced by the last 2 digits of the week-based year (see below) as a decimal number [00,99]. [ tm_year, tm_wday, tm_yday]
- strftime.11.12
%G Replaced by the week-based year (see below) as a decimal number (for example, 1977). [ tm_year, tm_wday, tm_yday]
- strftime.11.13
%h Equivalent to %b. [ tm_mon]
- strftime.11.14
%H Replaced by the hour (24-hour clock) as a decimal number [00,23]. [ tm_hour]
- strftime.11.15
%I Replaced by the hour (12-hour clock) as a decimal number [01,12]. [ tm_hour]
- strftime.11.16
%j Replaced by the day of the year as a decimal number [001,366]. [ tm_yday]
- strftime.11.17
%m Replaced by the month as a decimal number [01,12]. [ tm_mon]
- strftime.11.18
%M Replaced by the minute as a decimal number [00,59]. [ tm_min]
- strftime.11.19
%n Replaced by a <newline>.
- strftime.11.20
%p Replaced by the locale's equivalent of either a.m. or p.m. [ tm_hour]
- strftime.11.21
%r Replaced by the time in a.m. and p.m. notation; [CX] in the POSIX locale this shall be equivalent to %I : %M : %S %p. [ tm_hour, tm_min, tm_sec]
- strftime.11.22
%R Replaced by the time in 24-hour notation ( %H : %M ). [ tm_hour, tm_min]
- strftime.11.23
%S Replaced by the second as a decimal number [00,60]. [ tm_sec]
- strftime.11.24
%t Replaced by a <tab>.
- strftime.11.25
%T Replaced by the time ( %H : %M : %S ). [ tm_hour, tm_min, tm_sec]
- strftime.11.26
%u Replaced by the weekday as a decimal number [1,7], with 1 representing Monday. [ tm_wday]
- strftime.11.27
%U Replaced by the week number of the year as a decimal number [00,53]. The first Sunday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
- strftime.11.28
%V Replaced by the week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
- strftime.11.29
%w Replaced by the weekday as a decimal number [0,6], with 0 representing Sunday. [ tm_wday]
- strftime.11.30
%W Replaced by the week number of the year as a decimal number [00,53]. The first Monday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
- strftime.11.31
%x Replaced by the locale's appropriate date representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- strftime.11.32
%X Replaced by the locale's appropriate time representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- strftime.11.33
%y Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
- strftime.11.34
%Y Replaced by the year as a decimal number (for example, 1997). [ tm_year]
- strftime.11.35
%z Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ), or by no characters if no timezone is determinable. For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). [CX] If tm_isdst is zero, the standard time offset is used. If tm_isdst is greater than zero, the daylight savings time offset is used. If tm_isdst is negative, no characters are returned. [ tm_isdst]
- strftime.11.36
%Z Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]
- strftime.11.37
%% Replaced by %.
- app.strftime.12
If a conversion specification does not correspond to any of the above, the behavior is undefined.
- app.strftime.13
If a struct tm broken-down time structure is created by localtime() or localtime_r(), or modified by mktime(), and the value of TZ is subsequently modified, the results of the %Z and %z strftime() conversion specifiers are undefined, when strftime() is called with such a broken-down time structure.
- app.strftime.14
If a struct tm broken-down time structure is created or modified by gmtime() or gmtime_r(), it is unspecified whether the result of the %Z and %z conversion specifiers shall refer to UTC or the current local timezone, when strftime() is called with such a broken-down time structure.
- strftime.15 (struct)
Some conversion specifiers can be modified by the E or O modifier characters to indicate that an alternative format or specification should be used rather than the one normally used by the unmodified conversion specifier.
- strftime.16
If the alternative format or specification does not exist for the current locale (see ERA in the Base Definitions volume of IEEE Std 1003.1-2001, Section 7.3.5, LC_TIME), the behavior shall be as if the unmodified conversion specification were used.
- strftime.17.01
%Ec Replaced by the locale's alternative appropriate date and time representation.
- strftime.17.02
%EC Replaced by the name of the base year (period) in the locale's alternative representation.
- strftime.17.03
%Ex Replaced by the locale's alternative date representation.
- strftime.17.04
%EX Replaced by the locale's alternative time representation.
- strftime.17.05
%Ey Replaced by the offset from %EC (year only) in the locale's alternative representation.
- strftime.17.06
%EY Replaced by the full alternative year representation.
- strftime.17.07
%Od Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading spaces.
- strftime.17.08
%Oe Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading spaces.
- strftime.17.09
%OH Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols.
- strftime.17.10
%OI Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols.
- strftime.17.11
%Om Replaced by the month using the locale's alternative numeric symbols.
- strftime.17.12
%OM Replaced by the minutes using the locale's alternative numeric symbols.
- strftime.17.13
%OS Replaced by the seconds using the locale's alternative numeric symbols.
- strftime.17.14
%Ou Replaced by the weekday as a number in the locale's alternative representation (Monday=1).
- strftime.17.15
%OU Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols.
- strftime.17.16
%OV Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols.
- strftime.17.17
%Ow Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
- strftime.17.18
%OW Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
- strftime.17.19
%Oy Replaced by the year (offset from %C ) using the locale's alternative numeric symbols.
- strftime.18.01
%g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. In this system, weeks begin on a Monday and week 1 of the year is the week that includes January 4th, which is also the week that includes the first Thursday of the year, and is also the first week that contains at least four days in the year.
Generalizes:
- strftime.11.11
- strftime.11.12
- strftime.11.28
- strftime.18.02
If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of the last week of the preceding year; thus, for Saturday 2nd January 1999, %G is replaced by 1998 and %V is replaced by 53.
Generalizes:
- strftime.11.11
- strftime.11.12
- strftime.11.28
- strftime.18.03
If December 29th, 30th, or 31st is a Monday, it and any following days are part of week 1 of the following year. Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
Generalizes:
- strftime.11.11
- strftime.11.12
- strftime.11.28
- app.strftime.19
If a conversion specifier is not one of the above, the behavior is undefined.
- strftime.20.01
If the total number of resulting bytes including the terminating null byte is not more than maxsize, strftime() shall return the number of bytes placed into the array pointed to by s, not including the terminating null byte.
- strftime.20.02
Otherwise, 0 shall be returned and the contents of the array are unspecified.
- [+]strptime (64 / 42 / 0)
- strptime.01
The strptime() function shall convert the character string pointed to by buf to values which are stored in the tm structure pointed to by tm, using the format specified by format.
Generalizes:
- strptime.02
- strptime.03
- strptime.04
- strptime.06.01
- strptime.06.02
- strptime.06.03
- strptime.06.04
- strptime.06.05
- strptime.06.06
- strptime.06.07
- strptime.06.08
- strptime.06.09
- strptime.06.10
- strptime.06.11
- strptime.06.12
- strptime.06.13
- strptime.06.14
- strptime.06.15
- strptime.06.16
- strptime.06.17
- strptime.06.18
- strptime.06.19
- strptime.06.20
- strptime.06.21
- strptime.06.22
- strptime.06.23
- strptime.06.24
- strptime.06.25
- strptime.06.26
- strptime.06.27
- strptime.06.28
- strptime.06.29
- strptime.06.30
- strptime.07
- strptime.08
- strptime.09.01
- strptime.09.02
- strptime.09.03
- strptime.09.04
- strptime.09.05
- strptime.09.06
- strptime.09.07
- strptime.09.08
- strptime.09.09
- strptime.09.10
- strptime.09.11
- strptime.09.12
- strptime.09.13
- strptime.09.14
- strptime.09.15
- strptime.09.16
- strptime.09.17
- strptime.10
- strptime.11
- strptime.12.01
- strptime.12.02
- strptime.13
- strptime.14
- strptime.15.01
- strptime.15.02
- strptime.16
- strptime.17.01
- strptime.17.02
- strptime.02
The format is composed of zero or more directives.
- strptime.03
Each directive is composed of one of the following: one or more white-space characters (as specified by isspace()); an ordinary character (neither '%' nor a white-space character); or a conversion specification.
- strptime.04
Each conversion specification is composed of a '%' character followed by a conversion character which specifies the replacement required.
Generalizes:
- strptime.06.01
- strptime.06.02
- strptime.06.03
- strptime.06.04
- strptime.06.05
- strptime.06.06
- strptime.06.07
- strptime.06.08
- strptime.06.09
- strptime.06.10
- strptime.06.11
- strptime.06.12
- strptime.06.13
- strptime.06.14
- strptime.06.15
- strptime.06.16
- strptime.06.17
- strptime.06.18
- strptime.06.19
- strptime.06.20
- strptime.06.21
- strptime.06.22
- strptime.06.23
- strptime.06.24
- strptime.06.25
- strptime.06.26
- strptime.06.27
- strptime.06.28
- strptime.06.29
- strptime.06.30
- strptime.09.01
- strptime.09.02
- strptime.09.03
- strptime.09.04
- strptime.09.05
- strptime.09.06
- strptime.09.07
- strptime.09.08
- strptime.09.09
- strptime.09.10
- strptime.09.11
- strptime.09.12
- strptime.09.13
- strptime.09.14
- strptime.09.15
- strptime.09.16
- strptime.09.17
- app.strptime.05
The application shall ensure that there is white-space or other non-alphanumeric characters between any two conversion specifications.
- strptime.06
The following conversion specifications are supported:
- strptime.06.01
%a The day of the week, using the locale's weekday names; either the abbreviated or full name may be specified.
- strptime.06.02
%A Equivalent to %a.
- strptime.06.03
%b The month, using the locale's month names; either the abbreviated or full name may be specified.
- strptime.06.04
%B Equivalent to %b.
- strptime.06.05
%c Replaced by the locale's appropriate date and time representation.
- strptime.06.06
%C The century number [00,99]; leading zeros are permitted but not required.
- strptime.06.07
%d The day of the month [01,31]; leading zeros are permitted but not required.
- strptime.06.08
%D The date as %m / %d / %y.
- strptime.06.09
%e Equivalent to %d.
- strptime.06.10
%h Equivalent to %b.
- strptime.06.11
%H The hour (24-hour clock) [00,23]; leading zeros are permitted but not required.
- strptime.06.12
%I The hour (12-hour clock) [01,12]; leading zeros are permitted but not required.
- strptime.06.13
%j The day number of the year [001,366]; leading zeros are permitted but not required.
- strptime.06.14
%m The month number [01,12]; leading zeros are permitted but not required.
- strptime.06.15
%M The minute [00,59]; leading zeros are permitted but not required.
- strptime.06.16
%n Any white space.
- strptime.06.17
%p The locale's equivalent of a.m or p.m.
- strptime.06.18
%r 12-hour clock time using the AM/PM notation if t_fmt_ampm is not an empty string in the LC_TIME portion of the current locale; in the POSIX locale, this shall be equivalent to %I : %M : %S %p.
- strptime.06.19
%R The time as %H : %M.
- strptime.06.20
%S The seconds [00,60]; leading zeros are permitted but not required.
- strptime.06.21
%t Any white space.
- strptime.06.22
%T The time as %H : %M : %S.
- strptime.06.23
%U The week number of the year (Sunday as the first day of the week) as a decimal number [00,53]; leading zeros are permitted but not required.
- strptime.06.24
%w The weekday as a decimal number [0,6], with 0 representing Sunday; leading zeros are permitted but not required.
- strptime.06.25
%W The week number of the year (Monday as the first day of the week) as a decimal number [00,53]; leading zeros are permitted but not required.
- strptime.06.26
%x The date, using the locale's date format.
- strptime.06.27
%X The time, using the locale's time format.
- strptime.06.28
%y The year within century. When a century is not otherwise specified, values in the range [69,99] shall refer to years 1969 to 1999 inclusive, and values in the range [00,68] shall refer to years 2000 to 2068 inclusive; leading zeros shall be permitted but shall not be required.
- strptime.06.29
%Y The year, including the century (for example, 1988).
- strptime.06.30
%% Replaced by %.
- strptime.07
Some conversion specifiers can be modified by the E and O modifier characters to indicate that an alternative format or specification should be used rather than the one normally used by the unmodified conversion specifier.
- strptime.08
If the alternative format or specification does not exist in the current locale, the behavior shall be as if the unmodified conversion specification were used.
- strptime.09.01
%Ec The locale's alternative appropriate date and time representation.
- strptime.09.02
%EC The name of the base year (period) in the locale's alternative representation.
- strptime.09.03
%Ex The locale's alternative date representation.
- strptime.09.04
%EX The locale's alternative time representation.
- strptime.09.05
%Ey The offset from %EC (year only) in the locale's alternative representation.
- strptime.09.06
%EY The full alternative year representation.
- strptime.09.07
%Od The day of the month using the locale's alternative numeric symbols; leading zeros are permitted but not required.
- strptime.09.08
%Oe Equivalent to %Od.
- strptime.09.09
%OH The hour (24-hour clock) using the locale's alternative numeric symbols.
- strptime.09.10
%OI The hour (12-hour clock) using the locale's alternative numeric symbols.
- strptime.09.11
%Om The month using the locale's alternative numeric symbols.
- strptime.09.12
%OM The minutes using the locale's alternative numeric symbols.
- strptime.09.13
%OS The seconds using the locale's alternative numeric symbols.
- strptime.09.14
%OU The week number of the year (Sunday as the first day of the week) using the locale's alternative numeric symbols.
- strptime.09.15
%Ow The number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
- strptime.09.16
%OW The week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
- strptime.09.17
%Oy The year (offset from %C ) using the locale's alternative numeric symbols.
- strptime.10
A conversion specification composed of white-space characters is executed by scanning input up to the first character that is not white-space (which remains unscanned), or until no more characters can be scanned.
- strptime.11
A conversion specification that is an ordinary character is executed by scanning the next character from the buffer.
- strptime.12
If the character scanned from the buffer differs from the one comprising the directive,
- strptime.12.01
the directive fails,
- strptime.12.02
and the differing and subsequent characters remain unscanned.
- strptime.13
A series of conversion specifications composed of %n, %t, white-space characters, or any combination is executed by scanning up to the first character that is not white space (which remains unscanned), or until no more characters can be scanned.
- strptime.14
Any other conversion specification is executed by scanning characters until a character matching the next directive is scanned, or until no more characters can be scanned.
- strptime.15
These characters, except the one matching the next directive, are then compared to the locale values associated with the conversion specifier.
- strptime.15.01
If a match is found, values for the appropriate tm structure members are set to values corresponding to the locale information.
- strptime.15.02
If no match is found, strptime() fails and no more characters are scanned.
- strptime.16
Case is ignored when matching items in buf such as month or weekday names.
- strptime.17.01
Upon successful completion, strptime() shall return a pointer to the character following the last character parsed.
- strptime.17.02
Otherwise, a null pointer shall be returned.
- app.strptime.lsb.01
The ISO POSIX (2003) specifies fields for which "leading zeros are permitted but not required"; however, applications shall not expect to be able to supply more leading zeroes for these fields than would be implied by the range of the field. Implementations may choose to either match an input with excess leading zeroes, or treat this as a non-matching input. For example, %j has a range of 001 to 366, so 0, 00, 000, 001, and 045 are acceptable inputs, but inputs such as 0000, 0366 and the like are not.
- [+]util.format.wprintf (334 / 294 / 2)
- [+]fwprintf (56 / 49 / 0)
- fwprintf.01
The fwprintf() function shall place output on the named output stream.
- fwprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- fwprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- fwprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.fwprintf.03
The results are undefined if there are insufficient arguments for the format.
- fwprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.fwprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- fwprintf.05
these functions shall return
- fwprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- fwprintf.05.02
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
- app.fwprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- fwprintf.06
In addition, all forms of fwprintf() may fail if:
- fwprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- fwprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.fwprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- fwprintf.07
In addition, wprintf() and fwprintf() may fail if:
- fwprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- fwprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- fwprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- fwprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- fwprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.fwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.fwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- fwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- fwprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- fwprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- fwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- fwprintf.11.04
An optional length modifier that specifies the size of the argument.
- fwprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- fwprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- fwprintf.12.01
In this case an argument of type int supplies the field width or precision.
- fwprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- fwprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- fwprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- fwprintf.13
The flag wide characters and their meanings are:
- fwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- fwprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- fwprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- fwprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- fwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- fwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.fwprintf.13
The flag wide characters and their meanings are:
- app.fwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.fwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.fwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.fwprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- fwprintf.14
The length modifiers and their meanings are:
- fwprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- fwprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- fwprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- fwprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- fwprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- fwprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- fwprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- fwprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- fwprintf.15
The conversion specifiers and their meanings are:
- fwprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- fwprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- fwprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- fwprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- fwprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- fwprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- fwprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fwprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fwprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- fwprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- fwprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- fwprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- fwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- fwprintf.15.14
C [XSI] Equivalent to lc.
- fwprintf.15.15
S [XSI] Equivalent to ls.
- fwprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.fwprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.fwprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.fwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- fwprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- fwprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- fwprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- fwprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- fwprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]swprintf (55 / 49 / 1)
- swprintf.01
The swprintf() function shall place output followed by the null wide character in consecutive wide characters starting at *ws; no more than n wide characters shall be written, including a terminating null wide character, which is always added (unless n is zero).
- swprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- swprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- swprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.swprintf.03
The results are undefined if there are insufficient arguments for the format.
- app.swprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- swprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- swprintf.05
these functions shall return
- swprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- swprintf.05.02 (failed)
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error.
- app.swprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- app.swprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- swprintf.06
In addition, all forms of fwprintf() may fail if:
- swprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- swprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- swprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- swprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- swprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- swprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.swprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.swprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- swprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- swprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- swprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- swprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- swprintf.11.04
An optional length modifier that specifies the size of the argument.
- swprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- swprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- swprintf.12.01
In this case an argument of type int supplies the field width or precision.
- swprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- swprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- swprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- swprintf.13
The flag wide characters and their meanings are:
- swprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- swprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- swprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- swprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- swprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- swprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.swprintf.13
The flag wide characters and their meanings are:
- app.swprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.swprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.swprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.swprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- swprintf.14
The length modifiers and their meanings are:
- swprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- swprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- swprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- swprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- swprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- swprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- swprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- swprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.swprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.swprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.swprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- swprintf.15
The conversion specifiers and their meanings are:
- swprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- swprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- swprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- swprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- swprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- swprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- swprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- swprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- swprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- swprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- swprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- swprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- swprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- swprintf.15.14
C [XSI] Equivalent to lc.
- swprintf.15.15
S [XSI] Equivalent to ls.
- swprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- swprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- swprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- swprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- swprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- swprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vfwprintf (56 / 49 / 0)
- vfwprintf.01
The fwprintf() function shall place output on the named output stream.
- app.vfwprintf.03
The results are undefined if there are insufficient arguments for the format.
- vfwprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- vfwprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- vfwprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.vfwprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- vfwprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.vfwprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- vfwprintf.05
these functions shall return
- vfwprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- vfwprintf.05.02
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
- vfwprintf.06
In addition, all forms of fwprintf() may fail if:
- vfwprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vfwprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- app.vfwprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vfwprintf.07
In addition, wprintf() and fwprintf() may fail if:
- vfwprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- vfwprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- vfwprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- vfwprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vfwprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vfwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- vfwprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vfwprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vfwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vfwprintf.11.04
An optional length modifier that specifies the size of the argument.
- vfwprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- app.vfwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.vfwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vfwprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vfwprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vfwprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vfwprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- vfwprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vfwprintf.13
The flag wide characters and their meanings are:
- app.vfwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.vfwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vfwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vfwprintf.13
The flag wide characters and their meanings are:
- vfwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- vfwprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- vfwprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vfwprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vfwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vfwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vfwprintf.14
The length modifiers and their meanings are:
- vfwprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vfwprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vfwprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vfwprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vfwprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vfwprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vfwprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vfwprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vfwprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- app.vfwprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.vfwprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vfwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vfwprintf.15
The conversion specifiers and their meanings are:
- vfwprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vfwprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vfwprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vfwprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vfwprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vfwprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vfwprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfwprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfwprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vfwprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- vfwprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- vfwprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- vfwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vfwprintf.15.14
C [XSI] Equivalent to lc.
- vfwprintf.15.15
S [XSI] Equivalent to ls.
- vfwprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- vfwprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vfwprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vfwprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vfwprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vfwprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vswprintf (55 / 49 / 1)
- vswprintf.01
The swprintf() function shall place output followed by the null wide character in consecutive wide characters starting at *ws; no more than n wide characters shall be written, including a terminating null wide character, which is always added (unless n is zero).
- vswprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- vswprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- vswprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.vswprintf.03
The results are undefined if there are insufficient arguments for the format.
- app.vswprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- vswprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- vswprintf.05
these functions shall return
- vswprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- vswprintf.05.02 (failed)
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error.
- app.vswprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- app.vswprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vswprintf.06
In addition, all forms of fwprintf() may fail if:
- vswprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vswprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vswprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- vswprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- vswprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vswprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vswprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.vswprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vswprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- vswprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vswprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vswprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vswprintf.11.04
An optional length modifier that specifies the size of the argument.
- vswprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- vswprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vswprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vswprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vswprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- vswprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- vswprintf.13
The flag wide characters and their meanings are:
- vswprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- vswprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- vswprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vswprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vswprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vswprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vswprintf.13
The flag wide characters and their meanings are:
- app.vswprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.vswprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vswprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vswprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vswprintf.14
The length modifiers and their meanings are:
- vswprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vswprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vswprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vswprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vswprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vswprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vswprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vswprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- app.vswprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.vswprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vswprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vswprintf.15
The conversion specifiers and their meanings are:
- vswprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vswprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vswprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vswprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vswprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vswprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vswprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vswprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vswprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vswprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- vswprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- vswprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- vswprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vswprintf.15.14
C [XSI] Equivalent to lc.
- vswprintf.15.15
S [XSI] Equivalent to ls.
- vswprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- vswprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vswprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vswprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vswprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vswprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]vwprintf (56 / 49 / 0)
- vwprintf.01
The wprintf() function shall place output on the standard output stream stdout.
- vwprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- vwprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- vwprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.vwprintf.03
The results are undefined if there are insufficient arguments for the format.
- vwprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.vwprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- vwprintf.05
these functions shall return
- vwprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- vwprintf.05.02
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
- app.vwprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- app.vwprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- vwprintf.06
In addition, all forms of fwprintf() may fail if:
- vwprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- vwprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vwprintf.07
In addition, wprintf() and fwprintf() may fail if:
- vwprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- vwprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- vwprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- vwprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vwprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- app.vwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.vwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vwprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- vwprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- vwprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- vwprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- vwprintf.11.04
An optional length modifier that specifies the size of the argument.
- vwprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- vwprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- vwprintf.12.01
In this case an argument of type int supplies the field width or precision.
- vwprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- vwprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- vwprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- app.vwprintf.13
The flag wide characters and their meanings are:
- app.vwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.vwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.vwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- vwprintf.13
The flag wide characters and their meanings are:
- vwprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- vwprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- vwprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- vwprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- vwprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- vwprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.vwprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- vwprintf.14
The length modifiers and their meanings are:
- vwprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- vwprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- vwprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- vwprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- vwprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- vwprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- vwprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- vwprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- vwprintf.15
The conversion specifiers and their meanings are:
- vwprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vwprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vwprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vwprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- vwprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- vwprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- vwprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vwprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vwprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- vwprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- vwprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- vwprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- vwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vwprintf.15.14
C [XSI] Equivalent to lc.
- vwprintf.15.15
S [XSI] Equivalent to ls.
- vwprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.vwprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.vwprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.vwprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- vwprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- vwprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- vwprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- vwprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- vwprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]wprintf (56 / 49 / 0)
- wprintf.01
The wprintf() function shall place output on the standard output stream stdout.
- wprintf.03
Each of these functions shall convert, format, and print its arguments under control of the format wide-character string. The format is composed of zero or more directives:
- wprintf.03.01
ordinary wide-characters, which are simply copied to the output stream
- wprintf.03.02
conversion specifications, each of which results in the fetching of zero or more arguments.
- app.wprintf.03
The results are undefined if there are insufficient arguments for the format.
- app.wprintf.04
The format can contain either numbered argument specifications (that is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is, % and * ), but not both. The only exception to this is that %% can be mixed with the "%n$" form. The results of mixing numbered and unnumbered argument specifications in a format wide-character string are undefined.
- wprintf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- wprintf.05
these functions shall return
- wprintf.05.01
the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf()
- wprintf.05.02
a negative value if an output error was encountered, [CX] and set errno to indicate the error.
- app.wprintf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format wide-character string.
- app.wprintf.06
A field width, or precision, or both, may be indicated by an asterisk ( '*' ). In this case an argument of type int supplies the field width or precision. Applications shall ensure that arguments specifying field width, or precision, or both appear in that order before the argument, if any, to be converted.
- wprintf.06
In addition, all forms of fwprintf() may fail if:
- wprintf.06.01
[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected.
- wprintf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- wprintf.07
In addition, wprintf() and fwprintf() may fail if:
- wprintf.07.01
[ENOMEM] [XSI] Insufficient storage space is available.
- wprintf.08
In format wide-character strings containing the "%n$" form of conversion specification, numbered arguments in the argument list can be referenced from the format wide-character string as many times as required.
- wprintf.09
In format wide-character strings containing the % form of conversion specification, each argument in the argument list shall be used exactly once.
- wprintf.10
All forms of the fwprintf() function allow for the insertion of a locale-dependent radix character in the output string, output as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- wprintf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- wprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- wprintf.11.01
Zero or more flags (in any order), which modify the meaning of the conversion specification.
- wprintf.11.02
An optional minimum field width. If the converted value has fewer wide characters than the field width, it shall be padded with spaces by default on the left; it shall be padded on the right, if the left-adjustment flag ( '-' ), described below, is given to the field width. The field width takes the form of an asterisk ( '*' ), described below, or a decimal integer.
- wprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- wprintf.11.04
An optional length modifier that specifies the size of the argument.
- wprintf.11.05
A conversion specifier wide character that indicates the type of conversion to be applied.
- app.wprintf.11
Each conversion specification is introduced by the '%' wide character [XSI] or by the wide-character sequence "%n$", after which the following appear in sequence:
- app.wprintf.11.03
An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the radix character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of wide characters to be printed from a string in the s conversion specifiers. The precision takes the form of a period ( '.' ) followed either by an asterisk ( '*' ), described below, or an optional decimal digit string, where a null digit string is treated as 0. If a precision appears with any other conversion wide character, the behavior is undefined.
- wprintf.12
A field width, or precision, or both, may be indicated by an asterisk ( '*' ).
- wprintf.12.01
In this case an argument of type int supplies the field width or precision.
- wprintf.12.02
A negative field width is taken as a '-' flag followed by a positive field width.
- wprintf.12.03
A negative precision is taken as if the precision were omitted. [XSI] In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision, for example:wprintf(L"%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec); The flag wide characters and their meanings are:' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used. - The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified. + The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified. <space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored. # Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined. 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined. The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% . If a conversion specification does not match one of the above forms, the behavior is undefined.In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result. Characters generated by fwprintf() and wprintf() shall be printed as if fputwc() had been called.For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded. If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros. Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.[CX] The st_ctime and st_mtime fields of the file shall be marked for update between the call to a successful execution of fwprintf() or wprintf() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). RETURN VALUEUpon successful completion, these functions shall return the number of wide characters transmitted, excluding the terminating null wide character in the case of swprintf(), or a negative value if an output error was encountered, [CX] and set errno to indicate the error. If n or more wide characters were requested to be written, swprintf() shall return a negative value, [CX] and set errno to indicate the error. ERRORSFor the conditions under which fwprintf() and wprintf() fail and may fail, refer to fputwc().In addition, all forms of fwprintf() may fail if:[EILSEQ] [XSI] A wide-character code that does not correspond to a valid character has been detected. [EINVAL] [XSI] There are insufficient arguments. In addition, wprintf() and fwprintf() may fail if:[ENOMEM] [XSI] Insufficient storage space is available. The following sections are informative.EXAMPLESTo print the language-independent date and time format, the following statement could be used:wprintf(format, weekday, month, day, hour, min);For American usage, format could be a pointer to the wide-character string:L"%s, %s %d, %d:%.2d\n"producing the message:Sunday, July 3, 10:02whereas for German usage, format could be a pointer to the wide-character string:L"%1$s, %3$d. %2$s, %4$d:%5$.2d\n"producing the message:Sonntag, 3. Juli, 10:02APPLICATION USAGENone.RATIONALENone.FUTURE DIRECTIONSNone.SEE ALSObtowc(), fputwc(), fwscanf(), mbrtowc(), setlocale() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, <stdio.h>, <wchar.h>CHANGE HISTORYFirst released in Issue 5. Included for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E).Issue 6The Open Group Corrigendum U040/1 is applied to the RETURN VALUE section, describing the case if n or more wide characters are requested to be written using swprintf().The DESCRIPTION is updated to avoid use of the term "must" for application requirements.The following changes are made for alignment with the ISO/IEC 9899:1999 standard:The prototypes for fwprintf(), swprintf(), and wprintf() are updated.The DESCRIPTION is updated.The hh, ll, j, t, and z length modifiers are added.The a, A, and F conversion characters are added.XSI shading is removed from the description of character string representations of infinity and NaN floating-point values.The DESCRIPTION is updated to use the terms "conversion specifier" and "conversion specification" consistently.ISO/IEC 9899:1999 standard, Technical Corrigendum 1 is incorporated.End of informative text.UNIX (R) is a registered Trademark of The Open Group.
POSIX (R) is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]
- wprintf.12.04
In format wide-character strings containing the "%n$" form of a conversion specification, a field width or precision may be indicated by the sequence "*m$", where m is a decimal integer in the range [1,{NL_ARGMAX}] giving the position in the argument list (after the format argument) of an integer argument containing the field width or precision
- wprintf.13
The flag wide characters and their meanings are:
- wprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- wprintf.13.02
- The result of the conversion shall be left-justified within the field. The conversion shall be right-justified if this flag is not specified.
- wprintf.13.03
+ The result of a signed conversion shall always begin with a sign ( '+' or '-' ). The conversion shall begin with a sign only when a negative value is converted if this flag is not specified.
- wprintf.13.04
<space> If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
- wprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- wprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.wprintf.13
The flag wide characters and their meanings are:
- app.wprintf.13.01
' [XSI] The integer portion of the result of a decimal conversion ( %i, %d, %u, %f, %F, %g, or %G ) shall be formatted with thousands' grouping wide characters. For other conversions, the behavior is undefined. The numeric grouping wide character is used.
- app.wprintf.13.05
# Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be 0. For x or X conversion specifiers, a non-zero result shall have 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g , and G conversion specifiers, the result shall always contain a radix character, even if no digits follow it. Without this flag, a radix character appears in the result of these conversions only if a digit follows it. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they normally are. For other conversion specifiers, the behavior is undefined.
- app.wprintf.13.06
0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers, leading zeros (following any indication of sign or base) are used to pad to the field width; no space padding is performed. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. If the '0' and '" flags both appear, the grouping wide characters are inserted before zero padding. For other conversions, the behavior is undefined.
- app.wprintf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument. h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument. l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier. ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument. j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument. z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument. t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
- wprintf.14
The length modifiers and their meanings are:
- wprintf.14.01
hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char argument.
- wprintf.14.02
h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short or unsigned short argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short or unsigned short before printing); or that a following n conversion specifier applies to a pointer to a short argument.
- wprintf.14.03
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long or unsigned long argument; that a following n conversion specifier applies to a pointer to a long argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion specifier.
- wprintf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long or unsigned long long argument; or that a following n conversion specifier applies to a pointer to a long long argument.
- wprintf.14.05
j Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion specifier applies to a pointer to an intmax_t argument.
- wprintf.14.06
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to a size_t argument.
- wprintf.14.07
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
- wprintf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument.
- wprintf.15
The conversion specifiers and their meanings are:
- wprintf.15.01
d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- wprintf.15.02
o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- wprintf.15.03
u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- wprintf.15.04
x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters.
- wprintf.15.05
X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" .
- wprintf.15.06
f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.
- wprintf.15.07
e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- wprintf.15.08
g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- wprintf.15.09
a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
- wprintf.15.10
c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written.
- wprintf.15.11
s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.
- wprintf.15.12
p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner.
- wprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- wprintf.15.14
C [XSI] Equivalent to lc.
- wprintf.15.15
S [XSI] Equivalent to ls.
- wprintf.15.16
% Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.wprintf.15
The conversion specifiers and their meanings are:d, i The int argument shall be converted to a signed decimal in the style "[-]dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. o The unsigned argument shall be converted to unsigned octal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. u The unsigned argument shall be converted to unsigned decimal format in the style "dddd". The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. x The unsigned argument shall be converted to unsigned hexadecimal format in the style "dddd" ; the letters "abcdef" are used. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no wide characters. X Equivalent to the x conversion specifier, except that letters "ABCDEF" are used instead of "abcdef" . f, F The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. A double argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined. A double argument representing a NaN shall be converted in one of the styles "[-]nan" or "[-]nan(n-char-sequence)"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.e, E The double argument shall be converted in the style "[-]d.ddde?dd", where there shall be one digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall be equal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no '#' flag is present, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate number of digits. The E conversion wide character shall produce a number with 'E' instead of 'e' introducing the exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.g, G The double argument shall be converted in the style f or e (or in the style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. If an explicit precision is zero, it shall be taken as 1. The style used depends on the value converted; style e (or E ) shall be used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailing zeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.a, A A double argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhp?d", where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted; if the precision is zero and the '#' flag is not specified, no decimal-point wide character shall appear. The letters "abcdef" are used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with 'X' and 'P' instead of 'x' and 'p'. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.c If no l (ell) qualifier is present, the int argument shall be converted to a wide character as if by calling the btowc() function and the resulting wide character shall be written. Otherwise, the wint_t argument shall be converted to wchar_t, and written. s If no l (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character array containing a character sequence beginning in the initial shift state. Characters from the array shall be converted as if by repeated calls to the mbrtowc() function, with the conversion state described by an mbstate_t object initialized to zero before the first character is converted, and written up to (but not including) the terminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If the precision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If an l (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type wchar_t. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If no precision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null wide character. If a precision is specified, no more than that many wide characters shall be written.p The application shall ensure that the argument is a pointer to void. The value of the pointer shall be converted to a sequence of printable wide characters in an implementation-defined manner. n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Output a '%' wide character; no argument shall be converted. The entire conversion specification shall be %% .
- app.wprintf.15.01
If a conversion specification does not match one of the above forms, the behavior is undefined.
- app.wprintf.15.13
n The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characters written to the output so far by this call to one of the fwprintf() functions. No argument shall be converted, but one shall be consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.
- wprintf.16
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field shall be expanded to contain the conversion result.
- wprintf.17.02
For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers in hexadecimal floating style with the given precision, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- wprintf.18.01
For e, E, f, F, g, and G conversion specifiers, if the number of significant decimal digits is at most DECIMAL_DIG, then the result should be correctly rounded.
- wprintf.18.02
If the number of significant decimal digits is more than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG digits, then the result should be an exact representation with trailing zeros.
- wprintf.18.03
Otherwise, the source value is bounded by two adjacent decimal strings L < U, both having DECIMAL_DIG significant digits; the value of the resultant decimal string D should satisfy L <= D <= U, with the extra stipulation that the error should have a correct sign for the current rounding direction.
- [+]util.format.wscanf (336 / 300 / 0)
- [+]fwscanf (56 / 50 / 0)
- fwscanf.01
The fwscanf() function shall read from the named input stream.
- fwscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- fwscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- fwscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- fwscanf.03.02
a conversion specification.
- fwscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.fwscanf.03
The result is undefined if there are insufficient arguments for the format.
- fwscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.fwscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- app.fwscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- fwscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- fwscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- fwscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- fwscanf.06
In addition, fwscanf() may fail if:
- fwscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- fwscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- fwscanf.07
If a directive fails, as detailed below, the function shall return.
- fwscanf.08
Failures are described as
- fwscanf.08.01
input failures (due to the unavailability of input bytes)
- fwscanf.08.02
matching failures (due to inappropriate input)
- fwscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- fwscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- fwscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- fwscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- fwscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- fwscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- fwscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- fwscanf.11.06
An optional assignment-suppressing character '*'.
- fwscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- fwscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- fwscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- app.fwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.fwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- fwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- fwscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- fwscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- fwscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- fwscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- fwscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- fwscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- fwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.fwscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- fwscanf.14
The length modifiers and their meanings are:
- fwscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- fwscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- fwscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- fwscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- fwscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- fwscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- fwscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- fwscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- fwscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.fwscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.fwscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.fwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- fwscanf.15
The following conversion specifier wide characters are valid:
- fwscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- fwscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- fwscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fwscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fwscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- fwscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- fwscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- fwscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- fwscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- fwscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- fwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- fwscanf.15.12
C [XSI] Equivalent to lc.
- fwscanf.15.13
S [XSI] Equivalent to ls.
- fwscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- fwscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- fwscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- fwscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- fwscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]swscanf (56 / 50 / 0)
- swscanf.01
The swscanf() function shall read from the wide-character string ws.
- swscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- swscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- swscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- swscanf.03.02
a conversion specification.
- swscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.swscanf.03
The result is undefined if there are insufficient arguments for the format.
- app.swscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- swscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- swscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- swscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- swscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.swscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- swscanf.06
In addition, fwscanf() may fail if:
- swscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- swscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- swscanf.07
If a directive fails, as detailed below, the function shall return.
- swscanf.08
Failures are described as
- swscanf.08.01
input failures (due to the unavailability of input bytes)
- swscanf.08.02
matching failures (due to inappropriate input)
- swscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- swscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- swscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- swscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- swscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- swscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- swscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- swscanf.11.06
An optional assignment-suppressing character '*'.
- swscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- swscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- swscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- swscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- swscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- swscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- swscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- swscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- swscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- swscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- swscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.swscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.swscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- app.swscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- swscanf.14
The length modifiers and their meanings are:
- swscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- swscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- swscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- swscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- swscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- swscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- swscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- swscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- swscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.swscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.swscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.swscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- swscanf.15
The following conversion specifier wide characters are valid:
- swscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- swscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- swscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- swscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- swscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- swscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- swscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- swscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- swscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- swscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- swscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- swscanf.15.12
C [XSI] Equivalent to lc.
- swscanf.15.13
S [XSI] Equivalent to ls.
- swscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- swscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- swscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.Reaching the end of the string in swscanf() shall be equivalent to encountering end-of-file for fwscanf().
- swscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- swscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vfwscanf (56 / 50 / 0)
- vfwscanf.01
The fwscanf() function shall read from the named input stream.
- vfwscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- vfwscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- vfwscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- vfwscanf.03.02
a conversion specification.
- vfwscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.vfwscanf.03
The result is undefined if there are insufficient arguments for the format.
- app.vfwscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- vfwscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.vfwscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vfwscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vfwscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vfwscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- vfwscanf.06
In addition, fwscanf() may fail if:
- vfwscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vfwscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vfwscanf.07
If a directive fails, as detailed below, the function shall return.
- vfwscanf.08
Failures are described as
- vfwscanf.08.01
input failures (due to the unavailability of input bytes)
- vfwscanf.08.02
matching failures (due to inappropriate input)
- vfwscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- vfwscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vfwscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vfwscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- vfwscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vfwscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- vfwscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vfwscanf.11.06
An optional assignment-suppressing character '*'.
- vfwscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- vfwscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- vfwscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- vfwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- vfwscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- vfwscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- vfwscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- vfwscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vfwscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- vfwscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- vfwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.vfwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.vfwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- vfwscanf.14
The length modifiers and their meanings are:
- vfwscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vfwscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vfwscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vfwscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vfwscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vfwscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vfwscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vfwscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vfwscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.vfwscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vfwscanf.15
The following conversion specifier wide characters are valid:
- vfwscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vfwscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vfwscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfwscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfwscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vfwscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- vfwscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vfwscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- vfwscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- vfwscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- vfwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vfwscanf.15.12
C [XSI] Equivalent to lc.
- vfwscanf.15.13
S [XSI] Equivalent to ls.
- vfwscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- vfwscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- app.vfwscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.vfwscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vfwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vfwscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- vfwscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- vfwscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vswscanf (56 / 50 / 0)
- vswscanf.01
The swscanf() function shall read from the wide-character string ws.
- vswscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- app.vswscanf.03
The result is undefined if there are insufficient arguments for the format.
- vswscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- vswscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- vswscanf.03.02
a conversion specification.
- vswscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- vswscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- app.vswscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- app.vswscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vswscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vswscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vswscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- vswscanf.06
In addition, fwscanf() may fail if:
- vswscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vswscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vswscanf.07
If a directive fails, as detailed below, the function shall return.
- vswscanf.08
Failures are described as
- vswscanf.08.01
input failures (due to the unavailability of input bytes)
- vswscanf.08.02
matching failures (due to inappropriate input)
- vswscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- vswscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vswscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vswscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- vswscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vswscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- vswscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vswscanf.11.06
An optional assignment-suppressing character '*'.
- vswscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- vswscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- vswscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- vswscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- vswscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- vswscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- vswscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- vswscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vswscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- vswscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- vswscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.vswscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.vswscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- app.vswscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vswscanf.14
The length modifiers and their meanings are:
- vswscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vswscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vswscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vswscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vswscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vswscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vswscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vswscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vswscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vswscanf.15
The following conversion specifier wide characters are valid:
- vswscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vswscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vswscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vswscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vswscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vswscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- vswscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vswscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- vswscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- vswscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- vswscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vswscanf.15.12
C [XSI] Equivalent to lc.
- vswscanf.15.13
S [XSI] Equivalent to ls.
- vswscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- vswscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- app.vswscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.vswscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vswscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vswscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.Reaching the end of the string in swscanf() shall be equivalent to encountering end-of-file for fwscanf().
- vswscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- vswscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]vwscanf (56 / 50 / 0)
- vwscanf.01
The wscanf() function shall read from the standard input stream stdin.
- vwscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- vwscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- vwscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- vwscanf.03.02
a conversion specification.
- vwscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.vwscanf.03
The result is undefined if there are insufficient arguments for the format.
- app.vwscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- vwscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- vwscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- vwscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- vwscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.vwscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- vwscanf.06
In addition, fwscanf() may fail if:
- vwscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- vwscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- vwscanf.07
If a directive fails, as detailed below, the function shall return.
- vwscanf.08
Failures are described as
- vwscanf.08.01
input failures (due to the unavailability of input bytes)
- vwscanf.08.02
matching failures (due to inappropriate input)
- vwscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- vwscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- vwscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- vwscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- vwscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- vwscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- vwscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- vwscanf.11.06
An optional assignment-suppressing character '*'.
- vwscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- vwscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- vwscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- vwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- vwscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- vwscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- vwscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- vwscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- vwscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- vwscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- vwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.vwscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.vwscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- app.vwscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vwscanf.14
The length modifiers and their meanings are:
- vwscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- vwscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- vwscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- vwscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- vwscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- vwscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- vwscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- vwscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- vwscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- vwscanf.15
The following conversion specifier wide characters are valid:
- vwscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vwscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- vwscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vwscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vwscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- vwscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- vwscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- vwscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- vwscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- vwscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- vwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vwscanf.15.12
C [XSI] Equivalent to lc.
- vwscanf.15.13
S [XSI] Equivalent to ls.
- vwscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- vwscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- app.vwscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.vwscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.vwscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- vwscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- vwscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- vwscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]wscanf (56 / 50 / 0)
- wscanf.01
The wscanf() function shall read from the standard input stream stdin.
- wscanf.02
The fwscanf() functions shall execute each directive of the format in turn.
- wscanf.03
The format is a wide-character string composed of zero or more directives. Each directive is composed of one of the following:
- wscanf.03.01
an ordinary wide character (neither '%' nor a white-space character)
- wscanf.03.02
a conversion specification.
- wscanf.03.03
one or more white-space wide characters ( <space>s, <tab>s, <newline>s, <vertical-tab>s, or <form-feed>s)
- app.wscanf.03
The result is undefined if there are insufficient arguments for the format.
- app.wscanf.04
The format can contain either form of a conversion specification-that is, % or "%n$"- but the two forms cannot normally be mixed within a single format wide-character string. The only exception to this is that %% or %* can be mixed with the "%n$" form.
- wscanf.04
If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
- wscanf.05.01
Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure.
- wscanf.05.02
If a read error occurs, the error indicator for the stream is set, EOF shall be returned, [CX] and errno shall be set to indicate the error.
- wscanf.05.03
If the input ends before the first matching failure or conversion, EOF shall be returned.
- app.wscanf.05
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the ( N-1)th, are pointers.
- wscanf.06
In addition, fwscanf() may fail if:
- wscanf.06.01
[EILSEQ] [XSI] Input byte sequence does not form a valid character.
- wscanf.06.02
[EINVAL] [XSI] There are insufficient arguments.
- wscanf.07
If a directive fails, as detailed below, the function shall return.
- wscanf.08
Failures are described as
- wscanf.08.01
input failures (due to the unavailability of input bytes)
- wscanf.08.02
matching failures (due to inappropriate input)
- wscanf.09
A directive composed of one or more white-space wide characters is executed by reading input until no more valid input can be read, or up to the first wide character which is not a white-space wide character, which remains unread.
- wscanf.10
The fwscanf() function in all its forms allows for detection of a language-dependent radix character in the input string, encoded as a wide-character value. The radix character is defined in the program's locale (category LC_NUMERIC ).
- wscanf.10.01
In the POSIX locale, or in a locale where the radix character is not defined, the radix character shall default to a period ( '.' ).
- wscanf.11
Each conversion specification is introduced by a '%' [XSI] or the sequence "%n$" after which the following appear in sequence:
- wscanf.11.02
An optional non-zero decimal integer that specifies the maximum field width.
- wscanf.11.04
An optional length modifier that specifies the size of the receiving object.
- wscanf.11.05
A conversion specifier wide character that specifies the type of conversion to be applied. The valid conversion specifiers are described below.
- wscanf.11.06
An optional assignment-suppressing character '*'.
- wscanf.12
A directive that is an ordinary wide character shall be executed as follows.
- wscanf.12.01
The next wide character is read from the input and compared with the wide character that comprises the directive;
- wscanf.12.02
The next wide character is read from the input and compared with the wide character that comprises the directive; if the comparison shows that they are not equivalent, the directive shall fail, and the differing and subsequent wide characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a wide character from being read, the directive shall fail.
- app.wscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- app.wscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$". If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the space provided, the behavior is undefined.
- wscanf.13
A directive that is a conversion specification defines a set of matching input sequences, as described below for each conversion wide character. A conversion specification is executed in the following steps.
- wscanf.13.01
Input white-space wide characters (as specified by iswspace()) shall be skipped, unless the conversion specification includes a [, c, or n conversion specifier.
- wscanf.13.02
An item shall be read from the input, unless the conversion specification includes an n conversion specifier wide character. An input item is defined as the longest sequence of input wide characters, not exceeding any specified field width, which is an initial subsequence of a matching sequence.
- wscanf.13.03
The first wide character, if any, after the input item shall remain unread.
- wscanf.13.04
If the length of the input item is zero, the execution of the conversion specification shall fail; this condition is a matching failure, unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure.
- wscanf.13.05
Except in the case of a % conversion specifier, the input item (or, in the case of a %n conversion specification, the count of input wide characters) shall be converted to a type appropriate to the conversion wide character.
- wscanf.13.06
If the input item is not a matching sequence, the execution of the conversion specification shall fail; this condition is a matching failure.
- wscanf.13.07
Unless assignment suppression was indicated by a '*', the result of the conversion shall be placed in the object pointed to by the first argument following the format argument that has not already received a conversion result if the conversion specification is introduced by %, [XSI] or in the nth argument if introduced by the wide-character sequence "%n$".
- app.wscanf.14
The length modifiers and their meanings are:hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char. h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short. l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t. ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long. j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t. z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type. t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type. L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double. If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- wscanf.14
The length modifiers and their meanings are:
- wscanf.14.01
hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to signed char or unsigned char.
- wscanf.14.02
h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short or unsigned short.
- wscanf.14.03
l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long or unsigned long; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ conversion specifier applies to an argument with type pointer to wchar_t.
- wscanf.14.04
ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long or unsigned long long.
- wscanf.14.05
j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.
- wscanf.14.06
z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed integer type.
- wscanf.14.07
t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding unsigned type.
- wscanf.14.08
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to long double.
- wscanf.14.09
The %s, %S and %[ conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a case, the argument corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results.
- app.wscanf.15
The following conversion specifier wide characters are valid:d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int. o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned. a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined. n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined. C [XSI] Equivalent to lc. S [XSI] Equivalent to ls. % Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%. If a conversion specification is invalid, the behavior is undefined.
- app.wscanf.15.01
If a conversion specification is invalid, the behavior is undefined.
- app.wscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- wscanf.15
The following conversion specifier wide characters are valid:
- wscanf.15.01
d Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstol() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- wscanf.15.02
i Matches an optionally signed integer, whose format is the same as expected for the subject sequence of wcstol() with 0 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to int.
- wscanf.15.03
o Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 8 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- wscanf.15.04
u Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 10 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- wscanf.15.05
x Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of wcstoul() with the value 16 for the base argument. In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to unsigned.
- wscanf.15.06
a, e, f, g Matches an optionally signed floating-point number, infinity, or NaN whose format is the same as expected for the subject sequence of wcstod(). In the absence of a size modifier, the application shall ensure that the corresponding argument is a pointer to float. If the fwprintf() family of functions generates character string representations for infinity and NaN (a symbolic entity encoded in floating-point format) to support IEEE Std 754-1985, the fwscanf() family of functions shall recognize them as input.
- wscanf.15.07
s Matches a sequence of non white-space wide characters. If no l (ell) qualifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.
- wscanf.15.08
[ Matches a non-empty sequence of wide characters from a set of expected wide characters (the wscanset). If no l (ell) qualifier is present, wide characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The application shall ensure that the corresponding argument is a pointer to a character array large enough to accept the sequence and the terminating null character, which shall be added automatically. If an l (ell) qualifier is present, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence and the terminating null wide character, which shall be added automatically.The conversion specification includes all subsequent wide characters in the format string up to and including the matching right square bracket ( ']' ). The wide characters between the square brackets (the wscanlist) comprise the scanset, unless the wide character after the left square bracket is a circumflex ( '^' ), in which case the wscanset contains all wide characters that do not appear in the wscanlist between the circumflex and the right square bracket. If the conversion specification begins with "[]" or "[^]", the right square bracket is included in the wscanlist and the next right square bracket is the matching right square bracket that ends the conversion specification; otherwise, the first right square bracket is the one that ends the conversion specification. If a '-' is in the wscanlist and is not the first wide character, nor the second where the first wide character is a '^', nor the last wide character, the behavior is implementation-defined.
- wscanf.15.09
c Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the conversion specification). If no l (ell) length modifier is present, characters from the input field shall be converted as if by repeated calls to the wcrtomb() function, with the conversion state described by an mbstate_t object initialized to zero before the first wide character is converted. The corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence. No null character is added.If an l (ell) length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the sequence. No null wide character is added.Otherwise, the application shall ensure that the corresponding argument is a pointer to an array of wchar_t large enough to accept the sequence. No null wide character is added.
- wscanf.15.10
p Matches an implementation-defined set of sequences, which shall be the same as the set of sequences that is produced by the %p conversion specification of the corresponding fwprintf() functions. The application shall ensure that the corresponding argument is a pointer to a pointer to void. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the %p conversion is undefined.
- wscanf.15.11
n No input is consumed. The application shall ensure that the corresponding argument is a pointer to the integer into which is to be written the number of wide characters read from the input so far by this call to the fwscanf() functions. Execution of a %n conversion specification shall not increment the assignment count returned at the completion of execution of the function. No argument shall be converted, but one shall be consumed. If the conversion specification includes an assignment-suppressing wide character or a field width, the behavior is undefined.
- wscanf.15.12
C [XSI] Equivalent to lc.
- wscanf.15.13
S [XSI] Equivalent to ls.
- wscanf.15.14
% Matches a single '%' wide character; no conversion or assignment shall occur. The complete conversion specification shall be %%.
- wscanf.15.15
The conversion specifiers A, E, F, G, and X are also valid and shall be equivalent to, respectively, a, e, f, g, and x.
- wscanf.16
If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any wide characters matching the current conversion specification (except for %n ) have been read (other than leading white-space, where permitted), execution of the current conversion specification shall terminate with an input failure. Otherwise, unless execution of the current conversion specification is terminated with a matching failure, execution of the following conversion specification (if any) shall be terminated with an input failure.
- wscanf.17
If conversion terminates on a conflicting input, the offending input shall be left unread in the input.
- wscanf.18
Any trailing white space (including <newline>) shall be left unread unless matched by a conversion specification. The success of literal matches and suppressed assignments is only directly determinable via the %n conversion specification.
- [+]util.format.wtime (69 / 6 / 0)
- [+]wcsftime (69 / 6 / 0)
- wcsftime.01
The wcsftime() function shall be equivalent to the strftime() function, except that:
- wcsftime.01.01
The argument wcs points to the initial element of an array of wide characters into which the generated output is to be placed.
- wcsftime.01.02
The argument maxsize indicates the maximum number of wide characters to be placed in the output array.
- wcsftime.01.03
The argument format is a wide-character string and the conversion specifications are replaced by corresponding sequences of wide characters.
- wcsftime.01.04
The return value indicates the number of wide characters placed in the output array.
- app.wcsftime.02
If copying takes place between objects that overlap, the behavior is undefined.
- wcsftime.03.01
If the total number of resulting wide-character codes including the terminating null wide-character code is no more than maxsize, wcsftime() shall return the number of wide-character codes placed into the array pointed to by wcs, not including the terminating null wide-character code.
- wcsftime.03.02
Otherwise, zero is returned and the contents of the array are unspecified.
- wcsftime.strftime.03 (struct)
The format string consists of zero or more conversion specifications and ordinary characters.
- wcsftime.strftime.04 (struct)
A conversion specification consists of a '%' character, possibly followed by an E or O modifier, and a terminating conversion specifier character that determines the conversion specification's behavior.
- wcsftime.strftime.05
All ordinary characters (including the terminating null byte) are copied unchanged into the array.
- wcsftime.strftime.07
No more than maxsize bytes are placed into the array.
- wcsftime.strftime.08
Each conversion specifier is replaced by appropriate characters as described in the following list.
Generalizes:
- wcsftime.strftime.11.01
- wcsftime.strftime.11.02
- wcsftime.strftime.11.03
- wcsftime.strftime.11.04
- wcsftime.strftime.11.05
- wcsftime.strftime.11.06
- wcsftime.strftime.11.07
- wcsftime.strftime.11.08
- wcsftime.strftime.11.09
- wcsftime.strftime.11.10
- wcsftime.strftime.11.11
- wcsftime.strftime.11.12
- wcsftime.strftime.11.13
- wcsftime.strftime.11.14
- wcsftime.strftime.11.15
- wcsftime.strftime.11.16
- wcsftime.strftime.11.17
- wcsftime.strftime.11.18
- wcsftime.strftime.11.19
- wcsftime.strftime.11.20
- wcsftime.strftime.11.21
- wcsftime.strftime.11.22
- wcsftime.strftime.11.23
- wcsftime.strftime.11.24
- wcsftime.strftime.11.25
- wcsftime.strftime.11.26
- wcsftime.strftime.11.27
- wcsftime.strftime.11.28
- wcsftime.strftime.11.29
- wcsftime.strftime.11.30
- wcsftime.strftime.11.31
- wcsftime.strftime.11.32
- wcsftime.strftime.11.33
- wcsftime.strftime.11.34
- wcsftime.strftime.11.35
- wcsftime.strftime.11.36
- wcsftime.strftime.11.37
- wcsftime.strftime.17.01
- wcsftime.strftime.17.02
- wcsftime.strftime.17.03
- wcsftime.strftime.17.04
- wcsftime.strftime.17.05
- wcsftime.strftime.17.06
- wcsftime.strftime.17.07
- wcsftime.strftime.17.08
- wcsftime.strftime.17.09
- wcsftime.strftime.17.10
- wcsftime.strftime.17.11
- wcsftime.strftime.17.12
- wcsftime.strftime.17.13
- wcsftime.strftime.17.14
- wcsftime.strftime.17.15
- wcsftime.strftime.17.16
- wcsftime.strftime.17.17
- wcsftime.strftime.17.18
- wcsftime.strftime.17.19
- wcsftime.strftime.09 (struct)
The appropriate characters are determined using the LC_TIME category of the current locale and by the values of zero or more members of the broken-down time structure pointed to by timeptr, as specified in brackets in the description.
- wcsftime.strftime.11
The following conversion specifications are supported:
- wcsftime.strftime.11.01
%a Replaced by the locale's abbreviated weekday name. [ tm_wday]
- wcsftime.strftime.11.02
%A Replaced by the locale's full weekday name. [ tm_wday]
- wcsftime.strftime.11.03
%b Replaced by the locale's abbreviated month name. [ tm_mon]
- wcsftime.strftime.11.04
%B Replaced by the locale's full month name. [ tm_mon]
- wcsftime.strftime.11.05
%c Replaced by the locale's appropriate date and time representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- wcsftime.strftime.11.06
%C Replaced by the year divided by 100 and truncated to an integer, as a decimal number [00,99]. [ tm_year]
- wcsftime.strftime.11.07
%d Replaced by the day of the month as a decimal number [01,31]. [ tm_mday]
- wcsftime.strftime.11.08
%D Equivalent to %m / %d / %y. [ tm_mon, tm_mday, tm_year]
- wcsftime.strftime.11.09
%e Replaced by the day of the month as a decimal number [1,31]; a single digit is preceded by a space. [ tm_mday]
- wcsftime.strftime.11.10
%F Equivalent to %Y - %m - %d (the ISO 8601:2000 standard date format). [ tm_year, tm_mon, tm_mday]
- wcsftime.strftime.11.11
%g Replaced by the last 2 digits of the week-based year (see below) as a decimal number [00,99]. [ tm_year, tm_wday, tm_yday]
- wcsftime.strftime.11.12
%G Replaced by the week-based year (see below) as a decimal number (for example, 1977). [ tm_year, tm_wday, tm_yday]
- wcsftime.strftime.11.13
%h Equivalent to %b. [ tm_mon]
- wcsftime.strftime.11.14
%H Replaced by the hour (24-hour clock) as a decimal number [00,23]. [ tm_hour]
- wcsftime.strftime.11.15
%I Replaced by the hour (12-hour clock) as a decimal number [01,12]. [ tm_hour]
- wcsftime.strftime.11.16
%j Replaced by the day of the year as a decimal number [001,366]. [ tm_yday]
- wcsftime.strftime.11.17
%m Replaced by the month as a decimal number [01,12]. [ tm_mon]
- wcsftime.strftime.11.18
%M Replaced by the minute as a decimal number [00,59]. [ tm_min]
- wcsftime.strftime.11.19
%n Replaced by a <newline>.
- wcsftime.strftime.11.20
%p Replaced by the locale's equivalent of either a.m. or p.m. [ tm_hour]
- wcsftime.strftime.11.21
%r Replaced by the time in a.m. and p.m. notation; [CX] in the POSIX locale this shall be equivalent to %I : %M : %S %p. [ tm_hour, tm_min, tm_sec]
- wcsftime.strftime.11.22
%R Replaced by the time in 24-hour notation ( %H : %M ). [ tm_hour, tm_min]
- wcsftime.strftime.11.23
%S Replaced by the second as a decimal number [00,60]. [ tm_sec]
- wcsftime.strftime.11.24
%t Replaced by a <tab>.
- wcsftime.strftime.11.25
%T Replaced by the time ( %H : %M : %S ). [ tm_hour, tm_min, tm_sec]
- wcsftime.strftime.11.26
%u Replaced by the weekday as a decimal number [1,7], with 1 representing Monday. [ tm_wday]
- wcsftime.strftime.11.27
%U Replaced by the week number of the year as a decimal number [00,53]. The first Sunday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
- wcsftime.strftime.11.28
%V Replaced by the week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
- wcsftime.strftime.11.29
%w Replaced by the weekday as a decimal number [0,6], with 0 representing Sunday. [ tm_wday]
- wcsftime.strftime.11.30
%W Replaced by the week number of the year as a decimal number [00,53]. The first Monday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
- wcsftime.strftime.11.31
%x Replaced by the locale's appropriate date representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- wcsftime.strftime.11.32
%X Replaced by the locale's appropriate time representation. (See the Base Definitions volume of IEEE Std 1003.1-2001, <time.h>.)
- wcsftime.strftime.11.33
%y Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
- wcsftime.strftime.11.34
%Y Replaced by the year as a decimal number (for example, 1997). [ tm_year]
- wcsftime.strftime.11.35
%z Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ), or by no characters if no timezone is determinable. For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). [CX] If tm_isdst is zero, the standard time offset is used. If tm_isdst is greater than zero, the daylight savings time offset is used. If tm_isdst is negative, no characters are returned. [ tm_isdst]
- wcsftime.strftime.11.36
%Z Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]
- wcsftime.strftime.11.37
%% Replaced by %.
- wcsftime.strftime.15 (struct)
Some conversion specifiers can be modified by the E or O modifier characters to indicate that an alternative format or specification should be used rather than the one normally used by the unmodified conversion specifier.
- wcsftime.strftime.16
If the alternative format or specification does not exist for the current locale (see ERA in the Base Definitions volume of IEEE Std 1003.1-2001, Section 7.3.5, LC_TIME), the behavior shall be as if the unmodified conversion specification were used.
- wcsftime.strftime.17.01
%Ec Replaced by the locale's alternative appropriate date and time representation.
- wcsftime.strftime.17.02
%EC Replaced by the name of the base year (period) in the locale's alternative representation.
- wcsftime.strftime.17.03
%Ex Replaced by the locale's alternative date representation.
- wcsftime.strftime.17.04
%EX Replaced by the locale's alternative time representation.
- wcsftime.strftime.17.05
%Ey Replaced by the offset from %EC (year only) in the locale's alternative representation.
- wcsftime.strftime.17.06
%EY Replaced by the full alternative year representation.
- wcsftime.strftime.17.07
%Od Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading spaces.
- wcsftime.strftime.17.08
%Oe Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading spaces.
- wcsftime.strftime.17.09
%OH Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.10
%OI Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.11
%Om Replaced by the month using the locale's alternative numeric symbols.
- wcsftime.strftime.17.12
%OM Replaced by the minutes using the locale's alternative numeric symbols.
- wcsftime.strftime.17.13
%OS Replaced by the seconds using the locale's alternative numeric symbols.
- wcsftime.strftime.17.14
%Ou Replaced by the weekday as a number in the locale's alternative representation (Monday=1).
- wcsftime.strftime.17.15
%OU Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.16
%OV Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.17
%Ow Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.18
%OW Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
- wcsftime.strftime.17.19
%Oy Replaced by the year (offset from %C ) using the locale's alternative numeric symbols.
- wcsftime.strftime.18.01
%g, %G, and %V give values according to the ISO 8601:2000 standard week-based year. In this system, weeks begin on a Monday and week 1 of the year is the week that includes January 4th, which is also the week that includes the first Thursday of the year, and is also the first week that contains at least four days in the year.
Generalizes:
- wcsftime.strftime.11.11
- wcsftime.strftime.11.12
- wcsftime.strftime.11.28
- wcsftime.strftime.18.02
If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of the last week of the preceding year; thus, for Saturday 2nd January 1999, %G is replaced by 1998 and %V is replaced by 53.
Generalizes:
- wcsftime.strftime.11.11
- wcsftime.strftime.11.12
- wcsftime.strftime.11.28
- wcsftime.strftime.18.03
If December 29th, 30th, or 31st is a Monday, it and any following days are part of week 1 of the following year. Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
Generalizes:
- wcsftime.strftime.11.11
- wcsftime.strftime.11.12
- wcsftime.strftime.11.28
- app.wcsftime.strftime.10
If any of the specified values are outside the normal range, the characters stored are unspecified.
- app.wcsftime.strftime.12
If a conversion specification does not correspond to any of the above, the behavior is undefined.
- app.wcsftime.strftime.13
If a struct tm broken-down time structure is created by localtime() or localtime_r(), or modified by mktime(), and the value of TZ is subsequently modified, the results of the %Z and %z strftime() conversion specifiers are undefined, when strftime() is called with such a broken-down time structure.
- app.wcsftime.strftime.14
If a struct tm broken-down time structure is created or modified by gmtime() or gmtime_r(), it is unspecified whether the result of the %Z and %z conversion specifiers shall refer to UTC or the current local timezone, when strftime() is called with such a broken-down time structure.
- app.wcsftime.strftime.19
If a conversion specifier is not one of the above, the behavior is undefined.
- [+]util.getopt (99 / 12 / 0)
- [+]getopt (57 / 4 / 0)
- getopt.01
The getopt() function is a command-line parser that shall follow Utility Syntax Guidelines 3, 4, 5, 6, 7, 9, and 10 in the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
- getopt.02
The parameters argc and argv are the argument count and argument array as passed to main() (see exec() ).
- getopt.03
The argument optstring is a string of recognized option characters; if a character is followed by a colon, the option takes an argument.
- getopt.04
All option characters allowed by Utility Syntax Guideline 3 are allowed in optstring. The implementation may accept other characters as an extension.
- getopt.05
The variable optind is the index of the next element of the argv[] vector to be processed. It shall be initialized to 1 by the system, and getopt() shall update it when it finishes with each element of argv[].
- getopt.06
When an element of argv[] contains multiple option characters, it is unspecified how getopt() determines which options have already been processed.
- getopt.07
The getopt() function shall return the next option character (if one is found) from argv that matches a character in optstring, if there is one that matches.
- getopt.08
If the option takes an argument, getopt() shall set the variable optarg to point to the option-argument as follows:
- getopt.08.01
If the option was the last character in the string pointed to by an element of argv, then optarg shall contain the next element of argv, and optind shall be incremented by 2.
- getopt.08.02
If the resulting value of optind is greater than argc, this indicates a missing option-argument, and getopt() shall return an error indication.
- getopt.08.03
Otherwise, optarg shall point to the string following the option character in that element of argv, and optind shall be incremented by 1.
- getopt.09
If, when getopt() is called:argv[optind] is a null pointer**argv[optind] is not the character - argv[optind] points to the string "-"
- getopt.09.child
getopt() shall return -1 without changing optind.
- getopt.10
If
- getopt.10.child
argv[optind] points to the string "--"getopt() shall return -1 after incrementing optind.
- getopt.11
If getopt() encounters an option character that is not contained in optstring, it shall return the question-mark ( '?' ) character.
- getopt.12
If it detects a missing option-argument, it shall return the colon character ( ':' ) if the first character of optstring was a colon, or a question-mark character ( '?' ) otherwise.
- getopt.13
In either case, getopt() shall set the variable optopt to the option character that caused the error.
- getopt.14
If the application has not set the variable opterr to 0 and the first character of optstring is not a colon, getopt() shall also print a diagnostic message to stderr in the format specified for the getopts utility.
- getopt.15
The getopt() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
- getopt.16
The getopt() function shall return the next option character specified on the command line.
- getopt.17
A colon ( ':' ) shall be returned if getopt() detects a missing argument and the first character of optstring was a colon ( ':' ).
- getopt.18
A question mark ( '?' ) shall be returned if getopt()
- getopt.18.01
encounters an option character not in optstring
- getopt.18.02
detects a missing argument and the first character of optstring was not a colon ( ':' ).
- getopt.19
Otherwise, getopt() shall return -1 when all command line options are parsed.
- getopt.30
The getopt() function can process command line arguments referenced by argv in one of three ways:
- getopt.30.01
PERMUTE
- getopt.30.01.01
the order of arguments in argv is altered so that all options (and their arguments) are moved in front of all of the operands. This is the default behavior.
- getopt.30.02
REQUIRE_ORDER
- getopt.30.02.01
The arguments in argv are processed in exactly the order given
- getopt.30.02.02
option processing stops when the first non-option argument is reached
- getopt.30.02.03
or when the element of argv is "--"
- getopt.30.02.04
This ordering can be enforced
- getopt.30.02.04.01
either by setting the environment variable POSIXLY_CORRECT
- getopt.30.02.04.02
or by setting the first character of optstring to '+'
- getopt.30.03
RETURN_IN_ORDER
- getopt.30.03.01
The order of arguments is not altered
- getopt.30.03.02
all arguments are processed
- getopt.30.03.03
Non-option arguments (operands) are handled as if they were the argument to an option with the value 1 ('\001').
- getopt.30.03.04
This ordering is selected by setting the first character of optstring to '-';
- getopt.31
LSB specifies that:
- getopt.31.01
an element of argv that starts with "-" (and is not exactly "-" or "--") is an option element.
- getopt.31.02
characters of an option element, aside from the initial "-", are option characters.
- getopt.32
POSIX specifies that:
- getopt.32.01
applications using getopt() shall obey the following syntax guidelines:
- getopt.32.01.01
option name is a single alphanumeric character from the portable character set
- getopt.32.01.02
option is preceded by the '-' delimiter character
- getopt.32.01.03
options without option-arguments should be accepted when grouped behind one '-' delimiter
- getopt.32.01.04
each option and option-argument is a separate argument
- getopt.32.01.05
option-arguments are not optional
- getopt.32.01.06
all options should precede operands on the command line
- getopt.32.01.07
the argument "--" is accepted as a delimiter indicating the end of options and the consideration of subsequent arguments, if any, as operands
- getopt.32.02
historical implementations of getopt() support other characters as options as an allowed extension, but applications that use extensions are not maximally portable.
- getopt.32.03
support for multi-byte option characters is only possible when such characters can be represented as type int.
- getopt.32.04
applications that call any utility with a first operand starting with '-' should usually specify "--" to mark the end of the options. Standard utilities that do not support this guideline indicate that fact in the OPTIONS section of the utility description.
- getopt.33
LSB specifies that:
- getopt.33.01
if a character is followed by two colons, the option takes an optional argument; if there is text in the current argv element, it is returned in optarg, otherwise optarg is set to 0.
- getopt.33.02
if optstring contains W followed by a semi-colon (;), then -W foo is treated as the long option --foo.
- getopt.33.03
The first character of optstring shall modify the behavior of getopt() as follows:
- getopt.33.03.01
if the first character is '+', then REQUIRE_ORDER processing shall be in effect (see above)
- getopt.33.03.02
if the first character is '-', then RETURN_IN_ORDER processing shall be in effect (see above)
- getopt.33.03.03
if the first character is ':', then getopt() shall return ':' instead of '?' to indicate a missing option argument, and shall not print any diagnostic message to stderr.
- getopt.34
POSIX specifies that:
- getopt.34.01
the -W option is reserved for implementation extensions.
- getopt.35
LSB specifies the following additional getopt() return values:
- getopt.35.01
'\001' is returned if RETURN_IN_ORDER argument ordering is in effect, and the next argument is an operand, not an option. The argument is available in optarg.
- getopt.36
POSIX specifies the following getopt() return values:
- getopt.36.01
the next option character is returned, if found successfully.
- getopt.36.02
':' is returned if a parameter is missing for one of the options and the first character of optstring is ':'.
- getopt.36.03
'?' is returned if an unknown option character not in optstring is encountered, or if getopt() detects a missing argument and the first character of optstring is not ':'.
- getopt.36.04
-1 is returned for the end of the option list.
- getopt.37
LSB specifies that:
- getopt.37.01
if the variable POSIXLY_CORRECT is set, option processing stops as soon as a non-option argument is encountered.
- getopt.37.02
the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] is the process ID for the current process), contains a space separated list of arguments that should not be treated as arguments even though they appear to be so.
- [+]getopt_long (12 / 0 / 0)
- getopt_long.01
getopt_long() works like getopt() except that it also accepts long options, started out by two dashes.
- getopt_long.02
Long option names may be abbreviated if the abbreviation is unique or is an exact match for some defined option.
- getopt_long.03
A long option may take a parameter, of the form --arg=param or --arg param.
- getopt_long.04
longopts is a pointer to the first element of an array of struct option declared in getopt.h as: struct option { const char *name; int has_arg; int *flag; int val; };
- getopt_long.05
The fields in this structure have the following meaning:
- getopt_long.05.01
name The name of the long option.has_arg One of: no_argument (or 0) if the option does not take an argument,required_argument (or 1) if the option requires an argument, oroptional_argument (or 2) if the option takes an optional argument.flag specifies how results are returned for a long option. If flag is NULL, then getopt_long() shall return val. (For example, the calling program may set val to the equivalent short option character.) Otherwise, getopt_long() returns 0, and flag shall point to a variable which shall be set to val if the option is found, but left unchanged if the option is not found.val The value to return, or to load into the variable pointed to by flag.
- getopt_long.06
getopt_long() returns the option character if a short option was found successfully,
- getopt_long.07
or ":" if there was a missing parameter for one of the options,
- getopt_long.08
or "?" for an unknown option character,
- getopt_long.09
or -1 for the end of the option list.
- getopt_long.10
For a long option, getopt_long() returns val if flag is NULL,
- getopt_long.11
and 0 otherwise.
- getopt_long.12
Error and -1 returns are the same as for getopt(), plus "?" for an ambiguous match or an extraneous parameter.
- [+]getopt_long_only (10 / 0 / 0)
- getopt_long_only.01
getopt_long_only() is like getopt_long(), but "-" as well as "--" can indicate a long option.
- getopt_long_only.02
If an option that starts with "-" (not "--") doesn't match a long option, but does match a short option, it is parsed as a short option instead.
- getopt_long_only.03
getopt_long_only() returns the option character if the option was found successfully,
- getopt_long_only.04
or ":" if there was a missing parameter for one of the options,
- getopt_long_only.05
or "?" for an unknown option character,
- getopt_long_only.06
or -1 for the end of the option list.
- getopt_long_only.07
getopt_long_only() also returns the option character when a short option is recognized.
- getopt_long_only.08
For a long option, they return val if flag is NULL,
- getopt_long_only.09
and 0 otherwise
- getopt_long_only.10
Error and -1 returns are the same as for getopt(), plus "?" for an ambiguous match or an extraneous parameter.
- [+]getsubopt (20 / 8 / 0)
- getsubopt.01
The getsubopt() function shall parse suboption arguments in a flag argument.
- getsubopt.02
The getsubopt() argument optionp is a pointer to a pointer to the option argument string.
- getsubopt.03
The suboption arguments shall be separated by commas and each may consist of either a single token, or a token-value pair separated by an equal sign.
- getsubopt.04
The keylistp argument shall be a pointer to a vector of strings.
- getsubopt.05
The end of the vector is identified by a null pointer.
- getsubopt.06
Each entry in the vector is one of the possible tokens that might be found in *optionp.
- getsubopt.07
Since commas delimit suboption arguments in optionp, they should not appear in any of the strings pointed to by keylistp.
- getsubopt.08
Similarly, because an equal sign separates a token from its value, the application should not include an equal sign in any of the strings pointed to by keylistp.
- getsubopt.09
The valuep argument is the address of a value string pointer.
- getsubopt.10
If a comma appears in optionp, it shall be interpreted as a suboption separator.
- getsubopt.11
After commas have been processed, if there are one or more equal signs in a suboption string, the first equal sign in any suboption string shall be interpreted as a separator between a token and a value.
- getsubopt.12
Subsequent equal signs in a suboption string shall be interpreted as part of the value.
- getsubopt.13
If the string at *optionp contains only one suboption argument (equivalently, no commas), getsubopt() shall update *optionp to point to the null character at the end of the string.
- getsubopt.14
Otherwise, it shall isolate the suboption argument by replacing the comma separator with a null character, and shall update *optionp to point to the start of the next suboption argument.
- getsubopt.15
If the suboption argument has an associated value (equivalently, contains an equal sign), getsubopt() shall update *valuep to point to the value's first character.
- getsubopt.16
Otherwise, it shall set *valuep to a null pointer.
- getsubopt.17
The calling application may use this information to determine whether the presence or absence of a value for the suboption is an error.
- getsubopt.18
Additionally, when getsubopt() fails to match the suboption argument with a token in the keylistp array, the calling application should decide if this is an error, or if the unrecognized option should be processed in another way.
- getsubopt.19
The getsubopt() function shall return the index of the matched token string,
- getsubopt.20
or -1 if no token strings were matched.
- [+]util.inet (27 / 26 / 0)
- [+]inet_addr (5 / 5 / 0)
- inet_addr.01
The inet_addr() function shall convert the string pointed to by cp, in the standard IPv4 dotted decimal notation, to an integer value suitable for use as an Internet address.
- inet_addr.02
Values specified using IPv4 dotted decimal notation take one of the following forms:a.b.c.d When four parts are specified, each shall be interpreted as a byte of data and assigned, from left to right, to the four bytes of an Internet address. a.b.c When a three-part address is specified, the last part shall be interpreted as a 16-bit quantity and placed in the rightmost two bytes of the network address. This makes the three-part address format convenient for specifying Class B network addresses as "128.net.host". a.b When a two-part address is supplied, the last part shall be interpreted as a 24-bit quantity and placed in the rightmost three bytes of the network address. This makes the two-part address format convenient for specifying Class A network addresses as "net.host". a When only one part is given, the value shall be stored directly in the network address without any byte rearrangement.
- inet_addr.03
All numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x or 0X implies hexadecimal; otherwise, a leading '0' implies octal; otherwise, the number is interpreted as decimal).
- inet_addr.04
Upon successful completion, inet_addr() shall return the Internet address.
- inet_addr.05
Otherwise, it shall return ( in_addr_t)(-1).
- [+]inet_ntoa (3 / 3 / 0)
- inet_ntoa.01
The inet_ntoa() function shall convert the Internet host address specified by in to a string in the Internet standard dot notation.
- inet_ntoa.02
All Internet addresses shall be returned in network order (bytes ordered from left to right).
- inet_ntoa.03
The inet_ntoa() function shall return a pointer to the network address in Internet standard dot notation.
- [+]inet_ntop (7 / 7 / 0)
- inet_ntop.01
The inet_ntop() function shall convert a numeric address into a text string suitable for presentation.
- inet_ntop.02
The af argument shall specify the family of the address. This can be AF_INET [IP6] or AF_INET6.
- inet_ntop.03
The src argument points to a buffer holding an IPv4 address if the af argument is AF_INET, [IP6] or an IPv6 address if the af argument is AF_INET6; the address must be in network byte order.
- app.inet_ntop.04.05
it shall not be NULL.
- inet_ntop.04
The dst argument points to a buffer where the function stores the resulting text string;
- app.inet_ntop.05
The size argument specifies the size of this buffer, which shall be large enough to hold the text string (INET_ADDRSTRLEN characters for IPv4, [IP6] INET6_ADDRSTRLEN characters for IPv6).
- inet_ntop.06
The inet_ntop() function shall return a pointer to the buffer containing the text string if the conversion succeeds, and NULL otherwise, and set errno to indicate the error.
- inet_ntop.08
The inet_ntop() and inet_pton() functions shall fail if:
- inet_ntop.08.01
[EAFNOSUPPORT] The af argument is invalid.
- inet_ntop.08.02
[ENOSPC] The size of the inet_ntop() result buffer is inadequate.
- [+]inet_pton (12 / 11 / 0)
- inet_pton.01
The inet_pton() function shall convert an address in its standard text presentation form into its numeric binary form.
- inet_pton.02
The af argument shall specify the family of the address. The AF_INET [IP6] and AF_INET6 address families shall be supported.
- inet_pton.03
The src argument points to the string being passed in.
- inet_pton.04
The dst argument points to a buffer into which the function stores the numeric address; this shall be large enough to hold the numeric address (32 bits for AF_INET, [IP6] 128 bits for AF_INET6).
- app.inet_pton.05
If the af argument of inet_pton() is AF_INET, the src string shall be in the standard IPv4 dotted-decimal form:ddd.ddd.ddd.dddwhere "ddd" is a one to three digit decimal number between 0 and 255 (see inet_addr()). The inet_pton() function does not accept other formats (such as the octal numbers, hexadecimal numbers, and fewer than four numbers that inet_addr() accepts).
- inet_pton.06
If the af argument of inet_pton() is AF_INET6, the src string shall be in one of the following standard IPv6 text forms:
- inet_pton.06.01
The preferred form is "x:x:x:x:x:x:x:x", where the 'x' s are the hexadecimal values of the eight 16-bit pieces of the address. Leading zeros in individual fields can be omitted, but there shall be at least one numeral in every field.
- inet_pton.06.02
A string of contiguous zero fields in the preferred form can be shown as "::". The "::" can only appear once in an address. Unspecified addresses ( "0:0:0:0:0:0:0:0" ) may be represented simply as "::".
- inet_pton.06.03
A third form that is sometimes more convenient when dealing with a mixed environment of IPv4 and IPv6 nodes is "x:x:x:x:x:x:d.d.d.d", where the 'x' s are the hexadecimal values of the six high-order 16-bit pieces of the address, and the 'd' s are the decimal values of the four low-order 8-bit pieces of the address (standard IPv4 representation).
- inet_pton.07
The inet_pton() function shall return
- inet_pton.07.01
1 if the conversion succeeds, with the address pointed to by dst in network byte order
- inet_pton.07.02
0 if the input is not a valid IPv4 dotted-decimal string [IP6] or a valid IPv6 address string
- inet_pton.07.03
-1 with errno set to [EAFNOSUPPORT] if the af argument is unknown.
- inet_pton.08
The inet_ntop() and inet_pton() functions shall fail if:
- inet_pton.08.01
[EAFNOSUPPORT] The af argument is invalid.
- inet_pton.08.02
[ENOSPC] The size of the inet_ntop() result buffer is inadequate.
- [+]util.pam (101 / 0 / 0)
- [+]pam_acct_mgmt (9 / 0 / 0)
- pam_acct_mgmt.01
pam_acct_mgmt() establishes the account's usability and the user's accessibility to the system.
- app.pam_acct_mgmt.02
It is typically called after the user has been authenticated.
- pam_acct_mgmt.03
flags may be specified as any valid flag (namely, one of those applicable to the flags argument of pam_authenticate()).
- pam_acct_mgmt.04
Additionally, the value of flags may be logically or'd with PAM_SILENT.
- pam_acct_mgmt.05
Return Value
- pam_acct_mgmt.05.01
PAM_SUCCESS Success.
- pam_acct_mgmt.05.02
PAM_NEW_AUTHTOK_REQD User is valid, but user's authentication token has expired. The correct response to this return-value is to require that the user satisfy the pam_chauthtok() function before obtaining service. It may not be possible for an application to do this. In such a case, the user should be denied access until the account password is updated.
- pam_acct_mgmt.05.03
PAM_ACCT_EXPIRED User is no longer permitted access to the system.
- pam_acct_mgmt.05.04
PAM_AUTH_ERR Authentication error.
- pam_acct_mgmt.05.05
PAM_PERM_DENIED User is not permitted to gain access at this time.
- pam_acct_mgmt.05.06
PAM_USER_UNKNOWN User is not known to a module's account management component.
- [+]pam_authenticate (11 / 0 / 0)
- pam_authenticate.01
pam_authenticate() serves as an interface to the authentication mechanisms of the loaded modules.
- pam_authenticate.02
flags is an optional parameter that may be specified by the following value:
- pam_authenticate.02.01
PAM_DISALLOW_NULL_AUTHTOKInstruct the authentication modules to return PAM_AUTH_ERR if the user does not have a registered authorization token.
- pam_authenticate.03
Additionally, the value of flags may be logically or'd with PAM_SILENT.
- pam_authenticate.04
The process may need to be privileged in order to successfully call this function.
- pam_authenticate.05
Return Value
- pam_authenticate.05.01
PAM_SUCCESSSuccess.
- pam_authenticate.05.02
PAM_AUTH_ERRUser was not authenticated or process did not have sufficient privileges to perform authentication.
- pam_authenticate.05.03
PAM_CRED_INSUFFICIENTApplication does not have sufficient credentials to authenticate the user.
- pam_authenticate.05.04
PAM_AUTHINFO_UNAVAILModules were not able to access the authentication information. This might be due to a network or hardware failure, etc.
- pam_authenticate.05.05
PAM_USER_UNKNOWNSupplied username is not known to the authentication service.
- pam_authenticate.05.06
PAM_MAXTRIESOne or more authentication modules has reached its limit of tries authenticating the user. Do not try again.
- pam_authenticate.05.07
PAM_ABORTOne or more authentication modules failed to load.
- [+]pam_chauthtok (11 / 0 / 0)
- pam_chauthtok.01
pam_chauthtok() is used to change the authentication token for a given user as indicated by the state associated with the handle pamh.
- pam_chauthtok.02
flags is an optional parameter that may be specified by the following value:
- pam_chauthtok.02.01
PAM_CHANGE_EXPIRED_AUTHTOKUser's authentication token should only be changed if it has expired.
- pam_chauthtok.03
Additionally, the value of flags may be logically or'd with PAM_SILENT.
- pam_chauthtok.04
RETURN VALUE
- pam_chauthtok.04.01
PAM_SUCCESSSuccess.
- pam_chauthtok.04.02
PAM_AUTHTOK_ERRA module was unable to obtain the new authentication token.
- pam_chauthtok.04.03
PAM_AUTHTOK_RECOVER_ERRA module was unable to obtain the old authentication token.
- pam_chauthtok.04.04
PAM_AUTHTOK_LOCK_BUSYOne or more modules were unable to change the authentication token since it is currently locked.
- pam_chauthtok.04.05
PAM_AUTHTOK_DISABLE_AGINGAuthentication token aging has been disabled for at least one of the modules.
- pam_chauthtok.04.06
PAM_PERM_DENIEDPermission denied.
- pam_chauthtok.04.07
PAM_TRY_AGAINNot all modules were in a position to update the authentication token(s). In such a case, none of the user's authentication tokens are updated.
- pam_chauthtok.04.08
PAM_USER_UNKNOWNUser is not known to the authentication token changing service.
- [+]pam_close_session (5 / 0 / 0)
- pam_close_session.01
pam_close_session() is used to indicate that an authenticated session has ended.
- app.pam_close_session.02
It is used to inform the module that the user is exiting a session.
- pam_close_session.03
It should be possible for the PAM library to open a session and close the same session from different applications.
- pam_close_session.04
flags may have the value PAM_SILENT to indicate that no output should be generated as a result of this function call.
- pam_close_session.05
Return Value
- pam_close_session.05.01
PAM_SUCCESS Success.
- pam_close_session.05.02
PAM_SESSION_ERR One of the required loaded modules was unable to close a session for the user.
- [+]pam_end (4 / 0 / 0)
- pam_end.01
pam_end() terminates use of the PAM library.
- pam_end.02
On success, the contents of *pamh are no longer valid, and all memory associated with it is invalid.
- pam_end.03
Normally, pam_status is passed the value PAM_SUCCESS, but in the event of an unsuccessful service application, the appropriate PAM error return value should be used.
- pam_end.04
Return Value
- pam_end.04.01
PAM_SUCCESS Success.
- [+]pam_fail_delay (6 / 0 / 0)
- pam_fail_delay.01
pam_fail_delay() specifies the minimum delay for the PAM library to use when an authentication error occurs.
- pam_fail_delay.02
The actual delay can vary by as much at 25%.
- pam_fail_delay.03
If this function is called multiple times, the longest time specified by any of the call will be used.
- pam_fail_delay.04
The delay is invoked if an authentication error occurs during the pam_authenticate() or pam_chauthtok() function calls.
- pam_fail_delay.05
Independent of the success of pam_authenticate() or pam_chauthtok(), the delay time is reset to its default value of 0 when the PAM library returns control to the application from these two functions.
- pam_fail_delay.06
Return Value
- pam_fail_delay.06.01
PAM_SUCCESS Success.
- [+]pam_get_item (5 / 0 / 0)
- pam_get_item.01
pam_get_item() obtains the value of the indicated item_type.
On success, item contains a pointer to the value of the corresponding item.
- pam_get_item.02
The possible values of item_type are the same as listed for pam_set_item().
- app.pam_get_item.04
Note that this is a pointer to the actual data and should not be free()'d or over-written.
- pam_get_item.05
Return Value
- pam_get_item.05.01
PAM_SUCCESS Success.
- pam_get_item.05.02
PAM_PERM_DENIED Application passed a NULL pointer for item.
- pam_get_item.05.03
PAM_BAD_ITEM Application attempted to get an undefined item.
- [+]pam_getenvlist (6 / 0 / 0)
- pam_getenvlist.01
pam_getenvlist() returns a pointer to the complete PAM environment.
- pam_getenvlist.02
This pointer points to an array of pointers to NUL-terminated strings and must be terminated by a NULL pointer.
- pam_getenvlist.03
Each string has the form "name=value".
- pam_getenvlist.04
The PAM library module allocates memory for the returned value and the associated strings.
- app.pam_getenvlist.05
The calling application is responsible for freeing this memory.
- pam_getenvlist.06
pam_getenvlist() returns an array of string pointers containing the PAM environment.
- pam_getenvlist.07
On error, NULL is returned.
- [+]pam_open_session (5 / 0 / 0)
- pam_open_session.01
The pam_open_session() function is used to indicate that an authenticated session has begun, after the user has been identified (see pam_authenticate()) and, if necessary, granted credentials (see pam_setcred()).
- app.pam_open_session.02
It is used to inform the module that the user is currently in a session.
- pam_open_session.03
It should be possible for the PAM library to open a session and close the same session from different applications.
- pam_open_session.04
flags may have the value PAM_SILENT to indicate that no output be generated as a result of this function call.
- pam_open_session.05
Return Value
- pam_open_session.05.01
PAM_SUCCESS Success.
- pam_open_session.05.02
PAM_SESSION_ERR One of the loaded modules was unable to open a session for the user.
- [+]pam_set_item (13 / 0 / 0)
- pam_set_item.01
pam_set_item() (re)sets the value of one of the following item_types:
- pam_set_item.01.01
PAM_SERVICE service name
- pam_set_item.01.02
PAM_USER user name
- pam_set_item.01.03
PAM_TTY terminal nameThe value for a device file should include the /dev/ prefix. The value for graphical, X-based, applications should be the $DISPLAY variable.
- pam_set_item.01.04
PAM_RHOST remote host name
- pam_set_item.01.05
PAM_CONV conversation structure
- pam_set_item.01.06
PAM_RUSER remote user name
- pam_set_item.01.07
PAM_USER_PROMPT string to be used when prompting for a user's nameThe default value for this string is Please enter username: .
- pam_set_item.02
For all item_types other than PAM_CONV, item is a pointer to a NULL-terminated character string.
- pam_set_item.03
In the case of PAM_CONV, item points to an initialized pam_conv structure.
- pam_set_item.04
Return Value
- pam_set_item.04.01
PAM_SUCCESS Success.
- pam_set_item.04.02
PAM_PERM_DENIED An attempt was made to replace the conversation structure with a NULL value.
- pam_set_item.04.03
PAM_BUF_ERR Function ran out of memory making a copy of the item.
- pam_set_item.04.04
PAM_BAD_ITEM Application attempted to set an undefined item.
- [+]pam_setcred (11 / 0 / 0)
- pam_setcred.01
pam_setcred() sets the module-specific credentials of the user.
- app.pam_setcred.02
It is usually called after the user has been authenticated, after the account management function has been called and after a session has been opened for the user.
- pam_setcred.03
flags maybe specified from among the following values:
- pam_setcred.03.01
PAM_ESTABLISH_CREDset credentials for the authentication service
- pam_setcred.03.02
PAM_DELETE_CREDdelete credentials associated with the authentication service
- pam_setcred.03.03
PAM_REINITIALIZE_CREDreinitialize the user credentials
- pam_setcred.03.04
PAM_REFRESH_CREDextend lifetime of the user credentials
- pam_setcred.04
Additionally, the value of flags may be logically or'd with PAM_SILENT.
- pam_setcred.05
Return Value
- pam_setcred.05.01
PAM_SUCCESS Success.
- pam_setcred.05.02
PAM_CRED_UNAVAIL Module cannot retrieve the user's credentials.
- pam_setcred.05.03
PAM_CRED_EXPIRED User's credentials have expired.
- pam_setcred.05.04
PAM_USER_UNKNOWN User is not known to an authentication module.
- pam_setcred.05.05
PAM_CRED_ERR Module was unable to set the credentials of the user.
- [+]pam_start (12 / 0 / 0)
- pam_start.01
pam_start() is used to initialize the PAM library.
- app.pam_start.02
It must be called prior to any other usage of the PAM library.
- pam_start.03
On success, *pamh becomes a handle that provides continuity for successive calls to the PAM library.
- app.pam_start.04
pam_start() expects arguments as follows:
- app.pam_start.04.01
the service_name of the program
- app.pam_start.04.02
the username of the individual to be authenticated
- app.pam_start.04.03
a pointer to an application-supplied pam_conv structure
- app.pam_start.04.04
a pointer to a pam_handle_t pointer
- pam_start.05
An application must provide the conversation function used for direct communication between a loaded module and the application.
- pam_start.06
The application also typically provides a means for the module to prompt the user for a password, etc.
- app.pam_start.07
The structure, pam_conv, is defined to be, struct pam_conv { int (*conv) (int num_msg, const struct pam_message * *msg, struct pam_response * *resp, void *appdata_ptr); void *appdata_ptr; };It is initialized by the application before it is passed to the library. The contents of this structure are attached to the *pamh handle. The point of this argument is to provide a mechanism for any loaded module to interact directly with the application program; this is why it is called a conversation structure.
- app.pam_start.07.01
struct pam_conv { int (*conv) (int num_msg, const struct pam_message * *msg, struct pam_response * *resp, void *appdata_ptr); void *appdata_ptr; };
- app.pam_start.08
It is initialized by the application before it is passed to the library.
- pam_start.09
The contents of this structure are attached to the *pamh handle.
- pam_start.10
The point of this argument is to provide a mechanism for any loaded module to interact directly with the application program; this is why it is called a conversation structure.
- pam_start.11
When a module calls the referenced conv() function, appdata_ptr is set to the second element of this structure.
- pam_start.12
The other arguments of a call to conv() concern the information exchanged by module and application.
- pam_start.12.01
num_msg holds the length of the array of pointers passed via msg.
- pam_start.13
On success, the pointer resp points to an array of num_msg pam_response structures, holding the application-supplied text.
- app.pam_start.14
Note that resp is a struct pam_response array and not an array of pointers.
- pam_start.15
Return Value
- pam_start.15.01
PAM_SUCCESS Success.
- pam_start.15.02
PAM_BUF_ERR Memory allocation error.
- pam_start.15.03
PAM_ABORT Internal failure.
- [+]pam_strerror (3 / 0 / 0)
- pam_strerror.01
pam_strerror() returns a string describing the PAM error associated with errnum.
- pam_strerror.01.01
On success, this function returns a description of the indicated error.
- pam_strerror.01.02
Otherwise, a string indicating that the error is unknown shall be returned
- pam_strerror.02
It is unspecified whether or not the string returned is translated according to the setting of LC_MESSAGES.
- app.pam_strerror.03 (struct)
The application should not free or modify this string.
- [+]util.regex (116 / 50 / 0)
- [+]fnmatch (11 / 9 / 0)
- fnmatch.01
The fnmatch() function shall match patterns
Generalizes:
- fnmatch.02
- fnmatch.03.01
- fnmatch.03.02
- fnmatch.03.03
- fnmatch.03.04
- fnmatch.03.05.01
- fnmatch.03.05.02
- fnmatch.03.06
- fnmatch.04.01
- fnmatch.04.02
- fnmatch.04.03
- fnmatch.02 (struct)
It checks the string specified by the string argument to see if it matches the pattern specified by the pattern argument.
- fnmatch.03
The flags argument shall modify the interpretation of pattern and string. It is the bitwise-inclusive OR of zero or more of the flags defined in <fnmatch.h>.
- fnmatch.03.01
If the FNM_PATHNAME flag is set in flags, then a slash character ( '/' ) in string shall be explicitly matched by a slash in pattern; it shall not be matched by either the asterisk or question-mark special characters, nor by a bracket expression.
- fnmatch.03.02
If the FNM_PATHNAME flag is not set, the slash character shall be treated as an ordinary character.
- fnmatch.03.03
If FNM_NOESCAPE is not set in flags, a backslash character ( '\' ) in pattern followed by any other character shall match that second character in string. In particular, "\\" shall match a backslash in string.
- fnmatch.03.04
If FNM_NOESCAPE is set, a backslash character shall be treated as an ordinary character.
- fnmatch.03.05
If FNM_PERIOD is set in flags, then a leading period ( '.' ) in string shall match a period in pattern; as described by rule 2 in the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.13.3, Patterns Used for Filename Expansion where the location of "leading" is indicated by the value of FNM_PATHNAME:
- fnmatch.03.05.01
If FNM_PATHNAME is set, a period is "leading" if it is the first character in string or if it immediately follows a slash.
- fnmatch.03.05.02
If FNM_PATHNAME is not set, a period is "leading" only if it is the first character of string.
- fnmatch.03.06
If FNM_PERIOD is not set, then no special restrictions are placed on matching a period.
- fnmatch.04.01
If string matches the pattern specified by pattern, then fnmatch() shall return 0.
- fnmatch.04.02
If there is no match, fnmatch() shall return FNM_NOMATCH, which is defined in <fnmatch.h>.
- fnmatch.04.03
If an error occurs, fnmatch() shall return another non-zero value.
- [+]regcomp (25 / 8 / 0)
- regcomp.01
These functions interpret basic and extended regular expressions
- regcomp.02
The regcomp() function shall compile the regular expression contained in the string pointed to by the pattern argument and place the results in the structure pointed to by preg.
- regcomp.03
The cflags argument is the bitwise-inclusive OR of zero or more of the following flags, which are defined in the <regex.h> header:
- regcomp.03.01
REG_EXTENDED Use Extended Regular Expressions.
- regcomp.03.02
REG_ICASE Ignore case in match. (See the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 9, Regular Expressions.)
- regcomp.03.03
REG_NOSUB Report only success/fail in regexec().
- regcomp.03.04
REG_NEWLINE Change the handling of <newline>s, as described in the text.
- regcomp.04
The default regular expression type for pattern is a Basic Regular Expression.
- regcomp.05
The application can specify Extended Regular Expressions using the REG_EXTENDED cflags flag.
- regcomp.06
If the REG_NOSUB flag was not set in cflags, then regcomp() shall set re_nsub to the number of parenthesized subexpressions (delimited by "\(\)" in basic regular expressions or "()" in extended regular expressions) found in pattern.
- regcomp.16
The following constants are defined as error return values:
- regcomp.16.01
REG_NOMATCH regexec() failed to match.
- regcomp.16.02
REG_BADPAT Invalid regular expression.
- regcomp.16.03
REG_ECOLLATE Invalid collating element referenced.
- regcomp.16.04
REG_ECTYPE Invalid character class type referenced.
- regcomp.16.05
REG_EESCAPE Trailing '\' in pattern.
- regcomp.16.06
REG_ESUBREG Number in "\digit" invalid or in error.
- regcomp.16.07
REG_EBRACK "[]" imbalance.
- regcomp.16.08
REG_EPAREN "\(\)" or "()" imbalance.
- regcomp.16.09
REG_EBRACE "\{\}" imbalance.
- regcomp.16.10
REG_BADBR Content of "\{\}" invalid: not a number, number too large, more than two numbers, first larger than second.
- regcomp.16.11
REG_ERANGE Invalid endpoint in range expression.
- regcomp.16.12
REG_ESPACE Out of memory.
- regcomp.16.13
REG_BADRPT '?', '*', or '+' not preceded by valid regular expression.
- regcomp.26.01
Upon successful completion, the regcomp() function shall return 0.
- regcomp.26.02
Otherwise, it shall return an integer value indicating an error as described in <regex.h>, and the content of preg is undefined. If a code is returned, the interpretation shall be as given in <regex.h>.
- regcomp.27
If regcomp() detects an invalid RE, it may return REG_BADPAT, or it may return one of the error codes that more precisely describes the error.
- [+]regerror (22 / 21 / 0)
- regerror.01
These functions interpret basic and extended regular expressions
Generalizes:
- regerror.16.01
- regerror.16.02
- regerror.16.03
- regerror.16.04
- regerror.16.05
- regerror.16.06
- regerror.16.07
- regerror.16.08
- regerror.16.09
- regerror.16.10
- regerror.16.11
- regerror.16.12
- regerror.16.13
- regerror.17
- regerror.18
- regerror.20
- regerror.21
- regerror.22
- regerror.23
- regerror.26
- regerror.27
- regerror.16
The following constants are defined as error return values:
- regerror.16.01
REG_NOMATCH regexec() failed to match.
- regerror.16.02
REG_BADPAT Invalid regular expression.
- regerror.16.03
REG_ECOLLATE Invalid collating element referenced.
- regerror.16.04
REG_ECTYPE Invalid character class type referenced.
- regerror.16.05
REG_EESCAPE Trailing '\' in pattern.
- regerror.16.06
REG_ESUBREG Number in "\digit" invalid or in error.
- regerror.16.07
REG_EBRACK "[]" imbalance.
- regerror.16.08
REG_EPAREN "\(\)" or "()" imbalance.
- regerror.16.09
REG_EBRACE "\{\}" imbalance.
- regerror.16.10
REG_BADBR Content of "\{\}" invalid: not a number, number too large, more than two numbers, first larger than second.
- regerror.16.11
REG_ERANGE Invalid endpoint in range expression.
- regerror.16.12
REG_ESPACE Out of memory.
- regerror.16.13
REG_BADRPT '?', '*', or '+' not preceded by valid regular expression.
- regerror.17
The regerror() function provides a mapping from error codes returned by regcomp() and regexec() to unspecified printable strings.
- regerror.18
It generates a string corresponding to the value of the errcode argument, which the application shall ensure is the last non-zero value returned by regcomp() or regexec() with the given value of preg.
- app.regerror.19
If errcode is not such a value, the content of the generated string is unspecified.
- regerror.20
If preg is a null pointer, but errcode is a value returned by a previous call to regexec() or regcomp(), the regerror() still generates an error string corresponding to the value of errcode, but it might not be as detailed under some implementations.
- regerror.21
If the errbuf_size argument is not 0, regerror() shall place the generated string into the buffer of size errbuf_size bytes pointed to by errbuf.
- regerror.22
If the string (including the terminating null) cannot fit in the buffer, regerror() shall truncate the string and null-terminate the result.
- regerror.23
If errbuf_size is 0, regerror() shall ignore the errbuf argument, and return the size of the buffer needed to hold the generated string.
- regerror.26
Upon successful completion, the regerror() function shall return the number of bytes needed to hold the entire generated string, including the null termination.
- regerror.27
If the return value is greater than errbuf_size, the string returned in the buffer pointed to by errbuf has been truncated.
- [+]regexec (42 / 10 / 0)
- regexec.01
These functions interpret basic and extended regular expressions
Generalizes:
- regexec.02
- regexec.03.01
- regexec.03.02
- regexec.04.01
- regexec.04.02
- regexec.05
- regexec.06.02.01
- regexec.06.02.02
- regexec.07
- regexec.08
- regexec.09
- regexec.10
- regexec.11
- regexec.12.01
- regexec.12.02.01
- regexec.12.02.02.01
- regexec.12.02.02.02
- regexec.12.03.01
- regexec.12.03.02
- regexec.12.04
- regexec.12.05
- regexec.14
- regexec.15.01
- regexec.15.02
- regexec.15.03
- regexec.16.01
- regexec.16.02
- regexec.16.03
- regexec.16.04
- regexec.16.05
- regexec.16.06
- regexec.16.07
- regexec.16.08
- regexec.16.09
- regexec.16.10
- regexec.16.11
- regexec.16.12
- regexec.16.13
- regexec.26.01
- regexec.26.02
- regexec.30
- regexec.02
The regexec() function compares the null-terminated string specified by string with the compiled regular expression preg initialized by a previous call to regcomp().
- regexec.03.01
If it finds a match, regexec() shall return 0;
- regexec.03.02
otherwise, it shall return non-zero indicating either no match or an error.
- regexec.04
The eflags argument is the bitwise-inclusive OR of zero or more of the following flags, which are defined in the <regex.h> header:
- regexec.04.01
REG_NOTBOL The first character of the string pointed to by string is not the beginning of the line. Therefore, the circumflex character ( '^' ), when taken as a special character, shall not match the beginning of string.
- regexec.04.02
REG_NOTEOL The last character of the string pointed to by string is not the end of the line. Therefore, the dollar sign ( '$' ), when taken as a special character, shall not match the end of string.
- regexec.05
If nmatch is 0 or REG_NOSUB was set in the cflags argument to regcomp(), then regexec() shall ignore the pmatch argument.
- regexec.06.02
and regexec() shall fill in the elements of that array with offsets of the substrings of string that correspond to the parenthesized subexpressions of pattern:
- regexec.06.02.01
pmatch[ i]. rm_so shall be the byte offset of the beginning
- regexec.06.02.02
and pmatch[ i]. rm_eo shall be one greater than the byte offset of the end of substring i.
- app.regexec.06.01
Otherwise, the application shall ensure that the pmatch argument points to an array with at least nmatch elements,
- regexec.07
Subexpression i begins at the ith matched open parenthesis, counting from 1.
- regexec.08
Offsets in pmatch[0] identify the substring that corresponds to the entire regular expression.
- regexec.09
Unused elements of pmatch up to pmatch[ nmatch-1] shall be filled with -1.
- regexec.10
If there are more than nmatch subexpressions in pattern ( pattern itself counts as a subexpression), then regexec() shall still do the match, but shall record only the first nmatch substrings.
- regexec.11
When matching a basic or extended regular expression, any given parenthesized subexpression of pattern might participate in the match of several different substrings of string, or it might not match any substring even though the pattern as a whole did match.
- regexec.12
The following rules shall be used to determine which substrings to report in pmatch when matching regular expressions:
- regexec.12.01
If subexpression i in a regular expression is not contained within another subexpression, and it participated in the match several times, then the byte offsets in pmatch[ i] shall delimit the last such match.
- regexec.12.02.01
If subexpression i is not contained within another subexpression, and it did not participate in an otherwise successful match, the byte offsets in pmatch[ i] shall be -1.
- regexec.12.02.02
A subexpression does not participate in the match when:
- regexec.12.02.02.01
'*' or "\{\}" appears immediately after the subexpression in a basic regular expression, or '*', '?', or "{}" appears immediately after the subexpression in an extended regular expression, and the subexpression did not match (matched 0 times)
- regexec.12.02.02.02
'|' is used in an extended regular expression to select this subexpression or another, and the other subexpression matched.
- regexec.12.03.01
If subexpression i is contained within another subexpression j, and i is not contained within any other subexpression that is contained within j, and a match of subexpression j is reported in pmatch[ j], then the match or non-match of subexpression i reported in pmatch[ i] shall be as described in 1. and 2. above, but within the substring reported in pmatch[ j] rather than the whole string.
- regexec.12.03.02
The offsets in pmatch[ i] are still relative to the start of string.
- regexec.12.04
If subexpression i is contained in subexpression j, and the byte offsets in pmatch[ j] are -1, then the pointers in pmatch[ i] shall also be -1.
- regexec.12.05
If subexpression i matched a zero-length string, then both byte offsets in pmatch[ i] shall be the byte offset of the character or null terminator immediately following the zero-length string.
- app.regexec.13
If, when regexec() is called, the locale is different from when the regular expression was compiled, the result is undefined.
- regexec.14
If REG_NEWLINE is not set in cflags, then a <newline> in pattern or string shall be treated as an ordinary character.
- regexec.15
If REG_NEWLINE is set, then <newline> shall be treated as an ordinary character except as follows:
- regexec.15.01
A <newline> in string shall not be matched by a period outside a bracket expression or by any form of a non-matching list
- regexec.15.02
A circumflex ( '^' ) in pattern, when used to specify expression anchoring (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 9.3.8, BRE Expression Anchoring), shall match the zero-length string immediately after a <newline> in string, regardless of the setting of REG_NOTBOL.
- regexec.15.03
A dollar sign ( '$' ) in pattern, when used to specify expression anchoring, shall match the zero-length string immediately before a <newline> in string, regardless of the setting of REG_NOTEOL.
- regexec.16
The following constants are defined as error return values:
- regexec.16.01
REG_NOMATCH regexec() failed to match.
- regexec.16.02
REG_BADPAT Invalid regular expression.
- regexec.16.03
REG_ECOLLATE Invalid collating element referenced.
- regexec.16.04
REG_ECTYPE Invalid character class type referenced.
- regexec.16.05
REG_EESCAPE Trailing '\' in pattern.
- regexec.16.06
REG_ESUBREG Number in "\digit" invalid or in error.
- regexec.16.07
REG_EBRACK "[]" imbalance.
- regexec.16.08
REG_EPAREN "\(\)" or "()" imbalance.
- regexec.16.09
REG_EBRACE "\{\}" imbalance.
- regexec.16.10
REG_BADBR Content of "\{\}" invalid: not a number, number too large, more than two numbers, first larger than second.
- regexec.16.11
REG_ERANGE Invalid endpoint in range expression.
- regexec.16.12
REG_ESPACE Out of memory.
- regexec.16.13
REG_BADRPT '?', '*', or '+' not preceded by valid regular expression.
- app.regexec.24
If the preg argument to regexec() or regfree() is not a compiled regular expression returned by regcomp(), the result is undefined.
- regexec.26.01
Upon successful completion, the regexec() function shall return 0.
- regexec.26.02
Otherwise, it shall return REG_NOMATCH to indicate no match.
- regexec.30
Certain aspects of regular expression matching are optional; see Internationalization and Regular Expressions.
- [+]regfree (16 / 2 / 0)
- regfree.01
These functions interpret basic and extended regular expressions
Generalizes:
- regfree.02
- regfree.16.01
- regfree.16.02
- regfree.16.03
- regfree.16.04
- regfree.16.05
- regfree.16.06
- regfree.16.07
- regfree.16.08
- regfree.16.09
- regfree.16.10
- regfree.16.11
- regfree.16.12
- regfree.16.13
- regfree.25
- regfree.02
The regfree() function frees any memory allocated by regcomp() associated with preg.
- regfree.16
The following constants are defined as error return values:
- regfree.16.01
REG_NOMATCH regexec() failed to match.
- regfree.16.02
REG_BADPAT Invalid regular expression.
- regfree.16.03
REG_ECOLLATE Invalid collating element referenced.
- regfree.16.04
REG_ECTYPE Invalid character class type referenced.
- regfree.16.05
REG_EESCAPE Trailing '\' in pattern.
- regfree.16.06
REG_ESUBREG Number in "\digit" invalid or in error.
- regfree.16.07
REG_EBRACK "[]" imbalance.
- regfree.16.08
REG_EPAREN "\(\)" or "()" imbalance.
- regfree.16.09
REG_EBRACE "\{\}" imbalance.
- regfree.16.10
REG_BADBR Content of "\{\}" invalid: not a number, number too large, more than two numbers, first larger than second.
- regfree.16.11
REG_ERANGE Invalid endpoint in range expression.
- regfree.16.12
REG_ESPACE Out of memory.
- regfree.16.13
REG_BADRPT '?', '*', or '+' not preceded by valid regular expression.
- app.regfree.24
If the preg argument to regexec() or regfree() is not a compiled regular expression returned by regcomp(), the result is undefined.
- regfree.25
A preg is no longer treated as a compiled regular expression after it is given to regfree().
- [+]util.search.hash (17 / 9 / 0)
- [+]hcreate (6 / 4 / 0)
- hcreate.01
The hcreate(), hdestroy(), and hsearch() functions shall manage hash search tables.
Generalizes:
- hcreate.02.01
- hcreate.02.02
- hcreate.03
- hcreate.11
- hcreate.12
- hcreate.13.01
- hcreate.02.01
The hcreate() function shall allocate sufficient space for the table
- hcreate.02.02
the application shall ensure it is called before hsearch() is used
- hcreate.03 (struct)
The nel argument is an estimate of the maximum number of entries that the table shall contain. This number may be adjusted upward by the algorithm in order to obtain certain mathematically favorable circumstances.
- hcreate.11
The hcreate() function shall return 0 if it cannot allocate sufficient space for the table
- hcreate.12
otherwise, it shall return non-zero.
- hcreate.13
The hcreate() and hsearch() functions may fail if:
- hcreate.13.01
[ENOMEM] Insufficient storage space is available.
- [+]hdestroy (4 / 3 / 0)
- hdestroy.01
The hcreate(), hdestroy(), and hsearch() functions shall manage hash search tables.
Generalizes:
- hdestroy.02.01
- hdestroy.02.02
- hdestroy.03
- hdestroy.02
The hdestroy() function
- hdestroy.02.01
shall dispose of the search table
- hdestroy.02.02
may be followed by another call to hcreate()
- hdestroy.03
After the call to hdestroy(), the data can no longer be considered accessible.
- [+]hsearch (7 / 2 / 0)
- hsearch.01
The hcreate(), hdestroy(), and hsearch() functions shall manage hash search tables.
Generalizes:
- hsearch.02
- hsearch.03
- hsearch.05
- hsearch.06
- hsearch.07
- hsearch.08
- hsearch.09
- hsearch.12.01
- hsearch.12.02
- hsearch.13.01
- hsearch.02
The hsearch() function is a hash-table search routine.
Generalizes:
- hsearch.01
- hsearch.03
- hsearch.05
- hsearch.06
- hsearch.07
- hsearch.08
- hsearch.09
- hsearch.12.01
- hsearch.12.02
- hsearch.13.01
- hsearch.03
It shall return a pointer into a hash table indicating the location at which an entry can be found.
- hsearch.05 (struct)
The comparison function used by hsearch() is strcmp().
- hsearch.06 (struct)
The action argument is a member of an enumeration type ACTION indicating the disposition of the entry if it cannot be found in the table.
- hsearch.07 (struct)
ENTER indicates that the item should be inserted in the table at an appropriate point.
- hsearch.08 (struct)
FIND indicates that no entry should be made.
- hsearch.09
Unsuccessful resolution is indicated by the return of a null pointer.
- hsearch.12
The hsearch() function shall return a null pointer if
- hsearch.12.01
the action is FIND and the item could not be found
- hsearch.12.02
the action is ENTER and the table is full.
- hsearch.13
The hcreate() and hsearch() functions may fail if:
- hsearch.13.01
[ENOMEM] Insufficient storage space is available.
- [+]util.search.queue (5 / 3 / 0)
- [+]insque (3 / 2 / 0)
- insque.00
The insque() and remque() functions shall manipulate queues built from doubly-linked lists. The queue can be either circular or linear.
Generalizes:
- app.insque.01
An application using insque() or remque() shall ensure it defines a structure in which the first two members of the structure are pointers to the same type of structure
- insque.02
The insque() function shall insert the element pointed to by element into a queue immediately after the element pointed to by pred.
- insque.03
If the queue is to be used as a linear list, invoking insque(&element, NULL), where element is the initial element of the queue, shall initialize the forward and backward pointers of element to null pointers.
- app.insque.04
If the queue is to be used as a circular list, the application shall ensure it initializes the forward pointer and the backward pointer of the initial element of the queue to the element's own address.
- [+]remque (2 / 1 / 0)
- remque.00
The insque() and remque() functions shall manipulate queues built from doubly-linked lists. The queue can be either circular or linear.
Generalizes:
- app.remque.01
An application using insque() or remque() shall ensure it defines a structure in which the first two members of the structure are pointers to the same type of structure
- remque.02
The remque() function shall remove the element pointed to by element from a queue.
- [+]util.search.search (24 / 11 / 0)
- [+]bsearch (8 / 2 / 0)
- bsearch.01
The bsearch() function shall search an array of nel objects, the initial element of which is pointed to by base, for an element that matches the object pointed to by key. The size of each element in the array is specified by width.
- bsearch.02
If the nel argument has the value zero,
- bsearch.02.01
the comparison function pointed to by compar shall not be called
- bsearch.02.02
no match shall be found.
- bsearch.03
The comparison function pointed to by compar shall be called with two arguments that point to the key object and to an array element, in that order.
- bsearch.03.01
The implementation shall ensure that the first argument is always a pointer to the key.
- app.bsearch.04
The application shall ensure that the comparison function pointed to by compar does not alter the contents of the array.
- bsearch.05
The implementation may reorder elements of the array between calls to the comparison function, but shall not alter the contents of any individual element.
- app.bsearch.06
When the same objects (consisting of width bytes, irrespective of their current positions in the array) are passed more than once to the comparison function, the results shall be consistent with one another. That is, the same object shall always compare the same way with the key.
- app.bsearch.07
The application shall ensure that the function returns an integer less than, equal to, or greater than 0 if the key object is considered, respectively, to be less than, to match, or to be greater than the array element.
- app.bsearch.08
The application shall ensure that the array consists of all the elements that compare less than, all the elements that compare equal to, and all the elements that compare greater than the key object, in that order.
- bsearch.09
The bsearch() function shall return a pointer to a matching member of the array,
- bsearch.10
or a null pointer if no match is found.
- bsearch.11
If two or more members compare equal, which member is returned is unspecified.
- [+]lfind (4 / 2 / 0)
- lfind.01
The lsearch() function shall linearly search the table and return a pointer into the table for the matching entry.
- lfind.01.01
The key argument points to the entry to be sought in the table. The base argument points to the first element in the table. The width argument is the size of an element in bytes. The nelp argument points to an integer containing the current number of elements in the table.
- lfind.01.01.01
If the searched for entry is found, both lsearch() and lfind() shall return a pointer to it.
- lfind.02
The lfind() function shall be equivalent to lsearch(), except that if the entry is not found, it is not added to the table. Instead, a null pointer is returned.
- lfind.02.01
Otherwise,
- lfind.02.01.01
lfind() shall return a null pointer
- lfind.03
The compar argument points to a comparison function which the application shall supply (for example, strcmp()). It is called with two arguments that point to the elements being compared.
- app.lfind.04
The application shall ensure that the function returns 0 if the elements are equal, and non-zero otherwise.
- lfind.05
Both functions shall return a null pointer in case of error.
- [+]lsearch (6 / 4 / 0)
- lsearch.01
The lsearch() function shall linearly search the table and return a pointer into the table for the matching entry.
- lsearch.01.01
The key argument points to the entry to be sought in the table. The base argument points to the first element in the table. The width argument is the size of an element in bytes. The nelp argument points to an integer containing the current number of elements in the table.
- lsearch.01.01.01
If the searched for entry is found, both lsearch() and lfind() shall return a pointer to it.
- lsearch.02.01
If the entry does not occur, it shall be added at the end of the table.
- lsearch.02.02
The integer to which nelp points shall be incremented if the entry is added to the table.
- lsearch.02.03
Otherwise,
- lsearch.02.03.01
lsearch() shall return a pointer to the newly added element.
- lsearch.03
The compar argument points to a comparison function which the application shall supply (for example, strcmp()). It is called with two arguments that point to the elements being compared.
- app.lsearch.04
The application shall ensure that the function returns 0 if the elements are equal, and non-zero otherwise.
- lsearch.05
Both functions shall return a null pointer in case of error.
- [+]qsort (6 / 3 / 0)
- qsort.01
The qsort() function shall sort an array of nel objects, the initial element of which is pointed to by base. The size of each object, in bytes, is specified by the width argument.
- qsort.01.01
The contents of the array shall be sorted in ascending order according to a comparison function.
- qsort.02
If the nel argument has the value zero,
- qsort.02.01
the comparison function pointed to by compar shall not be called
- qsort.02.02
no rearrangement shall take place.
- app.qsort.03
The application shall ensure that the comparison function pointed to by compar does not alter the contents of the array.
- qsort.04
The implementation may reorder elements of the array between calls to the comparison function, but shall not alter the contents of any individual element.
- app.qsort.05
When the same objects (consisting of width bytes, irrespective of their current positions in the array) are passed more than once to the comparison function, the results shall be consistent with one another. That is, they shall define a total ordering on the array.
- qsort.06
The compar argument is a pointer to the comparison function, which is called with two arguments that point to the elements being compared.
- app.qsort.07
The application shall ensure that the function returns an integer less than, equal to, or greater than 0, if the first argument is considered respectively less than, equal to, or greater than the second.
- qsort.08
If two members compare as equal, their order in the sorted array is unspecified.
- [+]util.search.tree (29 / 15 / 0)
- [+]tdelete (8 / 6 / 0)
- tdelete.01
The tdelete(), tfind(), tsearch(), and twalk() functions manipulate binary search trees.
Generalizes:
- tdelete.02
- tdelete.03
- tdelete.04
- tdelete.05
- tdelete.06
- tdelete.07
- tdelete.08
- tdelete.09.01
- tdelete.09.02
- tdelete.12
- tdelete.15
- tdelete.16.01
- tdelete.16.02
- tdelete.02 (struct)
Comparisons are made with a user-supplied routine, the address of which is passed as the compar argument.
- tdelete.03 (struct)
This routine is called with two arguments, which are the pointers to the elements being compared.
- tdelete.04 (struct)
The application shall ensure that the user-supplied routine returns an integer less than, equal to, or greater than 0, according to whether the first argument is to be considered less than, equal to, or greater than the second argument.
- tdelete.05 (struct)
The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared.
- tdelete.06
The tdelete() function shall delete a node from a binary search tree.
- tdelete.07 (struct)
The arguments are the same as for tsearch().
- tdelete.08
The variable pointed to by rootp shall be changed if the deleted node was the root of the tree.
- tdelete.09.01
The tdelete() function shall return a pointer to the parent of the deleted node,
- tdelete.09.02
or a null pointer if the node is not found.
- tdelete.12 (struct)
If the calling function alters the pointer to the root, the result is undefined.
- tdelete.15
A null pointer shall be returned by tdelete(), tfind(), and tsearch() if rootp is a null pointer on entry.
- tdelete.16.01
The tdelete() function shall return a pointer to the parent of the deleted node,
- tdelete.16.02
or a null pointer if the node is not found.
- [+]tfind (7 / 4 / 0)
- tfind.01
The tdelete(), tfind(), tsearch(), and twalk() functions manipulate binary search trees.
Generalizes:
- tfind.02
- tfind.03
- tfind.04
- tfind.05
- tfind.06.01
- tfind.06.02
- tfind.07
- tfind.12
- tfind.13.01
- tfind.13.02
- tfind.15
- tfind.02 (struct)
Comparisons are made with a user-supplied routine, the address of which is passed as the compar argument.
- tfind.03 (struct)
This routine is called with two arguments, which are the pointers to the elements being compared.
- tfind.04 (struct)
The application shall ensure that the user-supplied routine returns an integer less than, equal to, or greater than 0, according to whether the first argument is to be considered less than, equal to, or greater than the second argument.
- tfind.05 (struct)
The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared.
- tfind.06.01
Like tsearch(), tfind() shall search for a node in the tree, returning a pointer to it if found.
- tfind.06.02
However, if it is not found, tfind() shall return a null pointer.
- tfind.07
The arguments for tfind() are the same as for tsearch().
- tfind.12 (struct)
If the calling function alters the pointer to the root, the result is undefined.
- tfind.13.01
If the node is found, both tsearch() and tfind() shall return a pointer to it.
- tfind.13.02
If not, tfind() shall return a null pointer,
- tfind.15
A null pointer shall be returned by tdelete(), tfind(), and tsearch() if rootp is a null pointer on entry.
- [+]tsearch (10 / 2 / 0)
- tsearch.01
The tdelete(), tfind(), tsearch(), and twalk() functions manipulate binary search trees.
Generalizes:
- tsearch.02
- tsearch.03
- tsearch.04
- tsearch.05
- tsearch.06
- tsearch.07
- tsearch.08.01
- tsearch.08.02
- tsearch.09
- tsearch.10
- tsearch.11
- tsearch.12
- tsearch.13.01
- tsearch.13.02
- tsearch.14
- tsearch.15
- tsearch.02 (struct)
Comparisons are made with a user-supplied routine, the address of which is passed as the compar argument.
- tsearch.03 (struct)
This routine is called with two arguments, which are the pointers to the elements being compared.
- tsearch.04 (struct)
The application shall ensure that the user-supplied routine returns an integer less than, equal to, or greater than 0, according to whether the first argument is to be considered less than, equal to, or greater than the second argument.
- tsearch.05 (struct)
The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared.
- tsearch.06
The tsearch() function shall build and access the tree.
Generalizes:
- tsearch.01
- tsearch.02
- tsearch.03
- tsearch.04
- tsearch.05
- tsearch.07
- tsearch.08.01
- tsearch.08.02
- tsearch.09
- tsearch.10
- tsearch.11
- tsearch.12
- tsearch.13.01
- tsearch.13.02
- tsearch.14
- tsearch.15
- tsearch.07
The key argument is a pointer to an element to be accessed or stored.
- tsearch.08.01
If there is a node in the tree whose element is equal to the value pointed to by key, a pointer to this found node shall be returned.
- tsearch.08.02
Otherwise, the value pointed to by key shall be inserted (that is, a new node is created and the value of key is copied to this node), and a pointer to this node returned.
- tsearch.09 (struct)
Only pointers are copied, so the application shall ensure that the calling routine stores the data.
- tsearch.10 (struct)
The rootp argument points to a variable that points to the root node of the tree.
- tsearch.11
A null pointer value for the variable pointed to by rootp denotes an empty tree; in this case, the variable shall be set to point to the node which shall be at the root of the new tree.
- tsearch.12 (struct)
If the calling function alters the pointer to the root, the result is undefined.
- tsearch.13.01
If the node is found, both tsearch() and tfind() shall return a pointer to it.
- tsearch.13.02
and tsearch() shall return a pointer to the inserted item.
- tsearch.14
A null pointer shall be returned by tsearch() if there is not enough space available to create a new node.
- tsearch.15
A null pointer shall be returned by tdelete(), tfind(), and tsearch() if rootp is a null pointer on entry.
- [+]twalk (4 / 3 / 0)
- twalk.01
The tdelete(), tfind(), tsearch(), and twalk() functions manipulate binary search trees.
Generalizes:
- twalk.02
- twalk.03
- twalk.04
- twalk.05
- twalk.06
- twalk.07
- twalk.08
- twalk.09.01
- twalk.10
- twalk.12
- twalk.13
- twalk.02
The twalk() function shall traverse a binary search tree.
- twalk.03 (struct)
The root argument is a pointer to the root node of the tree to be traversed.
- twalk.04
Any node in a tree may be used as the root for a walk below that node.
- twalk.05 (struct)
The argument action is the name of a routine to be invoked at each node.
- twalk.06 (struct)
This routine is, in turn, called with three arguments.
- twalk.07 (struct)
The first argument shall be the address of the node being visited.
- twalk.08 (struct)
The structure pointed to by this argument is unspecified and shall not be modified by the application, but it shall be possible to cast a pointer-to-node into a pointer-to-pointer-to-element to access the element stored in the node.
- twalk.09
The second argument shall be a value from an enumeration data type:typedef enum { preorder, postorder, endorder, leaf } VISIT;
- twalk.09.01
depending on whether this is the first, second, or third time that the node is visited (during a depth-first, left-to-right traversal of the tree), or whether the node is a leaf.
- twalk.10 (struct)
The third argument shall be the level of the node in the tree, with the root being level 0.
- twalk.12 (struct)
If the calling function alters the pointer to the root, the result is undefined.
- twalk.13 (struct)
The twalk() function shall not return a value.
- [+]util.string.casecmp (12 / 10 / 0)
- [+]strcasecmp (3 / 2 / 0)
- strcasecmp.01
The strcasecmp() function shall compare, while ignoring differences in case, the string pointed to by s1 to the string pointed to by s2.
Generalizes:
- strcasecmp.02
- strcasecmp.04
- strcasecmp.02
In the POSIX locale, strcasecmp() and strncasecmp() shall behave as if the strings had been converted to lowercase and then a byte comparison performed.
- app.strcasecmp.03
The results are unspecified in other locales.
- strcasecmp.04
Upon completion, strcasecmp() shall return an integer greater than, equal to, or less than 0, if the string pointed to by s1 is, ignoring case, greater than, equal to, or less than the string pointed to by s2, respectively.
- [+]strcasestr (6 / 5 / 0)
- strcasestr.01
The strstr() function shall locate the first occurrence in the string pointed to by s1 of the sequence of bytes (excluding the terminating null byte) in the string pointed to by s2.
- strcasestr.02
The strcasestr() shall behave as strstr(), except that it shall ignore the case of both strings.
- strcasestr.03
he strcasestr() function shall be locale aware; that is strcasestr() shall behave as if both strings had been converted to lower case in the current locale before the comparison is performed.
- strcasestr.04.01
Upon successful completion, strcasestr() shall return a pointer to the located string
- strcasestr.04.02
or a null pointer if the string is not found
- strcasestr.05
If s2 points to a string with zero length, the function shall return s1.
- [+]strncasecmp (3 / 3 / 0)
- strncasecmp.01
The strncasecmp() function shall compare, while ignoring differences in case, not more than n bytes from the string pointed to by s1 to the string pointed to by s2.
- strncasecmp.02
In the POSIX locale, strcasecmp() and strncasecmp() shall behave as if the strings had been converted to lowercase and then a byte comparison performed.
- app.strncasecmp.03
The results are unspecified in other locales.
- strncasecmp.04
Upon successful completion, strncasecmp() shall return an integer greater than, equal to, or less than 0, if the possibly null-terminated array pointed to by s1 is, ignoring case, greater than, equal to, or less than the possibly null-terminated array pointed to by s2, respectively.
- [+]util.string.mem (38 / 34 / 0)
- [+]__mempcpy (2 / 2 / 0)
- __mempcpy.01
__mempcpy() copies n bytes of source to destination
- __mempcpy.02
returning pointer to bytes after the last written byte.
- [+]__rawmemchr (3 / 0 / 0)
- __rawmemchr.01
__rawmemchr() searches in s for c.
- __rawmemchr.02
__rawmemchr() is a weak alias to rawmemchr().
Generalizes:
- __rawmemchr.01
- __rawmemchr.03
- __rawmemchr.03
It is similar to memchr(), but it has no length limit.
Generalizes:
- __rawmemchr.01
- __rawmemchr.02
- [+]bcmp (5 / 4 / 0)
- bcmp.01
The bcmp() function shall compare the first n bytes of the area pointed to by s1 with the area pointed to by s2.
Generalizes:
- bcmp.02
The bcmp() function shall return 0 if s1 and s2 are identical
- bcmp.03
otherwise, it shall return non-zero
- bcmp.04
Both areas are assumed to be n bytes long.
- bcmp.05
If the value of n is 0, bcmp() shall return 0.
- [+]bcopy (1 / 1 / 0)
- bcopy.01
The bcopy() function shall copy n bytes from the area pointed to by s1 to the area pointed to by s2.
- bcopy.02 (struct)
The bytes are copied correctly even if the area pointed to by s1 overlaps the area pointed to by s2.
- [+]bzero (1 / 1 / 0)
- bzero.01
The bzero() function shall place n zero-valued bytes in the area pointed to by s.
- [+]memccpy (4 / 4 / 0)
- memccpy.01
The memccpy() function shall copy bytes from memory area s2 into s1, stopping
- memccpy.01.01
after the first occurrence of byte c (converted to an unsigned char) is copied
- memccpy.01.02
or after n bytes are copied, whichever comes first
- app.memccpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- memccpy.03
The memccpy() function shall return
- memccpy.03.01
a pointer to the byte after the copy of c in s1
- memccpy.03.02
a null pointer if c was not found in the first n bytes of s2.
- [+]memchr (3 / 3 / 0)
- memchr.01
The memchr() function shall locate the first occurrence of c (converted to an unsigned char) in the initial n bytes (each interpreted as unsigned char) of the object pointed to by s.
- memchr.02
The memchr() function shall return
- memchr.02.01
a pointer to the located byte
- memchr.02.02
a null pointer if the byte does not occur in the object
- [+]memcmp (3 / 3 / 0)
- memcmp.01
The memcmp() function shall compare the first n bytes (each interpreted as unsigned char) of the object pointed to by s1 to the first n bytes of the object pointed to by s2.
- memcmp.02
The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of bytes (both interpreted as type unsigned char) that differ in the objects being compared.
- memcmp.03
The memcmp() function shall return an integer greater than, equal to, or less than 0, if the object pointed to by s1 is greater than, equal to, or less than the object pointed to by s2, respectively.
- [+]memcpy (2 / 2 / 0)
- memcpy.01
The memcpy() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1.
- app.memcpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- memcpy.03
The memcpy() function shall return s1;
- [+]memmem (2 / 2 / 0)
- memmem.01
memmem() finds the start of the first occurrence of the byte array referenced by needle of length needlelen in the memory area haystack of length haystacklen.
- memmem.02
memmem() returns a pointer to the beginning of the byte array, or NULL if the byte array is not found.
- [+]memmove (2 / 2 / 0)
- memmove.01
The memmove() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1.
- memmove.02 (struct)
Copying takes place as if the n bytes from the object pointed to by s2 are first copied into a temporary array of n bytes that does not overlap the objects pointed to by s1 and s2, and then the n bytes from the temporary array are copied into the object pointed to by s1.
- memmove.03
The memmove() function shall return s1;
- [+]memrchr (3 / 3 / 0)
- memrchr.01
The memrchr() function shall locate the last occurence of c (converted to an unsigned char) in the initial n bytes (each interpreted as an unsigned char) of the object pointed to by s.
- memrchr.02
The memrchr() shall return
- memrchr.02.01
a pointer to the located byte
- memrchr.02.02
a null pointer if the byte does not occur in the object.
- [+]memset (2 / 2 / 0)
- memset.01
The memset() function shall copy c (converted to an unsigned char) into each of the first n bytes of the object pointed to by s.
- memset.02
The memset() function shall return s
- [+]swab (5 / 5 / 0)
- swab.01
The swab() function shall copy nbytes bytes, which are pointed to by src, to the object pointed to by dest, exchanging adjacent bytes.
- swab.02
The nbytes argument should be even.
- swab.03
If nbytes is odd, swab() copies and exchanges nbytes-1 bytes and the disposition of the last byte is unspecified.
- swab.04
If copying takes place between objects that overlap, the behavior is undefined.
- swab.05
If nbytes is negative, swab() does nothing.
- [+]util.string.str (56 / 53 / 0)
- [+]__stpcpy (2 / 2 / 0)
- __stpcpy.stpcpy.01
The stpcpy() function shall copy the string pointed to by src (including the terminating null character) to the array pointed to by dest.
- __stpcpy.stpcpy.04
stpcpy() returns a pointer to the end of the string dest (that is, the address of the terminating null character) rather than the beginning.
- app.__stpcpy.stpcpy.02
The strings may not overlap
- app.__stpcpy.stpcpy.03
the destination string dest shall be large enough to receive the copy
- [+]__strdup (4 / 3 / 0)
- __strdup.strdup.01
The strdup() function shall return a pointer to a new string, which is a duplicate of the string pointed to by s1.
- __strdup.strdup.01.01
The strdup() function shall return a pointer to a new string on success.
- __strdup.strdup.02
The returned pointer can be passed to free().
- __strdup.strdup.03
A null pointer is returned if the new string cannot be created.
- __strdup.strdup.03.01
it shall return a null pointer and set errno to indicate the error.
- __strdup.strdup.04
The strdup() function may fail if:
- __strdup.strdup.04.01
[ENOMEM] Storage space available is insufficient.
- [+]index (3 / 3 / 0)
- index.01
The strchr() function shall locate the first occurrence of c (converted to a char) in the string pointed to by s.
- index.01.01
The terminating null byte is considered to be part of the string.
- index.01.02
strchr() shall return a pointer to the byte
- index.01.03
a null pointer if the byte was not found
- [+]rindex (3 / 3 / 0)
- rindex.01
The strrchr() function shall locate the last occurrence of c (converted to a char) in the string pointed to by s.
- rindex.01.01
strrchr() shall return a pointer to the byte
- rindex.01.02
a null pointer if c does not occur in the string
- rindex.02
The terminating null byte is considered to be part of the string.
- [+]stpcpy (2 / 2 / 0)
- stpcpy.01
The stpcpy() function shall copy the string pointed to by src (including the terminating null character) to the array pointed to by dest.
- app.stpcpy.02
The strings may not overlap
- app.stpcpy.03
the destination string dest shall be large enough to receive the copy
- stpcpy.04
stpcpy() returns a pointer to the end of the string dest (that is, the address of the terminating null character) rather than the beginning.
- [+]stpncpy (4 / 4 / 0)
- stpncpy.01
The stpncpy() function shall copy at most n characters from the string pointed to by src, including the terminating null character, to the array pointed to by dest.
- stpncpy.02
Exactly n characters are written at dest.
- stpncpy.02.01
If the length strlen()(src) is smaller than n, the remaining characters in dest are filled with '\0' characters.
- stpncpy.02.02
If the length strlen(src) is greater than or equal to n, dest will not be null terminated.
- app.stpncpy.03
The strings may not overlap.
- app.stpncpy.04
The programmer shall ensure that there is room for at least n characters at dest.
- stpncpy.05
The stpncpy() function shall return a pointer to the terminating NULL in dest, or, if dest is not NULL-terminated, dest + n.
- [+]strcat (3 / 3 / 0)
- strcat.01
The strcat() function shall append a copy of the string pointed to by s2 (including the terminating null byte) to the end of the string pointed to by s1.
- strcat.02
The initial byte of s2 overwrites the null byte at the end of s1.
- app.strcat.03
If copying takes place between objects that overlap, the behavior is undefined.
- strcat.04
The strcat() function shall return s1
- [+]strchr (3 / 3 / 0)
- strchr.01
The strchr() function shall locate the first occurrence of c (converted to a char) in the string pointed to by s.
- strchr.01.01
The terminating null byte is considered to be part of the string.
- strchr.01.02
strchr() shall return a pointer to the byte
- strchr.01.03
a null pointer if the byte was not found
- [+]strcmp (1 / 1 / 0)
- strcmp.01
The strcmp() function shall compare the string pointed to by s1 to the string pointed to by s2.
- strcmp.01.01
The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of bytes (both interpreted as type unsigned char) that differ in the strings being compared.
- strcmp.01.01.01
strcmp() shall return an integer greater than, equal to, or less than 0, if the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2, respectively
- [+]strcpy (2 / 2 / 0)
- strcpy.01
The strcpy() function shall copy the string pointed to by s2 (including the terminating null byte) into the array pointed to by s1.
- app.strcpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- strcpy.03
The strcpy() function shall return s1
- [+]strcspn (1 / 1 / 0)
- strcspn.01
The strcspn() function shall compute the length (in bytes) of the maximum initial segment of the string pointed to by s1 which consists entirely of bytes not from the string pointed to by s2.
- strcspn.01.01
The strcspn() function shall return the length of the computed segment of the string pointed to by s1
- [+]strdup (4 / 3 / 0)
- strdup.01
The strdup() function shall return a pointer to a new string, which is a duplicate of the string pointed to by s1.
- strdup.01.01
The strdup() function shall return a pointer to a new string on success.
- strdup.02
The returned pointer can be passed to free().
- strdup.03
A null pointer is returned if the new string cannot be created.
- strdup.03.01
it shall return a null pointer and set errno to indicate the error.
- strdup.04
The strdup() function may fail if:
- strdup.04.01
[ENOMEM] Storage space available is insufficient.
- [+]strlen (1 / 1 / 0)
- strlen.01
The strlen() function shall compute the number of bytes in the string to which s points, not including the terminating null byte.
- strlen.01.01
The strlen() function shall return the length of s
- [+]strncat (4 / 4 / 0)
- strncat.01
The strncat() function shall append not more than n bytes (a null byte and bytes that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1.
- strncat.02
The initial byte of s2 overwrites the null byte at the end of s1.
- strncat.03
A terminating null byte is always appended to the result.
- app.strncat.04
If copying takes place between objects that overlap, the behavior is undefined.
- strncat.05
The strncat() function shall return s1
- [+]strncmp (2 / 2 / 0)
- strncmp.01
The strncmp() function shall compare not more than n bytes (bytes that follow a null byte are not compared) from the array pointed to by s1 to the array pointed to by s2.
- strncmp.01.01
strncmp() shall return an integer greater than, equal to, or less than 0, if the possibly null-terminated array pointed to by s1 is greater than, equal to, or less than the possibly null-terminated array pointed to by s2 respectively.
- strncmp.02
The sign of a non-zero return value is determined by the sign of the difference between the values of the first pair of bytes (both interpreted as type unsigned char) that differ in the strings being compared.
- [+]strncpy (2 / 2 / 0)
- strncpy.01
The strncpy() function shall copy not more than n bytes (bytes that follow a null byte are not copied) from the array pointed to by s2 to the array pointed to by s1.
- strncpy.01.01
If the array pointed to by s2 is a string that is shorter than n bytes, null bytes shall be appended to the copy in the array pointed to by s1, until n bytes in all are written.
- app.strncpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- strncpy.03
The strncpy() function shall return s1
- [+]strndup (4 / 3 / 0)
- strndup.01
The strndup() function shall return a malloc()'d copy of at most n bytes of string .
- strndup.02
The resultant string shall be terminated even if no NULL terminator appears before string + n .
- strndup.03
strndup() shall return a pointer to a newly allocated block of memory containing a copy of at most n bytes of string
- strndup.04
strndup() shall return NULL and set errno to indicate the error
- strndup.04.01
Errors
- strndup.04.01.01
[ENOMEM]
Insufficient memory available.
- [+]strnlen (2 / 2 / 0)
- strnlen.01
strnlen() returns the number of characters in the string s, not including the terminating \0 character, but at most maxlen.
- strnlen.01.01
In doing this, strnlen() looks only at the first maxlen characters at s and never beyond s + maxlen.
- strnlen.01.02
strnlen() returns strlen(s), if that is less than maxlen, or maxlen if there is no \0 character among the first maxlen characters pointed to by s.
- [+]strpbrk (2 / 2 / 0)
- strpbrk.01
The strpbrk() function shall locate the first occurrence in the string pointed to by s1 of any byte from the string pointed to by s2.
- strpbrk.01.01
strpbrk() shall return a pointer to the byte
- strpbrk.01.02
a null pointer if no byte from s2 occurs in s1
- [+]strrchr (3 / 3 / 0)
- strrchr.01
The strrchr() function shall locate the last occurrence of c (converted to a char) in the string pointed to by s.
- strrchr.01.01
strrchr() shall return a pointer to the byte
- strrchr.01.02
a null pointer if c does not occur in the string
- strrchr.02
The terminating null byte is considered to be part of the string.
- [+]strspn (1 / 1 / 0)
- strspn.01
The strspn() function shall compute the length (in bytes) of the maximum initial segment of the string pointed to by s1 which consists entirely of bytes from the string pointed to by s2.
- strspn.01.01
The strspn() function shall return the length of s1
- [+]strstr (3 / 3 / 0)
- strstr.01
The strstr() function shall locate the first occurrence in the string pointed to by s1 of the sequence of bytes (excluding the terminating null byte) in the string pointed to by s2.
- strstr.01.01
strstr() shall return a pointer to the located string
- strstr.01.02
a null pointer if the string is not found
- strstr.02
If s2 points to a string with zero length, the function shall return s1.
- [+]util.string.wcasecmp (10 / 8 / 0)
- [+]wcscasecmp (5 / 4 / 0)
- wcscasecmp.01
wcscasecmp() is the wide-character equivalent of strcasecmp().
Generalizes:
- wcscasecmp.02
- wcscasecmp.03.01
- wcscasecmp.03.02
- wcscasecmp.03.03
- wcscasecmp.02
It compares the wide-character string s1 and the wide-character string s2, ignoring case differences (towupper, towlower).
- wcscasecmp.03.01
The wcscasecmp() function shall return 0 if the wide-character strings s1 and s2 are equal except for case distinctions.
- wcscasecmp.03.02
It shall return a positive integer if s1 is greater than s2, ignoring case.
- wcscasecmp.03.03
It shall return a negative integer if s1 is less than s2, ignoring case.
- [+]wcsncasecmp (5 / 4 / 0)
- wcsncasecmp.01
wcsncasecmp() is the wide-character equivalent of strncasecmp().
Generalizes:
- wcsncasecmp.02
- wcsncasecmp.03.01
- wcsncasecmp.03.02
- wcsncasecmp.03.03
- wcsncasecmp.02
It compares the wide-character string s1 and the wide-character string s2, but at most n wide characters from each string, ignoring case differences (towupper, towlower).
- wcsncasecmp.03.01
wcscasecmp() returns 0 if the wide-character strings s1 and s2, truncated to at most length n, are equal except for case distinctions.
- wcsncasecmp.03.02
It returns a positive integer if truncated s1 is greater than truncated s2, ignoring case.
- wcsncasecmp.03.03
It returns a negative integer if truncated s1 is smaller than truncated s2, ignoring case.
- [+]util.string.wmem (21 / 16 / 0)
- [+]wmemchr (6 / 5 / 0)
- wmemchr.01
The wmemchr() function shall locate the first occurrence of wc in the initial n wide characters of the object pointed to by ws.
- wmemchr.02
This function shall not be affected by locale and all wchar_t values shall be treated identically.
- wmemchr.03
The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially.
- wmemchr.04
If n is zero, the application shall ensure that ws is a valid pointer and the function behaves as if no valid occurrence of wc is found.
- wmemchr.05
The wmemchr() function shall return
- wmemchr.05.01
a pointer to the located wide character
- wmemchr.05.02
null pointer if the wide character does not occur in the object.
- [+]wmemcmp (5 / 4 / 0)
- wmemcmp.01
The wmemcmp() function shall compare the first n wide characters of the object pointed to by ws1 to the first n wide characters of the object pointed to by ws2.
- wmemcmp.02
This function shall not be affected by locale and all wchar_t values shall be treated identically.
- wmemcmp.03
The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially.
- wmemcmp.04
If n is zero, the application shall ensure that ws1 and ws2 are valid pointers, and the function shall behave as if the two objects compare equal.
- wmemcmp.05
The wmemcmp() function shall return an integer greater than, equal to, or less than zero, respectively, as the object pointed to by ws1 is greater than, equal to, or less than the object pointed to by ws2.
- [+]wmemcpy (4 / 3 / 0)
- wmemcpy.01
The wmemcpy() function shall copy n wide characters from the object pointed to by ws2 to the object pointed to by ws1.
- wmemcpy.02
This function shall not be affected by locale and all wchar_t values shall be treated identically.
- wmemcpy.03
The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially.
- wmemcpy.04 (struct)
If n is zero, the application shall ensure that ws1 and ws2 are valid pointers, and the function shall copy zero wide characters.
- wmemcpy.05
The wmemcpy() function shall return the value of ws1.
- [+]wmemmove (3 / 2 / 0)
- wmemmove.01
The wmemmove() function shall copy n wide characters from the object pointed to by ws2 to the object pointed to by ws1.
- wmemmove.02 (struct)
Copying shall take place as if the n wide characters from the object pointed to by ws2 are first copied into a temporary array of n wide characters that does not overlap the objects pointed to by ws1 or ws2, and then the n wide characters from the temporary array are copied into the object pointed to by ws1.
- wmemmove.03
This function shall not be affected by locale and all wchar_t values shall be treated identically. The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially.
- wmemmove.04 (struct)
If n is zero, the application shall ensure that ws1 and ws2 are valid pointers, and the function shall copy zero wide characters.
- wmemmove.05
The wmemmove() function shall return the value of ws1.
- [+]wmemset (3 / 2 / 0)
- wmemset.01
The wmemset() function shall copy the value of wc into each of the first n wide characters of the object pointed to by ws.
- wmemset.02
This function shall not be affected by locale and all wchar_t values shall be treated identically. The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially.
- wmemset.03 (struct)
If n is zero, the application shall ensure that ws is a valid pointer, and the function shall copy zero wide characters.
- wmemset.04
The wmemset() functions shall return the value of ws.
- [+]util.string.wstr (46 / 43 / 0)
- [+]wcpcpy (2 / 2 / 0)
- wcpcpy.01
It copies the wide character string src, including the terminating null wide character code, to the array dest.
- app.wcpcpy.02
The strings may not overlap.
- app.wcpcpy.03
The programmer shall ensure that there is room for at least wcslen() (src)+1 wide characters at dest.
- wcpcpy.04
wcpcpy() returns a pointer to the end of the wide-character string dest
- [+]wcpncpy (6 / 6 / 0)
- wcpncpy.01
It copies at most n wide characters from the wide-character string src, including the terminating null wide character code, to the array dest.
- wcpncpy.02
Exactly n wide characters are written at dest.
- wcpncpy.03
If the length wcslen()(src) is smaller than n, the remaining wide characters in the array dest are filled with null wide character codes. If the length wcslen()(src) is greater than or equal to n, the string dest will not be terminated with a null wide character code.
- app.wcpncpy.04
The strings may not overlap.
- app.wcpncpy.05
The programmer shall ensure that there is room for at least n wide characters at dest.
- wcpncpy.06.else
wcpncpy() returns a pointer to the wide character one past the last non-null wide character written.
- wcpncpy.06.lcgn
wcpncpy() returns a pointer to the wide character one past the last non-null wide character written.
- wcpncpy.06.nzero
wcpncpy() returns a pointer to the wide character one past the last non-null wide character written.
- [+]wcscat (3 / 3 / 0)
- wcscat.01
The wcscat() function shall append a copy of the wide-character string pointed to by ws2 (including the terminating null wide-character code) to the end of the wide-character string pointed to by ws1.
- wcscat.02
The initial wide-character code of ws2 shall overwrite the null wide-character code at the end of ws1.
- wcscat.03
The wcscat() function shall return ws1
- app.wcscat.03
If copying takes place between objects that overlap, the behavior is undefined.
- [+]wcschr (3 / 3 / 0)
- wcschr.01
The wcschr() function shall locate the first occurrence of wc in the wide-character string pointed to by ws.
- wcschr.01.01
wcschr() shall return a pointer to the wide-character code
- wcschr.01.02
a null pointer if the wide-character code is not found
- app.wcschr.02
The application shall ensure that the value of wc is a character representable as a type wchar_t and a wide-character code corresponding to a valid character in the current locale.
- wcschr.03
The terminating null wide-character code is considered to be part of the wide-character string.
- [+]wcscmp (2 / 2 / 0)
- wcscmp.01
The wcscmp() function shall compare the wide-character string pointed to by ws1 to the wide-character string pointed to by ws2.
- wcscmp.01.01
The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of wide-character codes that differ in the objects being compared.
- wcscmp.01.02
Upon completion, wcscmp() shall return an integer greater than, equal to, or less than 0, if the wide-character string pointed to by ws1 is greater than, equal to, or less than the wide-character string pointed to by ws2, respectively.
- [+]wcscpy (2 / 2 / 0)
- wcscpy.01
The wcscpy() function shall copy the wide-character string pointed to by ws2 (including the terminating null wide-character code) into the array pointed to by ws1.
- app.wcscpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- wcscpy.03
The wcscpy() function shall return ws1
- [+]wcscspn (1 / 1 / 0)
- wcscspn.01
The wcscspn() function shall compute the length (in wide characters) of the maximum initial segment of the wide-character string pointed to by ws1 which consists entirely of wide-character codes not from the wide-character string pointed to by ws2.
- wcscspn.01.01
The wcscspn() function shall return the length of the initial substring of ws1
- [+]wcsdup (3 / 1 / 0)
- wcsdup.01
It allocates and returns a new wide-character string whose initial contents is a duplicate of the wide-character string s.
- wcsdup.01.01
wcsdup() returns a pointer to the new wide-character string
- wcsdup.01.02
NULL if sufficient memory was not available.
- wcsdup.02
Memory for the new wide-character string is obtained with malloc(), and can be freed with free().
- [+]wcslen (1 / 1 / 0)
- wcslen.01
The wcslen() function shall compute the number of wide-character codes in the wide-character string to which ws points, not including the terminating null wide-character code.
- wcslen.01.01
The wcslen() function shall return the length of ws
- [+]wcsncat (4 / 4 / 0)
- wcsncat.01
The wcsncat() function shall append not more than n wide-character codes (a null wide-character code and wide-character codes that follow it are not appended) from the array pointed to by ws2 to the end of the wide-character string pointed to by ws1.
- wcsncat.02
The initial wide-character code of ws2 shall overwrite the null wide-character code at the end of ws1.
- wcsncat.03
A terminating null wide-character code shall always be appended to the result.
- app.wcsncat.04
If copying takes place between objects that overlap, the behavior is undefined.
- wcsncat.05
The wcsncat() function shall return ws1
- [+]wcsncmp (2 / 2 / 0)
- wcsncmp.01
The wcsncmp() function shall compare not more than n wide-character codes (wide-character codes that follow a null wide-character code are not compared) from the array pointed to by ws1 to the array pointed to by ws2.
- wcsncmp.01.01
The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of wide-character codes that differ in the objects being compared.
- wcsncmp.01.02
wcsncmp() shall return an integer greater than, equal to, or less than 0, if the possibly null-terminated array pointed to by ws1 is greater than, equal to, or less than the possibly null-terminated array pointed to by ws2, respectively.
- [+]wcsncpy (3 / 3 / 0)
- wcsncpy.01
The wcsncpy() function shall copy not more than n wide-character codes (wide-character codes that follow a null wide-character code are not copied) from the array pointed to by ws2 to the array pointed to by ws1.
- app.wcsncpy.02
If copying takes place between objects that overlap, the behavior is undefined.
- wcsncpy.03
If the array pointed to by ws2 is a wide-character string that is shorter than n wide-character codes, null wide-character codes shall be appended to the copy in the array pointed to by ws1, until n wide-character codes in all are written.
- wcsncpy.04
The wcsncpy() function shall return ws1
- [+]wcsnlen (2 / 1 / 0)
- wcsnlen.01
It returns the number of wide-characters in the string s, not including the terminating null wide character code, but at most maxlen.
- wcsnlen.01.01
wcsnlen() returns wcslen() (s) if that is less than maxlen, or maxlen if there is no null wide character code among the first maxlen wide characters pointed to by s.
- wcsnlen.02
In doing this, wcsnlen() looks only at the first maxlen wide-characters at s and never beyond s + maxlen.
- [+]wcspbrk (2 / 2 / 0)
- wcspbrk.01
The wcspbrk() function shall locate the first occurrence in the wide-character string pointed to by ws1 of any wide-character code from the wide-character string pointed to by ws2.
- wcspbrk.01.01
wcspbrk() shall return a pointer to the wide-character code
- wcspbrk.01.02
a null pointer if no wide-character code from ws2 occurs in ws1
- [+]wcsrchr (3 / 3 / 0)
- wcsrchr.01
The wcsrchr() function shall locate the last occurrence of wc in the wide-character string pointed to by ws.
- wcsrchr.01.01
wcsrchr() shall return a pointer to the wide-character code
- wcsrchr.01.02
or a null pointer if wc does not occur in the wide-character string.
- app.wcsrchr.02
The application shall ensure that the value of wc is a character representable as a type wchar_t and a wide-character code corresponding to a valid character in the current locale.
- wcsrchr.03
The terminating null wide-character code shall be considered to be part of the wide-character string.
- [+]wcsspn (1 / 1 / 0)
- wcsspn.01
The wcsspn() function shall compute the length (in wide characters) of the maximum initial segment of the wide-character string pointed to by ws1 which consists entirely of wide-character codes from the wide-character string pointed to by ws2.
- wcsspn.01.01
The wcsspn() function shall return the length of the initial substring of ws1
- [+]wcsstr (3 / 3 / 0)
- wcsstr.01
The wcsstr() function shall locate the first occurrence in the wide-character string pointed to by ws1 of the sequence of wide characters (excluding the terminating null wide character) in the wide-character string pointed to by ws2.
- wcsstr.01.01
wcsstr() shall return a pointer to the located wide-character string
- wcsstr.01.02
a null pointer if the wide-character string is not found
- wcsstr.02
If ws2 points to a wide-character string with zero length, the function shall return ws1.
- [+]wcswcs (3 / 3 / 0)
- wcswcs.01
The wcswcs() function shall locate the first occurrence in the wide-character string pointed to by ws1 of the sequence of wide-character codes (excluding the terminating null wide-character code) in the wide-character string pointed to by ws2.
- wcswcs.01.01
wcswcs() shall return a pointer to the located wide-character string
- wcswcs.01.02
a null pointer if the wide-character string is not found.
- wcswcs.02
If ws2 points to a wide-character string with zero length, the function shall return ws1.
- [+]util.wordexp (21 / 8 / 0)
- [+]wordexp (20 / 7 / 0)
- wordexp.01
The wordexp() function shall store the number of generated words into pwordexp->we_wordc and a pointer to a list of pointers to words in pwordexp->we_wordv.
- app.wordexp.01
It is the caller's responsibility to allocate the storage pointed to by pwordexp.
- wordexp.02
Each individual field created during field splitting (see the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.6.5, Field Splitting) or pathname expansion (see the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.6.6, Pathname Expansion) shall be a separate word in the pwordexp->we_wordv list.
- wordexp.02.06
If wordexp() returns the value WRDE_NOSPACE, then pwordexp->we_wordc and pwordexp->we_wordv shall be updated to reflect any words that were successfully expanded.
- wordexp.02.07
In other cases, they shall not be modified.
- wordexp.03
The first pointer after the last word pointer shall be a null pointer.
- wordexp.04
The wordexp() function shall allocate other space as needed, including memory pointed to by pwordexp->we_wordv.
- wordexp.05
The flags argument is used to control the behavior of wordexp(). The value of flags is the bitwise-inclusive OR of zero or more of the following constants, which are defined in <wordexp.h>:
- wordexp.05.01
WRDE_APPEND Append words generated to the ones from a previous call to wordexp().
- wordexp.05.02
WRDE_DOOFFS Make use of pwordexp->we_offs. If this flag is set, pwordexp->we_offs is used to specify how many null pointers to add to the beginning of pwordexp->we_wordv. In other words, pwordexp->we_wordv shall point to pwordexp->we_offs null pointers, followed by pwordexp->we_wordc word pointers, followed by a null pointer.
- wordexp.05.03
WRDE_NOCMD If the implementation supports the utilities defined in the Shell and Utilities volume of IEEE Std 1003.1-2001, fail if command substitution, as specified in the Shell and Utilities volume of IEEE Std 1003.1-2001, Section 2.6.3, Command Substitution, is requested.
- wordexp.05.04
WRDE_REUSE The pwordexp argument was passed to a previous successful call to wordexp(), and has not been passed to wordfree(). The result shall be the same as if the application had called wordfree() and then called wordexp() without WRDE_REUSE.
- wordexp.05.05
WRDE_SHOWERR Do not redirect stderr to /dev/null.
- wordexp.05.05.01
Unless WRDE_SHOWERR is set in flags, wordexp() shall redirect stderr to /dev/null for any utilities executed as a result of command substitution while expanding words.
- wordexp.05.05.02
If WRDE_SHOWERR is set, wordexp() may write messages to stderr if syntax errors are detected while expanding words.
- wordexp.05.06
WRDE_UNDEF Report error on an attempt to expand an undefined shell variable.
- wordexp.105.101
The WRDE_APPEND flag can be used to append a new set of words to those generated by a previous call to wordexp().
- wordexp.120.102
Otherwise, a non-zero value, as described in <wordexp.h>, shall be returned to indicate an error.
- wordexp.20.01
Upon successful completion, wordexp() shall return 0.
- wordexp.20.02
The following constants are defined as error return values:
- wordexp.20.02.01
WRDE_BADCHAR One of the unquoted characters- <newline>, '|', '&', ';', '<', '>', '(', ')', '{', '}' - appears in words in an inappropriate context.
- wordexp.20.02.02
WRDE_BADVAL Reference to undefined shell variable when WRDE_UNDEF is set in flags.
- wordexp.20.02.03
WRDE_CMDSUB Command substitution requested when WRDE_NOCMD was set in flags.
- wordexp.20.02.04
WRDE_NOSPACE Attempt to allocate memory failed.
- wordexp.20.02.05
WRDE_SYNTAX Shell syntax error, such as unbalanced parentheses or unterminated string.
- [+]wordfree (1 / 1 / 0)
- wordfree.01
The wordfree() function frees any memory associated with pwordexp from a previous call to wordexp().