lseek OK
This commit is contained in:
parent
57bb5ae064
commit
5f6f1039a5
|
@ -24,25 +24,28 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if !__MESC__ && !__M2__
|
#if !__MESC__
|
||||||
off_t
|
off_t
|
||||||
_lseek (int filedes, off_t offset, int whence)
|
_lseek (int filedes, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
long long_offset = offset;
|
return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence);
|
||||||
return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
|
// long long_offset = offset;
|
||||||
|
// return _sys_call3 (SYS_lseek, filedes, long_offset, whence);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
lseek (int filedes, off_t offset, int whence)
|
lseek (int filedes, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
#if !__MESC__ && !__M2__
|
#if !__MESC__
|
||||||
if (_lseek (filedes, 0, SEEK_CUR) == -1)
|
if (_lseek (filedes, 0, SEEK_CUR) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
long long_offset = offset;
|
|
||||||
size_t skip = __buffered_read_clear (filedes);
|
size_t skip = __buffered_read_clear (filedes);
|
||||||
if (whence == SEEK_CUR)
|
if (whence == SEEK_CUR)
|
||||||
offset -= skip;
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue