fputws

Writes a wide-character string to the output stream.

Library:LibC
Classification:ANSI
Service:Characters and Strings

Syntax

  #include <wchar.h> 
   
  int  fputws (
     const wchar_t   *buf,
     struct _iobuf   *fp);
  

Parameters

buf

(IN) Points to the wide-character string to write.

fp

(IN) Points to the file.

Return Values

If successful, returns a non-negative integer. If a write error occurs, returns WEOF (-1), sets the error indicator for the stream, and sets errno to one of the following:

Decimal

Constant

Description

4

EBADF

The file descriptor is not a valid file descriptor open for writing.

5

ENOMEM

Insufficient storage space is available.

12

ENOSPC

No free space remains on the device containing the file.

24

EAGAIN

The O_NONBLOCK flag is set for the file descriptor, and the process cannot immediately perform the write operation.

25

ENXIO

A request was made to a nonexistent device, or the request was outside the capabilities of the device.

28

EIO

A physical I/O error has occurred.

32

EPIPE

An attempt was made to write to a pipe or FIFO that is not open for reading by any process.

63

EINTR

A signal interrupted the write operation.

71

EFBIG

An attempt was made to write to a file that exceeds the maximum file size.

101

EILSEQ

A wide character code does not correspond to a valid sequence.

Remarks

The fputws function writes the wide-character string pointed to by buf to the file designated by fp. The terminating-null character is not written.

See Also