fputws(S-osr5)
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-osr5)
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-osr5)
or
fclose(S-osr5)
is called the next time on stream successfully
or when
exit(S-osr5)
or
abort(S-osr5)
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-osr5),
fstat(S-osr5),
write(S-osr5)
Standards conformance
fputws(S-osr5)
is conformant with:
X/Open CAE Specification, System Interfaces and Headers,
Issue 4, 1992.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005