lseek: return current position on SEEK_CUR offset 0

This commit is contained in:
Matheus
2022-09-21 16:33:10 -03:00
parent ec67d3fe27
commit 190a57c313
+5
View File
@@ -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;