3 Copyright (C) 2001 Hans-Peter Nilsson
5 Permission to use, copy, modify, and distribute this software is
6 freely granted, provided that the above copyright notice, this notice
7 and the following disclaimer are preserved with no changes.
9 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 #include <sys/types.h>
17 #include <sys/unistd.h>
18 #include "sys/syscall.h"
26 off_t simoff = dir == SEEK_END ? -(ptr + 1) : ptr;
29 if ((unsigned int) file >= 32 || _MMIX_allocated_filehandle[file] == 0)
37 long curpos = TRAP2f (SYS_Ftell, file, 0);
45 ptr += (off_t) curpos;
48 ret = TRAP2f (SYS_Fseek, file, simoff);
55 ret = TRAP2f (SYS_Ftell, file, 0);