comparison src/s/irix5-0.h @ 4237:589ab12dbe3d

(PTY_OPEN): Use sigaction, not sigsetmask.
author Richard M. Stallman <rms@gnu.org>
date Fri, 23 Jul 1993 04:16:38 +0000
parents c10bb302a315
children 73d1d7d05a5a
comparison
equal deleted inserted replaced
4236:8e14db210975 4237:589ab12dbe3d
46 #endif 46 #endif
47 /* We need only try once to open a pty. */ 47 /* We need only try once to open a pty. */
48 #define PTY_ITERATION 48 #define PTY_ITERATION
49 /* Here is how to do it. */ 49 /* Here is how to do it. */
50 /* It is necessary to prevent SIGCHLD signals within _getpty. 50 /* It is necessary to prevent SIGCHLD signals within _getpty.
51 So we block them. */ 51 So we block them. But since all of Emacs uses classic SYSV signal()
52 #define PTY_OPEN \ 52 signals, there is no reliable way to do this (unlike BSD sighold or
53 { \ 53 POSIX sigaction). On Irix 5.* systems, the implementation of
54 int mask = sigblock (sigmask (SIGCHLD)); \ 54 sigaction is as close as you can get to a universal. */
55 char *name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \ 55 #define PTY_OPEN \
56 sigsetmask(mask); \ 56 { \
57 if (name == 0) \ 57 struct sigaction ocstat, cstat; \
58 return -1; \ 58 char * name; \
59 if (fd < 0) \ 59 sigemptyset(&cstat.sa_mask); \
60 return -1; \ 60 cstat.sa_handler = SIG_DFL; \
61 if (fstat (fd, &stb) < 0) \ 61 cstat.sa_flags = 0; \
62 return -1; \ 62 sigaction(SIGCLD, &cstat, &ocstat); \
63 strcpy (pty_name, name); \ 63 name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \
64 sigaction(SIGCLD, &ocstat, (struct sigaction *)0); \
65 if (name == 0) \
66 return -1; \
67 if (fd < 0) \
68 return -1; \
69 if (fstat (fd, &stb) < 0) \
70 return -1; \
71 strcpy (pty_name, name); \
64 } 72 }
73