Mercurial > emacs
comparison src/process.c @ 90261:7beb78bc1f8e
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 616-696)
- Add lisp/mh-e/.arch-inventory
- Update from CVS
- Merge from gnus--rel--5.10
- Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords.
- lisp/gnus/ChangeLog: Remove duplicate entry
* gnus--rel--5.10 (patch 147-181)
- Update from CVS
- Merge from emacs--cvs-trunk--0
- Update from CVS: lisp/mml.el (mml-preview): Doc fix.
- Update from CVS: texi/message.texi: Fix default values.
- Update from CVS: texi/gnus.texi (RSS): Addition.
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Mon, 16 Jan 2006 08:37:27 +0000 |
| parents | aa89c814f853 e5c85a134e67 |
| children | c5406394f567 |
comparison
equal
deleted
inserted
replaced
| 90260:0ca0d9181b5e | 90261:7beb78bc1f8e |
|---|---|
| 38 #include <errno.h> | 38 #include <errno.h> |
| 39 #include <setjmp.h> | 39 #include <setjmp.h> |
| 40 #include <sys/types.h> /* some typedefs are used in sys/file.h */ | 40 #include <sys/types.h> /* some typedefs are used in sys/file.h */ |
| 41 #include <sys/file.h> | 41 #include <sys/file.h> |
| 42 #include <sys/stat.h> | 42 #include <sys/stat.h> |
| 43 #ifdef HAVE_INTTYPES_H | |
| 44 #include <inttypes.h> | |
| 45 #endif | |
| 43 #ifdef HAVE_UNISTD_H | 46 #ifdef HAVE_UNISTD_H |
| 44 #include <unistd.h> | 47 #include <unistd.h> |
| 45 #endif | 48 #endif |
| 46 | 49 |
| 47 #if defined(WINDOWSNT) || defined(UNIX98_PTYS) | 50 #if defined(WINDOWSNT) || defined(UNIX98_PTYS) |
| 114 #include <sys/sysmacros.h> /* for "minor" */ | 117 #include <sys/sysmacros.h> /* for "minor" */ |
| 115 #endif /* not IRIS */ | 118 #endif /* not IRIS */ |
| 116 | 119 |
| 117 #ifdef HAVE_SYS_WAIT | 120 #ifdef HAVE_SYS_WAIT |
| 118 #include <sys/wait.h> | 121 #include <sys/wait.h> |
| 122 #endif | |
| 123 | |
| 124 /* Disable IPv6 support for w32 until someone figures out how to do it | |
| 125 properly. */ | |
| 126 #ifdef WINDOWSNT | |
| 127 # ifdef AF_INET6 | |
| 128 # undef AF_INET6 | |
| 129 # endif | |
| 119 #endif | 130 #endif |
| 120 | 131 |
| 121 #include "lisp.h" | 132 #include "lisp.h" |
| 122 #include "systime.h" | 133 #include "systime.h" |
| 123 #include "systty.h" | 134 #include "systty.h" |
| 138 #include "atimer.h" | 149 #include "atimer.h" |
| 139 | 150 |
| 140 Lisp_Object Qprocessp; | 151 Lisp_Object Qprocessp; |
| 141 Lisp_Object Qrun, Qstop, Qsignal; | 152 Lisp_Object Qrun, Qstop, Qsignal; |
| 142 Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; | 153 Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; |
| 143 Lisp_Object Qlocal, Qdatagram; | 154 Lisp_Object Qlocal, Qipv4, Qdatagram; |
| 155 #ifdef AF_INET6 | |
| 156 Lisp_Object Qipv6; | |
| 157 #endif | |
| 144 Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; | 158 Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; |
| 145 Lisp_Object QClocal, QCremote, QCcoding; | 159 Lisp_Object QClocal, QCremote, QCcoding; |
| 146 Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; | 160 Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; |
| 147 Lisp_Object QCsentinel, QClog, QCoptions, QCplist; | 161 Lisp_Object QCsentinel, QClog, QCoptions, QCplist; |
| 148 Lisp_Object QCfilter_multibyte; | 162 Lisp_Object QCfilter_multibyte; |
| 1194 | 1208 |
| 1195 #ifdef HAVE_SOCKETS | 1209 #ifdef HAVE_SOCKETS |
| 1196 DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, | 1210 DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, |
| 1197 1, 2, 0, | 1211 1, 2, 0, |
| 1198 doc: /* Convert network ADDRESS from internal format to a string. | 1212 doc: /* Convert network ADDRESS from internal format to a string. |
| 1213 A 4 or 5 element vector represents an IPv4 address (with port number). | |
| 1214 An 8 or 9 element vector represents an IPv6 address (with port number). | |
| 1199 If optional second argument OMIT-PORT is non-nil, don't include a port | 1215 If optional second argument OMIT-PORT is non-nil, don't include a port |
| 1200 number in the string; in this case, interpret a 4 element vector as an | 1216 number in the string, even when present in ADDRESS. |
| 1201 IP address. Returns nil if format of ADDRESS is invalid. */) | 1217 Returns nil if format of ADDRESS is invalid. */) |
| 1202 (address, omit_port) | 1218 (address, omit_port) |
| 1203 Lisp_Object address, omit_port; | 1219 Lisp_Object address, omit_port; |
| 1204 { | 1220 { |
| 1205 if (NILP (address)) | 1221 if (NILP (address)) |
| 1206 return Qnil; | 1222 return Qnil; |
| 1207 | 1223 |
| 1208 if (STRINGP (address)) /* AF_LOCAL */ | 1224 if (STRINGP (address)) /* AF_LOCAL */ |
| 1209 return address; | 1225 return address; |
| 1210 | 1226 |
| 1211 if (VECTORP (address)) /* AF_INET */ | 1227 if (VECTORP (address)) /* AF_INET or AF_INET6 */ |
| 1212 { | 1228 { |
| 1213 register struct Lisp_Vector *p = XVECTOR (address); | 1229 register struct Lisp_Vector *p = XVECTOR (address); |
| 1214 Lisp_Object args[6]; | 1230 Lisp_Object args[6]; |
| 1215 int nargs, i; | 1231 int nargs, i; |
| 1216 | 1232 |
| 1217 if (!NILP (omit_port) && (p->size == 4 || p->size == 5)) | 1233 if (p->size == 4 || (p->size == 5 && !NILP (omit_port))) |
| 1218 { | 1234 { |
| 1219 args[0] = build_string ("%d.%d.%d.%d"); | 1235 args[0] = build_string ("%d.%d.%d.%d"); |
| 1220 nargs = 4; | 1236 nargs = 4; |
| 1221 } | 1237 } |
| 1222 else if (p->size == 5) | 1238 else if (p->size == 5) |
| 1223 { | 1239 { |
| 1224 args[0] = build_string ("%d.%d.%d.%d:%d"); | 1240 args[0] = build_string ("%d.%d.%d.%d:%d"); |
| 1225 nargs = 5; | 1241 nargs = 5; |
| 1242 } | |
| 1243 else if (p->size == 8 || (p->size == 9 && !NILP (omit_port))) | |
| 1244 { | |
| 1245 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); | |
| 1246 nargs = 8; | |
| 1247 } | |
| 1248 else if (p->size == 9) | |
| 1249 { | |
| 1250 args[0] = build_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); | |
| 1251 nargs = 9; | |
| 1226 } | 1252 } |
| 1227 else | 1253 else |
| 1228 return Qnil; | 1254 return Qnil; |
| 1229 | 1255 |
| 1230 for (i = 0; i < nargs; i++) | 1256 for (i = 0; i < nargs; i++) |
| 2211 p = XVECTOR (address); | 2237 p = XVECTOR (address); |
| 2212 p->contents[--len] = make_number (ntohs (sin->sin_port)); | 2238 p->contents[--len] = make_number (ntohs (sin->sin_port)); |
| 2213 cp = (unsigned char *)&sin->sin_addr; | 2239 cp = (unsigned char *)&sin->sin_addr; |
| 2214 break; | 2240 break; |
| 2215 } | 2241 } |
| 2242 #ifdef AF_INET6 | |
| 2243 case AF_INET6: | |
| 2244 { | |
| 2245 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; | |
| 2246 uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; | |
| 2247 len = sizeof (sin6->sin6_addr)/2 + 1; | |
| 2248 address = Fmake_vector (make_number (len), Qnil); | |
| 2249 p = XVECTOR (address); | |
| 2250 p->contents[--len] = make_number (ntohs (sin6->sin6_port)); | |
| 2251 for (i = 0; i < len; i++) | |
| 2252 p->contents[i] = make_number (ntohs (ip6[i])); | |
| 2253 return address; | |
| 2254 } | |
| 2255 #endif | |
| 2216 #ifdef HAVE_LOCAL_SOCKETS | 2256 #ifdef HAVE_LOCAL_SOCKETS |
| 2217 case AF_LOCAL: | 2257 case AF_LOCAL: |
| 2218 { | 2258 { |
| 2219 struct sockaddr_un *sockun = (struct sockaddr_un *) sa; | 2259 struct sockaddr_un *sockun = (struct sockaddr_un *) sa; |
| 2220 for (i = 0; i < sizeof (sockun->sun_path); i++) | 2260 for (i = 0; i < sizeof (sockun->sun_path); i++) |
| 2255 if (p->size == 5) | 2295 if (p->size == 5) |
| 2256 { | 2296 { |
| 2257 *familyp = AF_INET; | 2297 *familyp = AF_INET; |
| 2258 return sizeof (struct sockaddr_in); | 2298 return sizeof (struct sockaddr_in); |
| 2259 } | 2299 } |
| 2300 #ifdef AF_INET6 | |
| 2301 else if (p->size == 9) | |
| 2302 { | |
| 2303 *familyp = AF_INET6; | |
| 2304 return sizeof (struct sockaddr_in6); | |
| 2305 } | |
| 2306 #endif | |
| 2260 } | 2307 } |
| 2261 #ifdef HAVE_LOCAL_SOCKETS | 2308 #ifdef HAVE_LOCAL_SOCKETS |
| 2262 else if (STRINGP (address)) | 2309 else if (STRINGP (address)) |
| 2263 { | 2310 { |
| 2264 *familyp = AF_LOCAL; | 2311 *familyp = AF_LOCAL; |
| 2301 len = sizeof (sin->sin_addr) + 1; | 2348 len = sizeof (sin->sin_addr) + 1; |
| 2302 i = XINT (p->contents[--len]); | 2349 i = XINT (p->contents[--len]); |
| 2303 sin->sin_port = htons (i); | 2350 sin->sin_port = htons (i); |
| 2304 cp = (unsigned char *)&sin->sin_addr; | 2351 cp = (unsigned char *)&sin->sin_addr; |
| 2305 } | 2352 } |
| 2353 #ifdef AF_INET6 | |
| 2354 else if (family == AF_INET6) | |
| 2355 { | |
| 2356 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; | |
| 2357 uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; | |
| 2358 len = sizeof (sin6->sin6_addr) + 1; | |
| 2359 i = XINT (p->contents[--len]); | |
| 2360 sin6->sin6_port = htons (i); | |
| 2361 for (i = 0; i < len; i++) | |
| 2362 if (INTEGERP (p->contents[i])) | |
| 2363 { | |
| 2364 int j = XFASTINT (p->contents[i]) & 0xffff; | |
| 2365 ip6[i] = ntohs (j); | |
| 2366 } | |
| 2367 return; | |
| 2368 } | |
| 2369 #endif | |
| 2306 } | 2370 } |
| 2307 else if (STRINGP (address)) | 2371 else if (STRINGP (address)) |
| 2308 { | 2372 { |
| 2309 #ifdef HAVE_LOCAL_SOCKETS | 2373 #ifdef HAVE_LOCAL_SOCKETS |
| 2310 if (family == AF_LOCAL) | 2374 if (family == AF_LOCAL) |
| 2594 | 2658 |
| 2595 :type TYPE -- TYPE is the type of connection. The default (nil) is a | 2659 :type TYPE -- TYPE is the type of connection. The default (nil) is a |
| 2596 stream type connection, `datagram' creates a datagram type connection. | 2660 stream type connection, `datagram' creates a datagram type connection. |
| 2597 | 2661 |
| 2598 :family FAMILY -- FAMILY is the address (and protocol) family for the | 2662 :family FAMILY -- FAMILY is the address (and protocol) family for the |
| 2599 service specified by HOST and SERVICE. The default address family is | 2663 service specified by HOST and SERVICE. The default (nil) is to use |
| 2600 Inet (or IPv4) for the host and port number specified by HOST and | 2664 whatever address family (IPv4 or IPv6) that is defined for the host |
| 2601 SERVICE. Other address families supported are: | 2665 and port number specified by HOST and SERVICE. Other address families |
| 2666 supported are: | |
| 2602 local -- for a local (i.e. UNIX) address specified by SERVICE. | 2667 local -- for a local (i.e. UNIX) address specified by SERVICE. |
| 2668 ipv4 -- use IPv4 address family only. | |
| 2669 ipv6 -- use IPv6 address family only. | |
| 2603 | 2670 |
| 2604 :local ADDRESS -- ADDRESS is the local address used for the connection. | 2671 :local ADDRESS -- ADDRESS is the local address used for the connection. |
| 2605 This parameter is ignored when opening a client process. When specified | 2672 This parameter is ignored when opening a client process. When specified |
| 2606 for a server process, the FAMILY, HOST and SERVICE args are ignored. | 2673 for a server process, the FAMILY, HOST and SERVICE args are ignored. |
| 2607 | 2674 |
| 2714 Lisp_Object proc; | 2781 Lisp_Object proc; |
| 2715 Lisp_Object contact; | 2782 Lisp_Object contact; |
| 2716 struct Lisp_Process *p; | 2783 struct Lisp_Process *p; |
| 2717 #ifdef HAVE_GETADDRINFO | 2784 #ifdef HAVE_GETADDRINFO |
| 2718 struct addrinfo ai, *res, *lres; | 2785 struct addrinfo ai, *res, *lres; |
| 2719 struct addrinfo hints; | 2786 struct addrinfo hints; |
| 2720 char *portstring, portbuf[128]; | 2787 char *portstring, portbuf[128]; |
| 2721 #else /* HAVE_GETADDRINFO */ | 2788 #else /* HAVE_GETADDRINFO */ |
| 2722 struct _emacs_addrinfo | 2789 struct _emacs_addrinfo |
| 2723 { | 2790 { |
| 2724 int ai_family; | 2791 int ai_family; |
| 2725 int ai_socktype; | 2792 int ai_socktype; |
| 2854 goto open_socket; | 2921 goto open_socket; |
| 2855 } | 2922 } |
| 2856 | 2923 |
| 2857 /* :family FAMILY -- nil (for Inet), local, or integer. */ | 2924 /* :family FAMILY -- nil (for Inet), local, or integer. */ |
| 2858 tem = Fplist_get (contact, QCfamily); | 2925 tem = Fplist_get (contact, QCfamily); |
| 2859 if (INTEGERP (tem)) | 2926 if (NILP (tem)) |
| 2927 { | |
| 2928 #if defined(HAVE_GETADDRINFO) && defined(AF_INET6) | |
| 2929 family = AF_UNSPEC; | |
| 2930 #else | |
| 2931 family = AF_INET; | |
| 2932 #endif | |
| 2933 } | |
| 2934 #ifdef HAVE_LOCAL_SOCKETS | |
| 2935 else if (EQ (tem, Qlocal)) | |
| 2936 family = AF_LOCAL; | |
| 2937 #endif | |
| 2938 #ifdef AF_INET6 | |
| 2939 else if (EQ (tem, Qipv6)) | |
| 2940 family = AF_INET6; | |
| 2941 #endif | |
| 2942 else if (EQ (tem, Qipv4)) | |
| 2943 family = AF_INET; | |
| 2944 else if (INTEGERP (tem)) | |
| 2860 family = XINT (tem); | 2945 family = XINT (tem); |
| 2861 else | 2946 else |
| 2862 { | |
| 2863 if (NILP (tem)) | |
| 2864 family = AF_INET; | |
| 2865 #ifdef HAVE_LOCAL_SOCKETS | |
| 2866 else if (EQ (tem, Qlocal)) | |
| 2867 family = AF_LOCAL; | |
| 2868 #endif | |
| 2869 } | |
| 2870 if (family < 0) | |
| 2871 error ("Unknown address family"); | 2947 error ("Unknown address family"); |
| 2948 | |
| 2872 ai.ai_family = family; | 2949 ai.ai_family = family; |
| 2873 | 2950 |
| 2874 /* :service SERVICE -- string, integer (port number), or t (random port). */ | 2951 /* :service SERVICE -- string, integer (port number), or t (random port). */ |
| 2875 service = Fplist_get (contact, QCservice); | 2952 service = Fplist_get (contact, QCservice); |
| 2876 | 2953 |
| 2932 | 3009 |
| 2933 immediate_quit = 1; | 3010 immediate_quit = 1; |
| 2934 QUIT; | 3011 QUIT; |
| 2935 memset (&hints, 0, sizeof (hints)); | 3012 memset (&hints, 0, sizeof (hints)); |
| 2936 hints.ai_flags = 0; | 3013 hints.ai_flags = 0; |
| 2937 hints.ai_family = NILP (Fplist_member (contact, QCfamily)) ? AF_UNSPEC : family; | 3014 hints.ai_family = family; |
| 2938 hints.ai_socktype = socktype; | 3015 hints.ai_socktype = socktype; |
| 2939 hints.ai_protocol = 0; | 3016 hints.ai_protocol = 0; |
| 2940 ret = getaddrinfo (SDATA (host), portstring, &hints, &res); | 3017 ret = getaddrinfo (SDATA (host), portstring, &hints, &res); |
| 2941 if (ret) | 3018 if (ret) |
| 2942 #ifdef HAVE_GAI_STRERROR | 3019 #ifdef HAVE_GAI_STRERROR |
| 3521 { IFF_AUTOMEDIA, "automedia" }, | 3598 { IFF_AUTOMEDIA, "automedia" }, |
| 3522 #endif | 3599 #endif |
| 3523 #ifdef IFF_DYNAMIC | 3600 #ifdef IFF_DYNAMIC |
| 3524 { IFF_DYNAMIC, "dynamic" }, | 3601 { IFF_DYNAMIC, "dynamic" }, |
| 3525 #endif | 3602 #endif |
| 3603 #ifdef IFF_OACTIVE | |
| 3604 { IFF_OACTIVE, "oactive" }, /* OpenBSD: transmission in progress */ | |
| 3605 #endif | |
| 3606 #ifdef IFF_SIMPLEX | |
| 3607 { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */ | |
| 3608 #endif | |
| 3609 #ifdef IFF_LINK0 | |
| 3610 { IFF_LINK0, "link0" }, /* OpenBSD: per link layer defined bit */ | |
| 3611 #endif | |
| 3612 #ifdef IFF_LINK1 | |
| 3613 { IFF_LINK1, "link1" }, /* OpenBSD: per link layer defined bit */ | |
| 3614 #endif | |
| 3615 #ifdef IFF_LINK2 | |
| 3616 { IFF_LINK2, "link2" }, /* OpenBSD: per link layer defined bit */ | |
| 3617 #endif | |
| 3526 { 0, 0 } | 3618 { 0, 0 } |
| 3527 }; | 3619 }; |
| 3528 | 3620 |
| 3529 DEFUN ("network-interface-info", Fnetwork_interface_info, Snetwork_interface_info, 1, 1, 0, | 3621 DEFUN ("network-interface-info", Fnetwork_interface_info, Snetwork_interface_info, 1, 1, 0, |
| 3530 doc: /* Return information about network interface named IFNAME. | 3622 doc: /* Return information about network interface named IFNAME. |
| 3557 int flags = rq.ifr_flags; | 3649 int flags = rq.ifr_flags; |
| 3558 struct ifflag_def *fp; | 3650 struct ifflag_def *fp; |
| 3559 int fnum; | 3651 int fnum; |
| 3560 | 3652 |
| 3561 any++; | 3653 any++; |
| 3562 for (fp = ifflag_table; flags != 0 && fp; fp++) | 3654 for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++) |
| 3563 { | 3655 { |
| 3564 if (flags & fp->flag_bit) | 3656 if (flags & fp->flag_bit) |
| 3565 { | 3657 { |
| 3566 elt = Fcons (intern (fp->flag_sym), elt); | 3658 elt = Fcons (intern (fp->flag_sym), elt); |
| 3567 flags -= fp->flag_bit; | 3659 flags -= fp->flag_bit; |
| 3593 } | 3685 } |
| 3594 #endif | 3686 #endif |
| 3595 res = Fcons (elt, res); | 3687 res = Fcons (elt, res); |
| 3596 | 3688 |
| 3597 elt = Qnil; | 3689 elt = Qnil; |
| 3598 #if defined(SIOCGIFNETMASK) && defined(ifr_netmask) | 3690 #if defined(SIOCGIFNETMASK) && (defined(HAVE_STRUCT_IFREQ_IFR_NETMASK) || defined(HAVE_STRUCT_IFREQ_IFR_ADDR)) |
| 3599 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) | 3691 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) |
| 3600 { | 3692 { |
| 3601 any++; | 3693 any++; |
| 3694 #ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK | |
| 3602 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); | 3695 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); |
| 3696 #else | |
| 3697 elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr)); | |
| 3698 #endif | |
| 3603 } | 3699 } |
| 3604 #endif | 3700 #endif |
| 3605 res = Fcons (elt, res); | 3701 res = Fcons (elt, res); |
| 3606 | 3702 |
| 3607 elt = Qnil; | 3703 elt = Qnil; |
| 3815 struct Lisp_Process *p; | 3911 struct Lisp_Process *p; |
| 3816 int s; | 3912 int s; |
| 3817 union u_sockaddr { | 3913 union u_sockaddr { |
| 3818 struct sockaddr sa; | 3914 struct sockaddr sa; |
| 3819 struct sockaddr_in in; | 3915 struct sockaddr_in in; |
| 3916 #ifdef AF_INET6 | |
| 3917 struct sockaddr_in6 in6; | |
| 3918 #endif | |
| 3820 #ifdef HAVE_LOCAL_SOCKETS | 3919 #ifdef HAVE_LOCAL_SOCKETS |
| 3821 struct sockaddr_un un; | 3920 struct sockaddr_un un; |
| 3822 #endif | 3921 #endif |
| 3823 } saddr; | 3922 } saddr; |
| 3824 int len = sizeof saddr; | 3923 int len = sizeof saddr; |
| 3870 args[1] = host; | 3969 args[1] = host; |
| 3871 args[2] = service; | 3970 args[2] = service; |
| 3872 caller = Fformat (3, args); | 3971 caller = Fformat (3, args); |
| 3873 } | 3972 } |
| 3874 break; | 3973 break; |
| 3974 | |
| 3975 #ifdef AF_INET6 | |
| 3976 case AF_INET6: | |
| 3977 { | |
| 3978 Lisp_Object args[9]; | |
| 3979 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; | |
| 3980 int i; | |
| 3981 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); | |
| 3982 for (i = 0; i < 8; i++) | |
| 3983 args[i+1] = make_number (ntohs(ip6[i])); | |
| 3984 host = Fformat (9, args); | |
| 3985 service = make_number (ntohs (saddr.in.sin_port)); | |
| 3986 | |
| 3987 args[0] = build_string (" <[%s]:%d>"); | |
| 3988 args[1] = host; | |
| 3989 args[2] = service; | |
| 3990 caller = Fformat (3, args); | |
| 3991 } | |
| 3992 break; | |
| 3993 #endif | |
| 3875 | 3994 |
| 3876 #ifdef HAVE_LOCAL_SOCKETS | 3995 #ifdef HAVE_LOCAL_SOCKETS |
| 3877 case AF_LOCAL: | 3996 case AF_LOCAL: |
| 3878 #endif | 3997 #endif |
| 3879 default: | 3998 default: |
| 5940 unsigned char *name; | 6059 unsigned char *name; |
| 5941 | 6060 |
| 5942 CHECK_SYMBOL (sigcode); | 6061 CHECK_SYMBOL (sigcode); |
| 5943 name = SDATA (SYMBOL_NAME (sigcode)); | 6062 name = SDATA (SYMBOL_NAME (sigcode)); |
| 5944 | 6063 |
| 6064 if (!strncmp(name, "SIG", 3)) | |
| 6065 name += 3; | |
| 6066 | |
| 5945 if (0) | 6067 if (0) |
| 5946 ; | 6068 ; |
| 5947 #ifdef SIGHUP | 6069 #ifdef SIGHUP |
| 5948 handle_signal ("SIGHUP", SIGHUP); | 6070 handle_signal ("HUP", SIGHUP); |
| 5949 #endif | 6071 #endif |
| 5950 #ifdef SIGINT | 6072 #ifdef SIGINT |
| 5951 handle_signal ("SIGINT", SIGINT); | 6073 handle_signal ("INT", SIGINT); |
| 5952 #endif | 6074 #endif |
| 5953 #ifdef SIGQUIT | 6075 #ifdef SIGQUIT |
| 5954 handle_signal ("SIGQUIT", SIGQUIT); | 6076 handle_signal ("QUIT", SIGQUIT); |
| 5955 #endif | 6077 #endif |
| 5956 #ifdef SIGILL | 6078 #ifdef SIGILL |
| 5957 handle_signal ("SIGILL", SIGILL); | 6079 handle_signal ("ILL", SIGILL); |
| 5958 #endif | 6080 #endif |
| 5959 #ifdef SIGABRT | 6081 #ifdef SIGABRT |
| 5960 handle_signal ("SIGABRT", SIGABRT); | 6082 handle_signal ("ABRT", SIGABRT); |
| 5961 #endif | 6083 #endif |
| 5962 #ifdef SIGEMT | 6084 #ifdef SIGEMT |
| 5963 handle_signal ("SIGEMT", SIGEMT); | 6085 handle_signal ("EMT", SIGEMT); |
| 5964 #endif | 6086 #endif |
| 5965 #ifdef SIGKILL | 6087 #ifdef SIGKILL |
| 5966 handle_signal ("SIGKILL", SIGKILL); | 6088 handle_signal ("KILL", SIGKILL); |
| 5967 #endif | 6089 #endif |
| 5968 #ifdef SIGFPE | 6090 #ifdef SIGFPE |
| 5969 handle_signal ("SIGFPE", SIGFPE); | 6091 handle_signal ("FPE", SIGFPE); |
| 5970 #endif | 6092 #endif |
| 5971 #ifdef SIGBUS | 6093 #ifdef SIGBUS |
| 5972 handle_signal ("SIGBUS", SIGBUS); | 6094 handle_signal ("BUS", SIGBUS); |
| 5973 #endif | 6095 #endif |
| 5974 #ifdef SIGSEGV | 6096 #ifdef SIGSEGV |
| 5975 handle_signal ("SIGSEGV", SIGSEGV); | 6097 handle_signal ("SEGV", SIGSEGV); |
| 5976 #endif | 6098 #endif |
| 5977 #ifdef SIGSYS | 6099 #ifdef SIGSYS |
| 5978 handle_signal ("SIGSYS", SIGSYS); | 6100 handle_signal ("SYS", SIGSYS); |
| 5979 #endif | 6101 #endif |
| 5980 #ifdef SIGPIPE | 6102 #ifdef SIGPIPE |
| 5981 handle_signal ("SIGPIPE", SIGPIPE); | 6103 handle_signal ("PIPE", SIGPIPE); |
| 5982 #endif | 6104 #endif |
| 5983 #ifdef SIGALRM | 6105 #ifdef SIGALRM |
| 5984 handle_signal ("SIGALRM", SIGALRM); | 6106 handle_signal ("ALRM", SIGALRM); |
| 5985 #endif | 6107 #endif |
| 5986 #ifdef SIGTERM | 6108 #ifdef SIGTERM |
| 5987 handle_signal ("SIGTERM", SIGTERM); | 6109 handle_signal ("TERM", SIGTERM); |
| 5988 #endif | 6110 #endif |
| 5989 #ifdef SIGURG | 6111 #ifdef SIGURG |
| 5990 handle_signal ("SIGURG", SIGURG); | 6112 handle_signal ("URG", SIGURG); |
| 5991 #endif | 6113 #endif |
| 5992 #ifdef SIGSTOP | 6114 #ifdef SIGSTOP |
| 5993 handle_signal ("SIGSTOP", SIGSTOP); | 6115 handle_signal ("STOP", SIGSTOP); |
| 5994 #endif | 6116 #endif |
| 5995 #ifdef SIGTSTP | 6117 #ifdef SIGTSTP |
| 5996 handle_signal ("SIGTSTP", SIGTSTP); | 6118 handle_signal ("TSTP", SIGTSTP); |
| 5997 #endif | 6119 #endif |
| 5998 #ifdef SIGCONT | 6120 #ifdef SIGCONT |
| 5999 handle_signal ("SIGCONT", SIGCONT); | 6121 handle_signal ("CONT", SIGCONT); |
| 6000 #endif | 6122 #endif |
| 6001 #ifdef SIGCHLD | 6123 #ifdef SIGCHLD |
| 6002 handle_signal ("SIGCHLD", SIGCHLD); | 6124 handle_signal ("CHLD", SIGCHLD); |
| 6003 #endif | 6125 #endif |
| 6004 #ifdef SIGTTIN | 6126 #ifdef SIGTTIN |
| 6005 handle_signal ("SIGTTIN", SIGTTIN); | 6127 handle_signal ("TTIN", SIGTTIN); |
| 6006 #endif | 6128 #endif |
| 6007 #ifdef SIGTTOU | 6129 #ifdef SIGTTOU |
| 6008 handle_signal ("SIGTTOU", SIGTTOU); | 6130 handle_signal ("TTOU", SIGTTOU); |
| 6009 #endif | 6131 #endif |
| 6010 #ifdef SIGIO | 6132 #ifdef SIGIO |
| 6011 handle_signal ("SIGIO", SIGIO); | 6133 handle_signal ("IO", SIGIO); |
| 6012 #endif | 6134 #endif |
| 6013 #ifdef SIGXCPU | 6135 #ifdef SIGXCPU |
| 6014 handle_signal ("SIGXCPU", SIGXCPU); | 6136 handle_signal ("XCPU", SIGXCPU); |
| 6015 #endif | 6137 #endif |
| 6016 #ifdef SIGXFSZ | 6138 #ifdef SIGXFSZ |
| 6017 handle_signal ("SIGXFSZ", SIGXFSZ); | 6139 handle_signal ("XFSZ", SIGXFSZ); |
| 6018 #endif | 6140 #endif |
| 6019 #ifdef SIGVTALRM | 6141 #ifdef SIGVTALRM |
| 6020 handle_signal ("SIGVTALRM", SIGVTALRM); | 6142 handle_signal ("VTALRM", SIGVTALRM); |
| 6021 #endif | 6143 #endif |
| 6022 #ifdef SIGPROF | 6144 #ifdef SIGPROF |
| 6023 handle_signal ("SIGPROF", SIGPROF); | 6145 handle_signal ("PROF", SIGPROF); |
| 6024 #endif | 6146 #endif |
| 6025 #ifdef SIGWINCH | 6147 #ifdef SIGWINCH |
| 6026 handle_signal ("SIGWINCH", SIGWINCH); | 6148 handle_signal ("WINCH", SIGWINCH); |
| 6027 #endif | 6149 #endif |
| 6028 #ifdef SIGINFO | 6150 #ifdef SIGINFO |
| 6029 handle_signal ("SIGINFO", SIGINFO); | 6151 handle_signal ("INFO", SIGINFO); |
| 6030 #endif | 6152 #endif |
| 6031 #ifdef SIGUSR1 | 6153 #ifdef SIGUSR1 |
| 6032 handle_signal ("SIGUSR1", SIGUSR1); | 6154 handle_signal ("USR1", SIGUSR1); |
| 6033 #endif | 6155 #endif |
| 6034 #ifdef SIGUSR2 | 6156 #ifdef SIGUSR2 |
| 6035 handle_signal ("SIGUSR2", SIGUSR2); | 6157 handle_signal ("USR2", SIGUSR2); |
| 6036 #endif | 6158 #endif |
| 6037 else | 6159 else |
| 6038 error ("Undefined signal name %s", name); | 6160 error ("Undefined signal name %s", name); |
| 6039 } | 6161 } |
| 6040 | 6162 |
| 6717 ADD_SUBFEATURE (QCtype, Qdatagram); | 6839 ADD_SUBFEATURE (QCtype, Qdatagram); |
| 6718 #endif | 6840 #endif |
| 6719 #ifdef HAVE_LOCAL_SOCKETS | 6841 #ifdef HAVE_LOCAL_SOCKETS |
| 6720 ADD_SUBFEATURE (QCfamily, Qlocal); | 6842 ADD_SUBFEATURE (QCfamily, Qlocal); |
| 6721 #endif | 6843 #endif |
| 6844 ADD_SUBFEATURE (QCfamily, Qipv4); | |
| 6845 #ifdef AF_INET6 | |
| 6846 ADD_SUBFEATURE (QCfamily, Qipv6); | |
| 6847 #endif | |
| 6722 #ifdef HAVE_GETSOCKNAME | 6848 #ifdef HAVE_GETSOCKNAME |
| 6723 ADD_SUBFEATURE (QCservice, Qt); | 6849 ADD_SUBFEATURE (QCservice, Qt); |
| 6724 #endif | 6850 #endif |
| 6725 #if !defined(TERM) && (defined(O_NONBLOCK) || defined(O_NDELAY)) | 6851 #if !defined(TERM) && (defined(O_NONBLOCK) || defined(O_NDELAY)) |
| 6726 ADD_SUBFEATURE (QCserver, Qt); | 6852 ADD_SUBFEATURE (QCserver, Qt); |
| 6775 staticpro (&Qfailed); | 6901 staticpro (&Qfailed); |
| 6776 Qlisten = intern ("listen"); | 6902 Qlisten = intern ("listen"); |
| 6777 staticpro (&Qlisten); | 6903 staticpro (&Qlisten); |
| 6778 Qlocal = intern ("local"); | 6904 Qlocal = intern ("local"); |
| 6779 staticpro (&Qlocal); | 6905 staticpro (&Qlocal); |
| 6906 Qipv4 = intern ("ipv4"); | |
| 6907 staticpro (&Qipv4); | |
| 6908 #ifdef AF_INET6 | |
| 6909 Qipv6 = intern ("ipv6"); | |
| 6910 staticpro (&Qipv6); | |
| 6911 #endif | |
| 6780 Qdatagram = intern ("datagram"); | 6912 Qdatagram = intern ("datagram"); |
| 6781 staticpro (&Qdatagram); | 6913 staticpro (&Qdatagram); |
| 6782 | 6914 |
| 6783 QCname = intern (":name"); | 6915 QCname = intern (":name"); |
| 6784 staticpro (&QCname); | 6916 staticpro (&QCname); |
