@ignore * File llseek.txh. * * Copyright (C) 2000 Martin Str@"omberg . * * This software may be used freely so long as this copyright notice is * left intact. There is no warranty on this software. * @end ignore @node llseek, io @findex llseek @subheading Syntax @example #include offset_t llseek(int fd, offset_t offset, int whence); @end example @subheading Description This function moves the file pointer for @var{fd} according to @var{whence}: @table @code @item SEEK_SET The file pointer is moved to the offset specified. @item SEEK_CUR The file pointer is moved relative to its current position. @item SEEK_END The file pointer is moved to a position @var{offset} bytes from the end of the file. The offset is usually nonpositive in this case. @end table @var{offset} is of type long long, thus enabling you to seek with offsets as large as ~2^63 (FAT16 limits this to ~2^31; FAT32 limits this to 2^32-2). @subheading Return Value The new offset is returned. Note that due to limitations in the underlying DOS implementation the offset wraps around to 0 at offset 2^32. -1 means the call failed. @subheading Portability @portability !ansi, !posix @subheading Example @example long long ret; ret = llseek(fd, (1<<32), SEEK_SET); /* Now ret equals 0 * (unfortunately). */ ret = llseek(fd, -1, SEEK_CUR); /* Now ret equals 2^32-1 (good!). */ ret = llseek(fd, 0, SEEK_SET); /* Now ret equals 0 (good!). */ ret = llseek(fd, -1, SEEK_CUR); /* Now ret equals 2^32-1 (bad). */ @end example