3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
8 #define _FILE_OFFSET_BITS 64
11 #include <_PDCLIB_glue.h>
14 typedef int64_t off_t;
16 static bool readf( _PDCLIB_fd_t fd, void * buf, size_t length,
17 size_t * numBytesRead )
19 ssize_t res = read(fd.sval, buf, length);
28 static bool writef( _PDCLIB_fd_t fd, const void * buf, size_t length,
29 size_t * numBytesWritten )
31 ssize_t res = write(fd.sval, buf, length);
35 *numBytesWritten = res;
40 /* Note: Assumes being compiled with an OFF64 programming model */
42 static bool seekf( _PDCLIB_fd_t fd, int_fast64_t offset, int whence,
43 int_fast64_t* newPos )
45 off_t npos = lseek( fd.sval, offset, whence );
54 static void closef( _PDCLIB_fd_t self )
59 const _PDCLIB_fileops_t _PDCLIB_fileops = {
69 #include <_PDCLIB_test.h>
73 // Tested by stdio test cases