On Wed, Nov 01, 2000 at 10:25:58PM -0600, G. Adam Stanislav wrote:

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.

> Whatever section 2 of man says does not work when making direct kernel
> calls. It only describes how the C library calls work.

> For example, open() returns -1 if the file is not open. But int 80h
> made in assembly language with EAX = 5 (SYS_open) returns a positive
> value whether or not the file was opened. My tests show it returns 2
> if the open fails, or a valid file descriptor otherwise. But can I
> rely on it being the case with other versions of FreeBSD (I have 3.1)?

If you're invoking syscalls directly, you're going to find yourself
duplicating a lot of the conveniance that it provides.
 
> Please don't tell me to read the kernel source code: I am not about
> to spend weeks or months wading through it just so I can write free
> software. (Quite frankly I tried, but I often have no clue as to which
> file contains the code I am looking for.)

This isn't such a daunting task with grep. Source code cross referencers
can also help, but I don't use them nearly as often as I thought I would.

-- 
Michael Bacarella <[EMAIL PROTECTED]>  ;finger address for public key
GPG Key Fingerprint: B4E4 82F5 BCAC AB83 E6F7  B5AA 933E 2A75 79A4 A9C1


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to