From 7f56eb7b93f7774321c3f5924447d96ffcb858b9 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 23 Dec 1994 22:31:35 +0000 Subject: Updated to recent version of Paul K.'s shlib code. This code has better warning handling and allows for link-time warnings with a modified version of gas. Note: Not all of the newer bits were updated such as some of the non-x86 machine-dependant code is relevant to FreeBSD right now. Obtained from: NetBSD --- sbin/ldconfig/ldconfig.8 | 47 +++++++++++++++++++++++++++++++++++------------ sbin/ldconfig/ldconfig.c | 18 +++++++----------- 2 files changed, 42 insertions(+), 23 deletions(-) (limited to 'sbin/ldconfig') diff --git a/sbin/ldconfig/ldconfig.8 b/sbin/ldconfig/ldconfig.8 index 1ca25a4..0a6cb69 100644 --- a/sbin/ldconfig/ldconfig.8 +++ b/sbin/ldconfig/ldconfig.8 @@ -1,6 +1,37 @@ +.\" +.\" Copyright (c) 1993 Paul Kranenburg +.\" 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 Paul Kranenburg. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. +.\" +.\" $Id$ +.\" .Dd October 3, 1993 .Dt LDCONFIG 8 -.Os FreeBSD 1.1 +.Os FreeBSD .Sh NAME .Nm ldconfig .Nd configure the shared library cache @@ -20,7 +51,7 @@ directories. It scans a set of built-in system directories and any specified on the command line (in the given order) looking for shared libraries and stores the results in the file .Xr /var/run/ld.so.hints -to forstall the overhead that would otherwise result from the +to forestall the overhead that would otherwise result from the directory search operations .Xr ld.so would have to perform to load the required shared libraries. @@ -56,16 +87,8 @@ Lists the current contents of .Xr ld.so.hints on the standard output. The hints file will not be modified. .It Fl s -Do not scan -.Nm ldconfig -\'s builtin system directories -.Sq /usr/lib -, -.Sq /usr/X386/lib -, -.Sq /usr/X11R6/lib -and -.Sq /usr/local/lib +Do not scan the built-in system directory +.Pq Dq /usr/lib for shared libraries. .It Fl v Switch on verbose mode. diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index b31271f..74f7f15 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ldconfig.c,v 1.6 1994/06/05 19:04:11 ats Exp $ + * $Id: ldconfig.c,v 1.7 1994/06/15 22:40:56 rich Exp $ */ #include @@ -54,7 +54,8 @@ #undef major #undef minor -char *progname; +extern char *__progname; + static int verbose; static int nostd; static int justread; @@ -84,12 +85,6 @@ char *argv[]; { int i, c; int rval = 0; - extern int optind; - - if ((progname = strrchr(argv[0], '/')) == NULL) - progname = argv[0]; - else - progname++; while ((c = getopt(argc, argv, "rsv")) != EOF) { switch (c) { @@ -103,7 +98,8 @@ char *argv[]; justread = 1; break; default: - fprintf(stderr, "Usage: %s [-r] [-s] [-v] [dir ...]\n", progname); + fprintf(stderr, "Usage: %s [-r][-s][-v][dir ...]\n", + __progname); exit(1); break; } @@ -368,7 +364,7 @@ listhints() } msize = PAGSIZ; - addr = mmap(0, msize, PROT_READ, MAP_FILE|MAP_COPY, fd, 0); + addr = mmap(0, msize, PROT_READ, MAP_COPY, fd, 0); if (addr == (caddr_t)-1) { perror(_PATH_LD_HINTS); @@ -389,7 +385,7 @@ listhints() if (hdr->hh_ehints > msize) { if (mmap(addr+msize, hdr->hh_ehints - msize, - PROT_READ, MAP_FILE|MAP_COPY|MAP_FIXED, + PROT_READ, MAP_COPY|MAP_FIXED, fd, msize) != (caddr_t)(addr+msize)) { perror(_PATH_LD_HINTS); -- cgit v1.1