1826523 Members
4095 Online
109695 Solutions
New Discussion

Lseek,Read system calls

 
manasa_1
Occasional Contributor

Lseek,Read system calls

Hello Everyone,

i am new to the HP-UX.
Could you please explain how a lseek and a read system calls will work.

my Job is to do the following:

7. Open existing file via open() with the O_RDONLY flag.
8. Call lseek() with SEEK_CUR flag, offset 0.
9. Call lseek() with SEEK_CUR flag, offset 60.
10. Call lseek() with SEEK_CUR flag, offset 0.
11. Call lseek() with SEEK_CUR flag, offset -40.
12. Read 40 bytes from file.
13. Call lseek() with SEEK_CUR flag, offset 0.
14. Close file.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Lseek,Read system calls

>i am new to the HP-UX.

This is nothing unique to HP-UX. These are standard calls you can make from C.
See open(2), lseek(2), read(2) and close(2).