flat assembler
Message board for the users of flat assembler.

Index > Linux > 64bit sys_seek ?

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Aug 2007, 10:06
hi, i need to perform file "seek" with 64bit file pointer. I was using syscall 19 for 32bit stuff. What to use for 64bit seek ?
Post 21 Aug 2007, 10:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Aug 2007, 15:03
You also have sys_llseek (syscall 140). However it uses 32-bit regs but allows to specify a 64-bit offset.

arafel's docs wrote:
sys_llseek [fs/read_write.c]

Repositions read/write file offset of an open file.

Arguments

eax 140
ebx File descriptor of an open file.
ecx The low order 32-bits of a signed value that specifies the distance to move.
edx The high order 32-bits of a signed value that specifies the distance to move.
esi Pointer to an integer which will receive the resulting file position.
edi The starting point for the file offset to move. It may be one of the following values: SEEK_SET The starting point is the beginning of the file.
SEEK_CUR The starting point is the current offset.
SEEK_END The starting point is the end of the file.



Return values

If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:

-EBADF ebx is not an open file descriptor.
-EFAULT Problem with copying results to user space.
-EINVAL edi is invalid.
Post 21 Aug 2007, 15:03
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Aug 2007, 18:21
thanks, just what i needed
Post 21 Aug 2007, 18:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.