Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2000 20:51:23 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Marco van de Voort <marcov@stack.nl>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: porting linux app. Syscalls
Message-ID:  <20000202205123.H25520@fw.wintelcom.net>
In-Reply-To: <20000203033030.099E62E803@hermes.tue.nl>; from marcov@stack.nl on Thu, Feb 03, 2000 at 04:27:52AM %2B0100
References:  <200002030019.QAA94322@bubba.whistle.com> <20000203033030.099E62E803@hermes.tue.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
* Marco van de Voort <marcov@stack.nl> [000202 20:02] wrote:
> 
> I'm new to the list (and to BSD development in general), and I'm developper
> of the FreePascal project (www.freepascal.org) which is a bootstrapping 
> compiler, completely written in Pascal.
> 
> Currently I started preparations for a port of the linux version to FreeBSD.
> 
> FreePascal (FPC) doesn't default link to libc for some reasons, and therefore
> directly calls syscalls, about 60 of them.
> 
> I started translating the syscalls this week (peeking at the linux "emulator" 
> code), and now I arrived at the "getdents" and readdir calls. (I want to create
> a native port, the emulator already runs fine)
> 
> These are supported by the emulator, but actually are emulated (they don't
> simply change parameters and do a FBSD syscall)
> 
> However when I looked into sys/syscall.h, I found out that the getdents call 
> seems to exist? So I have a few questions:-) 
> 
> 1. Is there documentation for the syscalls other than the code? I know there 
> are some manpages, but these seem to be outdated (e.g. the named 
> getdents call)

see: http://www.freebsd.org/cgi/man.cgi
you can view linux syscalls from the slackware docs.

> 
> 2. Can I use the getdents call to emulate the linux getdents? I use the base 
> functionality, not all details have to be fully the same, just the principle. And
> why does the emulator not use this call?

It seems that freebsd supports this call but it's hard to tell if the
actual implementation is the same, I would just try some simple 
"hello worlds" to see if you can either use the FreeBSD version
(possibly with a wrapper) or if you'll need to emulate it via a library
call.

It also seems that freebsd's version supports returning more information
to the user application, and it's possible that the linux emulation
code for getdents() actually pre-dates the FreeBSD emulation (it's happened
before)

It'd be interesting to know what you find out.

> 
> 3. If I can't use the call, the emulator code seems to call VOP_ functions. Can
>  I access these functions from the application?

no, those are kernel interfaces into the VFS system, you may not access
them directly, they don't even exist from the userland's perspective.
(mostly) :)

what confuses me is that you don't support bootstrapping from the 
system C compiler.

also, can you wrap lines at 70 characters?

-Alfred


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?20000202205123.H25520>