From owner-freebsd-hackers Tue Apr 11 18:22:18 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from kweetal.tue.nl (kweetal.tue.nl [131.155.2.7]) by hub.freebsd.org (Postfix) with ESMTP id 8871A37BBAB for ; Tue, 11 Apr 2000 18:22:14 -0700 (PDT) (envelope-from marcov@toad.stack.nl) Received: from hermes.tue.nl [131.155.2.46] by kweetal.tue.nl (8.9.3) for id DAA19187 (ESMTP); Wed, 12 Apr 2000 03:22:06 +0200 (MDT) Received: from deathstar (n199.dial.tue.nl [131.155.209.198]) by hermes.tue.nl (Postfix) with ESMTP id CCB302E802 for ; Wed, 12 Apr 2000 03:22:05 +0200 (CEST) From: "Marco van de Voort" To: hackers@freebsd.org Date: Wed, 12 Apr 2000 03:21:28 +0100 Subject: Syscall 198 __syscall, why??????? New port In-reply-to: <20000411182612.6D3E02E802@hermes.tue.nl> X-mailer: Pegasus Mail for Win32 (v3.12b) Message-Id: <20000412012205.CCB302E802@hermes.tue.nl> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message