HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
posix_ioutils.c File Reference
#include <sys/select.h>
#include <unistd.h>
#include <assert.h>
#include <hipc/posix/ioutils.h>
Include dependency graph for posix_ioutils.c:

Go to the source code of this file.

Functions

int hipcPosixReadReady (int fd)
 Check a file descriptor is ready to read by using select(2) and returns the result of select(2). More...
 
ssize_t hipcPosixReadExactly (const int fd, void *buf, const size_t count)
 Read count bytes from fd by using read(2). More...
 
ssize_t hipcPosixWriteExactly (const int fd, void const *buf, const size_t count)
 Writes count bytes to fd by using write(2). More...
 

Function Documentation

int hipcPosixReadReady ( int  fd)

Check a file descriptor is ready to read by using select(2) and returns the result of select(2).

Parameters
fdfile descriptor
Return values
1fd is at the ready.
0fd is not at the ready.
-1means occurrence of an error.

Definition at line 17 of file posix_ioutils.c.

ssize_t hipcPosixReadExactly ( const int  fd,
void *  buf,
const size_t  count 
)

Read count bytes from fd by using read(2).

count must be less than or equal to SSIZE_MAX, otherwise the result is unspecified.

Parameters
fdFile descriptor
bufBuffer into which the bytes are read
countNumber of the bytes to be read.
Return values
>0The number of the bytes that have been read
0The fd is at the end of the file or count is 0.
-1means occurrence of an error, and errno is set by read(2).

Definition at line 41 of file posix_ioutils.c.

Referenced by hipcPosixReadMsg(), and hipcUsocRead().

Here is the caller graph for this function:

ssize_t hipcPosixWriteExactly ( const int  fd,
void const *  buf,
const size_t  count 
)

Writes count bytes to fd by using write(2).

count must be less than or equal to SSIZE_MAX, otherwise the result is unspecified.

Parameters
fdFile descriptor
bufBuffer from which bytes are written
countNumber of bytes to be written.
Return values
>=0Number of bytes that have been written
-1means occurrence of an error, and errno is set by write(2).

Definition at line 71 of file posix_ioutils.c.

Referenced by hipcPosixWriteMsg(), and hipcUsocWrite().

Here is the caller graph for this function: