2 Copyright © 2002, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
11 #include <proto/dos.h>
12 #include "dos_intern.h"
16 struct FileHandle
*fh
,
19 struct DosLibrary
*DOSBase
22 AROS_LIBBASE_EXT_DECL( struct DosLibrary
*, DOSBase
)
24 /* Get pointer to I/O request. Use stackspace for now. */
25 struct IOFileSys iofs
;
27 /* Make sure the input parameters are sane. */
28 ASSERT_VALID_PTR( fh
);
31 mode
== OFFSET_BEGINNING
33 || mode
== OFFSET_CURRENT
36 /* Prepare I/O request. */
37 InitIOFS( &iofs
, FSA_SEEK
, DOSBase
);
39 iofs
.IOFS
.io_Device
= fh
->fh_Device
;
40 iofs
.IOFS
.io_Unit
= fh
->fh_Unit
;
42 iofs
.io_Union
.io_SEEK
.io_Offset
= (QUAD
)position
;
43 iofs
.io_Union
.io_SEEK
.io_SeekMode
= mode
;
45 /* Send the request. */
46 DosDoIO( &iofs
.IOFS
);
48 if( iofs
.io_DosError
)
50 SetIoErr( iofs
.io_DosError
);
54 return (LONG
) iofs
.io_Union
.io_SEEK
.io_Offset
;