summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-01-31 21:29:35 +0000
committerJim Blandy <jimb@redhat.com>1992-01-31 21:29:35 +0000
commit21031c17705a9f56687be289be86b9705e6c1af5 (patch)
tree3d268910f95ff98ca431ed20baad87e28d44253c
parent31810cf524f6a02cabde8843f1aa2a1fceea8908 (diff)
downloademacs-21031c17705a9f56687be289be86b9705e6c1af5.tar.gz
*** empty log message ***
-rw-r--r--src/m/intel386.h25
-rw-r--r--src/m/iris4d.h4
-rw-r--r--src/s/usg5-4.h2
-rw-r--r--src/sysdep.c39
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 @@
-/* machine description file for intel 386.
+/* Machine description file for intel 386.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -100,7 +100,7 @@ NOTE-END */
#define LOAD_AVE_TYPE short
/* Convert that into an integer that is 100 for a load average of 1.0 */
-#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
+#define LOAD_AVE_CVT(x) (((double) (x)) * 100.0 / FSCALE)
#define FSCALE 256.0 /* determined by experimentation... */
#endif
@@ -113,9 +113,9 @@ NOTE-END */
/* Convert that into an integer that is 100 for a load average of 1.0 */
/* This is totally uncalibrated. */
-#define LOAD_AVE_CVT(x) ((int) ((double) (x)) * 100.0 / FSCALE)
+#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
#define FSCALE 256.0
-*endif
+#endif
/* Define CANNOT_DUMP on machines where unexec does not work.
Then the function dump-emacs will not be defined
@@ -160,7 +160,9 @@ NOTE-END */
#else /* not XENIX */
#ifdef USG
+#ifndef LIB_STANDARD
#define LIB_STANDARD -lPW -lc
+#endif
#define HAVE_ALLOCA
#define NO_REMAP
#define TEXT_START 0
@@ -170,7 +172,6 @@ NOTE-END */
#ifdef BSD
#define HAVE_ALLOCA
#endif /* BSD */
- BSD */
/* If compiling with GCC, let GCC implement alloca. */
#if defined(__GNUC__) && !defined(alloca)
@@ -178,5 +179,15 @@ NOTE-END */
#define HAVE_ALLOCA
#endif
-/* Search these directories just in case; I'm told they might be needed. */
-#define C_SWITCH_MACHINE -I/usr/X/include -I/usr/netinclude
+#ifdef USG
+#ifdef __STDC__
+#ifndef DONT_DEFINE_SIGNAL
+/* Cast the function argument to avoid warnings. */
+#define signal(sig, func) (signal (sig, (void (*) (int)) (func)))
+#endif
+#endif
+#endif
+
+#ifdef USG5_4
+#define DATA_SEG_BITS 0x08000000
+#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. */
#define XMARKBIT(a) ((a) < 0)
#define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) | ((b) ? MARKBIT : 0))
#define XUNMARK(a) ((a) = (((unsigned)(a) << INTBITS-GCTYPEBITS-VALBITS) >> INTBITS-GCTYPEBITS-VALBITS))
+
+/* Turn off some "helpful" error checks for type mismatches
+ that we can't fix without breaking other machines. */
+#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. */
#define LIB_STANDARD GNULIB -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
-#define DATA_SEG_BITS 0x08000000
-
/* Use ptem.h to get structures related to windows. */
#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)
{
register char *p;
register char *e;
- int retval, sum;
+ int sum = 0;
+ struct stat st;
+
+ fstat (fildes, &st);
p = buf;
- sum = 0;
while (nbytes > 0)
{
- e = p + min (MAXIOSIZE, nbytes) - 1;
- while (*e != '\n' && e > p) e--;
- if (p == e) /* Ok.. so here we add a newline... sigh. */
- e = p + min (MAXIOSIZE, nbytes) - 1;
- retval = write (fildes, p, e - p + 1);
- if (retval != e - p + 1) return -1;
- p = e + 1;
- sum = sum + retval;
+ int len, retval;
+
+ /* Handle fixed-length files with carriage control. */
+ if (st.st_fab_rfm == FAB$C_FIX
+ && ((st.st_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0))
+ {
+ len = st.st_fab_mrs;
+ retval = write (fildes, p, min (len, nbytes));
+ if (retval != len)
+ return -1;
+ retval++; /* This skips the implied carriage control */
+ }
+ else
+ {
+ e = p + min (MAXIOSIZE, nbytes) - 1;
+ while (*e != '\n' && e > p) e--;
+ if (p == e) /* Ok.. so here we add a newline... sigh. */
+ e = p + min (MAXIOSIZE, nbytes) - 1;
+ len = e + 1 - p;
+ retval = write (fildes, p, len);
+ if (retval != len)
+ return -1;
+ }
+ p += retval;
+ sum += retval;
nbytes -= retval;
}
return sum;