lseek()
as implemented in ext4
will just increment the file pointer and do some validation checks. It doesn't depend on the file size, meaning it is O(1)
.
Also you can see this in the code, there isn't any loop nor suspicious function calls in there.
However, while this is true on ext4
, it might be not true for other filesystems, as this behaviour isn't guaranteed by POSIX. But it is likely unless the filesystem is meant for a very special purpose.