3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
10 #include <_PDCLIB_glue.h>
14 static bool readf( _PDCLIB_fd_t fd, void * buf, size_t length,
15 size_t * numBytesRead )
17 ssize_t res = read(fd.sval, buf, length);
26 static bool writef( _PDCLIB_fd_t fd, const void * buf, size_t length,
27 size_t * numBytesWritten )
29 ssize_t res = write(fd.sval, buf, length);
33 *numBytesWritten = res;
38 /* Note: Assumes being compiled with an OFF64 programming model */
40 static bool seekf( _PDCLIB_fd_t fd, int_fast64_t offset, int whence,
41 int_fast64_t* newPos )
43 off_t npos = lseek( fd.sval, offset, whence );
52 static void closef( _PDCLIB_fd_t self )
57 const _PDCLIB_fileops_t _PDCLIB_fileops = {
67 #include <_PDCLIB_test.h>
71 // Tested by stdio test cases