Mercurial > emacs
comparison src/process.c @ 96732:1e0b67e40d48
* systty.h: Remove code for Aix on 386, unsupported platform.
* s/ms-w32.h: Remove boilerplate comments.
(fcloseall, fgetchar, flushall, fputchar, getw, putw): Remove, unused.
* s/gnu-linux.h (TERM): Remove support.
(HAVE_SYSVIPC): Remove, unused.
(A_TEXT_OFFSET, A_TEXT_SEEK, ADJUST_EXEC_HEADER): Remove, not used
for this system.
* process.c: Remove support for IRIS, unused.
Remove support for TERM, not relevant anymore.
* unexalpha.c (DEFAULT_ENTRY_ADDRESS): Remove, replace the only
used with the definition.
* s/aix4-2.h (static): Do not undef.
* m/ibmrs6000.h: Remove code depending on USG5_4, this file is
only used on Aix.
(HAVE_SYSVIPC): Remove, unused.
* m/hp800.h (CANNOT_DUMP): Do not undef.
* m/alpha.h: Fix comment.
* s/usg5-4.h (HAVE_SYSVIPC): Remove, unused.
(USG_SHARED_LIBRARIES): Remove, only used in unexec.c which is not
used by this configuration.
* emacs.c: Remove code depending on USG_SHARED_LIBRARIES.
* unexec.c: Remove code depending on HPUX and
USG_SHARED_LIBRARIES, not used with this file. Remove code
depending on IRIS, unused. Remove if 0-ed code.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Wed, 16 Jul 2008 08:06:18 +0000 |
parents | d45acf0c8d23 |
children | 3760da9fe15e |
comparison
equal
deleted
inserted
replaced
96731:79339db0a32f | 96732:1e0b67e40d48 |
---|---|
66 #include <sys/un.h> | 66 #include <sys/un.h> |
67 #endif | 67 #endif |
68 #endif | 68 #endif |
69 #endif /* HAVE_SOCKETS */ | 69 #endif /* HAVE_SOCKETS */ |
70 | 70 |
71 /* TERM is a poor-man's SLIP, used on GNU/Linux. */ | |
72 #ifdef TERM | |
73 #include <client.h> | |
74 #endif | |
75 | |
76 #if defined(BSD_SYSTEM) | 71 #if defined(BSD_SYSTEM) |
77 #include <sys/ioctl.h> | 72 #include <sys/ioctl.h> |
78 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) | 73 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) |
79 #include <fcntl.h> | 74 #include <fcntl.h> |
80 #endif /* HAVE_PTYS and no O_NDELAY */ | 75 #endif /* HAVE_PTYS and no O_NDELAY */ |
92 #include <sys/ioctl.h> | 87 #include <sys/ioctl.h> |
93 #endif | 88 #endif |
94 #include <net/if.h> | 89 #include <net/if.h> |
95 #endif | 90 #endif |
96 #endif | 91 #endif |
97 | |
98 #ifdef IRIS | |
99 #include <sys/sysmacros.h> /* for "minor" */ | |
100 #endif /* not IRIS */ | |
101 | 92 |
102 #ifdef HAVE_SYS_WAIT | 93 #ifdef HAVE_SYS_WAIT |
103 #include <sys/wait.h> | 94 #include <sys/wait.h> |
104 #endif | 95 #endif |
105 | 96 |
257 #endif /* HAVE_SELECT || FIONREAD */ | 248 #endif /* HAVE_SELECT || FIONREAD */ |
258 #endif /* HAVE_SOCKETS */ | 249 #endif /* HAVE_SOCKETS */ |
259 #endif /* DATAGRAM_SOCKETS */ | 250 #endif /* DATAGRAM_SOCKETS */ |
260 #endif /* BROKEN_DATAGRAM_SOCKETS */ | 251 #endif /* BROKEN_DATAGRAM_SOCKETS */ |
261 | 252 |
262 #ifdef TERM | |
263 #undef NON_BLOCKING_CONNECT | |
264 #undef DATAGRAM_SOCKETS | |
265 #endif | |
266 | |
267 #if !defined (ADAPTIVE_READ_BUFFERING) && !defined (NO_ADAPTIVE_READ_BUFFERING) | 253 #if !defined (ADAPTIVE_READ_BUFFERING) && !defined (NO_ADAPTIVE_READ_BUFFERING) |
268 #ifdef EMACS_HAS_USECS | 254 #ifdef EMACS_HAS_USECS |
269 #define ADAPTIVE_READ_BUFFERING | 255 #define ADAPTIVE_READ_BUFFERING |
270 #endif | 256 #endif |
271 #endif | 257 #endif |
540 | 526 |
541 #ifdef PTY_OPEN | 527 #ifdef PTY_OPEN |
542 PTY_OPEN; | 528 PTY_OPEN; |
543 #else /* no PTY_OPEN */ | 529 #else /* no PTY_OPEN */ |
544 { | 530 { |
545 # ifdef IRIS | |
546 /* Unusual IRIS code */ | |
547 *ptyv = emacs_open ("/dev/ptc", O_RDWR | O_NDELAY, 0); | |
548 if (fd < 0) | |
549 return -1; | |
550 if (fstat (fd, &stb) < 0) | |
551 return -1; | |
552 # else /* not IRIS */ | |
553 { /* Some systems name their pseudoterminals so that there are gaps in | 531 { /* Some systems name their pseudoterminals so that there are gaps in |
554 the usual sequence - for example, on HP9000/S700 systems, there | 532 the usual sequence - for example, on HP9000/S700 systems, there |
555 are no pseudoterminals with names ending in 'f'. So we wait for | 533 are no pseudoterminals with names ending in 'f'. So we wait for |
556 three failures in a row before deciding that we've reached the | 534 three failures in a row before deciding that we've reached the |
557 end of the ptys. */ | 535 end of the ptys. */ |
569 # ifdef O_NONBLOCK | 547 # ifdef O_NONBLOCK |
570 fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); | 548 fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); |
571 # else | 549 # else |
572 fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); | 550 fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); |
573 # endif | 551 # endif |
574 # endif /* not IRIS */ | |
575 } | 552 } |
576 #endif /* no PTY_OPEN */ | 553 #endif /* no PTY_OPEN */ |
577 | 554 |
578 if (fd >= 0) | 555 if (fd >= 0) |
579 { | 556 { |
585 sprintf (pty_name, "/dev/tty%c%x", c, i); | 562 sprintf (pty_name, "/dev/tty%c%x", c, i); |
586 #endif /* no PTY_TTY_NAME_SPRINTF */ | 563 #endif /* no PTY_TTY_NAME_SPRINTF */ |
587 if (access (pty_name, 6) != 0) | 564 if (access (pty_name, 6) != 0) |
588 { | 565 { |
589 emacs_close (fd); | 566 emacs_close (fd); |
590 # if !defined(IRIS) && !defined(__sgi) | 567 # ifndef __sgi |
591 continue; | 568 continue; |
592 # else | 569 # else |
593 return -1; | 570 return -1; |
594 # endif /* IRIS */ | 571 # endif /* __sgi */ |
595 } | 572 } |
596 setup_pty (fd); | 573 setup_pty (fd); |
597 return fd; | 574 return fd; |
598 } | 575 } |
599 } | 576 } |
3206 tem = Fplist_get (contact, QCserver); | 3183 tem = Fplist_get (contact, QCserver); |
3207 if (!NILP (tem)) | 3184 if (!NILP (tem)) |
3208 { | 3185 { |
3209 /* Don't support network sockets when non-blocking mode is | 3186 /* Don't support network sockets when non-blocking mode is |
3210 not available, since a blocked Emacs is not useful. */ | 3187 not available, since a blocked Emacs is not useful. */ |
3211 #if defined(TERM) || (!defined(O_NONBLOCK) && !defined(O_NDELAY)) | 3188 #if !defined(O_NONBLOCK) && !defined(O_NDELAY) |
3212 error ("Network servers not supported"); | 3189 error ("Network servers not supported"); |
3213 #else | 3190 #else |
3214 is_server = 1; | 3191 is_server = 1; |
3215 if (INTEGERP (tem)) | 3192 if (INTEGERP (tem)) |
3216 backlog = XINT (tem); | 3193 backlog = XINT (tem); |
3235 buffer = Fplist_get (contact, QCbuffer); | 3212 buffer = Fplist_get (contact, QCbuffer); |
3236 filter = Fplist_get (contact, QCfilter); | 3213 filter = Fplist_get (contact, QCfilter); |
3237 sentinel = Fplist_get (contact, QCsentinel); | 3214 sentinel = Fplist_get (contact, QCsentinel); |
3238 | 3215 |
3239 CHECK_STRING (name); | 3216 CHECK_STRING (name); |
3240 | |
3241 #ifdef TERM | |
3242 /* Let's handle TERM before things get complicated ... */ | |
3243 host = Fplist_get (contact, QChost); | |
3244 CHECK_STRING (host); | |
3245 | |
3246 service = Fplist_get (contact, QCservice); | |
3247 if (INTEGERP (service)) | |
3248 port = htons ((unsigned short) XINT (service)); | |
3249 else | |
3250 { | |
3251 struct servent *svc_info; | |
3252 CHECK_STRING (service); | |
3253 svc_info = getservbyname (SDATA (service), "tcp"); | |
3254 if (svc_info == 0) | |
3255 error ("Unknown service: %s", SDATA (service)); | |
3256 port = svc_info->s_port; | |
3257 } | |
3258 | |
3259 s = connect_server (0); | |
3260 if (s < 0) | |
3261 report_file_error ("error creating socket", Fcons (name, Qnil)); | |
3262 send_command (s, C_PORT, 0, "%s:%d", SDATA (host), ntohs (port)); | |
3263 send_command (s, C_DUMB, 1, 0); | |
3264 | |
3265 #else /* not TERM */ | |
3266 | 3217 |
3267 /* Initialize addrinfo structure in case we don't use getaddrinfo. */ | 3218 /* Initialize addrinfo structure in case we don't use getaddrinfo. */ |
3268 ai.ai_socktype = socktype; | 3219 ai.ai_socktype = socktype; |
3269 ai.ai_protocol = 0; | 3220 ai.ai_protocol = 0; |
3270 ai.ai_next = NULL; | 3221 ai.ai_next = NULL; |
3671 if (is_server) | 3622 if (is_server) |
3672 report_file_error ("make server process failed", contact); | 3623 report_file_error ("make server process failed", contact); |
3673 else | 3624 else |
3674 report_file_error ("make client process failed", contact); | 3625 report_file_error ("make client process failed", contact); |
3675 } | 3626 } |
3676 | |
3677 #endif /* not TERM */ | |
3678 | 3627 |
3679 inch = s; | 3628 inch = s; |
3680 outch = s; | 3629 outch = s; |
3681 | 3630 |
3682 if (!NILP (buffer)) | 3631 if (!NILP (buffer)) |
7293 ADD_SUBFEATURE (QCfamily, Qipv6); | 7242 ADD_SUBFEATURE (QCfamily, Qipv6); |
7294 #endif | 7243 #endif |
7295 #ifdef HAVE_GETSOCKNAME | 7244 #ifdef HAVE_GETSOCKNAME |
7296 ADD_SUBFEATURE (QCservice, Qt); | 7245 ADD_SUBFEATURE (QCservice, Qt); |
7297 #endif | 7246 #endif |
7298 #if !defined(TERM) && (defined(O_NONBLOCK) || defined(O_NDELAY)) | 7247 #if defined(O_NONBLOCK) || defined(O_NDELAY) |
7299 ADD_SUBFEATURE (QCserver, Qt); | 7248 ADD_SUBFEATURE (QCserver, Qt); |
7300 #endif | 7249 #endif |
7301 | 7250 |
7302 for (sopt = socket_options; sopt->name; sopt++) | 7251 for (sopt = socket_options; sopt->name; sopt++) |
7303 subfeatures = Fcons (intern (sopt->name), subfeatures); | 7252 subfeatures = Fcons (intern (sopt->name), subfeatures); |