From: Thadeu Lima de Souza Cascardo Date: Wed, 7 May 2008 11:53:25 +0000 (-0300) Subject: The lseek system call. X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fkernel%2Fold_slides%2F.git;a=commitdiff_plain;h=6d6a3172034640d0730d90aab08cf8c816331315 The lseek system call. --- diff --git a/_ldd.xml b/_ldd.xml index 47ebedf..f5a8bff 100644 --- a/_ldd.xml +++ b/_ldd.xml @@ -56,7 +56,7 @@ write close -seek +lseek ioctl @@ -144,4 +144,27 @@ c = write (fd, buffer, strlen (buffer)); + +lseek + +The lseek system call changes the current position of the file, allowing +to read or write in that position. Seeking on a device may have many +different meanings. + + +off\_t lseek (int fd, off\_t pos, int whence); + + +The meaning of the position depends on the value of whence, which can be +SEEK\_SET (the absolute position), SEEK\_CUR (relative to the current +position), SEEK\_END (relative to the end of the file). + + +Example: + + +lseek (fd, 0, SEEK\_END); + + +