From 1fb05e3db1891142410bc58c320dfe281749fffe Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 19 Feb 1997 04:43:53 +0000 Subject: update from main archive 970218 1997-02-19 03:28 Miles Bader * argp/argp-help.c: Add support for user provided filter of help messages. * argp/argp-parse.c: Likewise. * argp/argp.h: Likewise. * argp/argp-namefrob.h: Define __argp_input. * argp/argp-test.c: Add example for filter. 1997-02-19 02:58 Ulrich Drepper * argp.h: New file. * locale/programs/locale.c: Switch to use argp. * errno.h: Make it possible to get definition of error_t even after having errno.h already. * elf/dl-hash.h: New file. ELF hashing function. Extracted from dl-lookup.c. * elf/dl-lookup.c (_dl_elf_hash): Remove definition. * elf/dl-load.c: Rename _dl_does_name_match_p to _dl_name_match_p. * elf/dl-version.c: Likewise. * elf/dl-lookup.c: Implement new versioning lookup scheme. * elf/dl-version.c (_dl_check_map_versions): Initialize new field in l_versions member. * elf/dlvsym.c: Correct call of _dl_lookup_versioned_symbol_skip and _dl_lookup_versioned_symbol. * elf/link.h: Rename hash_name_pair to struct r_found_version. * sysdeps/alpha/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/mips/dl-machine.h: Likewise. * intl/l10nflist.c: (_nl_make_l10nflist): Fix bug in computation of length of abs_filename. * locale/Makefile (CPPFLAGS): Define LOCALE_ALIAS_PATH. * locale/programs/ld-monetary.c (monetary_add): Allow value 0 in mon_grouping information. This means no more grouping. * locale/programs/ld-numeric.c (numeric_add): Write value \377 when seein value 0 in grouping information. * locale/programs/linereader.c (lr_close): Don't free fname since it might be used in error messages. * locale/programs/locale.c: Check whether output of `locale -a' really is locale directory. Also print locale aliases. * misc/search.h (__action_fn_t): Parameters VALUE and LEVEL cannot be const. 1997-02-19 02:16 Ulrich Drepper * sysdeps/unix/bsd/sun/sunos4/resourcebits.h: Correct #defin to #define. Reported by Rick Flower . 1997-02-19 01:37 Erik Troan * shadow/sgetspent_r.c: Accept empty third, fourth and fifth fields. 1997-02-19 01:02 Ulrich Drepper * sysdeps/unix/mman/syscalls.list: msync takes 3 arguments. Reported by Andreas Jaeger . * sysdeps/stub/msync.c (msync): Add missing third parameter. 1997-02-19 00:29 Ulrich Drepper * sysdeps/unix/bsd/sigsuspend.c: Call __sigpause with needed additional argument. 1997-02-18 22:13 Ulrich Drepper * inet/net/ethernet.h: New file. * sysdeps/unix/sysv/linux/netinet/if_ether.c: Add BSD compatibility. * sysdeps/unix/sysv/linux/net/if_slip.h: New file. Contributed by a sun . * sysdeps/unix/sysv/linux/net/if_arp.h: Include . * sunrpc/rpc/rpc_msg.h: Include . Reported by a sun . 1997-02-16 14:25 Andreas Schwab * Makerules ((common-objpfx)distinfo-$(subdir)): Depend on sysdep makefiles which may change the distinfo variables. 1997-02-16 14:03 Andreas Schwab * sysdeps/unix/sysv/linux/Makefile (sysdep_headers) [$(subdir)=misc]: Add sys/quota.h. (sysdep_headers) [$(subdir)=inet]: Add netinet/udp.h. 1997-02-17 13:12 aleph1@dfw.net * sunrpc/clnt_simp.c (callrpc): Prevent buffer overflow by using strncpy. 1997-02-18 03:28 Ulrich Drepper * stdio-common/bug10.c (main): Correct parameter. 1997-02-17 02:51 Ulrich Drepper * malloc/obstack.h: Add `extern "C"' protection. * posix/regex.h: Likewise. * io/ftw.h: Likewise. * misc/libgen.h: Likewise. * login/utmp.h: Likewise. * sysdeps/unix/sysv/linux/sys/reboot.h: Likewise. * sysdeps/unix/sysv/linux/netinet/in.h: Likewise. * sunrpc/rpc/pmap_rmt.h: Likewise. * sunrpc/rpc/auth_des.h: Likewise. * elf/link.h: Likewise. Reported by HJ Lu. 1997-02-17 01:45 a sun Linux specific network headers. * sysdeps/unix/sysv/linux/netinet/if_fddi.h: New file. * sysdeps/unix/sysv/linux/netinet/if_tr.h: New file. * sysdeps/unix/sysv/linux/netinet/ip_icmp.h: New file. * sysdeps/unix/sysv/linux/netinet/ip_fw.h: New file. * sysdeps/unix/sysv/linux/netinet/igmp.h: New file. * sysdeps/unix/sysv/linux/netinet/icmp.h: New file. * sysdeps/unix/sysv/linux/netinet/ip.h: New file. * sysdeps/unix/sysv/linux/netinet/tcp.h: New file. * sysdeps/unix/sysv/linux/netipx/ipx.h: New file. * sysdeps/unix/sysv/linux/netatalk/atalk.h: New file. * sysdeps/unix/sysv/linux/Dist: Add new network headers. * sysdeps/unix/sysv/linux/Makefile [$(subdir)=misc] (sysdep_headers): Add sys/quota.h. [$(subdir)=inet] (sysdep_headers): Add new network header. * sysdeps/unix/sysv/linux/netinet/udp.h: Add Linux specific changes. * inet/netinet/ip.h: Move to sysdeps/generic. * inet/netinet/tcp.h: Likewise. * sysdeps/generic/netinet/ip.h: Moved to here from inet/netinet. * sysdeps/generic/netinet/tcp.h: Likewise. 1997-02-17 01:18 Ulrich Drepper * misc/sys/syslog.h (prioritynames): Correct definition to use braces where necessary. (facilitynames): Likewise. Patch by Ronald F. Guilmette . Comment and beautify declarations. 1997-02-16 19:54 1997 Philip Blundell * inet/Makefile (routines): Add in6_addr, getnameinfo. * inet/getnameinfo.c: New file. Implementation of getnameinfo() by Craig Metz. * inet/in6_addr.c: New file. IPv6 addressing constants. * posix/Makefile (routines): Add gai_strerror. * resolv/netdb.h: Add more constants for IPv6 basic API. * sysdeps/posix/gai_strerror.c: New file. * sysdeps/stub/gai_strerror.c New file. * sysdeps/unix/sysv/linux/netinet/in.h: Add definitions for IPv6 basic API. * sysdeps/posix/getaddrinfo.c: Update from latest version by Craig Metz and use reentrant getXXbyYY functions. 1997-02-15 14:32 Andreas Jaeger * argp/argp.h: Declare argp_program_version as const char. * argp/argp-test.c: Likewise * stdlib/testrand.c (main): Declare main prototype. * stdlib/testdiv.c (main): Likewise. * string/testcopy.c (main): Likewise. * string/test-ffs.c (main): Likewise. * time/test_time.c (main): Likewise. * locale/duplocale.c (__duplocale): Return result. 1997-02-16 03:54 Ulrich Drepper * sysdeps/unix/sysv/linux/netinet/in.h: Declare bindresvport. Reported by fabsoft@fabserver1.zarm.uni-bremen.de. * nss/nss.h: Remove declaration of __nss_shlib_revision. * nss/nsswitch.c: Don't use NSS_SHLIB_VERSION macro. 1997-02-16 03:48 Thorsten Kukuk * nis/nss_nis/nis-ethers.c (_nss_nis_getethernam_r): Rename to _nss_nis_gethostton_r. (_nss_nis_getetherbyaddr_r): Rename to _nss_nis_getntohost_r. 1997-02-15 22:37 Andy Berkheimer * resolv/gethnamaddr.c (gethostbyname2): Test for ':' in name before trying to resolv name as numeric IPv6 address. * nss/digits_dots.c: Likewise. Sat Feb 15 04:51:08 1997 Ulrich Drepper * locale/setlocale.c (setlocale): Don't try to be clever about unused locales. When the existence of the locale files isn't tested the result of setlocale might be different. 1997-02-15 03:34 Ulrich Drepper * locale/setlocale.c (setlocale): Don't increment usage_count of new locale if it already has the value MAX_USAGE_COUNT (it might be the C locale data which is read-only). --- sysdeps/alpha/dl-machine.h | 2 +- sysdeps/generic/netinet/ip.h | 172 +++++++++++++++++ sysdeps/generic/netinet/tcp.h | 112 +++++++++++ sysdeps/i386/dl-machine.h | 2 +- sysdeps/m68k/dl-machine.h | 2 +- sysdeps/mips/dl-machine.h | 2 +- sysdeps/posix/gai_strerror.c | 52 ++++++ sysdeps/posix/getaddrinfo.c | 289 +++++++++++++++++++++++------ sysdeps/stub/gai_strerror.c | 28 +++ sysdeps/stub/msync.c | 30 +-- sysdeps/unix/bsd/sigsuspend.c | 30 +-- sysdeps/unix/bsd/sun/sunos4/resourcebits.h | 6 +- sysdeps/unix/mman/syscalls.list | 2 +- sysdeps/unix/sysv/linux/Dist | 8 + sysdeps/unix/sysv/linux/Makefile | 7 +- sysdeps/unix/sysv/linux/net/if_arp.h | 1 + sysdeps/unix/sysv/linux/net/if_slip.h | 6 + sysdeps/unix/sysv/linux/netatalk/atalk.h | 27 +++ sysdeps/unix/sysv/linux/netinet/icmp.h | 25 +++ sysdeps/unix/sysv/linux/netinet/if_ether.h | 112 +++++++++-- sysdeps/unix/sysv/linux/netinet/if_fddi.h | 37 ++++ sysdeps/unix/sysv/linux/netinet/if_tr.h | 41 ++++ sysdeps/unix/sysv/linux/netinet/igmp.h | 93 ++++++++++ sysdeps/unix/sysv/linux/netinet/in.h | 100 ++++++++++ sysdeps/unix/sysv/linux/netinet/ip.h | 254 +++++++++++++++++++++++++ sysdeps/unix/sysv/linux/netinet/ip_fw.h | 187 +++++++++++++++++++ sysdeps/unix/sysv/linux/netinet/ip_icmp.h | 210 +++++++++++++++++++++ sysdeps/unix/sysv/linux/netinet/tcp.h | 162 ++++++++++++++++ sysdeps/unix/sysv/linux/netinet/udp.h | 46 +++-- sysdeps/unix/sysv/linux/netipx/ipx.h | 28 +++ sysdeps/unix/sysv/linux/sys/reboot.h | 5 +- 31 files changed, 1949 insertions(+), 129 deletions(-) create mode 100644 sysdeps/generic/netinet/ip.h create mode 100644 sysdeps/generic/netinet/tcp.h create mode 100644 sysdeps/posix/gai_strerror.c create mode 100644 sysdeps/stub/gai_strerror.c create mode 100644 sysdeps/unix/sysv/linux/net/if_slip.h create mode 100644 sysdeps/unix/sysv/linux/netatalk/atalk.h create mode 100644 sysdeps/unix/sysv/linux/netinet/icmp.h create mode 100644 sysdeps/unix/sysv/linux/netinet/if_fddi.h create mode 100644 sysdeps/unix/sysv/linux/netinet/if_tr.h create mode 100644 sysdeps/unix/sysv/linux/netinet/igmp.h create mode 100644 sysdeps/unix/sysv/linux/netinet/ip.h create mode 100644 sysdeps/unix/sysv/linux/netinet/ip_fw.h create mode 100644 sysdeps/unix/sysv/linux/netinet/ip_icmp.h create mode 100644 sysdeps/unix/sysv/linux/netinet/tcp.h create mode 100644 sysdeps/unix/sysv/linux/netipx/ipx.h (limited to 'sysdeps') diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 316f717e01..fc9f9712cb 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -325,7 +325,7 @@ static inline void elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, - const hash_name_pair *version) + const struct r_found_version *version) { Elf64_Addr * const reloc_addr = (void *)(map->l_addr + reloc->r_offset); unsigned long const r_info = ELF64_R_TYPE (reloc->r_info); diff --git a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h new file mode 100644 index 0000000000..a119c629f7 --- /dev/null +++ b/sysdeps/generic/netinet/ip.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_IP_H +#define _NETINET_IP_H + +#include +#include +#include + +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ +#define IPVERSION 4 + +/* + * Structure of an internet header, naked of options. + */ +struct ip { +#if __BYTE_ORDER == __LITTLE_ENDIAN + __u_char ip_hl:4, /* header length */ + ip_v:4; /* version */ +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + __u_char ip_v:4, /* version */ + ip_hl:4; /* header length */ +#endif + __u_char ip_tos; /* type of service */ + __u_short ip_len; /* total length */ + __u_short ip_id; /* identification */ + __u_short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + __u_char ip_ttl; /* time to live */ + __u_char ip_p; /* protocol */ + __u_short ip_sum; /* checksum */ + struct in_addr ip_src, ip_dst; /* source and dest address */ +}; + +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for IP type of service (ip_tos) + */ +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#define IPTOS_LOWCOST 0x02 +#define IPTOS_MINCOST IPTOS_LOWCOST + +/* + * Definitions for IP precedence (also in ip_tos) (hopefully unused) + */ +#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_INTERNETCONTROL 0xc0 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 + +/* + * Definitions for options. + */ +#define IPOPT_COPIED(o) ((o)&0x80) +#define IPOPT_CLASS(o) ((o)&0x60) +#define IPOPT_NUMBER(o) ((o)&0x1f) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_NOP 1 /* no operation */ + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SSRR 137 /* strict source route */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +#define MAX_IPOPTLEN 40 + +/* + * Time stamp option structure. + */ +struct ip_timestamp { + __u_char ipt_code; /* IPOPT_TS */ + __u_char ipt_len; /* size of structure (variable) */ + __u_char ipt_ptr; /* index of current entry */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + __u_char ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + __u_char ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#endif + __u_long data[9]; +}; + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ + +#define IP_MSS 576 /* default maximum segment size */ + +#endif /* netinet/ip.h. */ diff --git a/sysdeps/generic/netinet/tcp.h b/sysdeps/generic/netinet/tcp.h new file mode 100644 index 0000000000..e5011b053c --- /dev/null +++ b/sysdeps/generic/netinet/tcp.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_TCP_H + +#define _NETINET_TCP_H 1 +#include + + +__BEGIN_DECLS + +typedef unsigned int tcp_seq; +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +struct tcphdr { + u_short th_sport; /* source port */ + u_short th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + u_char th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +#endif +#if __BYTE_ORDER == __BIG_ENDIAN + u_char th_off:4, /* data offset */ + th_x2:4; /* (unused) */ +#endif + u_char th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 + u_short th_win; /* window */ + u_short th_sum; /* checksum */ + u_short th_urp; /* urgent pointer */ +}; + +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 /* Experimental */ +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ + +#define TCPOPT_TSTAMP_HDR \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + +/* + * Default maximum segment size for TCP. + * With an IP MSS of 576, this is 536, + * but 512 is probably more convenient. + * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). + */ +#define TCP_MSS 512 + +#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ + +#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ + +/* + * User-settable options (used with setsockopt). + */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_MAXSEG 0x02 /* set maximum segment size */ + +#define SOL_TCP 6 /* TCP level */ + +__END_DECLS + +#endif /* netinet/tcp.h */ diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 570e0d9066..90ec6ce9f9 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -204,7 +204,7 @@ _dl_start_user:\n\ static inline void elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, - const Elf32_Sym *sym, const hash_name_pair *version) + const Elf32_Sym *sym, const struct r_found_version *version) { Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset); Elf32_Addr loadbase; diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index 95a8342574..0c9b6acb6d 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -200,7 +200,7 @@ _dl_start_user: static inline void elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, - const Elf32_Sym *sym, const hash_name_pair *version) + const Elf32_Sym *sym, const struct r_found_version *version) { Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset); Elf32_Addr loadbase; diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index a4a02bfd97..39a1cc8be6 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -423,7 +423,7 @@ _dl_start_user:\n\ static inline void elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, - const ElfW(Sym) *sym, const hash_name_pair *version) + const ElfW(Sym) *sym, const struct r_found_version *version) { ElfW(Addr) *const reloc_addr = (void *) (map->l_addr + reloc->r_offset); ElfW(Addr) loadbase, undo; diff --git a/sysdeps/posix/gai_strerror.c b/sysdeps/posix/gai_strerror.c new file mode 100644 index 0000000000..b89a1f6889 --- /dev/null +++ b/sysdeps/posix/gai_strerror.c @@ -0,0 +1,52 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +static struct + { + int code; + const char *msg; + } +values[] = + { + { EAI_ADDRFAMILY, N_("Address family for hostname not supported") }, + { EAI_AGAIN, N_("Temporary failure in name resolution") }, + { EAI_BADFLAGS, N_("Bad value for ai_flags") }, + { EAI_FAIL, N_("Non-recoverable failure in name resolution") }, + { EAI_FAMILY, N_("ai_family not supported") }, + { EAI_MEMORY, N_("Memory allocation failure") }, + { EAI_NODATA, N_("No address associated with hostname") }, + { EAI_NONAME, N_("Name or service not known") }, + { EAI_SERVICE, N_("Servname not supported for ai_socktype") }, + { EAI_SOCKTYPE, N_("ai_socktype not supported") }, + { EAI_SYSTEM, N_("System error") } + }; + +char * +gai_strerror (int code) +{ + int i; + for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i) + if (values[i].code == code) + return (char *) values[i].msg; + + return (char *) _("Unknown error"); +} diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 90af24fb61..042e0a5ef8 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -42,21 +42,43 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ +/* getaddrinfo() v1.13 */ + +/* To do what POSIX says, even when it's broken: */ +/* #define BROKEN_LIKE_POSIX 1 */ +#define LOCAL 1 +#define INET6 1 +#define HOSTTABLE 0 +#define RESOLVER 1 + #include -#include #include +#include +#include +#if LOCAL +#include +#include +#include +#include +#endif /* LOCAL */ #include -#ifdef INET6 -#include -#endif /* INET6 */ #include -#include -#include +#include + +#ifndef AF_LOCAL +#define AF_LOCAL AF_UNIX +#endif /* AF_LOCAL */ +#ifndef PF_LOCAL +#define PF_LOCAL PF_UNIX +#endif /* PF_LOCAL */ +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 108 +#endif /* UNIX_PATH_MAX */ #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) -#ifdef HOSTTABLE +#if HOSTTABLE struct hostent *_hostname2addr_hosts(const char *name, int); struct hostent *_addr2hostname_hosts(const char *name, int, int); #endif /* HOSTTABLE */ @@ -66,7 +88,7 @@ static struct addrinfo nullreq = struct gaih_service { char *name; - unsigned long num; + int num; }; struct gaih_servtuple { @@ -86,18 +108,69 @@ struct gaih_addrtuple { char addr[16]; }; -static struct gaih_addrtuple nulladdr; - struct gaih_typeproto { int socktype; int protocol; - const char *name; + char *name; }; +#if LOCAL +static int gaih_local(const char *name, const struct gaih_service *service, + const struct addrinfo *req, struct addrinfo **pai) +{ + struct utsname utsname; + + if (name || (req->ai_flags & AI_CANONNAME)) + if (uname(&utsname)) + return -EAI_SYSTEM; + if (name) { + if (strcmp(name, "localhost") && strcmp(name, "local") && strcmp(name, "unix") && strcmp(name, utsname.nodename)) + return (GAIH_OKIFUNSPEC | -EAI_NONAME); + }; + + if (!(*pai = malloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) ? (strlen(utsname.nodename) + 1): 0)))) + return -EAI_MEMORY; + + (*pai)->ai_next = NULL; + (*pai)->ai_flags = req->ai_flags; + (*pai)->ai_family = AF_LOCAL; + (*pai)->ai_socktype = req->ai_socktype ? req->ai_socktype : SOCK_STREAM; + (*pai)->ai_protocol = req->ai_protocol; + (*pai)->ai_addrlen = sizeof(struct sockaddr_un); + (*pai)->ai_addr = (void *)(*pai) + sizeof(struct addrinfo); +#if SALEN + ((struct sockaddr_un *)(*pai)->ai_addr)->sun_len = sizeof(struct sockaddr_un); +#endif /* SALEN */ + ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL; + memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); + if (service) { + char *c; + if (c = strchr(service->name, '/')) { + if (strlen(service->name) >= sizeof(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path)) + return (GAIH_OKIFUNSPEC | -EAI_SERVICE); + strcpy(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, service->name); + } else { + if (strlen(P_tmpdir "/") + 1 + strlen(service->name) >= sizeof(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path)) + return (GAIH_OKIFUNSPEC | -EAI_SERVICE); + strcpy(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, P_tmpdir "/"); + strcat(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, service->name); + }; + } else { + if (!tmpnam(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path)) + return -EAI_SYSTEM; + }; + if (req->ai_flags & AI_CANONNAME) + strcpy((*pai)->ai_canonname = (char *)(*pai) + sizeof(struct addrinfo) + sizeof(struct sockaddr_un), utsname.nodename); + else + (*pai)->ai_canonname = NULL; + return 0; +}; +#endif /* LOCAL */ + static struct gaih_typeproto gaih_inet_typeproto[] = { { 0, 0, NULL }, - { SOCK_STREAM, IPPROTO_TCP, "tcp" }, - { SOCK_DGRAM, IPPROTO_UDP, "udp" }, + { SOCK_STREAM, IPPROTO_TCP, (char *)"tcp" }, + { SOCK_DGRAM, IPPROTO_UDP, (char *)"udp" }, { 0, 0, NULL } }; @@ -124,12 +197,12 @@ static int gaih_inet(const char *name, const struct gaih_service *service, { struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = &nullserv; - struct gaih_addrtuple *at = &nulladdr; + struct gaih_addrtuple *at = NULL; int i; if (req->ai_protocol || req->ai_socktype) { for (tp++; tp->name && - ((req->ai_socktype != tp->socktype) || !req->ai_socktype) && + ((req->ai_socktype != tp->socktype) || !req->ai_socktype) && ((req->ai_protocol != tp->protocol) || !req->ai_protocol); tp++); if (!tp->name) if (req->ai_socktype) @@ -139,7 +212,7 @@ static int gaih_inet(const char *name, const struct gaih_service *service, } if (service) { - if (service->name) { + if (service->num < 0) { if (tp->name) { if (i = gaih_inet_serv(service->name, tp, &st)) return i; @@ -182,18 +255,18 @@ static int gaih_inet(const char *name, const struct gaih_service *service, if (inet_pton(AF_INET, name, at->addr) > 0) at->family = AF_INET; -#ifdef INET6 +#if INET6 if (!at->family && (!req->ai_family || (req->ai_family == AF_INET6))) if (inet_pton(AF_INET6, name, at->addr) > 0) at->family = AF_INET6; #endif /* INET6 */ -#ifdef HOSTTABLE +#if HOSTTABLE if (!at->family) { struct hostent *h; struct gaih_addrtuple **pat = &at; -#ifdef INET6 +#if INET6 if (!req->ai_family || (req->ai_family == AF_INET6)) if (h = _hostname2addr_hosts(name, AF_INET6)) { for (i = 0; h->h_addr_list[i]; i++) { @@ -229,14 +302,35 @@ static int gaih_inet(const char *name, const struct gaih_service *service, } #endif /* HOSTTABLE */ -#ifdef RESOLVER +#if RESOLVER if (!at->family) { struct hostent *h; struct gaih_addrtuple **pat = &at; -#ifdef INET6 - if (!req->ai_family || (req->ai_family == AF_INET6)) - if (h = gethostbyname2(name, AF_INET6)) { +#if INET6 + if (!req->ai_family || (req->ai_family == AF_INET6)) { + int herrno; + int tmpbuflen = 1024; + struct hostent th; + char *tmpbuf = __alloca(tmpbuflen); + while (__gethostbyname2_r(name, AF_INET6, &th, tmpbuf, tmpbuflen, + &h, &herrno)) { + if (herrno == NETDB_INTERNAL) { + if (errno == ERANGE) { + /* Need more buffer */ + tmpbuflen *= 2; + tmpbuf = __alloca(tmpbuflen); + } else { + /* Bail out */ + __set_h_errno(herrno); + i = -EAI_SYSTEM; + goto ret; + } + } else { + break; + } + } + if (h) { for (i = 0; h->h_addr_list[i]; i++) { if (!*pat) { if (!(*pat = malloc(sizeof(struct gaih_addrtuple)))) { @@ -250,10 +344,32 @@ static int gaih_inet(const char *name, const struct gaih_service *service, pat = &((*pat)->next); } } + } #endif /* INET6 */ - if (!req->ai_family || (req->ai_family == AF_INET)) - if (h = gethostbyname2(name, AF_INET)) { + if (!req->ai_family || (req->ai_family == AF_INET)) { + int herrno; + struct hostent th; + int tmpbuflen = 1024; + char *tmpbuf = __alloca(tmpbuflen); + while (__gethostbyname2_r(name, AF_INET, &th, tmpbuf, tmpbuflen, + &h, &herrno)) { + if (herrno == NETDB_INTERNAL) { + if (errno == ERANGE) { + /* Need more buffer */ + tmpbuflen *= 2; + tmpbuf = __alloca(tmpbuflen); + } else { + /* Bail out */ + __set_h_errno(herrno); + i = -EAI_SYSTEM; + goto ret; + } + } else { + break; + } + } + if (h) { for (i = 0; h->h_addr_list[i]; i++) { if (!*pat) { if (!(*pat = malloc(sizeof(struct gaih_addrtuple)))) { @@ -267,20 +383,39 @@ static int gaih_inet(const char *name, const struct gaih_service *service, pat = &((*pat)->next); } } + } } #endif /* RESOLVER */ if (!at->family) return (GAIH_OKIFUNSPEC | -EAI_NONAME); } else { - memset(&nulladdr, 0, sizeof(nulladdr)); -#ifdef INET6 - if (!req->ai_family || (req->ai_family == AF_INET6)) - nulladdr.family = AF_INET6; - else + if (!(at = malloc(sizeof(struct gaih_addrtuple)))) { + i = -EAI_MEMORY; + goto ret; + }; + + memset(at, 0, sizeof(struct gaih_addrtuple)); + +#if INET6 + if (!(at->next = malloc(sizeof(struct gaih_addrtuple)))) { + i = -EAI_MEMORY; + goto ret; + }; + + at->family = AF_INET6; + + memset(at->next, 0, sizeof(struct gaih_addrtuple)); + at->next->family = AF_INET; +#else /* INET6 */ + at->family = AF_INET; #endif /* INET6 */ - nulladdr.family = AF_INET; - } + }; + + if (!pai) { + i = 0; + goto ret; + }; { const char *c = NULL; @@ -288,7 +423,7 @@ static int gaih_inet(const char *name, const struct gaih_service *service, struct gaih_addrtuple *at2 = at; int j; #ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 128 +#define MAXHOSTNAMELEN 128 #endif /* MAXHOSTNAMELEN */ char buffer[MAXHOSTNAMELEN]; @@ -296,24 +431,44 @@ static int gaih_inet(const char *name, const struct gaih_service *service, if (req->ai_flags & AI_CANONNAME) { struct hostent *h = NULL; -#ifdef RESOLVER - h = gethostbyaddr(at2->addr, -#ifdef INET6 - (at2->family == AF_INET6) ? sizeof(struct in6_addr) : +#if RESOLVER + int herrno; + struct hostent th; + int tmpbuflen = 1024; + char *tmpbuf = __alloca(tmpbuflen); + while (__gethostbyaddr_r(at2->addr, +#if INET6 + (at2->family == AF_INET6) ? sizeof(struct in6_addr) : #endif /* INET6 */ - sizeof(struct in_addr), at2->family); + sizeof(struct in_addr), at2->family, + &th, tmpbuf, tmpbuflen, &h, &herrno)) { + if (herrno == NETDB_INTERNAL) { + if (errno == ERANGE) { + /* Need more buffer */ + tmpbuflen *= 2; + tmpbuf = __alloca(tmpbuflen); + } else { + /* Bail out */ + __set_h_errno(herrno); + i = -EAI_SYSTEM; + goto ret; + } + } else { + break; + } + } #endif /* RESOLVER */ -#ifdef HOSTTABLE +#if HOSTTABLE if (!h) h = _addr2hostname_hosts(at2->addr, -#ifdef INET6 - (at2->family == AF_INET6) ? sizeof(struct in6_addr) : +#if INET6 + (at2->family == AF_INET6) ? sizeof(struct in6_addr) : #endif /* INET6 */ sizeof(struct in_addr), at2->family); #endif /* HOSTTABLE */ if (!h) - c = inet_ntop(at2->family, at2->addr, buffer, sizeof(buffer)); + c = inet_ntop(at2->family, at2->addr, buffer, sizeof(buffer)); else c = h->h_name; @@ -326,7 +481,7 @@ static int gaih_inet(const char *name, const struct gaih_service *service, } else j = 0; -#ifdef INET6 +#if INET6 if (at2->family == AF_INET6) i = sizeof(struct sockaddr_in6); else @@ -351,7 +506,7 @@ static int gaih_inet(const char *name, const struct gaih_service *service, ((struct sockaddr_in *)(*pai)->ai_addr)->sin_family = at2->family; ((struct sockaddr_in *)(*pai)->ai_addr)->sin_port = st2->port; -#ifdef INET6 +#if INET6 if (at2->family == AF_INET6) { ((struct sockaddr_in6 *)(*pai)->ai_addr)->sin6_flowinfo = 0; memcpy(&((struct sockaddr_in6 *)(*pai)->ai_addr)->sin6_addr, at2->addr, sizeof(struct in6_addr)); @@ -361,7 +516,7 @@ static int gaih_inet(const char *name, const struct gaih_service *service, memcpy(&((struct sockaddr_in *)(*pai)->ai_addr)->sin_addr, at2->addr, sizeof(struct in_addr)); memset(((struct sockaddr_in *)(*pai)->ai_addr)->sin_zero, 0, sizeof(((struct sockaddr_in *)(*pai)->ai_addr)->sin_zero)); } - + if (c) { (*pai)->ai_canonname = (void *)(*pai) + sizeof(struct addrinfo) + i; strcpy((*pai)->ai_canonname, c); @@ -388,7 +543,7 @@ ret: st = st2; } } - if (at != &nulladdr) { + if (at) { struct gaih_addrtuple *at2 = at; while(at) { at2 = at->next; @@ -406,24 +561,34 @@ struct gaih { }; static struct gaih gaih[] = { -#ifdef INET6 +#if INET6 { PF_INET6, gaih_inet }, #endif /* INET6 */ { PF_INET, gaih_inet }, +#if LOCAL + { PF_LOCAL, gaih_local }, +#endif /* LOCAL */ { PF_UNSPEC, NULL } }; int getaddrinfo(const char *name, const char *service, const struct addrinfo *req, struct addrinfo **pai) { - int i = 0; - int j = 0; - struct addrinfo *p = NULL, **end = &p; + int i = 0, j = 0; + struct addrinfo *p = NULL, **end; struct gaih *g = gaih, *pg = NULL; struct gaih_service gaih_service, *pservice; + if (name && (name[0] == '*') && !name[1]) + name = NULL; + + if (service && (service[0] == '*') && !service[1]) + service = NULL; + +#if BROKEN_LIKE_POSIX if (!name && !service) return EAI_NONAME; +#endif /* BROKEN_LIKE_POSIX */ if (!req) req = &nullreq; @@ -437,26 +602,35 @@ int getaddrinfo(const char *name, const char *service, if (service && *service) { char *c; gaih_service.num = strtoul(gaih_service.name = (void *)service, &c, 10); - if (!*c) { - if (!req->ai_socktype) - return EAI_SERVICE; - gaih_service.name = NULL; + if (*c) { + gaih_service.num = -1; } +#if BROKEN_LIKE_POSIX + else + if (!req->ai_socktype) + return EAI_SERVICE; +#endif /* BROKEN_LIKE_POSIX */ pservice = &gaih_service; } else pservice = NULL; + if (pai) + end = &p; + else + end = NULL; + while(g->gaih) { if ((req->ai_family == g->family) || !req->ai_family) { j++; if (!((pg && (pg->gaih == g->gaih)))) { pg = g; - if ((i = g->gaih(name, pservice, req, end))) { + if (i = g->gaih(name, pservice, req, end)) { if (!req->ai_family && (i & GAIH_OKIFUNSPEC)) continue; goto gaih_err; } - while(*end) end = &((*end)->ai_next); + if (end) + while(*end) end = &((*end)->ai_next); } } g++; @@ -470,6 +644,9 @@ int getaddrinfo(const char *name, const char *service, return 0; } + if (!pai && !i) + return 0; + gaih_err: if (p) freeaddrinfo(p); diff --git a/sysdeps/stub/gai_strerror.c b/sysdeps/stub/gai_strerror.c new file mode 100644 index 0000000000..b63f0e2623 --- /dev/null +++ b/sysdeps/stub/gai_strerror.c @@ -0,0 +1,28 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +char * +gai_strerror (int code) +{ + static char buffer[128]; + snprintf (buffer, sizeof buffer, "Unknown error (%d)", code); + return buffer; +} diff --git a/sysdeps/stub/msync.c b/sysdeps/stub/msync.c index 21421b73f1..c8cbe430a5 100644 --- a/sysdeps/stub/msync.c +++ b/sysdeps/stub/msync.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ unpredictable before this is done. */ int -msync (caddr_t addr, size_t len) +msync (caddr_t addr, size_t len, int flags) { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/unix/bsd/sigsuspend.c b/sysdeps/unix/bsd/sigsuspend.c index 4c045aa663..d416a5f6c7 100644 --- a/sysdeps/unix/bsd/sigsuspend.c +++ b/sysdeps/unix/bsd/sigsuspend.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include @@ -42,5 +42,5 @@ sigsuspend (set) if (__sigismember (set, sig)) mask |= sigmask (sig); - return __sigpause (mask); + return __sigpause (mask, 0); } diff --git a/sysdeps/unix/bsd/sun/sunos4/resourcebits.h b/sysdeps/unix/bsd/sun/sunos4/resourcebits.h index d0d177c6ff..ff55773e69 100644 --- a/sysdeps/unix/bsd/sun/sunos4/resourcebits.h +++ b/sysdeps/unix/bsd/sun/sunos4/resourcebits.h @@ -1,5 +1,5 @@ /* Bit values for resource limits. SunOS 4 version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -49,8 +49,8 @@ enum __rlimit_resource /* Number of open files. */ RLIMIT_NOFILE, RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ -#defin RLIMIT_NOFILE RLIMIT_NOFILE -#defin RLIMIT_OFILE RLIMIT_OFILE +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE RLIMIT_OFILE RLIM_NLIMITS, diff --git a/sysdeps/unix/mman/syscalls.list b/sysdeps/unix/mman/syscalls.list index a5f44e465b..dc63d89d7d 100644 --- a/sysdeps/unix/mman/syscalls.list +++ b/sysdeps/unix/mman/syscalls.list @@ -3,5 +3,5 @@ madvise - madvise 3 madvise mmap - mmap 6 __mmap mmap mprotect - mprotect 3 __mprotect mprotect -msync - msync 2 __libc_msync msync +msync - msync 3 __libc_msync msync munmap - munmap 2 __munmap munmap diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist index 0660b247ef..0c5903dc89 100644 --- a/sysdeps/unix/sysv/linux/Dist +++ b/sysdeps/unix/sysv/linux/Dist @@ -11,8 +11,16 @@ net/if_ppp.h net/ppp-comp.h net/ppp_defs.h net/route.h +netatalk/atalk.h +netinet/icmp.h +netinet/if_fddi.h +netinet/if_tr.h +netinet/igmp.h netinet/in_systm.h +netinet/ip_fw.h +netinet/ip_icmp.h netinet/udp.h +netipx/ipx.h nfs/nfs.h sys/acct.h sys/debugreg.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index e02ee8cfe4..ad77f8872c 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -10,7 +10,8 @@ sysdep_routines += sysctl clone llseek sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \ sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \ sys/user.h syscall-list.h sys/sysmacros.h sys/procfs.h \ - sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h + sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \ + sys/quota.h # Generate the list of SYS_* macros for the system calls (__NR_* macros). $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h @@ -52,7 +53,9 @@ inhibit-siglist := yes endif ifeq ($(subdir),inet) -sysdep_headers += netinet/in_systm.h sys/socketvar.h +sysdep_headers += netinet/in_systm.h netinet/udp.h netinet/icmp.h \ + netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \ + netinet/ip_fw.h netinet/ip_icmp.h sys/socketvar.h endif # Don't compile the ctype glue code, since there is no old non-GNU C library. diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h index cf48f10f79..b1cd18360e 100644 --- a/sysdeps/unix/sysv/linux/net/if_arp.h +++ b/sysdeps/unix/sysv/linux/net/if_arp.h @@ -26,6 +26,7 @@ #include #include +#include __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/net/if_slip.h b/sysdeps/unix/sysv/linux/net/if_slip.h new file mode 100644 index 0000000000..2670427dbe --- /dev/null +++ b/sysdeps/unix/sysv/linux/net/if_slip.h @@ -0,0 +1,6 @@ +#ifndef __NET_SLIP_H +#define __NET_SLIP_H 1 + +#include + +#endif diff --git a/sysdeps/unix/sysv/linux/netatalk/atalk.h b/sysdeps/unix/sysv/linux/netatalk/atalk.h new file mode 100644 index 0000000000..be3a72d48f --- /dev/null +++ b/sysdeps/unix/sysv/linux/netatalk/atalk.h @@ -0,0 +1,27 @@ +/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef __NETATALK_ATALK_H +#define __NETATALK_ATALK_H 1 + +#include +#include + +#define SOL_ATALK 258 /* sockopt level for atalk */ + +#endif diff --git a/sysdeps/unix/sysv/linux/netinet/icmp.h b/sysdeps/unix/sysv/linux/netinet/icmp.h new file mode 100644 index 0000000000..f6b2d8ad94 --- /dev/null +++ b/sysdeps/unix/sysv/linux/netinet/icmp.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NETINET_ICMP_H +#define _NETINET_ICMP_H 1 + +#include +#include + +#endif /* netinet/icmp.h */ diff --git a/sysdeps/unix/sysv/linux/netinet/if_ether.h b/sysdeps/unix/sysv/linux/netinet/if_ether.h index 0da5a5aea9..7194490f53 100644 --- a/sysdeps/unix/sysv/linux/netinet/if_ether.h +++ b/sysdeps/unix/sysv/linux/netinet/if_ether.h @@ -1,35 +1,109 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef __NETINET_IF_ETHER_H #define __NETINET_IF_ETHER_H 1 #include +#include /* Get definitions from kernel header file. */ #include +#ifdef __USE_BSD +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 + * $FreeBSD$ + */ -/* This is a name for the 48 bit ethernet address available on many - systems. */ -struct ether_addr -{ - unsigned char ether_addr_octet[ETH_ALEN]; +#include +#include + +__BEGIN_DECLS +/* + * Ethernet Address Resolution Protocol. + * + * See RFC 826 for protocol description. Structure below is adapted + * to resolving internet addresses. Field names used correspond to + * RFC 826. + */ +struct ether_arp { + struct arphdr ea_hdr; /* fixed-size header */ + u_int8_t arp_sha[ETH_ALEN]; /* sender hardware address */ + u_int8_t arp_spa[4]; /* sender protocol address */ + u_int8_t arp_tha[ETH_ALEN]; /* target hardware address */ + u_int8_t arp_tpa[4]; /* target protocol address */ }; +#define arp_hrd ea_hdr.ar_hrd +#define arp_pro ea_hdr.ar_pro +#define arp_hln ea_hdr.ar_hln +#define arp_pln ea_hdr.ar_pln +#define arp_op ea_hdr.ar_op + +/* + * Macro to map an IP multicast address to an Ethernet multicast address. + * The high-order 25 bits of the Ethernet address are statically assigned, + * and the low-order 23 bits are taken from the low end of the IP address. + */ +#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \ + /* struct in_addr *ipaddr; */ \ + /* u_char enaddr[ETH_ALEN]; */ \ +{ \ + (enaddr)[0] = 0x01; \ + (enaddr)[1] = 0x00; \ + (enaddr)[2] = 0x5e; \ + (enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \ + (enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \ + (enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \ +} + +__END_DECLS +#endif /* __USE_BSD */ #endif /* netinet/if_ether.h */ diff --git a/sysdeps/unix/sysv/linux/netinet/if_fddi.h b/sysdeps/unix/sysv/linux/netinet/if_fddi.h new file mode 100644 index 0000000000..d5d6dbdbe2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/netinet/if_fddi.h @@ -0,0 +1,37 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NETINET_IF_FDDI_H +#define _NETINET_IF_FDDI_H 1 + +#include +#include +#include + +#include + +#ifdef __USE_BSD + +struct fddi_header { + u_int8_t fddi_fc; /* Frame Control (FC) value */ + u_int8_t fddi_dhost[FDDI_K_ALEN]; /* Destination host */ + u_int8_t fddi_shost[FDDI_K_ALEN]; /* Source host */ +}; +#endif + +#endif /* netinet/if_fddi.h */ diff --git a/sysdeps/unix/sysv/linux/netinet/if_tr.h b/sysdeps/unix/sysv/linux/netinet/if_tr.h new file mode 100644 index 0000000000..3c1be2102f --- /dev/null +++ b/sysdeps/unix/sysv/linux/netinet/if_tr.h @@ -0,0 +1,41 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NETINET_IF_TR_H +#define _NETINET_IF_TR_H 1 + +#include +#include +#include + +#include + +#ifdef __USE_BSD + +struct trn_hdr { + u_int8_t trn_ac; /* access control field */ + u_int8_t trn_fc; /* field control field */ + u_int8_t trn_dhost[TR_ALEN]; /* destination host */ + u_int8_t trn_shost[TR_ALEN]; /* source host */ + u_int16_t trn_rcf; /* route control field */ + u_int16_t trn_rseg[8]; /* routing registers */ +}; + +#endif + +#endif /* netinet/if_tr.h */ diff --git a/sysdeps/unix/sysv/linux/netinet/igmp.h b/sysdeps/unix/sysv/linux/netinet/igmp.h new file mode 100644 index 0000000000..7a6ed6e8c6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/netinet/igmp.h @@ -0,0 +1,93 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NETINET_IGMP_H +#define _NETINET_IGMP_H 1 + +#include +#include + +#include +#include + +#ifdef __USE_BSD + +#include + +__BEGIN_DECLS + +/* + * Copyright (c) 1988 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)igmp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD$ + */ + +struct igmp { + u_int8_t igmp_type; /* IGMP type */ + u_int8_t igmp_code; /* routing code */ + u_int16_t igmp_cksum; /* checksum */ + struct in_addr igmp_group; /* group address */ +}; + +/* + * Message types, including version number. + */ +#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */ +#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */ +#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */ +#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */ + +__END_DECLS + +#endif + +#endif /* netinet/igmp.h */ diff --git a/sysdeps/unix/sysv/linux/netinet/in.h b/sysdeps/unix/sysv/linux/netinet/in.h index 0fec8ce3dd..53be934968 100644 --- a/sysdeps/unix/sysv/linux/netinet/in.h +++ b/sysdeps/unix/sysv/linux/netinet/in.h @@ -22,8 +22,11 @@ #include #include +#include +__BEGIN_DECLS + /* Standard well-defined IP protocols. */ enum { @@ -134,6 +137,32 @@ struct in_addr #endif +/* IPv6 address */ +struct in6_addr + { + union + { + u_int8_t u6_addr8[16]; + u_int16_t u6_addr16[8]; + u_int32_t u6_addr32[4]; +#if (~0UL) > 0xffffffff + u_int64_t u6_addr64[2]; +#endif + } in6_u; +#define s6_addr in6_u.u6_addr8 +#define s6_addr16 in6_u.u6_addr16 +#define s6_addr32 in6_u.u6_addr32 +#define s6_addr64 in6_u.u6_addr64 + }; + +extern const struct in6_addr in6addr_any; /* :: */ +extern const struct in6_addr in6addr_loopback; /* ::1 */ +#define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } + +#define INET_ADDRSTRLEN 16 +#define INET6_ADDRSTRLEN 46 + /* Get the definition of the macro to define the common sockaddr members. */ #include