diff options
| author | Gerd Moellmann | 1999-10-27 10:22:21 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-10-27 10:22:21 +0000 |
| commit | fdc5e0fcf45d30512f6df068fb1b8963f7ce0048 (patch) | |
| tree | 15367ec2a170988c8c72773349fbc7c512ca4607 /src/s/gnu-linux.h | |
| parent | 513331d3298cfc76f75996effbe738308eed4f6f (diff) | |
| download | emacs-fdc5e0fcf45d30512f6df068fb1b8963f7ce0048.tar.gz emacs-fdc5e0fcf45d30512f6df068fb1b8963f7ce0048.zip | |
[HAVE_DEV_PTMX]: Redefine FIRST_PTY_LETTER to 'z'.
Define PTY_NAME_SPRINTF.
Redefine PTY_TTY_NAME_SPRINTF.
Diffstat (limited to 'src/s/gnu-linux.h')
| -rw-r--r-- | src/s/gnu-linux.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 68b3e8d5a41..f5419a6e3af 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -59,6 +59,42 @@ Boston, MA 02111-1307, USA. */ | |||
| 59 | 59 | ||
| 60 | #define FIRST_PTY_LETTER 'p' | 60 | #define FIRST_PTY_LETTER 'p' |
| 61 | 61 | ||
| 62 | #ifdef HAVE_DEV_PTMX | ||
| 63 | |||
| 64 | /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock | ||
| 65 | rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't | ||
| 66 | work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x | ||
| 67 | (x<2) but I'm not sure. fnf@cygnus.com */ | ||
| 68 | /* This sets the name of the slave side of the PTY. On SysVr4, | ||
| 69 | grantpt(3) forks a subprocess, so keep sigchld_handler() from | ||
| 70 | intercepting that death. If any child but grantpt's should die | ||
| 71 | within, it should be caught after sigrelse(2). */ | ||
| 72 | |||
| 73 | #undef FIRST_PTY_LETTER | ||
| 74 | #define FIRST_PTY_LETTER 'z' | ||
| 75 | |||
| 76 | /* This sets the name of the master side of the PTY. */ | ||
| 77 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | ||
| 78 | |||
| 79 | #undef PTY_TTY_NAME_SPRINTF | ||
| 80 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 81 | { \ | ||
| 82 | char *ptsname (), *ptyname; \ | ||
| 83 | \ | ||
| 84 | sigblock (sigmask (SIGCLD)); \ | ||
| 85 | if (grantpt (fd) == -1) \ | ||
| 86 | { close (fd); return -1; } \ | ||
| 87 | sigunblock (sigmask (SIGCLD)); \ | ||
| 88 | if (unlockpt (fd) == -1) \ | ||
| 89 | { close (fd); return -1; } \ | ||
| 90 | if (!(ptyname = ptsname (fd))) \ | ||
| 91 | { close (fd); return -1; } \ | ||
| 92 | strncpy (pty_name, ptyname, sizeof (pty_name)); \ | ||
| 93 | pty_name[sizeof (pty_name) - 1] = 0; \ | ||
| 94 | } | ||
| 95 | |||
| 96 | #endif /* HAVE_DEV_PTMX */ | ||
| 97 | |||
| 62 | /* | 98 | /* |
| 63 | * Define HAVE_TERMIOS if the system provides POSIX-style | 99 | * Define HAVE_TERMIOS if the system provides POSIX-style |
| 64 | * functions and macros for terminal control. | 100 | * functions and macros for terminal control. |