Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fputws(3) [osf1 man page]

fputws(3)						     Library Functions Manual							 fputws(3)

NAME
fputws - Writes a wide-character string to a stream LIBRARY
Standard C Library (libc) SYNOPSIS
#include <stdio.h> #include <wchar.h> int fputws( const wchar_t *wcs, FILE *stream); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fputws(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to a wide-character string to be written to output. Points to the FILE structure of an open file. DESCRIPTION
The fputws() function reads the wchar_t string pointed to by the wcs parameter, converts each wide character to a multibyte character, and writes the result to the output stream pointed to by the stream parameter. The function does not append a newline or a terminating null character to the result. The fputws() function parallels the fputs() function. The st_ctime and st_mtime fields of the file are marked for update between the successful execution of the fputws() function and the next successful completion of a call to the fflush() or fclose() function on the same stream, or a call to the exit() or abort() function. RETURN VALUES
On successful completion, the fputws() function returns a non-negative number to indicate the number of bytes written to the output stream. Otherwise, the function returns -1, sets the error indicator for the stream, and sets errno to indicate the error. ERRORS
If any of the following conditions occur, the fputws() function sets errno to the corresponding value: The O_NONBLOCK flag is set for the file descriptor underlying stream and the process would be delayed in the write operation. The file descriptor underlying stream is not a valid file descriptor open for writing. An attempt was made to write to a file that exceeds the process's file-size limit or the maximum file size. The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream. The write operation was interrupted by a signal that was caught, and no data was transferred. One of the following errors was encountered: The process is a member of a background process group attempting to write to its controlling terminal and TOSTOP is set; the process is neither ignoring nor blocking SIGTTOU and the process group of the process is orphaned. A physical I/O error occurred. This condition is defined starting with Issue 4 Version 2 and later revisions of the XSH specification. A wide character read from wcs does not correspond to a valid multibyte character in the current locale. There was no free space remaining on the device containing the file. An attempt was made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal will also be sent to the process. RELATED INFORMATION
Functions: fgetws(3), gets(3), wcstombs(3), printf(3), putc(3), puts(3), putwc(3), wprintf(3) Standards: standards(5) delim off fputws(3)

Check Out this Related Man Page

gets(3) 						     Library Functions Manual							   gets(3)

NAME
gets, fgets - Get a string from a stream LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <stdio.h> char *gets( char *string); char *fgets( char *string, int n, FILE *stream); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: gets(), fgets(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to a string to receive bytes. Specifies an upper bound on the number of bytes to read. Points to the FILE structure of an open file. DESCRIPTION
The gets() function reads bytes from the standard input stream, stdin, into the array pointed to by the string parameter. Data is read until a newline character is read or an end-of-file condition is encountered. If reading is stopped due to a newline character, the newline character is discarded and the string is terminated with a null byte. The fgets() function reads bytes from the data pointed to by the stream parameter into the array pointed to by the string parameter. Data is read until n-1 bytes have been read, until a newline character is read and transferred to string, or until an end-of-file condition is encountered. The string is then terminated with a null byte. NOTES
The gets() function does not check the input for a maximum size. Consequently, if more bytes are entered than will fit in the space allo- cated for the string parameter, gets() will write beyond the end of the allocated space, producing indeterminate results. To avoid this condition, use fgets() instead of gets(). RETURN VALUES
Upon successful completion, the gets() and fgets() functions return string. If the stream is at end-of-file, the end-of-file indicator for the stream is set and a null pointer is returned. If a read error occurs, the error indicator for the stream is set, a null pointer is returned, and errno is set to indicate the error. ERRORS
The fgets() and gets() functions set errno to the specified value for the following conditions: The O_NONBLOCK flag is set for the underly- ing stream and the process would be delayed by the read operation. The file descriptor underlying the stream is not a valid file descrip- tor or is not open for reading. The read operation was interrupted by a signal which was caught and no data was transferred. The call is attempting to read from the process's controlling terminal and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. Insufficient memory is available for the operation. The device associated with stream does not exist. RELATED INFORMATION
Functions: clearerr(3), feof(3), ferror(3), fgetws(3), fileno(3), fopen(3), fputws(3), fread(3), getc(3), getwc(3), puts(3), scanf(3) Standards: standards(5) delim off gets(3)
Man Page