From owner-freebsd-hackers Wed Feb 2 20:25:36 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by builder.freebsd.org (Postfix) with ESMTP id F36CB425B for ; Wed, 2 Feb 2000 20:25:33 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) id UAA02926; Wed, 2 Feb 2000 20:51:24 -0800 (PST) Date: Wed, 2 Feb 2000 20:51:23 -0800 From: Alfred Perlstein To: Marco van de Voort Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: porting linux app. Syscalls Message-ID: <20000202205123.H25520@fw.wintelcom.net> References: <200002030019.QAA94322@bubba.whistle.com> <20000203033030.099E62E803@hermes.tue.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000203033030.099E62E803@hermes.tue.nl>; from marcov@stack.nl on Thu, Feb 03, 2000 at 04:27:52AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Marco van de Voort [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