1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-25 02:02:09 +03:00
1998-10-16 10:07  Ulrich Drepper  <drepper@cygnus.com>

	* iconv/Makefile [! elf]: Define CFLAGS-gconv_simple.c to
	-DSTATIC_GCONV.
	* iconv/skeleton.c: Include ELF header only of STATIC?GCONV is not
	defined.  Avoid using DL_CLL_FCT if it is not defined.

1998-10-16 10:40 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* resolv/arpa/nameser.h: Include sys/types.h unconditionally.
	Include endian.h unconditionally.  Remove portability goop
	depending on #ifdef linux, #ifdef BSD, #ifdef machine-type.

1998-10-16 11:39 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* sunrpc/rpc/types.h: Mark file so fixincludes won't modify it.
This commit is contained in:
Ulrich Drepper
1998-10-16 11:41:15 +00:00
parent a9e73d4044
commit c66dbe00b9
8 changed files with 76 additions and 74 deletions

View File

@ -1,3 +1,20 @@
1998-10-16 10:07 Ulrich Drepper <drepper@cygnus.com>
* iconv/Makefile [! elf]: Define CFLAGS-gconv_simple.c to
-DSTATIC_GCONV.
* iconv/skeleton.c: Include ELF header only of STATIC?GCONV is not
defined. Avoid using DL_CLL_FCT if it is not defined.
1998-10-16 10:40 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* resolv/arpa/nameser.h: Include sys/types.h unconditionally.
Include endian.h unconditionally. Remove portability goop
depending on #ifdef linux, #ifdef BSD, #ifdef machine-type.
1998-10-16 11:39 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* sunrpc/rpc/types.h: Mark file so fixincludes won't modify it.
1998-10-15 Ulrich Drepper <drepper@cygnus.com> 1998-10-15 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Remove __kernel_termios * sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Remove __kernel_termios
@ -6,16 +23,16 @@
* sysdeps/unix/sysv/linux/arm/Dist: Add bits/armsigctx.h. * sysdeps/unix/sysv/linux/arm/Dist: Add bits/armsigctx.h.
1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> 1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* string/bits/string2.h (strcmp): Don't cache the result of * string/bits/string2.h (strcmp): Don't cache the result of
__builtin_constant_p in variables, otherwise constant folding __builtin_constant_p in variables, otherwise constant folding
can fail in big functions. can fail in big functions.
1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> 1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* string/bits/string2.h: Add prototypes for the new inline * string/bits/string2.h: Add prototypes for the new inline
functions. functions.
1998-10-15 Ulrich Drepper <drepper@cygnus.com> 1998-10-15 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Include termios.h to * sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Include termios.h to
@ -47,10 +64,10 @@
here instead of including kernel_termios.h. here instead of including kernel_termios.h.
1998-10-14 Andreas Jaeger <aj@arthur.rhein-neckar.de> 1998-10-14 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/opendir.c (__opendir): Remove label lose2 which is * sysdeps/unix/opendir.c (__opendir): Remove label lose2 which is
unnecessary after the changes of 1998-10-12. unnecessary after the changes of 1998-10-12.
1998-10-13 Ulrich Drepper <drepper@cygnus.com> 1998-10-13 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/ioperm.c (inline_outb): Fix output * sysdeps/unix/sysv/linux/alpha/ioperm.c (inline_outb): Fix output

View File

@ -31,6 +31,7 @@ ifeq ($(elf),yes)
routines += gconv_dl routines += gconv_dl
else else
CFLAGS-gconv_db.c = -DSTATIC_GCONV CFLAGS-gconv_db.c = -DSTATIC_GCONV
CFLAGS-gconv_simple.c = -DSTATIC_GCONV
endif endif
distribute = gconv_builtin.h gconv_int.h loop.c skeleton.c distribute = gconv_builtin.h gconv_int.h loop.c skeleton.c

View File

