2000-08-15  Marko Myllynen  <myllynen@lut.fi>

	* inet/netinet/icmp6.h: Added Mobile IPv6 definitions.
This commit is contained in:
Ulrich Drepper 2000-08-16 02:05:38 +00:00
parent 3a41e72395
commit 9df7693376
6 changed files with 185 additions and 7 deletions

View File

@ -7,7 +7,7 @@ are presented here.
Open Group's hdrchk
-------------------
===================
The hdrchk test suite is available from the Open Group at
@ -48,3 +48,121 @@ struct sigevent { <members> };
include files (namely, putting some of them in gcc-local directory) I
copied over the iso646.h, float.h, and stddef.h headers and ignored the
problems resulting from the splitted limits.h file).
Technical C standards conformance issues in glibc
=================================================
If you compile programs against glibc with __STRICT_ANSI__ defined
(as, for example, by gcc -ansi, gcc -std=c89, gcc -std=iso1990:199409
or gcc -std=c99), and use only the headers specified by the version of
the C standard chosen, glibc will attempt to conform to that version
of the C standard (as indicated by __STDC_VERSION__):
GCC options Standard version
-ansi ISO/IEC 9899:1990
-std=c89 ISO/IEC 9899:1990
-std=iso9899:199409 ISO/IEC 9899:1990 as amended by Amd.1:1995
-std=c99 ISO/IEC 9899:1999
(Note that -std=c99 is not available in GCC 2.95.2, and that no
version of GCC presently existing implements the full C99 standard.)
You may then define additional feature test macros to enable the
features from other standards, and use the headers defined in those
standards (for example, defining _POSIX_C_SOURCE to be 199506L to
enable features from ISO/IEC 9945-1:1996).
There are some technical ways in which glibc is known not to conform
to the supported versions of the C standard, as detailed below. Some
of these relate to defects in the standard that are expected to be
fixed, or to compiler limitations.
Defects in the C99 standard
===========================
The definition of macros such as INT8_C in <stdint.h> and <inttypes.h>
is not implementable (Defect Report #209); this is expected to be
fixed in a Technical Corrigendum to make the macros yield a constant
expression of the promoted type (for example, int rather than char)
rather than needing to be able to represent constants of type char.
glibc follows this corrected version.
Several of the <fenv.h> functions are specified to return void, but
Defect Report #202 points out that under some circumstances they may
need to return an error status. They are expected to be corrected to
return int; glibc follows this corrected specification.
Implementation of library functions
===================================
The implementation of some library functions does not fully follow the
standard specification:
C99 added additional forms of floating point constants (hexadecimal
constants, NaNs and infinities) to be recognised by strtod() and
scanf(). The effect is to change the behavior of some strictly
conforming C90 programs; glibc implements the C99 versions only
irrespective of the standard version selected.
C99 added %a as another scanf format specifier for floating point
values. This conflicts with the glibc extension where %as, %a[ and
%aS mean to allocate the string for the data read. A strictly
conforming C99 program using %as, %a[ or %aS in a scanf format string
will misbehave under glibc.
Compiler limitations
====================
The macros __STDC_IEC_559__, __STDC_IEC_559_COMPLEX__ and
__STDC_ISO_10646__ are properly supposed to be defined by the
compiler, and to be constant throughout the translation unit (before
and after any library headers are included). However, they mainly
relate to library features, and the necessary magic has yet to be
implemented for GCC to predefine them to the correct values for the
library in use, so glibc defines them in <features.h>. Programs that
test them before including any standard headers may misbehave.
GCC doesn't support the optional imaginary types. Nor does it
understand the keyword _Complex. This has the corresponding impact on
the relevant headers.
glibc's use of extern inline conflicts with C99: in C99, extern inline
means that an external definition is generated as well as possibly an
inline definition, but in GCC it means that no external definition is
generated. When GCC's C99 mode implements C99 inline semantics, this
will break the uses of extern inline in glibc's headers. (Actually,
glibc uses `extern __inline', which is beyond the scope of the
standard, but it would clearly be very confusing for `__inline' and
plain `inline' to have different meanings in C99 mode.)
glibc's <tgmath.h> implementation is arcane but thought to work
correctly; a clean and comprehensible version requires compiler
builtins.
For most of the headers required of freestanding implementations,
glibc relies on GCC to provide correct versions. (At present, glibc
provides <stdint.h>, and GCC doesn't.) GCC's <float.h> is missing
FLT_EVAL_METHOD and DECIMAL_DIG; glibc instead provides them in
<math.h>, which is not what the standard specifies. GCC's <stdbool.h>
is broken: GCC lacks support for the _Bool type.
Implementing MATH_ERRNO, MATH_ERREXCEPT and math_errhandling in
<math.h> needs compiler support: see
http://sources.redhat.com/ml/libc-hacker/2000-06/msg00008.html
http://sources.redhat.com/ml/libc-hacker/2000-06/msg00014.html
http://sources.redhat.com/ml/libc-hacker/2000-06/msg00015.html
Issues with headers
===================
There are various technical issues with the definitions contained in
glibc's headers. See
http://sources.redhat.com/ml/libc-alpha/2000-07/msg00259.html
http://sources.redhat.com/ml/libc-alpha/2000-07/msg00279.html

View File

@ -1,3 +1,7 @@
2000-08-15 Marko Myllynen <myllynen@lut.fi>
* inet/netinet/icmp6.h: Added Mobile IPv6 definitions.
2000-08-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/Dist: Add oldgetrlimit64.c.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,93,94,95,96,97,2000 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
@ -36,18 +36,18 @@ struct icmp6_filter
uint32_t data[8];
};
struct icmp6_hdr
struct icmp6_hdr
{
uint8_t icmp6_type; /* type field */
uint8_t icmp6_code; /* code field */
uint16_t icmp6_cksum; /* checksum field */
union
union
{
uint32_t icmp6_un_data32[1]; /* type-specific field */
uint16_t icmp6_un_data16[2]; /* type-specific field */
uint8_t icmp6_un_data8[4]; /* type-specific field */
} icmp6_dataun;
};
};
#define icmp6_data32 icmp6_dataun.icmp6_un_data32
#define icmp6_data16 icmp6_dataun.icmp6_un_data16
@ -135,6 +135,7 @@ struct nd_router_advert /* router advertisement */
#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
#define ND_RA_FLAG_MANAGED 0x80
#define ND_RA_FLAG_OTHER 0x40
#define ND_RA_FLAG_HOME_AGENT 0x20
#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
struct nd_neighbor_solicit /* neighbor solicitation */
@ -177,7 +178,7 @@ struct nd_redirect /* redirect */
struct in6_addr nd_rd_dst; /* destination address */
/* could be followed by options */
};
#define nd_rd_type nd_rd_hdr.icmp6_type
#define nd_rd_code nd_rd_hdr.icmp6_code
#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
@ -195,6 +196,8 @@ struct nd_opt_hdr /* Neighbor discovery option header */
#define ND_OPT_PREFIX_INFORMATION 3
#define ND_OPT_REDIRECTED_HEADER 4
#define ND_OPT_MTU 5
#define ND_OPT_RTR_ADV_INTERVAL 7
#define ND_OPT_HOME_AGENT_INFO 8
struct nd_opt_prefix_info /* prefix information */
{
@ -210,6 +213,7 @@ struct nd_opt_prefix_info /* prefix information */
#define ND_OPT_PI_FLAG_ONLINK 0x80
#define ND_OPT_PI_FLAG_AUTO 0x40
#define ND_OPT_PI_FLAG_RADDR 0x20
struct nd_opt_rd_hdr /* redirected header */
{

View File

@ -1,3 +1,8 @@
2000-08-15 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add ex12. Add rule to build it.
* Examples/ex12.c: New file.
2000-08-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_SEMAPHORES

View File

@ -0,0 +1,46 @@
/* Variant of ex6, but this time we use pthread_exit (). */
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
void *
test_thread (void *v_param)
{
pthread_exit (NULL);
}
int
main (void)
{
unsigned long count;
setvbuf (stdout, NULL, _IONBF, 0);
for (count = 0; count < 2000; ++count)
{
pthread_t thread;
int status;
status = pthread_create (&thread, NULL, test_thread, NULL);
if (status != 0)
{
printf ("status = %d, count = %lu: %s\n", status, count,
strerror (errno));
return 1;
}
else
{
printf ("count = %lu\n", count);
}
/* pthread_detach (thread); */
if (pthread_join (thread, NULL) != 0)
{
printf ("join failed, count %lu\n", count);
return 2;
}
usleep (10);
}
return 0;
}

View File

@ -41,7 +41,7 @@ nodelete-yes = -Wl,--enable-new-dtags,-z,nodelete
LDFLAGS-pthread.so = $(nodelete-$(have-z-nodelete))
vpath %.c Examples
tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 joinrace tststack
tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 joinrace tststack
include ../Rules
@ -76,5 +76,6 @@ $(objpfx)ex8: $(libpthread)
$(objpfx)ex9: $(libpthread)
$(objpfx)ex10: $(libpthread) $(librt)
$(objpfx)ex11: $(libpthread) $(librt)
$(objpfx)ex12: $(libpthread)
$(objpfx)joinrace: $(libpthread)
$(objpfx)tststack: $(libpthread)