]> pd.if.org Git - pdclib.old/blobdiff - platform/example/functions/_PDCLIB/seek.c
* platform/example is now a "stub" platform - it should compile anywhere, but
[pdclib.old] / platform / example / functions / _PDCLIB / seek.c
index 755abe2cb1eb9393a943356007f9071a69b9f2de..381baef05b9ba5de8f6d0d90e8ba107f869646ef 100644 (file)
@@ -7,56 +7,12 @@
 */
 
 #include <stdio.h>
-
-#ifndef _PDCLIB_GLUE_H
-#define _PDCLIB_GLUE_H
+#include <errno.h>
 #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:
-            /* See comments on implementation-defined errno values in
-               <_PDCLIB_config.h>.
-            */
-            _PDCLIB_errno = _PDCLIB_ERROR;
-            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:
-            /* See comments on implementation-defined errno values in
-               <_PDCLIB_config.h>.
-            */
-            _PDCLIB_errno = _PDCLIB_ERROR;
-            break;
-        default:
-            /* This should be something like EUNKNOWN. */
-            _PDCLIB_errno = _PDCLIB_ERROR;
-            break;
-    }
+    errno = ENOTSUP;
     return EOF;
 }