diff options
| author | Jim Blandy | 1992-01-31 21:29:35 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-01-31 21:29:35 +0000 |
| commit | 23b0668cf2879d5520b2157ef1fc7ad18f402ac6 (patch) | |
| tree | e5e6e080b131ff55035ecd1aa4b1615c853cb2c0 /src | |
| parent | 93a3712002fec52f80d4cf0500f762e8dd8a558b (diff) | |
| download | emacs-23b0668cf2879d5520b2157ef1fc7ad18f402ac6.tar.gz emacs-23b0668cf2879d5520b2157ef1fc7ad18f402ac6.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/m/intel386.h | 25 | ||||
| -rw-r--r-- | src/m/iris4d.h | 4 | ||||
| -rw-r--r-- | src/s/usg5-4.h | 2 | ||||
| -rw-r--r-- | src/sysdep.c | 39 |
4 files changed, 51 insertions, 19 deletions
diff --git a/src/m/intel386.h b/src/m/intel386.h index de07923f9a0..7a744797433 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* machine description file for intel 386. | 1 | /* Machine description file for intel 386. |
| 2 | Copyright (C) 1987 Free Software Foundation, Inc. | 2 | Copyright (C) 1987 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| @@ -100,7 +100,7 @@ NOTE-END */ | |||
| 100 | #define LOAD_AVE_TYPE short | 100 | #define LOAD_AVE_TYPE short |
| 101 | 101 | ||
| 102 | /* Convert that into an integer that is 100 for a load average of 1.0 */ | 102 | /* Convert that into an integer that is 100 for a load average of 1.0 */ |
| 103 | #define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE)) | 103 | #define LOAD_AVE_CVT(x) (((double) (x)) * 100.0 / FSCALE) |
| 104 | 104 | ||
| 105 | #define FSCALE 256.0 /* determined by experimentation... */ | 105 | #define FSCALE 256.0 /* determined by experimentation... */ |
| 106 | #endif | 106 | #endif |
| @@ -113,9 +113,9 @@ NOTE-END */ | |||
| 113 | /* Convert that into an integer that is 100 for a load average of 1.0 */ | 113 | /* Convert that into an integer that is 100 for a load average of 1.0 */ |
| 114 | /* This is totally uncalibrated. */ | 114 | /* This is totally uncalibrated. */ |
| 115 | 115 | ||
| 116 | #define LOAD_AVE_CVT(x) ((int) ((double) (x)) * 100.0 / FSCALE) | 116 | #define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE)) |
| 117 | #define FSCALE 256.0 | 117 | #define FSCALE 256.0 |
| 118 | *endif | 118 | #endif |
| 119 | 119 | ||
| 120 | /* Define CANNOT_DUMP on machines where unexec does not work. | 120 | /* Define CANNOT_DUMP on machines where unexec does not work. |
| 121 | Then the function dump-emacs will not be defined | 121 | Then the function dump-emacs will not be defined |
| @@ -160,7 +160,9 @@ NOTE-END */ | |||
| 160 | #else /* not XENIX */ | 160 | #else /* not XENIX */ |
| 161 | 161 | ||
| 162 | #ifdef USG | 162 | #ifdef USG |
| 163 | #ifndef LIB_STANDARD | ||
| 163 | #define LIB_STANDARD -lPW -lc | 164 | #define LIB_STANDARD -lPW -lc |
| 165 | #endif | ||
| 164 | #define HAVE_ALLOCA | 166 | #define HAVE_ALLOCA |
| 165 | #define NO_REMAP | 167 | #define NO_REMAP |
| 166 | #define TEXT_START 0 | 168 | #define TEXT_START 0 |
| @@ -170,7 +172,6 @@ NOTE-END */ | |||
| 170 | #ifdef BSD | 172 | #ifdef BSD |
| 171 | #define HAVE_ALLOCA | 173 | #define HAVE_ALLOCA |
| 172 | #endif /* BSD */ | 174 | #endif /* BSD */ |
| 173 | BSD */ | ||
| 174 | 175 | ||
| 175 | /* If compiling with GCC, let GCC implement alloca. */ | 176 | /* If compiling with GCC, let GCC implement alloca. */ |
| 176 | #if defined(__GNUC__) && !defined(alloca) | 177 | #if defined(__GNUC__) && !defined(alloca) |
| @@ -178,5 +179,15 @@ NOTE-END */ | |||
| 178 | #define HAVE_ALLOCA | 179 | #define HAVE_ALLOCA |
| 179 | #endif | 180 | #endif |
| 180 | 181 | ||
| 181 | /* Search these directories just in case; I'm told they might be needed. */ | 182 | #ifdef USG |
| 182 | #define C_SWITCH_MACHINE -I/usr/X/include -I/usr/netinclude | 183 | #ifdef __STDC__ |
| 184 | #ifndef DONT_DEFINE_SIGNAL | ||
| 185 | /* Cast the function argument to avoid warnings. */ | ||
| 186 | #define signal(sig, func) (signal (sig, (void (*) (int)) (func))) | ||
| 187 | #endif | ||
| 188 | #endif | ||
| 189 | #endif | ||
| 190 | |||
| 191 | #ifdef USG5_4 | ||
| 192 | #define DATA_SEG_BITS 0x08000000 | ||
| 193 | #endif | ||
diff --git a/src/m/iris4d.h b/src/m/iris4d.h index 89d022f765d..45ad2f7c2f2 100644 --- a/src/m/iris4d.h +++ b/src/m/iris4d.h | |||
| @@ -191,3 +191,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 191 | #define XMARKBIT(a) ((a) < 0) | 191 | #define XMARKBIT(a) ((a) < 0) |
| 192 | #define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) | ((b) ? MARKBIT : 0)) | 192 | #define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) | ((b) ? MARKBIT : 0)) |
| 193 | #define XUNMARK(a) ((a) = (((unsigned)(a) << INTBITS-GCTYPEBITS-VALBITS) >> INTBITS-GCTYPEBITS-VALBITS)) | 193 | #define XUNMARK(a) ((a) = (((unsigned)(a) << INTBITS-GCTYPEBITS-VALBITS) >> INTBITS-GCTYPEBITS-VALBITS)) |
| 194 | |||
| 195 | /* Turn off some "helpful" error checks for type mismatches | ||
| 196 | that we can't fix without breaking other machines. */ | ||
| 197 | #define C_SWITCH_MACHINE -cckr | ||
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h index 817ff0644a8..c977bb1c978 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4.h | |||
| @@ -45,8 +45,6 @@ and this notice must be preserved on all copies. */ | |||
| 45 | 45 | ||
| 46 | #define LIB_STANDARD GNULIB -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o | 46 | #define LIB_STANDARD GNULIB -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o |
| 47 | 47 | ||
| 48 | #define DATA_SEG_BITS 0x08000000 | ||
| 49 | |||
| 50 | /* Use ptem.h to get structures related to windows. */ | 48 | /* Use ptem.h to get structures related to windows. */ |
| 51 | 49 | ||
| 52 | #define NEED_PTEM_H | 50 | #define NEED_PTEM_H |
diff --git a/src/sysdep.c b/src/sysdep.c index 01b9b07c075..fd526e33f9c 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -3257,19 +3257,38 @@ sys_write (fildes, buf, nbytes) | |||
| 3257 | { | 3257 | { |
| 3258 | register char *p; | 3258 | register char *p; |
| 3259 | register char *e; | 3259 | register char *e; |
| 3260 | int retval, sum; | 3260 | int sum = 0; |
| 3261 | struct stat st; | ||
| 3262 | |||
| 3263 | fstat (fildes, &st); | ||
| 3261 | p = buf; | 3264 | p = buf; |
| 3262 | sum = 0; | ||
| 3263 | while (nbytes > 0) | 3265 | while (nbytes > 0) |
| 3264 | { | 3266 | { |
| 3265 | e = p + min (MAXIOSIZE, nbytes) - 1; | 3267 | int len, retval; |
| 3266 | while (*e != '\n' && e > p) e--; | 3268 | |
| 3267 | if (p == e) /* Ok.. so here we add a newline... sigh. */ | 3269 | /* Handle fixed-length files with carriage control. */ |
| 3268 | e = p + min (MAXIOSIZE, nbytes) - 1; | 3270 | if (st.st_fab_rfm == FAB$C_FIX |
| 3269 | retval = write (fildes, p, e - p + 1); | 3271 | && ((st.st_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0)) |
| 3270 | if (retval != e - p + 1) return -1; | 3272 | { |
| 3271 | p = e + 1; | 3273 | len = st.st_fab_mrs; |
| 3272 | sum = sum + retval; | 3274 | retval = write (fildes, p, min (len, nbytes)); |
| 3275 | if (retval != len) | ||
| 3276 | return -1; | ||
| 3277 | retval++; /* This skips the implied carriage control */ | ||
| 3278 | } | ||
| 3279 | else | ||
| 3280 | { | ||
| 3281 | e = p + min (MAXIOSIZE, nbytes) - 1; | ||
| 3282 | while (*e != '\n' && e > p) e--; | ||
| 3283 | if (p == e) /* Ok.. so here we add a newline... sigh. */ | ||
| 3284 | e = p + min (MAXIOSIZE, nbytes) - 1; | ||
| 3285 | len = e + 1 - p; | ||
| 3286 | retval = write (fildes, p, len); | ||
| 3287 | if (retval != len) | ||
| 3288 | return -1; | ||
| 3289 | } | ||
| 3290 | p += retval; | ||
| 3291 | sum += retval; | ||
| 3273 | nbytes -= retval; | 3292 | nbytes -= retval; |
| 3274 | } | 3293 | } |
| 3275 | return sum; | 3294 | return sum; |