From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 17:45:18 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 377AC16A4CE; Wed, 22 Dec 2004 17:45:18 +0000 (GMT) Received: from critter.freebsd.dk (f170.freebsd.dk [212.242.86.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D1CF43D31; Wed, 22 Dec 2004 17:45:17 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id iBMHjGAq008413; Wed, 22 Dec 2004 18:45:16 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: "Greg 'groggy' Lehey" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 22 Dec 2004 11:31:43 +1030." <20041222010143.GS53357@wantadilla.lemis.com> Date: Wed, 22 Dec 2004 18:45:16 +0100 Message-ID: <8412.1103737516@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: FreeBSD Architecture Mailing List Subject: Re: Header files with enums instead of defines? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2004 17:45:18 -0000 In message <20041222010143.GS53357@wantadilla.lemis.com>, "Greg 'groggy' Lehey" writes: >Has anybody thought about replacing #defines with enums in header >files? It would make debugging a whole lot easier. Foe example, I'm >currently looking at a debug printout which contains: I agree with others who have shot this down: compatibility would not allow us to do something like that. But that is not to say that the error reporting mechanism could not be improved in other ways. One of my pet peeves is that comples system calls have no way to convey additional information about why the return a given return value like EPERM. I would almost advocate adding a char[X] to each thread and a system call which could retrieve it. Complex system calls like mount/nmount, ioctl and similar could then stick an explanation into that string which strerror(3) or err(3) and similar functions could pull out and give the user. There is a heck of a difference between getting: fdisk: permission denied And fdisk: permission denied (partitions overlap) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.