putw()

write word to stream 

Function


SYNOPSIS

#include <stdio.h>

int putw(int w, FILE *stream);


DESCRIPTION

The putw() function writes a binary integer to output stream stream in the native format of the local system and advances the file position accordingly. The function does not assume or perform any address alignment at the destination.

This is a legacy function, inherently non-portable.


PARAMETERS

w 

Is the value of integer to write to stream.

stream 

Points to the output stream.


RETURN VALUES

If successful, the putw() function returns zero. On error, it returns non-zero and sets errno to one of the following values:

EACCES 

Another process has the file locked.

EBADF 

The value stream is not a pointer to a valid stream opened for writing.

EFBIG 

The file is a regular file and an attempt was made to write at or beyond the offset maximum.

EINTR 

A signal interrupted the call.

EIO 

An output error occurred.

ENOMEM 

Memory could not be allocated for internal buffers.

ENOSPC 

An attempt was made to write to a full disk.

ENXIO 

A device error occurred.

EPIPE 

An attempt was made to write to a closed pipe.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

Integer length and format varies from platform to platform.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
getw(), putc(), putwc()


PTC MKS Toolkit 10.4 Documentation Build 39.