+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>
* sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Remove __kernel_termios
* sysdeps/unix/sysv/linux/arm/Dist: Add bits/armsigctx.h.
1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
-
+
* string/bits/string2.h (strcmp): Don't cache the result of
__builtin_constant_p in variables, otherwise constant folding
can fail in big functions.
-
+
1998-10-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
-
+
* string/bits/string2.h: Add prototypes for the new inline
functions.
-
+
1998-10-15 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Include termios.h to
here instead of including kernel_termios.h.
1998-10-14 Andreas Jaeger <aj@arthur.rhein-neckar.de>
-
+
* sysdeps/unix/opendir.c (__opendir): Remove label lose2 which is
unnecessary after the changes of 1998-10-12.
-
+
1998-10-13 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/ioperm.c (inline_outb): Fix output
routines += gconv_dl
else
CFLAGS-gconv_db.c = -DSTATIC_GCONV
+CFLAGS-gconv_simple.c = -DSTATIC_GCONV
endif
distribute = gconv_builtin.h gconv_int.h loop.c skeleton.c
*/
#include <assert.h>
-#include <dlfcn.h>
#include <gconv.h>
#include <string.h>
#define __need_size_t
#define __need_NULL
#include <stddef.h>
-#include <elf/ldsodefs.h>
+
+#ifndef STATIC_GCONV
+# include <dlfcn.h>
+# include <elf/ldsodefs.h>
+#endif
/* The direction objects. */
if (status == GCONV_OK)
#endif
- /* Give the modules below the same chance. */
- status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
- written, 1));
+ {
+ /* Give the modules below the same chance. */
+#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
const char *outerr = data->outbuf;
int result;
+#ifdef DL_CALL_FCT
result = DL_CALL_FCT (fct, (next_step, next_data, &outerr,
outbuf, written, 0));
+#else
+ result = (*fct) (next_step, next_data, &outerr, outbuf,
+ written, 0);
+#endif
if (result != GCONV_EMPTY_INPUT)
{
@end menu
@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
invented @code{localeconv} function. It is a masterpiece of misdesign.
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}}.
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
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
in the module
@smallexample
- libnss_files.so.1
+ libnss_files.so.2
@end smallexample
@noindent
the function would return @code{unavail}
(@pxref{Actions in the NSS configuration}).
-The file name @file{libnss_files.so.1} would be on a @w{Solaris 2}
-system @file{nss_files.so.1}. This is the difference mentioned above.
+The file name @file{libnss_files.so.2} would be on a @w{Solaris 2}
+system @file{nss_files.so.2}. This is the difference mentioned above.
Sun's NSS modules are usable as modules which get indirectly loaded
only.
enum nss_status _nss_files_gethostbyname_r (const char *name,
struct hostent *result_buf,
char *buf, size_t buflen,
- int *h_errnop)
+ int *errnop, int *h_errnop)
@end smallexample
I.e., the interface function is in fact the reentrant function with the
new service module consists solely of the interface functions.
Each module is designed following a specific interface specification.
-For now the version is 1 and this manifests in the version number of the
-shared library object of the NSS modules: they have the extension
-@code{.1}. If the interface ever changes in an incompatible way,
-this number will be increased---hopefully this will never be necessary.
+For now the version is 2 (the interface in version 1 was not adequate)
+and this manifests in the version number of the shared library object of
+the NSS modules: they have the extension @code{.2}. If the interface
+changes again in an incompatible way, this number will be increased.
Modules using the old interface will still be usable.
Developers of a new service will have to make sure that their module is
of object files on an ELF system using GNU CC could be done like this:
@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
@noindent
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
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
function. Therefore one must not misuse this buffer to save some state
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
argument. This depends on the database used; it happens only for
@code{host} and @code{networks}.
@code{_nss_@var{DATABASE}_set@var{db}ent} all return value allowed for
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
addressed by the @var{PARAMS}. The type and number of these arguments
vary. It must be individually determined by looking to the user-level
The implementation of this function should honour the @var{stayopen}
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
@code{host} and @code{networks} database.
These functions are declared in @file{netdb.h}.
@comment netdb.h
+@comment BSD
@deftypefun int setnetgrent (const char *@var{netgroup})
A call to this function initializes the internal state of the library to
allow following calls of the @code{getnetgrent} iterate over all entries
@code{compat} service part of the NSS implementation.
@comment netdb.h
+@comment BSD
@deftypefun int getnetgrent (char **@var{hostp}, char **@var{userp}, char **@var{domainp})
This function returns the next unprocessed entry of the currently
selected netgroup. The string pointers, which addresses are passed in
@end deftypefun
@comment netdb.h
+@comment GNU
@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:
the strings the three string pointers @var{hostp}, @var{userp}, and
@end deftypefun
@comment netdb.h
+@comment BSD
@deftypefun void endnetgrent (void)
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.
@comment netdb.h
+@comment BSD
@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
@var{hostp}, @var{userp}, and @var{domainp} is part of the netgroup
#ifndef _ARPA_NAMESER_H
#define _ARPA_NAMESER_H 1
+#include <features.h>
#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-#include <sys/cdefs.h>
-
-#ifdef _AUX_SOURCE
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
/*
* revision information. this is the release date in YYYYMMDD format.
#define CONV_BADCKSUM (-3)
#define CONV_BADBUFLEN (-4)
-#ifndef BYTE_ORDER
-#if (BSD >= 199103)
-# 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
+/* glibc always has byte order info in <endian.h> */
+#include <endian.h>
/*
* Structure for query header. The order of the fields is machine- and
*/
/* @(#)types.h 1.18 87/07/24 SMI */
+/* fixincludes should not add extern "C" to this file */
/*
* Rpc additions to <sys/types.h>
*/