From owner-freebsd-hackers  Thu Nov  2  0:59: 9 2000
Delivered-To: freebsd-hackers@freebsd.org
Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31])
	by hub.freebsd.org (Postfix) with ESMTP id C185B37B4CF
	for <hackers@FreeBSD.ORG>; Thu,  2 Nov 2000 00:59:06 -0800 (PST)
Received: (from des@localhost)
	by flood.ping.uio.no (8.9.3/8.9.3) id JAA28114;
	Thu, 2 Nov 2000 09:59:03 +0100 (CET)
	(envelope-from des@ofug.org)
X-URL: http://www.ofug.org/~des/
X-Disclaimer: The views expressed in this message do not necessarily
  coincide with those of any organisation or company with
  which I am or have been affiliated.
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?
References: <20001101222558.A408@whizkidtech.net> <20001102001202.A14447@mmap.nyct.net>
From: Dag-Erling Smorgrav <des@ofug.org>
Date: 02 Nov 2000 09:59:02 +0100
In-Reply-To: Michael Bacarella's message of "Thu, 2 Nov 2000 00:12:02 -0500"
Message-ID: <xzp3dhasqax.fsf@flood.ping.uio.no>
Lines: 18
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: owner-freebsd-hackers@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

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