The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

putw - put a word on a stream (LEGACY)

 SYNOPSIS



#include <stdio.h>

int putw(int w, FILE *stream);

 DESCRIPTION

The putw() function writes the word (that is, type int) w to the output stream (at the position at which the file offset, if defined, is pointing). The size of a word is the size of a type int and varies from machine to machine. The putw() function neither assumes nor causes special alignment in the file.

The st_ctime and st_mtime fields of the file will be marked for update between the successful execution of putw() and the next successful completion of a call to fflush() or fclose() on the same stream or a call to exit() or abort().

This interface need not be reentrant.

 RETURN VALUE

Upon successful completion, putw() returns 0. Otherwise, a non-zero value is returned, the error indicators for the stream are set, and errno is set to indicate the error.

 ERRORS

Refer to fputc().

 EXAMPLES

None.

 APPLICATION USAGE

Because of possible differences in word length and byte ordering, files written using putw() are implementation-dependent, and possibly cannot be read using getw() by a different application or by the same application on a different processor.

The putw() function is inherently byte stream oriented and is not tenable in the context of either multibyte character streams or wide-character streams. Application programmers are recommended to use one of the character based output functions instead.

 FUTURE DIRECTIONS

None.

 SEE ALSO

fopen(), fwrite(), getw(), <stdio.h>.

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]