# IO ## **Overview** Provides data structures and functions for performing input/output \(I/O\) operations, such as printf and scanf. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files
Waiting to be notified of the completion of all asynchronous I/O operations. |
|
Not waiting to be notified of the completion of all asynchronous I/O operations. |
|
Language symbol type, which affects character classification and case conversion. |
|
Character sorting type, which affects string comparison and sorting habits. |
|
Message type, which affects prompt information, error information, status information, titles, labels, buttons, and menus. |
|
All types, which affect all content of locale settings. If LC_ALL is set, the locale information of all types is set to be consistent with LC_ALL. |
|
Defines the size of fd_set, that is, the maximum number of monitored files. |
|
FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0) |
|
FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long))))) |
|
FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long))))) |
|
FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long))))) |
Defines fd_set as the alias of the element type. |
lio_listio (int mode, struct aiocb *restrict const *restrict cbs, int cnt, struct sigevent *restrict sev) |
|
warn (const char *fmt,...) |
Displays a formatted error message on the standard error (stderr) output. |
vwarn (const char *fmt, va_list args) |
|
warnx (const char *fmt,...) |
|
vwarnx (const char *fmt, va_list args) |
|
err (int eval, const char *fmt, va_list args) |
|
errx (int eval, const char *fmt,...) |
|
verr (int eval, const char *fmt, va_list args) |
|
verrx (int eval, const char *fmt, va_list args) |
|
iconv_open (const char *to, const char *from) |
|
iconv (iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) |
|
iconv_close (iconv_t cd) |
|
setlocale (int category, const char *locale) |
Sets the current locale information based on input parameters. |
localeconv (void) |
struct lconv * Obtains the locale information about a region and stores them in lconv. |
catopen (const char *name, int oflag) |
|
catgets (nl_catd catd, int set_id, int msg_id, const char *s) |
|
fopen (const char *__restrict path, const char *__restrict mode) |
FILE * Opens the file stored in the specified path based on the given mode. |
remove (const char *pathname) |
|
rename (const char *oldpath, const char *newpath) |
|
Changes the position of a specified stream to a new position. |
|
Obtains the current value of the file position indicator for a specified file stream. |
|
Sets the position indicator of a specified stream to the beginning of the file. |
|
Obtains the current file position of a specified stream and writes it to the pos parameter. |
|
Sets the file position indicator for a specified file stream. |
|
fread (void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream) |
|
fwrite (const void *__restrict ptr, size_t size, size_t nmemb, FILE *__restrict stream) |
|
getchar (void) |
|
Writes a character into the position pointed to by a specified stream. |
|
putchar (int c) |
|
Reads a line of characters from a specified file stream and stores it into the string pointed to by s. |
|
gets (char *s) |
Reads a line of characters from the stdin and stores it in the buffer. |
Writes a character string (excluding the terminating null character) to a specified file stream. |
|
puts (const char *s) |
Writes a character string and appends a new-line character to the stdout. |
printf (const char *format,...) |
Formats arguments based on format and prints formatted data to the stdout. |
Formats arguments based on format and prints formatted data to a specified file stream. |
|
sprintf (char *str, const char *format,...) |
Prints formatted data from a variable argument list to a specified string. |
snprintf (char *str, size_t size, const char *format,...) |
Prints formatted data of a maximum of size bytes from a variable argument list to a specified string. |
vprintf (const char *format, va_list ap) |
Prints formatted data from a variable argument list to the stdout. |
Prints formatted data from a variable argument list to a specified file stream. |
|
vsprintf (char *str, const char *format, va_list ap) |
Prints formatted data from a variable argument list to a specified string. |
vsnprintf (char *str, size_t size, const char *format, va_list ap) |
Prints formatted data of a maximum of size bytes from a variable argument list to a specified string. |
scanf (const char *format,...) |
Reads formatted data from the stdin and stores the data to the additional arguments based on format. |
Reads formatted data from a specified file stream and stores it based on format into the locations pointed to by the variable arguments. |
|
sscanf (const char *str, const char *format,...) |
Reads data from a character string pointed to by str and stores it based on format into the locations pointed to by the variable arguments. |
vscanf (const char *format, va_list ap) |
Reads data from the stdin and stores it based on format into the locations pointed to by the elements in the variable argument list identified by ap. |
Reads data from a specified file stream and stores it based on format into the locations pointed to by the elements in the variable argument list identified by ap. |
|
vsscanf (const char *str, const char *format, va_list ap) |
Reads data from a specified string and stores it based on format into the locations pointed to by the elements in the variable argument list identified by ap. |
perror (const char *msg) |
Prints the last error occurred during a call to a system or library function to the standard error output stream (stderr). |
Sets the mode and size of the buffer for a specified stream. |
|
fmemopen (void *buf, size_t size, const char *mode) |
FILE * Opens a memory stream that allows the access mode specified by mode. |
open_memstream (char **ptr, size_t *size) |
FILE * |
Sets the position of the next input or output operation on a specified file stream. |
|
Obtains the current value of the file position indicator for a specified file stream. |
|
dprintf (int fd, const char *format,...) |
|
vdprintf (int fd, const char *format, va_list ap) |
Prints formatted data from a variable argument list to a specified file. |
ftrylockfile (FILE *filehandle) |
|
funlockfile (FILE *filehandle) |
|
getc_unlocked (FILE *stream) |
Obtains a character from a specified file stream without locking the file stream or checking whether it is locked. |
getchar_unlocked (void) |
|
putc_unlocked (int c, FILE *stream) |
Writes a character to a specified file stream with the thread remains unlocked. |
putchar_unlocked (int c) |
Writes a character to the stdout with the thread remains unlocked. |
getdelim (char **lineptr, size_t *n, int delim, FILE *stream) |
|
tempnam (const char *dir, const char *prefix) |
|
setlinebuf (FILE *f) |
|
fgetc_unlocked (FILE *stream) |
Reads a character from the file pointed to by stream with the thread remains unlocked. |
fputc_unlocked (int c, FILE *stream) |
Writes a character to the file stream pointed to by stream at the current position. |
ferror_unlocked (FILE *stream) |
|
Reads a line of data from the current position of a specified file stream. |
|
asprintf (char **strp, const char *fmt,...) |
|
vasprintf (char **strp, const char *fmt, va_list ap) |
Prints formatted data from a variable argument list to a specified character string. |
select (int nfds, fd_set *__restrict readfds, fd_set *__restrict writefds, fd_set *__restrict exceptfds, struct timeval *__restrict timeout) |
|
readv (int fd, const struct iovec *iov, int iovcnt) |
|
writev (int fd, const struct iovec *iov, int iovcnt) |
|
preadv (int fd, const struct iovec *iov, int iovcnt, off_t offset) |
Reads the data in a file whose fd offset is offset to the multi-group buffer space pointed to by iov. |
pwritev (int fd, const struct iovec *iov, int iovcnt, off_t offset) |
Writes the data of a multi-group buffer space pointed to by iov to the offset of fd. |
d | Indicates the file descriptor of the int type. |
s | Indicates the descriptor set of the fd_set type. |
d | Indicates the file descriptor of the int type. |
s | Indicates the descriptor set of the fd_set type. |
d | Indicates the file descriptor of the int type. |
s | Indicates the descriptor set of the fd_set type. |
s | Indicates the descriptor set of the fd_set type. |
strp | Indicates the double pointer to the start address of the target string. |
fmt | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
catd | Indicates the catalog descriptor to close. |
catd | Indicates the descriptor of the message catalog. |
set_id | Indicates the setting ID of the message catalog. |
msg_id | Indicates the ID of the message catalog. |
s | Indicates the pointer to a string to be returned if the operation fails. |
name | Indicates the pointer to the path name of the message catalog to open. |
oflag | Indicates the source of the language to use. |
fp | Indicates the pointer to the file object that identifies a stream to set. |
fd | Indicates the file descriptor that identifies a file. |
format | Indicates the pointer to the format string. |
eval | This function does not return, but exits with the value of eval. |
fmt | Indicates the pointer to the string to format. |
args | Indicates the parameters initialized by using va_start. |
eval | This function does not return, but exits with the value of eval. |
fmt | Indicates the pointer to the string to format. |
fd | Indicates the pointer to the file descriptor of the file to close. |
fp | Indicates the pointer to the file object that identifies a stream to test. |
stream | Indicates the pointer to the file object that identifies a stream. |
stream | Indicates the pointer to the file object that identifies a stream. |
fp | Indicates the pointer to the file object that identifies a stream to flush. |
stream | Indicates the pointer to the file object that identifies a stream. |
stream | Indicates the pointer to the file object that identifies a stream. |
stream | Indicates the pointer to the file object that identifies a stream. |
len | Indicates the pointer to the length of the string that is read. |
stream | Indicates the pointer to the file object that identifies a stream. |
pos | Indicates the pointer to the fpos_t object. |
fp | Indicates the pointer to the file object that identifies a stream for which the file descriptor is obtained. |
buf | Indicates the pointer to the buffer. |
size | Indicates the size of the buffer. |
mode | Indicates the pointer to the file operation mode. |
path | Indicates the pointer to the path of the file to open. |
mode | Indicates the pointer to the file access mode. The following table describes the available values. |
stream | Indicates the pointer to the file object that identifies a stream. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
c | Indicates the int promotion of the character to write. |
stream | Indicates the pointer to the file object that identifies a stream. |
c | Indicates the int promotion of the character to write. |
stream | Indicates the pointer to the file stream. |
s | Indicates the pointer to the character string to write. |
stream | Indicates the pointer to the file object that identifies a stream. |
ptr | Indicates the pointer to the array for storing the read data. |
size | Indicates the size of each element to read, in bytes. |
nmemb | Indicates the number of elements to read. |
stream | Indicates the pointer to the file object that identifies a stream to read. |
stream | Indicates the pointer to the file object that identifies a stream. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
fp | Indicates the pointer to the file object that identifies a stream for which the position is to set. |
offset | Indicates the offset that determines the position. |
whence | Indicates the start position of the offset. The following table describes the available values. |
fp | Indicates the pointer to the file object that identifies a stream for which the position is to set. |
offset | Indicates the offset that determines the next operation. |
whence | Indicates the start position of the offset. The following table describes the available values. |
fp | Indicates the pointer to the file object that identifies a stream for which the position is to set. |
pos | Indicates the pointer to the position to set. |
fp | Indicates the pointer to the file object that identifies a stream for which the position is to obtain. |
fp | Indicates the pointer to the file object that identifies a stream for which the position is to obtain. |
filehandle | Indicates the pointer to the file object. |
filehandle | Indicates the pointer to the file whose lock count is to be reduced. |
ptr | Indicates the pointer to the data to write. |
size | Indicates the size of each element to write, in bytes. |
nmemb | Indicates the number of elements to write. |
stream | Indicates the pointer to the file object that identifies a stream to which data is to write. |
stream | Indicates the pointer to the file object that identifies a stream. |
stream | Indicates the pointer to the file object that identifies a stream. |
s | Indicates the pointer to the memory buffer for storing the obtained string. |
stream | Indicates the pointer to the file object that identifies a stream. |
cd | Indicates the conversion descriptor obtained via iconv_open. |
in | Indicates the double pointer to the buffer for storing the input character. |
inb | Indicates the pointer to the length of the character input buffer. |
out | Indicates the double pointer to the buffer for storing the output character. |
outb | Indicates the pointer to length of the character output buffer. |
An incomplete multi-byte sequence is encountered in the input. |
cd | Indicates the conversion descriptor to close. |
to | Indicates the pointer to the source character set for conversion. |
from | Indicates the pointer to the target character set for conversion. |
ptr | Indicates the pointer to the buffer address. |
size | Indicates the pointer to the buffer size. |
f | Indicates the pointer to the file object that identifies a pipe to close. |
The child process does not exist, or the specified process group does not exist. |
|
msg | Indicates the pointer to the prompt message printed to stderr before the error message itself. |
fd | Indicates the file descriptor. |
iov | Indicates the pointer to the multi-group buffer. |
iovcnt | Indicates the number of buffers. For details, see IOV_MAX. |
offset | Indicates the offset of the file descriptor to read. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
c | Indicates the int promotion of the character to write. |
stream | Indicates the pointer to the file stream. |
c | Indicates the int promotion of the character to write. |
stream | Indicates the pointer to the file object that identifies a stream. |
c | Indicates the int promotion of the character to write. |
c | Indicates the int promotion of the character to write. |
s | Indicates the pointer to the start address of the output buffer. |
w | Indicates the word to write. |
stream | Indicates the pointer to the file object that identifies a stream. |
fd | Indicates the file descriptor. |
iov | Indicates the pointer to the multi-group buffer. |
iovcnt | Indicates the number of buffers. For details, see IOV_MAX. |
offset | Indicates the offset of the file descriptor to write. |
fd | Indicates the file descriptor. |
iov | Indicates the pointer to the multi-group buffer. |
iovcnt | Indicates the number of buffers. For details, see IOV_MAX. |
pathname | Indicates the pointer to the file or directory to delete. |
The length of pathname is greater than NAME_MAX. |
|
The file or directory pointed to by pathname does not exist. |
|
The path is a mount point or is neither a directory nor a file. |
|
When pathname points to a directory, the directory is not empty. |
|
The search permission on the path prefix component is denied, or the write permission of the directory in the path is denied. |
oldpath | Indicates the pointer to the old path name of the file to rename. |
newpath | Indicates the pointer to the new path name of the file. |
The device or resource is in use by the system or another process. |
|
stream | Indicates the pointer to the file object that identifies a stream. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
nfds | Indicates the maximum value of the file descriptor of the int type. |
readfds | Indicates the descriptor set of the readable event to observe, which is the fd_set * type. |
writefds | Indicates the descriptor set of the writable event to observe, which is the fd_set * type. |
exceptfds | Indicates the descriptor set of exception event to observe, which is the fd_set * type. |
timeout | Indicates the timeout interval, which is the struct timeval * type. |
stream | Indicates the pointer to the file object that identifies a stream. |
buf | Indicates the pointer to the start address of the buffer. |
f | Indicates the pointer to the file object that identifies a stream to set. |
buf | Indicates the pointer to the buffer to set. |
size | Indicates the buffer size. |
f | Indicates the pointer to the file object that identifies a stream to set. |
category | Indicates the type of locale information used to set the impact scope of region settings. The value can be LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, or LC_ALL. The region settings include the date format, numeric format, currency format, character processing, and character comparison. The current region settings can affect only one aspect of the content or all the content. |
locale | Indicates the string containing region names. These names are system-specific, but at least the following three language environments must exist: |
str | Indicates the pointer to the string to which the data is to be written. |
size | Indicates the maximum length of the destination string. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
str | Indicates the pointer to the string to which the data is to be written. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
str | Indicates the pointer to the character string to read. |
format | Indicates the pointer to the format string. |
... | Indicates the list of arguments corresponding to the format specifiers. |
dir | Indicates the pointer to directory for creating the temporary file. |
prefix | Indicates the pointer to the prefix of the file name. |
c | Indicates the int promotion of the character to be pushed back. |
stream | Indicates the pointer to the file object that identifies a stream. |
fd | Indicates the file descriptor that identifies a file. |
format | Indicates the pointer to the format string. |
ap | Indicates a value identifying a variable argument list initialized by using va_start. |
eval | This function does not return, but exits with the value of eval. |
fmt | Indicates the pointer to the string to format. |
args | Indicates the parameters initialized by using va_start. |
eval | This function does not return, but exits with the value of eval. |
fmt | Indicates the pointer to the string to format. |
args | Indicates the parameters initialized by using va_start. |
format | Indicates the pointer to the format string. |
ap | Indicates a value identifying a variable argument list initialized by using va_start. |
format | Indicates the pointer to the format string. |
ap | Indicates a value identifying a variable argument list initialized by using va_start. |
str | Indicates the pointer to the character string to read. |
format | Indicates the pointer to the format string. |
ap | Indicates a value identifying a variable argument list initialized by using va_start. |
fmt | Indicates the pointer to the string to format. |
args | Indicates the parameters initialized by using va_start. |
fmt | Indicates the pointer to the string to format. |
args | Indicates the parameters initialized by using va_start. |
fmt | Indicates the pointer to the string to format. |
... | Indicates the parameters corresponding to the format declaration. |
fmt | Indicates the pointer to the string to format. |
... | Indicates the parameters corresponding to the format declaration. |
we | Indicates the pointer to the word expansion buffer to free. |
fd | Indicates the file descriptor. |
iov | Indicates the pointer to the multi-group buffer. |
iovcnt | Indicates the number of buffers. For details, see IOV_MAX. |