Mercurial > emacs
comparison src/process.c @ 68146:e5c85a134e67
[HAVE_INTTYPES_H]: Include inttypes.h.
(ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE).
(Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK
macro. Also try member ifr_addr when getting netmask.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Thu, 12 Jan 2006 08:15:50 +0000 |
parents | b7409cbd6d99 |
children | 3bd95f4f2941 de425e4eb0bc 7beb78bc1f8e |
comparison
equal
deleted
inserted
replaced
68145:d88b44855af3 | 68146:e5c85a134e67 |
---|---|
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) |
3594 { IFF_AUTOMEDIA, "automedia" }, | 3597 { IFF_AUTOMEDIA, "automedia" }, |
3595 #endif | 3598 #endif |
3596 #ifdef IFF_DYNAMIC | 3599 #ifdef IFF_DYNAMIC |
3597 { IFF_DYNAMIC, "dynamic" }, | 3600 { IFF_DYNAMIC, "dynamic" }, |
3598 #endif | 3601 #endif |
3599 #ifdef IFF_OACTIV | 3602 #ifdef IFF_OACTIVE |
3600 { IFF_OACTIV, "oactiv" }, /* OpenBSD: transmission in progress */ | 3603 { IFF_OACTIVE, "oactive" }, /* OpenBSD: transmission in progress */ |
3601 #endif | 3604 #endif |
3602 #ifdef IFF_SIMPLEX | 3605 #ifdef IFF_SIMPLEX |
3603 { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */ | 3606 { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */ |
3604 #endif | 3607 #endif |
3605 #ifdef IFF_LINK0 | 3608 #ifdef IFF_LINK0 |
3681 } | 3684 } |
3682 #endif | 3685 #endif |
3683 res = Fcons (elt, res); | 3686 res = Fcons (elt, res); |
3684 | 3687 |
3685 elt = Qnil; | 3688 elt = Qnil; |
3686 #if defined(SIOCGIFNETMASK) && defined(ifr_netmask) | 3689 #if defined(SIOCGIFNETMASK) && (defined(HAVE_STRUCT_IFREQ_IFR_NETMASK) || defined(HAVE_STRUCT_IFREQ_IFR_ADDR)) |
3687 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) | 3690 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) |
3688 { | 3691 { |
3689 any++; | 3692 any++; |
3693 #ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK | |
3690 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); | 3694 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); |
3695 #else | |
3696 elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr)); | |
3697 #endif | |
3691 } | 3698 } |
3692 #endif | 3699 #endif |
3693 res = Fcons (elt, res); | 3700 res = Fcons (elt, res); |
3694 | 3701 |
3695 elt = Qnil; | 3702 elt = Qnil; |