OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man2 / uselib.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk16@ext.canterbury.ac.nz>
29 .\" Modified 2005-01-09 by aeb
30 .\"
31 .\" Japanese Version Copyright (c) 1997 SUTO Mitsuaki
32 .\"         all rights reserved.
33 .\" Translated 1997-06-26, SUTO Mitsuaki <suto@av.crl.sony.co.jp>
34 .\" Updated 2000-01-13,Kentaro Shirakata <argrath@yo.rim.or.jp>
35 .\" Updated 2005-02-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Updated 2005-04-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
37 .\"
38 .\"WORD:        Linux-specific          Linux 特有
39 .\"
40 .TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual"
41 .\"O .SH NAME
42 .SH 名前
43 .\"O uselib \- select shared library
44 uselib \- 共有ライブラリを選択する
45 .\"O .SH SYNOPSIS
46 .SH 書式
47 .B #include <unistd.h>
48 .sp
49 .BI "int uselib(const char *" library );
50 .\"O .SH DESCRIPTION
51 .SH 説明
52 .\"O The system call
53 .\"O .BR uselib ()
54 .\"O serves to load
55 .\"O a shared library to be used by the calling process.
56 .\"O It is given a pathname.
57 .\"O The address where to load is found
58 .\"O in the library itself.
59 .\"O The library can have any recognized
60 .\"O binary format.
61 システムコール
62 .BR uselib ()
63 は、呼び出し元プロセスが使用する
64 共有ライブラリをロードする際に使用される。
65 このシステムコールにはライブラリのパス名を指定する。
66 ライブラリをロードするアドレスはライブラリ自身に書かれている。
67 ライブラリは認識可能なバイナリ形式であればどんな形式でもよい。
68 .\"O .SH "RETURN VALUE"
69 .SH 返り値
70 .\"O On success, zero is returned.
71 .\"O On error, \-1 is returned, and
72 .\"O .I errno
73 .\"O is set appropriately.
74 成功した場合 0 を返す。失敗した場合 \-1 を返し、
75 .I errno
76 をエラーの内容に従って設定する。
77 .\"O .SH ERRORS
78 .SH エラー
79 .\"O In addition to all of the error codes returned by
80 .\"O .BR open (2)
81 .\"O and
82 .\"O .BR mmap (2),
83 .\"O the following may also be returned:
84 .BR open (2)
85
86 .BR mmap (2)
87 が返すエラーコードに加えて、以下のエラーコードが設定されることがある。
88 .TP
89 .B EACCES
90 .\"O The library specified by
91 .\"O .I library
92 .\"O does not have read or execute permission, or the caller does not have
93 .\"O search permission for one of the directories in the path prefix.
94 .\"O (See also
95 .\"O .BR path_resolution (7).)
96 .I library
97 で指定されたライブラリに対する読み込み許可、または実行許可がない。
98 もしくは
99 .I library
100 が存在するディレクトリかその上位のいずれかに対する検索許可がない
101 .RB ( path_resolution (7)
102 も参照)。
103 .TP
104 .B ENFILE
105 .\"O The system limit on the total number of open files has been reached.
106 オープンされたファイルの総数がシステム全体の上限に達した。
107 .TP
108 .B ENOEXEC
109 .\"O The file specified by
110 .\"O .I library
111 .\"O is not an executable of known type,
112 .\"O e.g., does not have the correct magic numbers.
113 .I library
114 で指定されたファイルが、実行可能ファイルと認識されるファイル種別では
115 ない、つまり正しいマジック・ナンバーが付いていない。
116 .\"O .SH "CONFORMING TO"
117 .SH 準拠
118 .\"O .BR uselib ()
119 .\"O is Linux-specific, and should not be used in programs
120 .\"O intended to be portable.
121 .BR uselib ()
122 は Linux 特有の関数であり、移植性を持たせたいプログラム
123 には使用すべきでない。
124 .\"O .SH NOTES
125 .SH 注意
126 .\"O .BR uselib ()
127 .\"O was used by early libc startup code to load
128 .\"O the shared libraries with names found in an array of names
129 .\"O in the binary.
130 初期の libc の起動コードは、
131 .BR uselib ()
132 を使って、
133 バイナリ中のリストに書かれている共有ライブラリを
134 リスト中のそのままの名前でロードしていた。
135 .LP
136 .\" libc 4.3.1f - changelog 1993-03-02
137 .\"O Since libc 4.3.2, startup code tries to prefix these names
138 .\"O with "/usr/lib", "/lib" and "" before giving up.
139 libc 4.3.2 以降では、これらの名前の前に "/usr/lib", "/lib", "" を
140 つけて共有ライブラリを探すようになった。
141 .\" libc 4.3.4 - changelog 1993-04-21
142 .\"O In libc 4.3.4 and later these names are looked for in the directories
143 .\"O found in
144 .\"O .BR LD_LIBRARY_PATH ,
145 .\"O and if not found there,
146 .\"O prefixes "/usr/lib", "/lib" and "/" are tried.
147 libc 4.3.4 以降では、これらの名前の共有ライブラリをまず
148 .B LD_LIBRARY_PATH
149 で指定されたディレクトリで探し、見つからなければ、
150 名前の前に "/usr/lib", "/lib", "/" をつけて探す。
151 .LP
152 .\"O From libc 4.4.4 on only the library "/lib/ld.so" is loaded,
153 .\"O so that this dynamic library can load the remaining libraries needed
154 .\"O (again using this call).
155 .\"O This is also the state of affairs in libc5.
156 libc 4.4.4 以降では、ライブラリ "/lib/ld.so" だけがロードされ、その後で
157 この動的ライブラリが (このシステムコールをもう一度使って)
158 必要な残りのライブラリをロードできるようになっている。
159 .LP
160 .\"O glibc2 does not use this call.
161 glibc2 は、このシステムコールを使用しない。
162 .\"O .SH "SEE ALSO"
163 .SH 関連項目
164 .BR ar (1),
165 .BR gcc (1),
166 .BR ld (1),
167 .BR ldd (1),
168 .BR mmap (2),
169 .BR open (2),
170 .BR dlopen (3),
171 .BR capabilities (7),
172 .BR ld.so (8)