linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: Andreas Schwab <schwab@suse.de>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Lukasz Trabinski <lukasz@wsisiz.edu.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: uselib()  & 2.6.X?
Date: Sun, 9 Jan 2005 01:49:49 +0100	[thread overview]
Message-ID: <20050109004949.GF6052@pclin040.win.tue.nl> (raw)
In-Reply-To: <je8y73zl35.fsf@sykes.suse.de>

On Sat, Jan 08, 2005 at 10:07:10PM +0100, Andreas Schwab wrote:
> Linus Torvalds <torvalds@osdl.org> writes:
> 
> > Another issue is likely that we should make the whole "uselib()"
> > interfaces configurable. I don't think modern binaries use it (where
> > "modern" probably means "compiled within the last 8 years" ;).
> 
> I don't think it was ever being used for anything besides a.out so IMHO it
> should depend on BINFMT_AOUT.

Let me contribute a man page. Comments welcome (-> aeb@cwi.nl).

USELIB(2)           Linux Programmer's Manual           USELIB(2)

NAME
       uselib - load shared library

SYNOPSIS
       #include <unistd.h>

       int uselib(const char *library);

DESCRIPTION
       The  system call uselib serves to load a shared library to
       be used by the calling process.  It is given  a  pathname.
       The  address where to load is found in the library itself.
       The library can have any recognized binary format.

RETURN VALUE
       On success, zero is returned.  On error, -1  is  returned,
       and errno is set appropriately.

ERRORS
       In  addition to all of the error codes returned by open(2)
       and mmap(2), the following may also be returned:

       EACCES The library specified by library is  not  readable,
              or  the  caller does not have search permission for
              one of the directories in  the  path  prefix.  (See
              also path_resolution(2).)

       ENFILE The  system limit on the total number of open files
              has been reached.

       ENOEXEC
              The file specified by library is not executable, or
              does not have the correct magic numbers.

CONFORMING TO
       uselib() is Linux specific, and should not be used in pro-
       grams intended to be portable.

NOTES
       uselib() was used by early libc (up to libc  4.3)  startup
       code  to  load the shared libraries with names found in an
       array of names in the binary.

       Later code tries to prefix these  names  with  "/usr/lib",
       "/lib" and "" before giving up.  In libc 4.4.1 these names
       are   looked   for   in   the   directories    found    in
       LD_LIBRARY_PATH,   and   if   not  found  there,  prefixes
       "/usr/lib", "/lib" and "/" are tried.

       From libc  4.4.4  on  only  the  library  "/lib/ld.so"  is
       loaded,  so that this dynamic library can load the remain-
       ing libraries needed.  This is also the state  of  affairs
       in libc5.

       glibc2 does not use this call.

SEE ALSO
       ar(1),  gcc(1),  ld(1), ldd(1), mmap(2), open(2), capabil-
       ity(7), ld.so(8)

Linux 2.6.10                2005-01-09                  USELIB(2)

  parent reply	other threads:[~2005-01-09  0:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 15:59 uselib() & 2.6.X? Lukasz Trabinski
2005-01-07 17:07 ` Marcelo Tosatti
2005-01-07 20:27   ` linux-os
2005-01-07 22:29     ` Athanasius
2005-01-07 22:49   ` Alan Cox
2005-01-08  0:15     ` Linus Torvalds
2005-01-07 22:12       ` Marcelo Tosatti
2005-01-08 18:46         ` Linus Torvalds
2005-01-08 18:28           ` Marcelo Tosatti
2005-01-09  1:38             ` Linus Torvalds
2005-01-09 11:06               ` Marcelo Tosatti
2005-01-10  8:34                 ` Frank Steiner
2005-01-10 16:51                   ` Marcelo Tosatti
2005-01-10 18:28                   ` Alan Cox
2005-01-11  7:49                     ` Frank Steiner
2005-01-08 21:07           ` Andreas Schwab
2005-01-08 22:30             ` Barry K. Nathan
2005-01-08 23:21             ` Andi Kleen
2005-01-08 23:30               ` Alan Cox
2005-01-09  0:57                 ` Andi Kleen
2005-01-09  0:49             ` Andries Brouwer [this message]
2005-01-09  2:21               ` Jesper Juhl
2005-01-09  2:17                 ` Andries Brouwer
2005-01-08 21:47           ` Alan Cox
2005-01-11 22:51           ` [PATCH] make uselib configurable (was Re: uselib() & 2.6.X?) Barry K. Nathan
2005-01-11 23:42             ` Jesper Juhl
2005-01-11 23:59             ` Andries Brouwer
2005-01-12  1:06               ` Jesper Juhl
2005-01-12  1:18                 ` David Lang
2005-01-11 22:36                   ` Marcelo Tosatti
2005-01-12  2:32                     ` Barry K. Nathan
2005-01-12  0:56                       ` Marcelo Tosatti
2005-01-12  6:10                         ` Barry K. Nathan
2005-01-12 16:47                           ` Adrian Bunk
2005-01-12 17:10                             ` Barry K. Nathan
2005-01-12 20:16                     ` Matt Mackall
2005-01-12  2:12               ` Barry K. Nathan
2005-01-12  2:23                 ` David Lang
2005-01-12  2:30                 ` Adrian Bunk
2005-01-12  5:11                 ` Stephen Pollei
2005-01-12 16:54                   ` Adrian Bunk
2005-01-12  7:58               ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050109004949.GF6052@pclin040.win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz@wsisiz.edu.pl \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=schwab@suse.de \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).