comparison src/unexalpha.c @ 29751:ea3c28a8be00

Include errno.h, string.h, unistd.h. Don't declare errno, strerror. Put text after #endif in comment.
author Dave Love <fx@gnu.org>
date Mon, 19 Jun 2000 16:19:05 +0000
parents 70b808126773
children d4a0bd8a25a3
comparison
equal deleted inserted replaced
29750:a313aa06c3bd 29751:ea3c28a8be00
1 /* Unexec for DEC alpha. schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf). 1 /* Unexec for DEC alpha. schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf).
2 2
3 Copyright (C) 1994 Free Software Foundation, Inc. 3 Copyright (C) 1994, 2000 Free Software Foundation, Inc.
4 4
5 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
6 6
7 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
25 #include <sys/file.h> 25 #include <sys/file.h>
26 #include <sys/stat.h> 26 #include <sys/stat.h>
27 #include <sys/mman.h> 27 #include <sys/mman.h>
28 #include <stdio.h> 28 #include <stdio.h>
29 #include <varargs.h> 29 #include <varargs.h>
30 #include <errno.h>
31 #ifdef HAVE_STRING_H
32 #include <string.h>
33 #endif
30 #if !defined (__NetBSD__) && !defined (__OpenBSD__) 34 #if !defined (__NetBSD__) && !defined (__OpenBSD__)
31 #include <filehdr.h> 35 #include <filehdr.h>
32 #include <aouthdr.h> 36 #include <aouthdr.h>
33 #include <scnhdr.h> 37 #include <scnhdr.h>
34 #include <syms.h> 38 #include <syms.h>
92 #define SEEK(_fd, _position, _error_message, _error_arg) \ 96 #define SEEK(_fd, _position, _error_message, _error_arg) \
93 errno = EEOF; \ 97 errno = EEOF; \
94 if (lseek (_fd, _position, L_SET) != _position) \ 98 if (lseek (_fd, _position, L_SET) != _position) \
95 fatal_unexec (_error_message, _error_arg); 99 fatal_unexec (_error_message, _error_arg);
96 100
97 extern int errno; 101 #ifdef HAVE_UNISTD_H
98 extern char *strerror (); 102 #include <unistd.h>
99 103 #else
100 void *sbrk (); 104 void *sbrk ();
105 #endif
101 106
102 #define EEOF -1 107 #define EEOF -1
103 108
104 static struct scnhdr *text_section; 109 static struct scnhdr *text_section;
105 static struct scnhdr *rel_dyn_section; 110 static struct scnhdr *rel_dyn_section;
233 #ifdef _RCONST 238 #ifdef _RCONST
234 CHECK_SCNHDR (rconst_section, _RCONST, STYP_RCONST); 239 CHECK_SCNHDR (rconst_section, _RCONST, STYP_RCONST);
235 #endif 240 #endif
236 #ifdef _PDATA 241 #ifdef _PDATA
237 CHECK_SCNHDR (pdata_section, _PDATA, STYP_PDATA); 242 CHECK_SCNHDR (pdata_section, _PDATA, STYP_PDATA);
238 #endif _PDATA 243 #endif /* _PDATA */
239 #ifdef _GOT 244 #ifdef _GOT
240 CHECK_SCNHDR (got_section, _GOT, STYP_GOT); 245 CHECK_SCNHDR (got_section, _GOT, STYP_GOT);
241 #endif _GOT 246 #endif /* _GOT */
242 CHECK_SCNHDR (data_section, _DATA, STYP_DATA); 247 CHECK_SCNHDR (data_section, _DATA, STYP_DATA);
243 #ifdef _XDATA 248 #ifdef _XDATA
244 CHECK_SCNHDR (xdata_section, _XDATA, STYP_XDATA); 249 CHECK_SCNHDR (xdata_section, _XDATA, STYP_XDATA);
245 #endif /* _XDATA */ 250 #endif /* _XDATA */
246 #ifdef _LIT8 251 #ifdef _LIT8