USELIB

Section: Linux Programmer's Manual (2)
Updated: 2020-12-21
Index JM Home Page
 

名前

uselib - 共有ライブラリを選択する  

書式

#include <unistd.h>

int uselib(const char *library);

Note: No declaration of this system call is provided in glibc headers; see NOTES.  

説明

システムコール uselib() は、呼び出し元プロセスが使用する 共有ライブラリをロードする際に使用される。 このシステムコールにはライブラリのパス名を指定する。 ライブラリをロードするアドレスはライブラリ自身に書かれている。 ライブラリは認識可能なバイナリ形式であればどんな形式でもよい。  

返り値

成功した場合は 0 が返される。エラーの場合は -1 が返され、 errno が適切に設定される。  

エラー

open(2) と mmap(2) が返すエラーコードに加えて、以下のエラーコードが設定されることがある。
EACCES
library で指定されたライブラリに対する読み込み許可、または実行許可がない。 もしくは library が存在するディレクトリかその上位のいずれかに対する検索許可がない (path_resolution(7) も参照)。
ENFILE
オープンされたファイルの総数がシステム全体の上限に達していた。
ENOEXEC
library で指定されたファイルが、実行可能ファイルと認識されるファイル種別ではない。 例えば、正しいマジックナンバーが付いていない。
 

準拠

uselib() は Linux 特有の関数であり、移植性を持たせたいプログラム には使用すべきでない。  

注意

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 syscall(2).

In ancient libc versions (before glibc 2.0), uselib() was used to load the shared libraries with names found in an array of names in the binary.

Since Linux 3.15, this system call is available only when the kernel is configured with the CONFIG_USELIB option.  

関連項目

ar(1), gcc(1), ld(1), ldd(1), mmap(2), open(2), dlopen(3), capabilities(7), ld.so(8)  

この文書について

この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。

関連キーワード

USELIB, ライブラリ, call, system, uselib, pages, エラー, 許可, names, 実行

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
返り値
エラー
準拠
注意
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:46 GMT, June 11, 2022