bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] sysexits.h


From: Simon Josefsson
Subject: Re: [Bug-gnulib] sysexits.h
Date: Tue, 10 Jun 2003 21:50:04 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>
>> I'm having some trouble
>> figuring out the standard status of it.  I doubt it is part of
>> ANSI/ISO C, but may be part of POSIX:2001.  How can I find out?  The
>> libc manual barely mention sysexits.h at all.
>
> POSIX:2001 (= Base Specifications Version 6) is available online at 
> http://www.opengroup.org/onlinepubs/007904975/nfindex.html
>
> sysexits.h is not contained there, therefore a fortiori it is not part
> of ISO C either.
>
> Also I'd really like to avoid code with Berkeley copyright in gnulib. While
> the clause 2 in this copyright may be acceptable for glibc, it'd be a
> major annoyance to start keeping track of "does GNU XY's documentation
> acknowledge the BSD copyright" for various packages XY. Maybe you can
> produce a sysexits.h yourself, based on some freely available documentation
> on the web, and by getting the common BSD values through a program looking
> like
>
>     ...
>     printf("#define EX_USAGE %d\n", EX_USAGE);
>     ...

I wrote the below based on a sysexits(3) man page that seems part of
FreeBSD and other systems.  The man page did include integer values
directly.  Is this OK?

/* exit() exit codes.
   Copyright (C) 2003 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

/* Written by Simon Josefsson based on sysexits(3) man page */

#ifndef _SYSEXITS_H
#define _SYSEXITS_H

#define EX_USAGE 64
#define EX_DATAERR 65
#define EX_NOINPUT 66
#define EX_NOUSER 67
#define EX_NOHOST 68
#define EX_UNAVAILABLE 69
#define EX_SOFTWARE 70
#define EX_OSERR 71
#define EX_OSFILE 72
#define EX_CANTCREAT 73
#define EX_IOERR 74
#define EX_TEMPFAIL 75
#define EX_PROTOCOL 76
#define EX_NOPERM 77
#define EX_CONFIG 78

#endif /* _SYSEXITS_H */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]