From owner-freebsd-arch@FreeBSD.ORG Tue Mar 31 06:52:11 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B9B1065672 for ; Tue, 31 Mar 2009 06:52:11 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id EA1308FC30 for ; Tue, 31 Mar 2009 06:52:10 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.2/8.14.2) with ESMTP id n2V6KuSk072937; Tue, 31 Mar 2009 02:20:56 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.2/8.13.8/Submit) id n2V6Kudd072936; Tue, 31 Mar 2009 02:20:56 -0400 (EDT) (envelope-from wollman) Date: Tue, 31 Mar 2009 02:20:56 -0400 (EDT) From: Garrett Wollman Message-Id: <200903310620.n2V6Kudd072936@hergotha.csail.mit.edu> To: phk@phk.freebsd.dk X-Newsgroups: mit.lcs.mail.freebsd-arch In-Reply-To: <95823.1238476941@critter.freebsd.dk> References: <49D1492C.5050101@freebsd.org> Organization: None X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Tue, 31 Mar 2009 02:20:56 -0400 (EDT) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu Cc: arch@freebsd.org Subject: Re: On errno 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: Tue, 31 Mar 2009 06:52:11 -0000 In article <95823.1238476941@critter.freebsd.dk>, phk@phk.freebsd.dk writes: >And the "standard" solution is stupid and useless, because more >often than not, some language, typically french, will want the >arguments in the opposite order... Which is why printf() supports putting the arguments in arbitrary order. A much more serious objection to this model is the desire someone will certainly have to use the %s format, with the attendent pain involved in moving variable-length strings along with the arguments across the user-kernel boundary. I'd much rather have plain integers, thank you very much. At most, a small structure, in which the only pointer is a reference to a user-space argument. (So [ENOENT] and [EACCES] could have an extended error code ECOMPONENTNAME which indicates that the pointer value is a substring of the pathname argument, and identifies the beginning of the pathname component being resolved when the failure occurred. You'd probably also want to have ENOTANERROR to indicate "error return indicates an expected success condition" and EFD to indicate "integer value is the file descriptor which caused the error condition.) But all this is really irrelevant if no other operating system or standard adopts the interface. Interfaces which are peculiar to FreeBSD are rarely useful. -GAWollman