1 ?RCS: $Id: d_strerror.U,v 3.0.1.3 1994/05/13 15:20:27 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: d_strerror.U,v $
12 ?RCS: Revision 3.0.1.3 1994/05/13 15:20:27 ram
13 ?RCS: patch27: now uses new macro support for cleaner Strerror def
15 ?RCS: Revision 3.0.1.2 1994/05/06 14:58:26 ram
16 ?RCS: patch23: renamed strerror into Strerror to protect name space (ADO)
18 ?RCS: Revision 3.0.1.1 1994/01/24 14:08:56 ram
19 ?RCS: patch16: protected code looking for sys_errnolist[] with @if
20 ?RCS: patch16: added default value for d_sysernlst
22 ?RCS: Revision 3.0 1993/08/18 12:07:35 ram
23 ?RCS: Baseline for dist 3.0 netwide release.
25 ?MAKE:d_syserrlst d_sysernlst: Csym Findhdr
26 ?MAKE: -pick add $@ %<
28 ?S: This variable conditionally defines HAS_SYS_ERRLIST if sys_errlist[] is
29 ?S: available to translate error numbers to strings.
32 ?S: This variable conditionally defines HAS_SYS_ERRNOLIST if sys_errnolist[]
33 ?S: is available to translate error numbers to the symbolic name.
35 ?C:HAS_SYS_ERRLIST (SYSERRLIST):
36 ?C: This symbol, if defined, indicates that the sys_errlist array is
37 ?C: available to translate error numbers to strings. The extern int
38 ?C: sys_nerr gives the size of that table.
40 ?C:HAS_SYS_ERRNOLIST (SYSERRNOLIST):
41 ?C: This symbol, if defined, indicates that the sys_errnolist array is
42 ?C: available to translate an errno code into its symbolic name (e.g.
43 ?C: ENOENT). The extern int sys_nerrno gives the size of that table.
45 ?H:#$d_syserrlst HAS_SYS_ERRLIST /**/
46 ?H:#$d_sysernlst HAS_SYS_ERRNOLIST /**/
50 : see if sys_errlist[] exists
52 if test "X$d_syserrlst" = X; then
53 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
54 echo "You have sys_errlist[], so we could roll our own strerror."
57 echo "You don't have sys_errlist[], so strerror() is welcome."
61 @if d_sysernlst || HAS_SYS_ERRNOLIST
62 if set sys_errnolist val -a d_sysernlst; eval $csym; $val; then
63 echo "(Symbolic error codes can be fetched via the sys_errnolist[] array.)"
66 echo "(However, I can't extract the symbolic error code out of errno.)"