void
_dl_map_object_deps (struct link_map *map,
- struct link_map **preloads, unsigned int npreloads)
+ struct link_map **preloads, unsigned int npreloads,
+ int trace_mode)
{
struct list
{
struct link_map *dep
= _dl_map_object (l, strtab + d->d_un.d_val,
l->l_type == lt_executable ? lt_library :
- l->l_type);
+ l->l_type, trace_mode);
if (dep->l_reserved)
/* This object is already in the search list we are
/* Map in the shared object file NAME. */
struct link_map *
-_dl_map_object (struct link_map *loader, const char *name, int type)
+_dl_map_object (struct link_map *loader, const char *name, int type,
+ int trace_mode)
{
int fd;
char *realname;
}
if (fd == -1)
- _dl_signal_error (errno, name, "cannot open shared object file");
+ {
+ if (trace_mode)
+ {
+ /* We haven't found an appropriate library. But since we
+ are only interested in the list of libraries this isn't
+ so severe. Fake an entry with all the information we
+ have (in fact only the name). */
+
+ /* Enter the new object in the list of loaded objects. */
+ if ((name_copy = local_strdup (name)) == NULL
+ || (l = _dl_new_object (name_copy, name, type)) == NULL)
+ _dl_signal_error (ENOMEM, name,
+ "cannot create shared object descriptor");
+ /* We use an opencount of 0 as a sign for the faked entry. */
+ l->l_opencount = 0;
+ l->l_reserved = 0;
+ }
+ else
+ _dl_signal_error (errno, name, "cannot open shared object file");
+ }
return _dl_map_object_from_fd (name_copy, fd, realname, loader, type);
}
struct r_debug *r;
/* Load the named object. */
- new = _dl_map_object (NULL, file, lt_loaded);
+ new = _dl_map_object (NULL, file, lt_loaded, 0);
if (new->l_searchlist)
/* It was already open. */
return new;
/* Load that object's dependencies. */
- _dl_map_object_deps (new, NULL, 0);
+ _dl_map_object_deps (new, NULL, 0, 0);
/* Relocate the objects loaded. We do this in reverse order so that copy
if (! l->l_searchlist)
/* We must construct the searchlist for this object. */
- _dl_map_object_deps (l, NULL, 0);
+ _dl_map_object_deps (l, NULL, 0, 0);
/* The primary scope is this object itself and its
dependencies. */
LOADER's DT_RPATH is used in searching for NAME.
If the object is already opened, returns its existing map. */
extern struct link_map *_dl_map_object (struct link_map *loader,
- const char *name, int type);
+ const char *name, int type,
+ int trace_mode);
/* Call _dl_map_object on the dependencies of MAP, and set up
MAP->l_searchlist. PRELOADS points to a vector of NPRELOADS previously
but before its dependencies. */
extern void _dl_map_object_deps (struct link_map *map,
struct link_map **preloads,
- unsigned int npreloads);
+ unsigned int npreloads, int trace_mode);
/* Cache the locations of MAP's hash table. */
extern void _dl_setup_hash (struct link_map *map);
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
+ /* Set up a flag which tells we are just starting. */
+ _dl_starting_up = 1;
+
if (*user_entry == (ElfW(Addr)) &_start)
{
/* Ho ho. We are not the program interpreter! We are the program
{
void doit (void)
{
- l = _dl_map_object (NULL, _dl_argv[0], lt_library);
+ l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
}
char *err_str = NULL;
const char *obj_name __attribute__ ((unused));
}
}
else
- l = _dl_map_object (NULL, _dl_argv[0], lt_library);
+ l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
phdr = l->l_phdr;
phent = l->l_phnum;
char *p;
while ((p = strsep (&list, ":")) != NULL)
{
- (void) _dl_map_object (NULL, p, lt_library);
+ (void) _dl_map_object (NULL, p, lt_library, 0);
++npreloads;
}
}
runp = file;
while ((p = strsep (&runp, ": \t\n")) != NULL)
{
- (void) _dl_map_object (NULL, p, lt_library);
+ (void) _dl_map_object (NULL, p, lt_library, 0);
++npreloads;
}
}
if (problem != NULL)
{
char *p = strndupa (problem, file_size - (problem - file));
- (void) _dl_map_object (NULL, p, lt_library);
+ (void) _dl_map_object (NULL, p, lt_library, 0);
}
/* We don't need the file anymore. */
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
specified some libraries to load, these are inserted before the actual
dependencies in the executable's searchlist for symbol resolution. */
- _dl_map_object_deps (l, preloads, npreloads);
+ _dl_map_object_deps (l, preloads, npreloads, mode == trace);
#ifndef MAP_ANON
/* We are done mapping things, so close the zero-fill descriptor. */
_dl_sysdep_message ("\t", "statically linked\n", NULL);
else
for (l = _dl_loaded->l_next; l; l = l->l_next)
- {
- char buf[20], *bp;
- buf[sizeof buf - 1] = '\0';
- bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
- while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof l->l_addr * 2)
- *--bp = '0';
- _dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name,
- " (0x", bp, ")\n", NULL);
- }
+ if (l->l_opencount == 0)
+ /* The library was not found. */
+ _dl_sysdep_message ("\t", l->l_libname, " => not found\n", NULL);
+ else
+ {
+ char buf[20], *bp;
+ buf[sizeof buf - 1] = '\0';
+ bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
+ while ((size_t) (&buf[sizeof buf - 1] - bp)
+ < sizeof l->l_addr * 2)
+ *--bp = '0';
+ _dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name,
+ " (0x", bp, ")\n", NULL);
+ }
if (mode != trace)
for (i = 1; i < _dl_argc; ++i)
_dl_debug_state ();
}
- /* We finished the intialization and will start up. */
- _dl_starting_up = 1;
-
/* Once we return, _dl_sysdep_start will invoke
the DT_INIT functions and then *USER_ENTRY. */
}
-#include <ansidecl.h>
#include <grp.h>
#include <pwd.h>
#include <sys/types.h>
#include <stdio.h>
int
-DEFUN_VOID(main)
+main (int argc, char *argv[])
{
uid_t me;
struct passwd *my_passwd;
me = getuid ();
my_passwd = getpwuid (me);
if (my_passwd == NULL)
- perror ("getpwuid");
+ printf ("Cannot find user entry for UID %d\n", me);
else
{
printf ("My login name is %s.\n", my_passwd->pw_name);
my_group = getgrgid (my_passwd->pw_gid);
if (my_group == NULL)
- perror ("getgrgid");
+ printf ("No data for group %d found\n", my_passwd->pw_gid);
else
{
printf ("My default group is %s (%d).\n",
exit (my_passwd && my_group ? EXIT_SUCCESS : EXIT_FAILURE);
}
-
-
-
{
int save = errno;
fclose (result->fp);
- free (result->fname);
+ free ((char *) result->fname);
free (result);
errno = save;
return NULL;
lr_close (struct linereader *lr)
{
fclose (lr->fp);
- free (lr->fname);
+ free ((char *) lr->fname);
free (lr->buf);
free (lr);
}
/* File listing canonical interesting mount points. */
-#define _PATH_MNTTAB "/etc/fstab"
#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
/* File listing currently active mount points. */
-#define _PATH_MOUNTED "/var/run/mtab"
#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
+++ /dev/null
-/*
- * Copyright (c) 1989, 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.
- *
- * @(#)paths.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _PATHS_H_
-#define _PATHS_H_
-
-/* Default search path. */
-#define _PATH_DEFPATH "/usr/bin:/bin"
-/* All standard utilities path. */
-#define _PATH_STDPATH \
- "/usr/bin:/bin:/usr/sbin:/sbin:/usr/contrib/bin:/usr/old/bin"
-
-#define _PATH_BSHELL "/bin/sh"
-#define _PATH_CONSOLE "/dev/console"
-#define _PATH_CSHELL "/bin/csh"
-#define _PATH_DEVDB "/var/run/dev.db"
-#define _PATH_DEVNULL "/dev/null"
-#define _PATH_DRUM "/dev/drum"
-#define _PATH_KMEM "/dev/kmem"
-#define _PATH_MAILDIR "/var/mail"
-#define _PATH_MAN "/usr/man"
-#define _PATH_MEM "/dev/mem"
-#define _PATH_NOLOGIN "/etc/nologin"
-#define _PATH_SENDMAIL "/usr/sbin/sendmail"
-#define _PATH_SHELLS "/etc/shells"
-#define _PATH_TTY "/dev/tty"
-#define _PATH_UNIX "/vmunix"
-#define _PATH_VI "/usr/bin/vi"
-
-/* Provide trailing slash, since mostly used for building pathnames. */
-#define _PATH_DEV "/dev/"
-#define _PATH_TMP "/tmp/"
-#define _PATH_VARDB "/var/db/"
-#define _PATH_VARRUN "/var/run/"
-#define _PATH_VARTMP "/var/tmp/"
-
-#endif /* !_PATHS_H_ */
#include <db.h>
#include <errno.h>
#include <fcntl.h>
+#include <string.h>
#include <libc-lock.h>
#include <paths.h>
#include "nsswitch.h"
confstr \
getopt getopt1 \
sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
- sched_primin sched_rr_gi
+ sched_primin sched_rr_gi \
+ getaddrinfo
aux := init-posix environ
tests := tstgetopt testfnm
include ../Rules
CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes
+CFLAGS-getaddrinfo.c = -DRESOLVER
$(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib)
lib: $(objpfx)libposix.a
char *__buffer, int __buflen));
#endif
+
+/* Extension from POSIX.1g. */
+#ifdef __USE_POSIX
+/* Structure to contain information about address of a service provider. */
+struct addrinfo
+{
+ int ai_flags; /* Input flags. */
+ int ai_family; /* Protocol family for socket. */
+ int ai_socktype; /* Socket type. */
+ int ai_protocol; /* Protocol for socket. */
+ int ai_addrlen; /* Length of socket address. */
+ struct sockaddr *ai_addr; /* Socket address for socket. */
+ char *ai_canonname; /* Canonical name for service location. */
+ struct addrinfo *ai_next; /* Pointer to next in list. */
+};
+
+/* Possible values for `ai_flags' field in `addrinfo' structure. */
+#define AI_PASSIVE 1 /* Socket address is intended for `bind'. */
+#define AI_CANONNAME 2 /* Request for canonical name. */
+
+/* Error values for `getaddrinfo' function. */
+#define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
+#define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+#define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+#define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+#define EAI_NODATA -5 /* No address associated with NAME. */
+#define EAI_FAMILY -6 /* `ai_family' not supported. */
+#define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
+#define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+#define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+#define EAI_MEMORY -10 /* Memory allocation failure. */
+#define EAI_SYSTEM -11 /* System error returned in `errno'. */
+
+
+/* Translate name of a service location and/or a service name to set of
+ socket addresses. */
+extern int getaddrinfo __P ((__const char *__name, __const char *__service,
+ __const struct addrinfo *__req,
+ struct addrinfo **__pai));
+
+/* Free `addrinfo' structure AI including associated storage. */
+extern void freeaddrinfo __P ((struct addrinfo *__ai));
+#endif /* POSIX */
+
__END_DECLS
#endif /* netdb.h */
make install
%files
-%doc FAQ NEWS NOTES README
+%doc FAQ NEWS NOTES README INSTALL
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <stdio.h>
#include <signal.h>
#endif
/* Defined in sys_siglist.c. */
-extern CONST char *CONST _sys_siglist[];
+extern const char *const _sys_siglist[];
/* Print out on stderr a line consisting of the test in S, a colon, a space,
a message describing the meaning of the signal number SIG and a newline.
If S is NULL or "", the colon and space are omitted. */
void
-DEFUN(psignal, (sig, s), int sig AND register CONST char *s)
+psignal (int sig, const char *s)
{
- CONST char *colon;
+ const char *colon, *desc;
if (s == NULL || s == '\0')
s = colon = "";
else
colon = ": ";
- if (sig >= 0 && sig < NSIG)
- (void) fprintf (stderr, "%s%s%s\n", s, colon, _(_sys_siglist[sig]));
+ if (sig >= 0 && sig < NSIG && (desc = _sys_siglist[sig]) != NULL)
+ (void) fprintf (stderr, "%s%s%s\n", s, colon, _(desc));
else
(void) fprintf (stderr, _("%s%sUnknown signal %d\n"), s, colon, sig);
}
#include <stdlib.h>
#include <errno.h>
#include <wchar.h>
-#include <libc-lock.h>
#include "_itoa.h"
#include "../locale/localeinfo.h"
} \
while (0)
# define UNBUFFERED_P(s) ((s)->__buffer == NULL)
+
+/* XXX These declarations should go as soon as the stdio header files
+ have these prototypes. */
+extern void __flockfile (FILE *);
+extern void __funlockfile (FILE *);
#endif /* USE_IN_LIBIO */
# define is_longlong is_long_double
#endif
-extern void __flockfile (FILE *);
-extern void __funlockfile (FILE *);
/* Global variables. */
static const char null[] = "(null)";
f = lead_str_end = find_spec (format, &mbstate);
/* Lock stream. */
+#ifdef USE_IN_LIBIO
+ __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s);
+ _IO_flockfile (s);
+#else
__libc_cleanup_region_start ((void (*) (void *)) &__funlockfile, s);
__flockfile (s);
+#endif
/* Write the literal text before the first format. */
outstring ((const UCHAR_T *) format,
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
(r) = __r; \
} while (0)
-extern UDItype __udiv_qrnnd ();
+extern UDItype __udiv_qrnnd __P ((UDItype *, UDItype, UDItype, UDItype));
#define UDIV_TIME 220
#endif /* LONGLONG_STANDALONE */
#endif /* __alpha */
: "=d" (__w) \
: "%dI" ((USItype)(u)), \
"dI" ((USItype)(v))); \
- __w; })
+ __w; })
#define udiv_qrnnd(q, r, nh, nl, d) \
do { \
union {UDItype __ll; \
--- /dev/null
+#define _GNU_SOURCE 1
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+int
+main (int argc, char *argv[])
+{
+ size_t size = sysconf (_SC_PAGESIZE);
+ char *adr;
+ int result = 0;
+
+ adr = (char *) mmap (NULL, size, PROT_READ|PROT_WRITE,
+ MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ if (adr == NULL)
+ {
+ if (errno == ENOSYS)
+ puts ("No test, mmap not available.");
+ else
+ {
+ printf ("mmaping failed: %m");
+ result = 1;
+ }
+ }
+ else
+ {
+ char dest[size];
+ int inner, middle, outer;
+
+ memset (adr, 'T', size);
+
+ /* strlen test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (inner = MAX (outer, size - 64); inner < size; ++inner)
+ {
+ adr[inner] = '\0';
+
+ if (strlen (&adr[outer]) != inner - outer)
+ {
+ printf ("strlen flunked for outer = %d, inner = %d\n",
+ outer, inner);
+ result = 1;
+ }
+
+ adr[inner] = 'T';
+ }
+ }
+
+ /* strchr test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (middle = MAX (outer, size - 64); middle < size; ++middle)
+ {
+ for (inner = middle; inner < size; ++inner)
+ {
+ char *cp;
+ adr[middle] = 'V';
+ adr[inner] = '\0';
+
+ cp = strchr (&adr[outer], 'V');
+
+ if ((inner == middle && cp != NULL)
+ || (inner != middle
+ && (cp - &adr[outer]) != middle - outer))
+ {
+ printf ("strchr flunked for outer = %d, middle = %d, "
+ "inner = %d\n", outer, middle, inner);
+ result = 1;
+ }
+
+ adr[inner] = 'T';
+ adr[middle] = 'T';
+ }
+ }
+ }
+
+ /* strrchr test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (middle = MAX (outer, size - 64); middle < size; ++middle)
+ {
+ for (inner = middle; inner < size; ++inner)
+ {
+ char *cp;
+ adr[middle] = 'V';
+ adr[inner] = '\0';
+
+ cp = strrchr (&adr[outer], 'V');
+
+ if ((inner == middle && cp != NULL)
+ || (inner != middle
+ && (cp - &adr[outer]) != middle - outer))
+ {
+ printf ("strrchr flunked for outer = %d, middle = %d, "
+ "inner = %d\n", outer, middle, inner);
+ result = 1;
+ }
+
+ adr[inner] = 'T';
+ adr[middle] = 'T';
+ }
+ }
+ }
+
+ /* strcpy test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (inner = MAX (outer, size - 64); inner < size; ++inner)
+ {
+ adr[inner] = '\0';
+
+ if (strcpy (dest, &adr[outer]) != dest
+ || strlen (dest) != inner - outer)
+ {
+ printf ("strcpy flunked for outer = %d, inner = %d\n",
+ outer, inner);
+ result = 1;
+ }
+
+ adr[inner] = 'T';
+ }
+ }
+
+ /* stpcpy test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (inner = MAX (outer, size - 64); inner < size; ++inner)
+ {
+ adr[inner] = '\0';
+
+ if ((stpcpy (dest, &adr[outer]) - dest) != inner - outer)
+ {
+ printf ("stpcpy flunked for outer = %d, inner = %d\n",
+ outer, inner);
+ result = 1;
+ }
+
+ adr[inner] = 'T';
+ }
+ }
+ }
+
+ return result;
+}
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#endif
/* Defined in siglist.c. */
-extern CONST char *CONST _sys_siglist[];
+extern const char *const _sys_siglist[];
/* Return a string describing the meaning of the signal number SIGNUM. */
char *
-DEFUN(strsignal, (signum), int signum)
+strsignal (int signum)
{
- if (signum < 0 || signum > NSIG)
+ const char *desc;
+
+ if (signum < 0 || signum > NSIG || (desc = _sys_siglist[signum]) == NULL)
{
static char buf[512];
int len = __snprintf (buf, sizeof buf, _("Unknown signal %d"), signum);
return buf;
}
- return (char *) _(_sys_siglist[signum]);
+ return (char *) _(desc);
}
svc_tcp svc_udp xdr xdr_array xdr_float xdr_mem \
xdr_rec xdr_ref xdr_stdio
-others := portmap rpcinfo
+others := rpcinfo
install-bin := rpcgen
install-sbin := rpcinfo
rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
endif
\f
ifeq ($(subdir),stdio-common)
-
-ifeq "$(filter $(objpfx)siglist.c,$(before-compile))" ""
+ifneq ($(inhibit-siglist),yes)
+ifeq "$(filter %siglist.c,$(before-compile))" ""
before-compile := $(before-compile) $(objpfx)siglist.c
$(objpfx)siglist.c: $(objpfx)make_siglist
@rm -f $@
generated := $(generated) make_siglist siglist.c
endif
-
+endif
endif
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
+#include <libintl.h>
#include <stdio.h>
#include <string.h>
#include "../stdio-common/_itoa.h"
#define _sys_nerr sys_nerr
#endif
+/* Set if startup process finished. */
+extern int _dl_starting_up;
+
/* Return a string describing the errno code in ERRNUM. */
char *
_strerror_internal (int errnum,
{
if (errnum < 0 || errnum >= _sys_nerr)
{
- const char *unk = _("Unknown error ");
+ static const char unk_orig[] = N_("Unknown error ");
+ const char *unk = _dl_starting_up ? unk_orig : _(unk_orig);
const size_t unklen = strlen (unk);
char *p = buf + buflen;
*--p = '\0';
return memcpy (p - unklen, unk, unklen);
}
- return (char *) _(_sys_errlist[errnum]);
+ return (char *) (_dl_starting_up ? _sys_errlist[errnum]
+ : _(_sys_errlist[errnum]));
}
--- /dev/null
+/*
+ * Copyright (c) 1989, 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.
+ *
+ * @(#)paths.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PATHS_H_
+#define _PATHS_H_
+
+/* Default search path. */
+#define _PATH_DEFPATH "/usr/bin:/bin"
+/* All standard utilities path. */
+#define _PATH_STDPATH \
+ "/usr/bin:/bin:/usr/sbin:/sbin:/usr/contrib/bin:/usr/old/bin"
+
+#define _PATH_BSHELL "/bin/sh"
+#define _PATH_CONSOLE "/dev/console"
+#define _PATH_CSHELL "/bin/csh"
+#define _PATH_DEVDB "/var/run/dev.db"
+#define _PATH_DEVNULL "/dev/null"
+#define _PATH_DRUM "/dev/drum"
+#define _PATH_KMEM "/dev/kmem"
+#define _PATH_MAILDIR "/var/mail"
+#define _PATH_MAN "/usr/man"
+#define _PATH_MEM "/dev/mem"
+#define _PATH_MNTTAB "/etc/fstab"
+#define _PATH_MOUNTED "/var/run/mtab"
+#define _PATH_NOLOGIN "/etc/nologin"
+#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+#define _PATH_SHELLS "/etc/shells"
+#define _PATH_TTY "/dev/tty"
+#define _PATH_UNIX "/vmunix"
+#define _PATH_VI "/usr/bin/vi"
+
+/* Provide trailing slash, since mostly used for building pathnames. */
+#define _PATH_DEV "/dev/"
+#define _PATH_TMP "/tmp/"
+#define _PATH_VARDB "/var/db/"
+#define _PATH_VARRUN "/var/run/"
+#define _PATH_VARTMP "/var/tmp/"
+
+#endif /* !_PATHS_H_ */