X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=platform%2Fposix%2Ffunctions%2F_PDCLIB%2Fseek.c;fp=platform%2Fexample_cygwin%2Ffunctions%2F_PDCLIB%2Fseek.c;h=755abe2cb1eb9393a943356007f9071a69b9f2de;hb=a38d56a6a13dbb89022b5448d2d5247f3f99ea41;hp=449a62a459cfd23a0a847470483993e373049775;hpb=81f4c957d2f820d9340d90d5b650cbbed054caa0;p=pdclib.old diff --git a/platform/example_cygwin/functions/_PDCLIB/seek.c b/platform/posix/functions/_PDCLIB/seek.c similarity index 76% rename from platform/example_cygwin/functions/_PDCLIB/seek.c rename to platform/posix/functions/_PDCLIB/seek.c index 449a62a..755abe2 100644 --- a/platform/example_cygwin/functions/_PDCLIB/seek.c +++ b/platform/posix/functions/_PDCLIB/seek.c @@ -15,7 +15,7 @@ #include "/usr/include/errno.h" -extern int lseek( int fd, int offset, int whence ); +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 ) { @@ -27,11 +27,14 @@ _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t of /* 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 = lseek( stream->handle, offset, whence ); + _PDCLIB_int64_t rc = lseek64( stream->handle, offset, whence ); if ( rc != EOF ) { stream->ungetidx = 0; @@ -42,11 +45,11 @@ _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t of } switch ( errno ) { - /* See comments on implementation-defined errno values in - <_PDCLIB_config.h>. - */ case EBADF: case EFAULT: + /* See comments on implementation-defined errno values in + <_PDCLIB_config.h>. + */ _PDCLIB_errno = _PDCLIB_ERROR; break; default: