Mercurial > emacs
comparison src/s/dgux.h @ 5094:8b59fb13665e
(PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF):
Defined to use all the available PTYs in an ELF environment which
uses the SVR4 mechanisms; grantpt(), unlockpt() and ptsname().
(FIRST_PTY_LETTER): Deleted.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 21 Nov 1993 09:04:48 +0000 |
parents | cac54c4a7305 |
children | 8415001e90e2 |
comparison
equal
deleted
inserted
replaced
5093:51d2f91b2ce1 | 5094:8b59fb13665e |
---|---|
244 */ | 244 */ |
245 | 245 |
246 #define HAVE_TERMIOS | 246 #define HAVE_TERMIOS |
247 #define NO_TERMIO | 247 #define NO_TERMIO |
248 | 248 |
249 /* Letter to use in finding device name of first pty, | |
250 if system supports pty's. 'p' means it is /dev/ptyp0 */ | |
251 | |
252 #define FIRST_PTY_LETTER 'p' | |
253 | |
254 /* | 249 /* |
255 * Use a Berkeley style sys/wait.h. | 250 * Use a Berkeley style sys/wait.h. |
256 * This makes WIF* macros operate on structures instead of ints. | 251 * This makes WIF* macros operate on structures instead of ints. |
257 */ | 252 */ |
258 | 253 |
346 | 341 |
347 #define C_DEBUG_SWITCH -g | 342 #define C_DEBUG_SWITCH -g |
348 | 343 |
349 #else /* not COFF */ | 344 #else /* not COFF */ |
350 | 345 |
346 /* Pseudo-terminal support under SVR4 only loops to deal with errors. */ | |
347 | |
348 #define PTY_ITERATION for (i = 0; i < 1; i++) | |
349 | |
350 /* This sets the name of the master side of the PTY. */ | |
351 | |
352 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | |
353 | |
354 /* This sets the name of the slave side of the PTY. On SysVr4, | |
355 grantpt(3) forks a subprocess, so keep sigchld_handler() from | |
356 intercepting that death. If any child but grantpt's should die | |
357 within, it should be caught after sigrelse(2). */ | |
358 | |
359 #define PTY_TTY_NAME_SPRINTF \ | |
360 { \ | |
361 char *ptsname(), *ptyname; \ | |
362 \ | |
363 sigblock(sigmask(SIGCLD)); \ | |
364 if (grantpt(fd) == -1) \ | |
365 fatal("could not grant slave pty"); \ | |
366 sigunblock(sigmask(SIGCLD)); \ | |
367 if (unlockpt(fd) == -1) \ | |
368 fatal("could not unlock slave pty"); \ | |
369 if (!(ptyname = ptsname(fd))) \ | |
370 fatal ("could not enable slave pty"); \ | |
371 strncpy(pty_name, ptyname, sizeof(pty_name)); \ | |
372 pty_name[sizeof(pty_name) - 1] = 0; \ | |
373 } | |
374 | |
375 /* Push various streams modules onto a PTY channel. */ | |
376 | |
377 #define SETUP_SLAVE_PTY \ | |
378 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ | |
379 fatal ("ioctl I_PUSH ptem", errno); \ | |
380 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \ | |
381 fatal ("ioctl I_PUSH ldterm", errno); \ | |
382 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \ | |
383 fatal ("ioctl I_PUSH ttcompat", errno); | |
384 | |
385 | |
351 #define C_COMPILER \ | 386 #define C_COMPILER \ |
352 TARGET_BINARY_INTERFACE=m88kdguxelf gcc -traditional | 387 TARGET_BINARY_INTERFACE=m88kdguxelf gcc -traditional |
353 | 388 |
354 #define LINKER \ | 389 #define LINKER \ |
355 TARGET_BINARY_INTERFACE=m88kdguxelf gcc | 390 TARGET_BINARY_INTERFACE=m88kdguxelf gcc |