.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified by Michael Haardt .\" Modified 1993-07-24 by Rik Faith .\" Modified 1996-10-22 by Eric S. Raymond .\" Modified 2004-06-23 by Michael Kerrisk .\" Modified 2005-01-09 by aeb .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 SUTO Mitsuaki .\" all rights reserved. .\" Translated 1997-06-26, SUTO Mitsuaki .\" Updated 2000-01-13,Kentaro Shirakata .\" Updated 2005-02-28, Akihiro MOTOKI .\" Updated 2005-04-20, Akihiro MOTOKI .\" .TH USELIB 2 2020\-12\-21 Linux "Linux Programmer's Manual" .SH 名前 uselib \- 共有ライブラリを選択する .SH 書式 \fB#include \fP .PP \fBint uselib(const char *\fP\fIlibrary\fP\fB);\fP .PP \fINote\fP: No declaration of this system call is provided in glibc headers; see NOTES. .SH 説明 システムコール \fBuselib\fP() は、呼び出し元プロセスが使用する 共有ライブラリをロードする際に使用される。 このシステムコールにはライブラリのパス名を指定する。 ライブラリをロードするアドレスはライブラリ自身に書かれている。 ライブラリは認識可能なバイナリ形式であればどんな形式でもよい。 .SH 返り値 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー \fBopen\fP(2) と \fBmmap\fP(2) が返すエラーコードに加えて、以下のエラーコードが設定されることがある。 .TP \fBEACCES\fP \fIlibrary\fP で指定されたライブラリに対する読み込み許可、または実行許可がない。 もしくは \fIlibrary\fP が存在するディレクトリかその上位のいずれかに対する検索許可がない (\fBpath_resolution\fP(7) も参照)。 .TP \fBENFILE\fP オープンされたファイルの総数がシステム全体の上限に達していた。 .TP \fBENOEXEC\fP \fIlibrary\fP で指定されたファイルが、実行可能ファイルと認識されるファイル種別ではない。 例えば、正しいマジックナンバーが付いていない。 .SH 準拠 \fBuselib\fP() は Linux 特有の関数であり、移植性を持たせたいプログラム には使用すべきでない。 .SH 注意 This obsolete system call is not supported by glibc. No declaration is provided in glibc headers, but, through a quirk of history, glibc versions before 2.23 did export an ABI for this system call. Therefore, in order to employ this system call, it was sufficient to manually declare the interface in your code; alternatively, you could invoke the system call using \fBsyscall\fP(2). .PP .\" .PP .\" .\" libc 4.3.1f - changelog 1993-03-02 .\" Since libc 4.3.2, startup code tries to prefix these names .\" with "/usr/lib", "/lib" and "" before giving up. .\" .\" libc 4.3.4 - changelog 1993-04-21 .\" In libc 4.3.4 and later these names are looked for in the directories .\" found in .\" .BR LD_LIBRARY_PATH , .\" and if not found there, .\" prefixes "/usr/lib", "/lib" and "/" are tried. .\" .PP .\" From libc 4.4.4 on only the library "/lib/ld.so" is loaded, .\" so that this dynamic library can load the remaining libraries needed .\" (again using this call). .\" This is also the state of affairs in libc5. .\" .PP .\" glibc2 does not use this call. In ancient libc versions (before glibc 2.0), \fBuselib\fP() was used to load the shared libraries with names found in an array of names in the binary. .PP .\" commit 69369a7003735d0d8ef22097e27a55a8bad9557a Since Linux 3.15, this system call is available only when the kernel is configured with the \fBCONFIG_USELIB\fP option. .SH 関連項目 \fBar\fP(1), \fBgcc\fP(1), \fBld\fP(1), \fBldd\fP(1), \fBmmap\fP(2), \fBopen\fP(2), \fBdlopen\fP(3), \fBcapabilities\fP(7), \fBld.so\fP(8) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。