aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoland McGrath1994-01-08 21:36:18 +0000
committerRoland McGrath1994-01-08 21:36:18 +0000
commit7088d1cad79c71fa84954e5242cf01f559213ff0 (patch)
tree3fc14573ba943199e1ce4947b55cfbca5c73b22b /src
parentce97267f95e597940247648751321e2b57e9de52 (diff)
downloademacs-7088d1cad79c71fa84954e5242cf01f559213ff0.tar.gz
emacs-7088d1cad79c71fa84954e5242cf01f559213ff0.zip
[! VMS]: Don't declare sys_errlist here.
[! HAVE_STRERROR] (strerror): New function. (dup2): Use strerror instead of sys_errlist.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c58
1 files changed, 18 insertions, 40 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 5f6b13f3da4..626f30284ca 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,11 +1,11 @@
1/* Interfaces to system-dependent kernel and library entries. 1/* Interfaces to system-dependent kernel and library entries.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -72,44 +72,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
72#endif 72#endif
73 73
74extern int errno; 74extern int errno;
75#ifndef VMS
76extern char *sys_errlist[];
77#endif
78 75
79#ifdef VMS
80#include <rms.h>
81#include <ttdef.h>
82#include <tt2def.h>
83#include <iodef.h>
84#include <ssdef.h>
85#include <descrip.h>
86#include <fibdef.h>
87#include <atrdef.h>
88#include <ctype.h>
89#include <string.h>
90#ifdef __GNUC__
91#include <sys/file.h>
92#else
93#include <file.h>
94#endif
95#undef F_SETFL
96#ifndef RAB$C_BID
97#include <rab.h>
98#endif
99#define MAXIOSIZE ( 32 * PAGESIZE ) /* Don't I/O more than 32 blocks at a time */
100#endif /* VMS */
101
102#ifndef BSD4_1
103#ifdef BSD /* this is done this way to avoid defined (BSD) || defined (USG)
104 because the vms compiler doesn't grok `defined' */
105#include <fcntl.h>
106#endif
107#ifdef USG
108#ifndef USG5
109#include <fcntl.h>
110#endif
111#endif
112#endif /* not 4.1 bsd */
113 76
114#ifdef BROKEN_FASYNC 77#ifdef BROKEN_FASYNC
115/* On some systems (DGUX comes to mind real fast) FASYNC causes 78/* On some systems (DGUX comes to mind real fast) FASYNC causes
@@ -2630,6 +2593,21 @@ char *sys_errlist[] =
2630#endif /* SHAREABLE_LIB_BUG */ 2593#endif /* SHAREABLE_LIB_BUG */
2631#endif /* LINK_CRTL_SHARE */ 2594#endif /* LINK_CRTL_SHARE */
2632#endif /* VMS */ 2595#endif /* VMS */
2596
2597#ifndef HAVE_STRERROR
2598char *
2599strerror (errnum)
2600 int errnum;
2601{
2602 extern char *sys_errlist[];
2603 extern int sys_nerr;
2604
2605 if (errnum >= 0 && errnum < sys_nerr)
2606 return sys_errlist[errnum];
2607 return (char *) "Unknown error";
2608}
2609
2610#endif /* ! HAVE_STRERROR */
2633 2611
2634#ifdef INTERRUPTIBLE_OPEN 2612#ifdef INTERRUPTIBLE_OPEN
2635 2613
@@ -2923,7 +2901,7 @@ dup2 (oldd, newd)
2923#ifdef F_DUPFD 2901#ifdef F_DUPFD
2924 fd = fcntl (oldd, F_DUPFD, newd); 2902 fd = fcntl (oldd, F_DUPFD, newd);
2925 if (fd != newd) 2903 if (fd != newd)
2926 error ("can't dup2 (%i,%i) : %s", oldd, newd, sys_errlist[errno]); 2904 error ("can't dup2 (%i,%i) : %s", oldd, newd, strerror (errno));
2927#else 2905#else
2928 fd = dup (old); 2906 fd = dup (old);
2929 if (fd == -1) 2907 if (fd == -1)