From owner-freebsd-arch@FreeBSD.ORG Wed Jun 6 01:30:59 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E100216A41F; Wed, 6 Jun 2007 01:30:59 +0000 (UTC) (envelope-from eric.lemar@isilon.com) Received: from seaxch07.isilon.com (seaxch07.isilon.com [70.103.106.46]) by mx1.freebsd.org (Postfix) with ESMTP id CB3ED13C46E; Wed, 6 Jun 2007 01:30:59 +0000 (UTC) (envelope-from eric.lemar@isilon.com) x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Tue, 5 Jun 2007 18:17:40 -0700 Message-ID: <896DB1FBFFD5A145833D9DA08CA12A85051A7F@seaxch07.desktop.isilon.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: *at family of syscalls in FreeBSD Thread-Index: Acemx1pfnYUkoPOWS7Gw0zmMSQe21gBER+OY References: <20070604162430.GA76813@freebsd.org> From: "Eric Lemar" To: "Roman Divacky" X-Mailman-Approved-At: Wed, 06 Jun 2007 02:48:43 +0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: arch@freebsd.org Subject: RE: *at family of syscalls in FreeBSD X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2007 01:31:00 -0000 I'm definitely a fan of this API. Aside from the general thread-related utility of this API, it provides a reasonable API for accessing windows-style ADS streams (subfiles) on a filesystem that supports them and is becoming reasonably cross-platform. This lets you handle things like ADS hanging off directories in a comparatively sane manner. We've actually implemented a subset of these syscalls in-house (Isilon) for use with our filesystem, largely for the ADS-related functionality. Generally speaking, in our tree most of the traditional non-'at' = syscalls are just small kernel wrappers around the 'at' interfaces. Overall ends up looking fairly clean and we've ended up using them even in places where we don't need the ADS functionality just because they are so convenient. If you're interested in implementing this API I'd be happy to talk about our implementation and see whether the relevant parts of our = implementation would be useful for the general community. thanks, Eric Lemar -------------------------- Eric Lemar Software Development Engineer Isilon Systems elemar@isilon.com ________________________________ From: owner-freebsd-arch@freebsd.org on behalf of Roman Divacky Sent: Mon 6/4/2007 9:24 AM To: arch@freebsd.org Subject: *at family of syscalls in FreeBSD Hi, Starting from Linux 2.6.16, there is available so called *at syscalls. = For example openat(), linkat() etc. Those syscalls are used to avoid races in = threaded programs and to implement per-thread CWD. in other words they are usefull. Thats = why Linux implemented them. I am currently implementing those in our Linuxulator. As suggested by = Robert Watson I implemented general kern_fooat() functions and wrapped them around = those kern_fooat() functions. It works ok and everything. But I want to introduce native = *at syscalls for FreeBSD binaries. Hence I am here to discuss the API. My suggestion: use Linux API with some slight naming changes: syscalls: =20 openat(), mkdirat(), mknodat(), chownat(), utimesat(), statat(), = unlinkat(), renameat(), linkat(), symlinkat(), readlinkat(), chmodat(), accessat(). example of a syscall: int openat(int dirfd, char *path, int flags, int mode); ie. exactly the same API as Linux have with the exception of naming them = sanely, ie. instead for example fchownat() we have chownat() because it does not operate on = a fd but on a path. I am not sure about compatibility but we can always introduce a weak = reference like fchownat() -> chownat(). =20 I want to have special AT_FDCWD -100 define for "cwd" argument, just = like linux. I am currently finishing my linuxulator-side work and I'd like to see = this in 7.0R so please comment on the API and the idea of introducing those syscalls in = FreeBSD. thank you Roman Divacky _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"