2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 Reposition read/write file offset.
13 /*****************************************************************************
26 Reposition read/write file offset
29 filedef - the filedescriptor being modified
31 How to modify the current position. whence
32 can be SEEK_SET, then offset is the absolute position
33 in the file (0 is the first byte), SEEK_CUR then the
34 position will change by offset (ie. -5 means to move
35 5 bytes to the beginning of the file) or SEEK_END.
36 SEEK_END means that the offset is relative to the
37 end of the file (-1 is the last byte and 0 is
41 The new position on success and -1 on error. If an error occurred, the global
42 variable errno is set.
55 ******************************************************************************/
58 fdesc
*fdesc
= __getfdesc(filedes
);
68 case SEEK_SET
: whence
= OFFSET_BEGINNING
; break;
69 case SEEK_CUR
: whence
= OFFSET_CURRENT
; break;
70 case SEEK_END
: whence
= OFFSET_END
; break;
77 cnt
= Seek ((BPTR
)fdesc
->fh
, offset
, whence
);
80 errno
= IoErr2errno (IoErr ());
82 return Seek((BPTR
)fdesc
->fh
, 0, OFFSET_CURRENT
);