Date: 02 Nov 2000 09:59:02 +0100 From: Dag-Erling Smorgrav <des@ofug.org> To: Michael Bacarella <mbac@mmap.nyct.net> Cc: "G. Adam Stanislav" <adam@whizkidtech.net>, hackers@FreeBSD.ORG Subject: Re: Kernel calls, are they documented somewhere? Message-ID: <xzp3dhasqax.fsf@flood.ping.uio.no> In-Reply-To: Michael Bacarella's message of "Thu, 2 Nov 2000 00:12:02 -0500" References: <20001101222558.A408@whizkidtech.net> <20001102001202.A14447@mmap.nyct.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Michael Bacarella <mbac@mmap.nyct.net> writes: > gcc does not generate code that can make FreeBSD system calls directly. > Most system calls as we know them by the manual have corresponding > wrappers in libc. See /usr/src/lib/libc if you have the source installed. Wrong. The threaded C library (libc_r) has wrappers for many syscalls so it won't block all threads when one is waiting for a syscall to complete, but apart from that, very few syscalls are wrapped. Adam, it's really quite simple: if the carry flag is set, the syscall failed, and the value returned is the errno (in your example, open(2) returned 2, which is ENOENT, i.e. the file didn't exist). If it succeeded, the value returned is the result (a file descriptor in open(2)'s case). DES -- Dag-Erling Smorgrav - des@ofug.org 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?xzp3dhasqax.fsf>