.\" 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 2005\-01\-09 Linux "Linux Programmer's Manual" .SH 名前 uselib \- 共有ライブラリを選択する .SH 書式 \fB#include \fP .sp \fBint uselib(const char *\fP\fIlibrary\fP\fB);\fP .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 注意 初期の libc の起動コードは、 \fBuselib\fP() を使って、 バイナリ中のリストに書かれている共有ライブラリを リスト中のそのままの名前でロードしていた。 .LP .\" libc 4.3.1f - changelog 1993-03-02 .\" libc 4.3.4 - changelog 1993-04-21 libc 4.3.2 以降では、これらの名前の前に "/usr/lib", "/lib", "" を つけて共有ライブラリを探すようになった。 libc 4.3.4 以降では、これらの名前の共有ライブラリをまず \fBLD_LIBRARY_PATH\fP で指定されたディレクトリで探し、見つからなければ、 名前の前に "/usr/lib", "/lib", "/" をつけて探す。 .LP libc 4.4.4 以降では、ライブラリ "/lib/ld.so" だけがロードされ、その後で この動的ライブラリが (このシステムコールをもう一度使って) 必要な残りのライブラリをロードできるようになっている。 .LP glibc2 は、このシステムコールを使用しない。 .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 プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。