emul-handler: fh_Arg1 should be the only element of struct FileHandle touched during...
[AROS.git] / rom / dos / internalseek.c
blobec066e04ec8df1c877e0055b8c947be0116b74eb
1 /*
2 Copyright © 2002-2008, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
8 #include <proto/dos.h>
9 #include "dos_intern.h"
11 LONG InternalSeek
13 struct FileHandle *fh,
14 LONG position,
15 LONG mode,
16 struct DosLibrary *DOSBase
19 LONG status;
20 SIPTR doserror = 0;
22 /* Make sure the input parameters are sane. */
23 ASSERT_VALID_PTR( fh );
24 ASSERT
26 mode == OFFSET_BEGINNING
27 || mode == OFFSET_END
28 || mode == OFFSET_CURRENT
30 D(bug("[seek] %x:%d:%d\n", fh, position, mode));
31 do {
32 status = dopacket3(DOSBase, &doserror, fh->fh_Type, ACTION_SEEK, fh->fh_Arg1, position, mode);
33 D(bug("=%d %d\n", status, doserror));
34 } while (status == -1 && !ErrorReport(doserror, REPORT_STREAM, (IPTR)fh, NULL));
36 return status;