Date: Wed, 12 Apr 2000 03:21:28 +0100 From: "Marco van de Voort" <marcov@stack.nl> To: hackers@freebsd.org Subject: Syscall 198 __syscall, why??????? New port Message-ID: <20000412012205.CCB302E802@hermes.tue.nl> In-Reply-To: <20000411182612.6D3E02E802@hermes.tue.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
> OS: FreeBSD 4.0 > I have a ported pascal compiler that doesn't work yet. It does now work now, except for some minor details, and haven't worked on libc linking yet. Am already subscribing to ports :-) > I use ktrace (great tool btw) to find the problem, mainly because the differences > between the linux and FreeBSD version are only in about 50 syscall calling > routines. > > Now the program terminates with the following sequence, which makes me > wonder. > > - A fstat (handle,buffer) with handle = 0x4 and buffer the right value. > returns 0. (success). I checked, and the file does exist. > - then a lseek on the same handle (0x4, so not overwritten by a dangling pointer ), > returns -1 (I forgot the errno, but ktrace says bad filedescriptor) I replaced lseek with the asm code of an objdumped libc program, and found that libc calls lseek via syscall 198 (___syscall), and NOT 199. (lseek self) This probably has to do with lseek returning 64-bits values, but I don't see the exact humour here. Can somebody explain this to me? (specially because I had to code a specific assembler function for lseek this way, instead of using my generic interface routines, which increases asm%) Marco van de Voort (MarcoV@Stack.nl) <http://www.stack.nl/~marcov/xtdlib.htm> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000412012205.CCB302E802>