DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

fputws(S)


fputws -- put wide character string on a stream

Syntax

cc . . . -lc

#include <stdio.h>
#include <wchar.h>

int fputws(const wchar_t *ws, FILE *stream)

Description

fputws(S) writes a character array to the stream pointed to by stream. The character array corresponds to the null-terminated wide character string ws, with the terminating null stripped. A newline character is not appended to the character array.

If fputws( ) returns successfully and a file is associated to stream, the st_ctime and st_mtime fields of the file are marked for update and will be updated when fflush(S) or fclose(S) is called the next time on stream successfully or when exit(S) or abort(S) is called.

Return values

Upon successful completion, fputws( ) returns a non-negative value. Otherwise, -1 is returned, an error indicator for the stream is set and errno is also set to indicate the error.

Diagnostics

fputws( ) will fail if either the stream is unbuffered or data in the stream's buffer needs to be written, and:


[EAGAIN]
Cannot write to the output stream immediately without blocking the process, and the O_NONBLOCK flag is set for the file descriptor associated with stream.

[EBADF]
Not a valid file descriptor open for writing.

[EFBIG]
Maximum file size or the file size limit for the process is exceeded in the attempt to write to a file.

[EINTR]
The write operation was terminated by a signal before any data was written.

[EIO]
Cannot write to the controlling terminal. This happens when the process is in an orphaned background process group and the attempt by the process to write to its controlling terminal fails, because the TOSTOP bit is set to disable the writing and the SIGTTOU signal is not ignored or not blocked by the process.

[ENOSPC]
No free space left on the device where the file associated with stream is stored.

[EPIPE]
The pipe or FIFO being written to is not opened by any process for reading. This error will also send a SIGPIPE signal to the process.

[ENXIO]
Attempt to write to a non-existent device, or to a device whose capabilities are exceeded.

See also

fflush(S), fstat(S), write(S)

Standards conformance

fputws(S) is conformant with:
X/Open CAE Specification, System Interfaces and Headers, Issue 4, 1992.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003