X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fexample%2Ffunctions%2F_PDCLIB%2Fseek.c;h=381baef05b9ba5de8f6d0d90e8ba107f869646ef;hb=a38d56a6a13dbb89022b5448d2d5247f3f99ea41;hp=9e2d102fd459a0c71566f69544628e2dbfb13fc8;hpb=0d54a75af25ca44411e7c4190cc2a93a390e61a2;p=pdclib.old diff --git a/platform/example/functions/_PDCLIB/seek.c b/platform/example/functions/_PDCLIB/seek.c index 9e2d102..381baef 100644 --- a/platform/example/functions/_PDCLIB/seek.c +++ b/platform/example/functions/_PDCLIB/seek.c @@ -7,56 +7,19 @@ */ #include - -#ifndef _PDCLIB_GLUE_H -#define _PDCLIB_GLUE_H +#include #include <_PDCLIB_glue.h> -#endif - -#include "/usr/include/errno.h" - -extern _PDCLIB_int64_t lseek64( int fd, _PDCLIB_int64_t offset, int whence ); _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence ) { - switch ( whence ) - { - case SEEK_SET: - case SEEK_CUR: - case SEEK_END: - /* EMPTY - OK */ - break; - default: - _PDCLIB_errno = _PDCLIB_EINVAL; - return EOF; - break; - } - _PDCLIB_int64_t rc = lseek64( stream->handle, offset, whence ); - if ( rc != EOF ) - { - stream->ungetidx = 0; - stream->bufidx = 0; - stream->bufend = 0; - stream->pos.offset = rc; - return rc; - } - switch ( errno ) - { - case EBADF: - case EFAULT: - _PDCLIB_errno = _PDCLIB_EIO; - break; - default: - _PDCLIB_errno = _PDCLIB_EUNKNOWN; - break; - } + errno = ENOTSUP; return EOF; } #ifdef TEST #include <_PDCLIB_test.h> -int main() +int main( void ) { /* Testing covered by ftell.c */ return TEST_RESULTS;