This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-10-19 09:32:35 +02:00
parent 57bb5ae064
commit 5f6f1039a5
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 9 additions and 6 deletions

View File

@ -24,25 +24,28 @@
#include <stdio.h>
#include <sys/types.h>
#if !__MESC__ && !__M2__
#if !__MESC__
off_t
_lseek (int filedes, off_t offset, int whence)
{
long long_offset = offset;
return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence);
// long long_offset = offset;
// return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
}
#endif
off_t
lseek (int filedes, off_t offset, int whence)
{
#if !__MESC__ && !__M2__
#if !__MESC__
if (_lseek (filedes, 0, SEEK_CUR) == -1)
return -1;
#endif
long long_offset = offset;
size_t skip = __buffered_read_clear (filedes);
if (whence == SEEK_CUR)
offset -= skip;
return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
//long long_offset = offset;
//return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
//return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence);
return _sys_call3 (SYS_lseek, filedes, (long) offset, whence);
}