lseek man page on OSF1

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
OSF1 logo
[printable version]

Digital UNIX Diffs - lseek(5)			 Digital UNIX Diffs - lseek(5)

NAME
       lseek -	Moves read-write file offset

SYNOPSIS
       #include <sys/types.h> #include <unistd.h>
       off_t lseek (
	       int filedes,
	       off_t offset,
	       int whence );

PARAMETERS
       Specifies  a  file  descriptor  obtained	 from  a  successful open() or
       fcntl() function.  Specifies a value, in bytes, that is	used  in  con‐
       junction	 with the whence parameter to set the file pointer. A negative
       value causes seeking in the reverse direction. The resulting file posi‐
       tion  may  also	be  negative.	Specifies how to interpret the	offset
       parameter in setting the	 file  pointer	associated  with  the  filedes
       parameter.   Values for the whence parameter are: Sets the file pointer
       to the value of the offset parameter.  Sets the	file  pointer  to  its
       current location plus the value of the offset parameter.	 Sets the file
       pointer to the size of the file plus the value of the offset parameter.

DIFFERENCES
       alpha-32bits(5): 32 vs 64 bit Differences

       When calling the lseek() system call for setting the  current  position
       in  a  file, use the off_t type defined in types.h for the file offset.
       Passing an int or long constant might work, but it is not portable  and
       is not guaranteed to continue to work.

EXAMPLES
       The   following	 example   shows   the	 correct   use	 of   lseek():
       -------------------------------------------------------------------------
       32-Bit	    Platform			      |	     AXP      Platform
       -----------------------------------+-------------------------------------
					  |
					  |	    #include	    <unistd.h>
       | #include <unistd.h>
					  |	 long	    offset,	  pos;
       | off_t offset, pos;
					  |
					  | pos = lseek(fd, offset, SEEK_SET);
       | pos = lseek(fd, offset, SEEK_SET); pos	 =  lseek(fd,  0L,  SEEK_CUR);
       | pos = lseek(fd, (off_t)0, SEEK_CUR);
					  |
       -------------------------------------------------------------------------


RELATED INFORMATION
       Functions:  lseek(2)

CATEGORY INDEX
	alpha-32bits(5)

       delim off

						 Digital UNIX Diffs - lseek(5)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OSF1

List of man pages available for OSF1

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net