getusershell
Section: C Library Functions (3)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
getusershell, setusershell, endusershell - 許可されたユーザーシェルを得る
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <unistd.h>
char *getusershell(void);
void setusershell(void);
void endusershell(void);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
getusershell(), setusershell(), endusershell():
glibc 2.21 以降:
_DEFAULT_SOURCE
glibc 2.19 と 2.20:
_DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
glibc 2.19 以前:
_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
説明
getusershell() 関数は /etc/shells ファイルから (開く必要があればこのファイルを開いてから)
現在行の次の一行を返す。 返された行の中身は有効なユーザーシェルのうちの一つのパス名である。 (訳注. 一行に付き一つのシェルのパス名が書かれている。)
もし /etc/shells が存在しないか、読み込み不可の場合には、 getusershell() は /bin/sh と
/bin/csh がファイルに記されているかのようにふるまう。
setusershell() 関数は /etc/shells ファイルの ファイルポインターを先頭に戻す。
endusershell() 関数は /etc/shells ファイルを閉じる。
返り値
getusershell() 関数はファイルの終端では NULL を返す。
ファイル
/etc/shells
属性
この節で使用されている用語の説明については、 attributes(7) を参照。
| インターフェース | 属性 | 値
|
|
getusershell(),
setusershell(),
endusershell()
| Thread safety | MT-Unsafe
|
標準規格
なし。
歴史
4.3BSD.
関連項目
shells(5)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- ファイル
-
- 属性
-
- 標準規格
-
- 歴史
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.