1493
+ 鐃緒申 1 #include "irix3-3.h"
+ 鐃緒申 2
+ 鐃緒申 3 #define USG5_3
+ 鐃緒申 4
+ 鐃緒申 5 /* Define HAVE_ALLOCA to say that the system provides a properly
+ 鐃緒申 6 working alloca function and it should be used. */
+ 鐃緒申 7 #define HAVE_ALLOCA
+ 鐃緒申 8 #undef C_ALLOCA
+ 鐃緒申 9 #define alloca __builtin_alloca
+ 鐃緒申 10
+ 鐃緒申 11 /* use K&R C */
+ 鐃緒申 12 #define C_SWITCH_MACHINE -cckr
+ 鐃緒申 13
+ 鐃緒申 14 /* SGI has all the fancy wait stuff, but we can't include sys/wait.h
+ 鐃緒申 15 because it defines BIG_ENDIAN and LITTLE_ENDIAN (ugh!.) Instead
+ 鐃緒申 16 we'll just define WNOHANG right here.
+ 鐃緒申 17 (An implicit decl is good enough for wait3.) */
+ 鐃緒申 18
+ 鐃緒申 19 #define WNOHANG 0x1
+ 鐃緒申 20
+ 鐃緒申 21 /* No need to use sprintf to get the tty name--we get that from _getpty. */
+ 鐃緒申 22 #define PTY_TTY_NAME_SPRINTF
+ 鐃緒申 23 /* No need to get the pty name at all. */
+ 鐃緒申 24 #define PTY_NAME_SPRINTF
+ 鐃緒申 25 #ifdef emacs
+ 鐃緒申 26 char *_get_pty();
+ 鐃緒申 27 #endif
+ 鐃緒申 28 /* We need only try once to open a pty. */
+ 鐃緒申 29 #define PTY_ITERATION
+ 鐃緒申 30 /* Here is how to do it. */
+ 鐃緒申 31 /* It is necessary to prevent SIGCHLD signals within _getpty.
+ 鐃緒申 32 So we block them. */
+ 鐃緒申 33 #define PTY_OPEN \
+ 鐃緒申 34 { \
+ 鐃緒申 35 int mask = sigblock (sigmask (SIGCHLD)); \
+ 鐃緒申 36 char *name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \
+ 鐃緒申 37 sigsetmask(mask); \
+ 鐃緒申 38 if (name == 0) \
+ 鐃緒申 39 return -1; \
+ 鐃緒申 40 if (fd < 0) \
+ 鐃緒申 41 return -1; \
+ 鐃緒申 42 if (fstat (fd, &stb) < 0) \
+ 鐃緒申 43 return -1; \
+ 鐃緒申 44 strcpy (pty_name, name); \
+ 鐃緒申 45 }