src/lib/ppc405lib/ssx_io.c
/// Call the sread() operation of a stream
Call the sread() operation of a stream
Call the sread () operation of a stream
int
sread(FILE *stream, void *buf, size_t count, size_t *read)
{
    ssize_t rc;
    size_t _read;
    if (SSX_ERROR_CHECK_API) {
        SSX_ERROR_IF((stream == 0), EBADF);
        SSX_IO_ERROR_IF(stream, (stream->sread == 0), ENXIO);
        SSX_IO_ERROR_IF(stream, (buf == 0), EINVAL);
    }
    if (count == 0) {
        if (read != 0) {
            *read = 0;
        }
        return 0;
    }
    rc = LOCK_FILE_OPERATION(stream, stream->sread(stream, buf, count, &_read));
    if (read != 0) {
        *read = _read;
    }
    return rc;
}
int sread ( FILE * stream , void * buf , size_t count , size_t * read ) { ssize_t rc ; size_t _read ; if ( SSX_ERROR_CHECK_API ) { SSX_ERROR_IF ( ( stream == 0 ) , EBADF ) ; SSX_IO_ERROR_IF ( stream , ( stream -> sread == 0 ) , ENXIO ) ; SSX_IO_ERROR_IF ( stream , ( buf == 0 ) , EINVAL ) ; } if ( count == 0 ) { if ( read != 0 ) { * read = 0 ; } return 0 ; } rc = LOCK_FILE_OPERATION ( stream , stream -> sread ( stream , buf , count , & _read ) ) ; if ( read != 0 ) { * read = _read ; } return rc ; }
Call the sread() operation of a stream
Call the sread () operation of a stream