mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
lseek: return current position on SEEK_CUR offset 0
This commit is contained in:
@@ -44,6 +44,11 @@ syscallret syscall_lseek(int ifd, off_t offset, int whence){
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
newoffset += offset;
|
||||
if(offset == 0){
|
||||
retv.errno = 0;
|
||||
retv.ret = fd->offset;
|
||||
goto _ret;
|
||||
}
|
||||
if(newoffset < 0 || newoffset > fsize){
|
||||
retv.errno = EINVAL;
|
||||
goto _ret;
|
||||
|
||||
Reference in New Issue
Block a user