@ -77,13 +77,16 @@
*/ */
#include <assert.h> #include <assert.h>
#include <dlfcn.h>
#include <gconv.h> #include <gconv.h>
#include <string.h> #include <string.h>
#define __need_size_t #define __need_size_t
#define __need_NULL #define __need_NULL
#include <stddef.h> #include <stddef.h>
#include <elf/ldsodefs.h>
#ifndef STATIC_GCONV
# include <dlfcn.h>
# include <elf/ldsodefs.h>
#endif
/* The direction objects. */ /* The direction objects. */
@ -219,9 +222,15 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
if (status == GCONV_OK) if (status == GCONV_OK)
#endif #endif
/* Give the modules below the same chance. */ {
status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL, /* Give the modules below the same chance. */
written, 1)); #ifdef DL_CALL_FCT
status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
written, 1));
#else
status = (*fct) (next_step, next_data, NULL, NULL, written, 1);
#endif
}
} }
} }
else else
@ -287,8 +296,13 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
const char *outerr = data->outbuf; const char *outerr = data->outbuf;
int result; int result;
#ifdef DL_CALL_FCT
result = DL_CALL_FCT (fct, (next_step, next_data, &outerr, result = DL_CALL_FCT (fct, (next_step, next_data, &outerr,
outbuf, written, 0)); outbuf, written, 0));
#else
result = (*fct) (next_step, next_data, &outerr, outbuf,
written, 0);
#endif
if (result != GCONV_EMPTY_INPUT) if (result != GCONV_EMPTY_INPUT)
{ {

View File

@ -376,7 +376,7 @@ as far as the system follows the Unix standards.
@end menu @end menu
@node The Lame Way to Locale Data, The Elegant and Fast Way, ,Locale Information @node The Lame Way to Locale Data, The Elegant and Fast Way, ,Locale Information
@subsection @code{localeconv}: It's portable but @dots{} @subsection @code{localeconv}: It is portable but @dots{}
Together with the @code{setlocale} function the @w{ISO C} people Together with the @code{setlocale} function the @w{ISO C} people
invented @code{localeconv} function. It is a masterpiece of misdesign. invented @code{localeconv} function. It is a masterpiece of misdesign.

View File

@ -151,7 +151,7 @@ individual service.
Assume the service @var{name} shall be used for a lookup. The code for Assume the service @var{name} shall be used for a lookup. The code for
this service is implemented in a module called @file{libnss_@var{name}}. this service is implemented in a module called @file{libnss_@var{name}}.
On a system supporting shared libraries this is in fact a shared library On a system supporting shared libraries this is in fact a shared library
with the name (for example) @file{libnss_@var{name}.so.1}. The number with the name (for example) @file{libnss_@var{name}.so.2}. The number
at the end is the currently used version of the interface which will not at the end is the currently used version of the interface which will not
change frequently. Normally the user should not have to be cognizant of change frequently. Normally the user should not have to be cognizant of
these files since they should be placed in a directory where they are these files since they should be placed in a directory where they are
@ -337,7 +337,7 @@ the function
in the module in the module
@smallexample @smallexample
libnss_files.so.1 libnss_files.so.2
@end smallexample @end smallexample
@noindent @noindent
@ -358,8 +358,8 @@ access them. If a function is not available it is simply treated as if
the function would return @code{unavail} the function would return @code{unavail}
(@pxref{Actions in the NSS configuration}). (@pxref{Actions in the NSS configuration}).
The file name @file{libnss_files.so.1} would be on a @w{Solaris 2} The file name @file{libnss_files.so.2} would be on a @w{Solaris 2}
system @file{nss_files.so.1}. This is the difference mentioned above. system @file{nss_files.so.2}. This is the difference mentioned above.
Sun's NSS modules are usable as modules which get indirectly loaded Sun's NSS modules are usable as modules which get indirectly loaded
only. only.
@ -398,7 +398,7 @@ The actual prototype of the function in the NSS modules in this case is
enum nss_status _nss_files_gethostbyname_r (const char *name, enum nss_status _nss_files_gethostbyname_r (const char *name,
struct hostent *result_buf, struct hostent *result_buf,
char *buf, size_t buflen, char *buf, size_t buflen,
int *h_errnop) int *errnop, int *h_errnop)
@end smallexample @end smallexample
I.e., the interface function is in fact the reentrant function with the I.e., the interface function is in fact the reentrant function with the
@ -511,10 +511,10 @@ sources and its development. The links between the C library and the
new service module consists solely of the interface functions. new service module consists solely of the interface functions.
Each module is designed following a specific interface specification. Each module is designed following a specific interface specification.
For now the version is 1 and this manifests in the version number of the For now the version is 2 (the interface in version 1 was not adequate)
shared library object of the NSS modules: they have the extension and this manifests in the version number of the shared library object of
@code{.1}. If the interface ever changes in an incompatible way, the NSS modules: they have the extension @code{.2}. If the interface
this number will be increased---hopefully this will never be necessary. changes again in an incompatible way, this number will be increased.
Modules using the old interface will still be usable. Modules using the old interface will still be usable.
Developers of a new service will have to make sure that their module is Developers of a new service will have to make sure that their module is
@ -524,7 +524,7 @@ Object Name) must also have this number. Building a module from a bunch
of object files on an ELF system using GNU CC could be done like this: of object files on an ELF system using GNU CC could be done like this:
@smallexample @smallexample
gcc -shared -o libnss_NAME.so.1 -Wl,-soname,libnss_NAME.so.1 OBJECTS gcc -shared -o libnss_NAME.so.2 -Wl,-soname,libnss_NAME.so.2 OBJECTS
@end smallexample @end smallexample
@noindent @noindent
@ -581,7 +581,7 @@ a simple noop.
There normally is no return value different to @var{NSS_STATUS_SUCCESS}. There normally is no return value different to @var{NSS_STATUS_SUCCESS}.
@item enum nss_status _nss_@var{database}_get@var{db}ent_r (@var{STRUCTURE} *result, char *buffer, size_t buflen) @item enum nss_status _nss_@var{database}_get@var{db}ent_r (@var{STRUCTURE} *result, char *buffer, size_t buflen, int *errnop)
Since this function will be called several times in a row to retrieve Since this function will be called several times in a row to retrieve
one entry after the other it must keep some kind of state. But this one entry after the other it must keep some kind of state. But this
also means the functions are not really reentrant. They are reentrant also means the functions are not really reentrant. They are reentrant
@ -598,6 +598,11 @@ guaranteed that the same buffer will be passed for the next call of this
function. Therefore one must not misuse this buffer to save some state function. Therefore one must not misuse this buffer to save some state
information from one call to another. information from one call to another.
Before the function returns the implementation should store the value of
the local @var{errno} variable in the variable pointed to be
@var{errnop}. This is important to guarantee the module working in
statically linked programs.
As explained above this function could also have an additional last As explained above this function could also have an additional last
argument. This depends on the database used; it happens only for argument. This depends on the database used; it happens only for
@code{host} and @code{networks}. @code{host} and @code{networks}.
@ -610,7 +615,7 @@ returned. When the service was not formerly initialized by a call to
@code{_nss_@var{DATABASE}_set@var{db}ent} all return value allowed for @code{_nss_@var{DATABASE}_set@var{db}ent} all return value allowed for
this function can also be returned here. this function can also be returned here.
@item enum nss_status _nss_@var{DATABASE}_get@var{db}by@var{XX}_r (@var{PARAMS}, @var{STRUCTURE} *result, char *buffer, size_t buflen) @item enum nss_status _nss_@var{DATABASE}_get@var{db}by@var{XX}_r (@var{PARAMS}, @var{STRUCTURE} *result, char *buffer, size_t buflen, int *errnop)
This function shall return the entry from the database which is This function shall return the entry from the database which is
addressed by the @var{PARAMS}. The type and number of these arguments addressed by the @var{PARAMS}. The type and number of these arguments
vary. It must be individually determined by looking to the user-level vary. It must be individually determined by looking to the user-level
@ -626,6 +631,11 @@ to non-constant global data.
The implementation of this function should honour the @var{stayopen} The implementation of this function should honour the @var{stayopen}
flag set by the @code{set@var{DB}ent} function whenever this makes sense. flag set by the @code{set@var{DB}ent} function whenever this makes sense.
Before the function returns the implementation should store the value of
the local @var{errno} variable in the variable pointed to be
@var{errnop}. This is important to guarantee the module working in
statically linked programs.
Again, this function takes an additional last argument for the Again, this function takes an additional last argument for the
@code{host} and @code{networks} database. @code{host} and @code{networks} database.

View File

@ -1882,6 +1882,7 @@ selected and then one can iterate over all entries in this netgroup.
These functions are declared in @file{netdb.h}. These functions are declared in @file{netdb.h}.
@comment netdb.h @comment netdb.h
@comment BSD
@deftypefun int setnetgrent (const char *@var{netgroup}) @deftypefun int setnetgrent (const char *@var{netgroup})
A call to this function initializes the internal state of the library to A call to this function initializes the internal state of the library to
allow following calls of the @code{getnetgrent} iterate over all entries allow following calls of the @code{getnetgrent} iterate over all entries
@ -1906,6 +1907,7 @@ the @code{innetgr} function and parts of the implementation of the
@code{compat} service part of the NSS implementation. @code{compat} service part of the NSS implementation.
@comment netdb.h @comment netdb.h
@comment BSD
@deftypefun int getnetgrent (char **@var{hostp}, char **@var{userp}, char **@var{domainp}) @deftypefun int getnetgrent (char **@var{hostp}, char **@var{userp}, char **@var{domainp})
This function returns the next unprocessed entry of the currently This function returns the next unprocessed entry of the currently
selected netgroup. The string pointers, which addresses are passed in selected netgroup. The string pointers, which addresses are passed in
@ -1920,6 +1922,7 @@ value of @code{0} means no further entries exist or internal errors occurred.
@end deftypefun @end deftypefun
@comment netdb.h @comment netdb.h
@comment GNU
@deftypefun int getnetgrent_r (char **@var{hostp}, char **@var{userp}, char **@var{domainp}, char *@var{buffer}, int @var{buflen}) @deftypefun int getnetgrent_r (char **@var{hostp}, char **@var{userp}, char **@var{domainp}, char *@var{buffer}, int @var{buflen})
This function is similar to @code{getnetgrent} with only one exception: This function is similar to @code{getnetgrent} with only one exception:
the strings the three string pointers @var{hostp}, @var{userp}, and the strings the three string pointers @var{hostp}, @var{userp}, and
@ -1937,6 +1940,7 @@ SunOS libc does not provide this function.
@end deftypefun @end deftypefun
@comment netdb.h @comment netdb.h
@comment BSD
@deftypefun void endnetgrent (void) @deftypefun void endnetgrent (void)
This function free all buffers which were allocated to process the last This function free all buffers which were allocated to process the last
selected netgroup. As a result all string pointers returned by calls selected netgroup. As a result all string pointers returned by calls
@ -1951,6 +1955,7 @@ only interesting question is whether a given entry is part of the
selected netgroup. selected netgroup.
@comment netdb.h @comment netdb.h
@comment BSD
@deftypefun int innetgr (const char *@var{netgroup}, const char *@var{host}, const char *@var{user}, const char *@var{domain}) @deftypefun int innetgr (const char *@var{netgroup}, const char *@var{host}, const char *@var{user}, const char *@var{domain})
This function tests whether the triple specified by the parameters This function tests whether the triple specified by the parameters
@var{hostp}, @var{userp}, and @var{domainp} is part of the netgroup @var{hostp}, @var{userp}, and @var{domainp} is part of the netgroup

View File

@ -83,17 +83,9 @@
#ifndef _ARPA_NAMESER_H #ifndef _ARPA_NAMESER_H
#define _ARPA_NAMESER_H 1 #define _ARPA_NAMESER_H 1
#include <features.h>
#include <sys/param.h> #include <sys/param.h>
#if (!defined(BSD)) || (BSD < 199306) #include <sys/types.h>
# include <sys/bitypes.h>
#else
# include <sys/types.h>
#endif
#include <sys/cdefs.h>
#ifdef _AUX_SOURCE
# include <sys/types.h>
#endif
/* /*
* revision information. this is the release date in YYYYMMDD format. * revision information. this is the release date in YYYYMMDD format.
@ -254,46 +246,8 @@
#define CONV_BADCKSUM (-3) #define CONV_BADCKSUM (-3)
#define CONV_BADBUFLEN (-4) #define CONV_BADBUFLEN (-4)
#ifndef BYTE_ORDER /* glibc always has byte order info in <endian.h> */
#if (BSD >= 199103) #include <endian.h>
# include <machine/endian.h>
#else
#ifdef linux
# include <endian.h>
#else
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
defined(__alpha__) || defined(__alpha)
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
defined(apollo) || defined(__convex__) || defined(_CRAY) || \
defined(__hppa) || defined(__hp9000) || \
defined(__hp9000s300) || defined(__hp9000s700) || \
defined (BIT_ZERO_ON_LEFT) || defined(m68k)
#define BYTE_ORDER BIG_ENDIAN
#endif
#endif /* linux */
#endif /* BSD */
#endif /* BYTE_ORDER */
#if !defined(BYTE_ORDER) || \
(BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
BYTE_ORDER != PDP_ENDIAN)
/* you must determine what the correct bit order is for
* your compiler - the next line is an intentional error
* which will force your compiles to bomb until you fix
* the above macros.
*/
error "Undefined or invalid BYTE_ORDER";
#endif
/* /*
* Structure for query header. The order of the fields is machine- and * Structure for query header. The order of the fields is machine- and

View File

@ -29,6 +29,7 @@
*/ */
/* @(#)types.h 1.18 87/07/24 SMI */ /* @(#)types.h 1.18 87/07/24 SMI */
/* fixincludes should not add extern "C" to this file */
/* /*
* Rpc additions to <sys/types.h> * Rpc additions to <sys/types.h>
*/ */