From: Akihiro Motoki Date: Fri, 26 Mar 2021 03:18:39 +0000 (+0900) Subject: LDP: Update draft based on the previous commit X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=56f56803cd2bbcae4e1af3cd569afe748c5001f7;p=linuxjm%2Fjm.git LDP: Update draft based on the previous commit --- diff --git a/manual/LDP_man-pages/draft/man2/_syscall.2 b/manual/LDP_man-pages/draft/man2/_syscall.2 index e92c2d7a..8c073e69 100644 --- a/manual/LDP_man-pages/draft/man2/_syscall.2 +++ b/manual/LDP_man-pages/draft/man2/_syscall.2 @@ -109,7 +109,7 @@ _syscall() マクロは、そのシステムコールの返り値 \fIr\fP が負 .\" システムコールを定義する際、引き数の型は値渡し (by\-value) か、 (構造体のように集合的なデータの場合は) ポインター渡し (by\-pointer) でなければならない。 -.SH EXAMPLES +.SH 例 .EX #include #include diff --git a/manual/LDP_man-pages/draft/man2/access.2 b/manual/LDP_man-pages/draft/man2/access.2 index de890378..236e901e 100644 --- a/manual/LDP_man-pages/draft/man2/access.2 +++ b/manual/LDP_man-pages/draft/man2/access.2 @@ -60,7 +60,7 @@ .\" .TH ACCESS 2 2020\-12\-21 Linux "Linux Programmer's Manual" .SH 名前 -access, faccessat, faccessat2 \- check user's permissions for a file +access, faccessat, faccessat2 \- ユーザーのファイルへのアクセス権をチェックする .SH 書式 .nf \fB#include \fP @@ -214,7 +214,7 @@ I/O エラーが発生した。 .PP \fBfaccessat\fP(): POSIX.1\-2008. .PP -\fBfaccessat2\fP(): Linux\-specific. +\fBfaccessat2\fP() は Linux 固有である。 .SH 注意 \fB警告\fP: あるユーザーが、例えば \fBopen\fP(2) によるアクセスが可能かどうかを、 (実際に行う前に) これらのシステムコールを使ってチェックするのは、セキュリティホールの原因になる。なぜならチェックをしてから @@ -248,7 +248,7 @@ the permissions on the file itself. これらのシステムコールは、 UID マッピングを使用した NFSv2 ファイルシステムでは正常に機能しないかもしれない。なぜならば UID のマッピングはサーバーで 行なわれ、権利のチェックをするクライアントには見えないからである。 (NFS バージョン 3 以降ではサーバー側でチェックが実行される。) 同様の問題は FUSE マウントでも起こり得る。 -.SS "C library/kernel differences" +.SS "C ライブラリとカーネルの違い" .\" The raw \fBfaccessat\fP() system call takes only the first three arguments. The \fBAT_EACCESS\fP and \fBAT_SYMLINK_NOFOLLOW\fP flags are actually implemented diff --git a/manual/LDP_man-pages/draft/man2/brk.2 b/manual/LDP_man-pages/draft/man2/brk.2 new file mode 100644 index 00000000..8f3d7e2d --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/brk.2 @@ -0,0 +1,139 @@ +.\" Copyright (c) 1993 Michael Haardt, (michael@moria.de) +.\" and Copyright 2006, 2008, Michael Kerrisk +.\" Fri Apr 2 11:32:09 MET DST 1993 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" Modified Wed Jul 21 19:52:58 1993 by Rik Faith +.\" Modified Sun Aug 21 17:40:38 1994 by Rik Faith +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1996 TABATA Tomohira +.\" all rights reserved. +.\" Translated Wed Jun 26 19:12:54 JST 1996 +.\" by TABATA Tomohira +.\" Modified Sat Dec 13 23:43:56 JST 1997 +.\" by HANATAKA Shinya +.\" Updated & Modified Wed May 19 01:55:29 JST 2004 +.\" by Yuichi SATO , LDP v1.66 +.\" Updated & Modified Tue Jan 2 09:09:47 JST 2007 by Yuichi SATO, LDP v2.43 +.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\" +.TH BRK 2 2016\-03\-15 Linux "Linux Programmer's Manual" +.SH 名前 +brk, sbrk \- データセグメントのサイズの変更する +.SH 書式 +\fB#include \fP +.PP +\fBint brk(void *\fP\fIaddr\fP\fB);\fP +.PP +\fBvoid *sbrk(intptr_t \fP\fIincrement\fP\fB);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBbrk\fP(), \fBsbrk\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +Since glibc 2.19: +.nf +.\" (_XOPEN_SOURCE\ >=\ 500 || +.\" _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && +_DEFAULT_SOURCE || + (_XOPEN_SOURCE\ >=\ 500) && + ! (_POSIX_C_SOURCE\ >=\ 200112L) +.fi +.TP 4 +From glibc 2.12 to 2.19: +.nf +.\" (_XOPEN_SOURCE\ >=\ 500 || +.\" _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && +_BSD_SOURCE || _SVID_SOURCE || + (_XOPEN_SOURCE\ >=\ 500) && + ! (_POSIX_C_SOURCE\ >=\ 200112L) +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +\fBbrk\fP() と \fBsbrk\fP() は \fIプログラムブレーク (program break)\fP の場所を変更する。 +プログラムブレークはプロセスのデータセグメント (data segment) の 末尾を示す (プログラムブレークは、初期化されていない +データセグメントの末尾の直後の場所となる)。 プログラムブレークを増やすということは、そのプロセスへの メモリーを割り当てる効果があり、 +プログラムブレークを減らすということは、メモリーを解放する ということである。 +.PP +\fBbrk\fP() は、データセグメントの末尾を \fIaddr\fP で指定した値に設定する。 設定が行われるのは、指定した値が有効で、 +システムに十分なメモリーがあり、 プロセスのデータサイズの最大値を超えていない場合である (\fBsetrlimit\fP(2) を参照)。 +.PP +\fBsbrk\fP() は、プログラムのデータ空間を \fIincrement\fP バイトだけ増やす。 \fIincrement\fP を 0 にして +\fBsbrk\fP() を呼び出すことで、プログラムの現在のブレーク (break) 場所を知ることができる。 +.SH 返り値 +成功した場合、 \fBbrk\fP() は 0 を返す。 エラーの場合には、\-1 を返し、 \fIerrno\fP に \fBENOMEM\fP を設定する。 +.PP +成功した場合、 \fBsbrk\fP() は変更前のプログラムブレークを返す (プログラムブレークが増やされた場合、この値は +新しく割り当てられたメモリーの先頭を指すポインターとなる)。 エラーの場合には、 \fI(void\ *)\ \-1\fP を返し、 \fIerrno\fP に +\fBENOMEM\fP を設定する。 +.SH 準拠 +.\" +.\" .BR brk () +.\" and +.\" .BR sbrk () +.\" are not defined in the C Standard and are deliberately excluded from the +.\" POSIX.1-1990 standard (see paragraphs B.1.1.1.3 and B.8.3.3). +4.3BSD, SUSv1. SUSv2 では「過去の名残 (LEGACY)」と位置付けられており、 POSIX.1\-2001 で削除された。 +.SH 注意 +\fBbrk\fP() や \fBsbrk\fP() を使用するのは避けること。 \fBmalloc\fP(3) メモリー割り当てパッケージの方が、移植性が高く、 +使いやすいメモリー割り当て方法を提供している。 +.PP +.\" One sees +.\" \fIint\fP (e.g., XPGv4, DU 4.0, HP-UX 11, FreeBSD 4.0, OpenBSD 3.2), +.\" \fIssize_t\fP (OSF1 2.0, Irix 5.3, 6.5), +.\" \fIptrdiff_t\fP (libc4, libc5, ulibc, glibc 2.0, 2.1), +.\" \fIintptr_t\fP (e.g., XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, NetBSD 1.6, +.\" Tru64 5.1, glibc2.2). +いろいろなシステムにおいて、 \fBsbrk\fP() の引き数に様々な型が使われている。 一般的なのは \fIint\fP, \fIssize_t\fP, +\fIptrdiff_t\fP, \fIintptr_t\fP である。 +.SS "C ライブラリとカーネルの違い" +上で説明した \fBbrk\fP() の返り値についての動作は、 Linux の \fBbrk\fP() システムコールをラップする glibc +の関数によるものである。 (その他の多くの実装でも、 \fBbrk\fP() の返り値はこれと同じである。 この返り値は SUSv2 でも規定されている。) +しかし、実際の Linux システムコールは、成功した場合、 プログラムの新しいブレークを返す。 +失敗した場合、このシステムコールは現在のブレークを返す。 glibc ラッパー関数は同様の働きをし (すなわち、新しいブレークが \fIaddr\fP +より小さいかどうかをチェックし)、 上で説明した 0 と \-1 という返り値を返す。 +.PP +Linux では \fBsbrk\fP() は \fBbrk\fP() システムコールを使うライブラリ関数として実装されており、 +以前のブレークの値を返すことができるように内部で調整が行われている。 +.SH 関連項目 +\fBexecve\fP(2), \fBgetrlimit\fP(2), \fBend\fP(3), \fBmalloc\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/chdir.2 b/manual/LDP_man-pages/draft/man2/chdir.2 index f2eb1a3a..113e5579 100644 --- a/manual/LDP_man-pages/draft/man2/chdir.2 +++ b/manual/LDP_man-pages/draft/man2/chdir.2 @@ -96,7 +96,7 @@ I/O エラーが発生した。 \fIpath\fP が長過ぎる。 .TP \fBENOENT\fP -The directory specified in \fIpath\fP does not exist. +\fIpath\fP で指定されたディレクトリが存在しない。 .TP \fBENOMEM\fP カーネルに十分なメモリーがない。 @@ -113,7 +113,7 @@ The directory specified in \fIpath\fP does not exist. \fIfd\fP が適切なファイルディスクリプターでない。 .TP \fBENOTDIR\fP -\fIfd\fP does not refer to a directory. +\fIfd\fP がディレクトリを参照していない。 .SH 準拠 POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.4BSD. .SH 注意 diff --git a/manual/LDP_man-pages/draft/man2/chmod.2 b/manual/LDP_man-pages/draft/man2/chmod.2 index 78d978ab..52b3d3b3 100644 --- a/manual/LDP_man-pages/draft/man2/chmod.2 +++ b/manual/LDP_man-pages/draft/man2/chmod.2 @@ -68,21 +68,21 @@ glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参 \fBfchmod\fP(): .RS 4 .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) -Since glibc 2.24: +glibc 2.24 以降: _POSIX_C_SOURCE\ >=\ 199309L .PP -Glibc 2.19 to 2.23 +glibc 2.19 から 2.23 まで _POSIX_C_SOURCE .PP -Glibc 2.16 to 2.19: +glibc 2.16 から 2.19 まで: _BSD_SOURCE || _POSIX_C_SOURCE .PP -Glibc 2.12 to 2.16: +glibc 2.12 から 2.16 まで: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE >= 200809L .PP .\" || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) -Glibc 2.11 and earlier: +glibc 2.11 以前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 .RE .PD @@ -269,7 +269,7 @@ The file is marked immutable or append\-only. (See \fBioctl_iflags\fP(2).) .PP \fBfchmodat\fP(): POSIX.1\-2008. .SH 注意 -.SS "C library/kernel differences" +.SS "C ライブラリとカーネルの違い" GNU C ライブラリの \fBfchmodat\fP() ラッパー関数は、このページで説明している POSIX で規定されたインターフェースを実装している。このインターフェースは、内部で呼ばれる Linux のシステムコールとは異なる。システムコールは \fIflags\fP 引き数を\fI持たない\fP。 diff --git a/manual/LDP_man-pages/draft/man2/chown.2 b/manual/LDP_man-pages/draft/man2/chown.2 index da152688..2975ae77 100644 --- a/manual/LDP_man-pages/draft/man2/chown.2 +++ b/manual/LDP_man-pages/draft/man2/chown.2 @@ -246,20 +246,17 @@ filesystem supports the \fB\-o\ grpid\fP (or, synonymously \fB\-o\ bsdgroups\fP) and \fB\-o\ nogrpid\fP (or, synonymously \fB\-o\ sysvgroups\fP) \fBmount\fP(8) options, then the rules are as follows: .IP * 2 -If the filesystem is mounted with \fB\-o\ grpid\fP, then the group of a new file -is made the same as that of the parent directory. +ファイルシステムが \fB\-o\ grpid\fP 付きでマウントされている場合、新しいファイルのグループは 親ディレクトリのグループと同じになる。 .IP * -If the filesystem is mounted with \fB\-o\ nogrpid\fP and the set\-group\-ID bit is -disabled on the parent directory, then the group of a new file is made the -same as the process's filesystem GID. +ファイルシステムが \fB\-o\ nogrpid\fP 付きでマウントされており、親ディレクトリでは set\-group\-ID ビットが +無効になっている場合、新しいファイルのグループは プロセスのファイルシステム GID と同じになる。 .IP * -If the filesystem is mounted with \fB\-o\ nogrpid\fP and the set\-group\-ID bit is -enabled on the parent directory, then the group of a new file is made the -same as that of the parent directory. +ファイルシステムが \fB\-o\ nogrpid\fP 付きでマウントされており、親ディレクトリでは set\-group\-ID ビットが +有効になっている場合、新しいファイルのグループは 親ディレクトリのグループと同じになる。 .PP -As at Linux 4.12, the \fB\-o\ grpid\fP and \fB\-o\ nogrpid\fP mount options are -supported by ext2, ext3, ext4, and XFS. Filesystems that don't support -these mount options follow the \fB\-o\ nogrpid\fP rules. +Linux 4.12 の時点では、マウントオプション \fB\-o\ grpid\fP と \fB\-o\ nogrpid\fP に対応しているファイルシステムは +ext2, ext3, ext4, XFS である。 これらのマウントオプションに対応していないファイルシステムでは、 \fB\-o\ nogrpid\fP +に関するルールが適用される。 .SS "glibc での注意" \fBfchownat\fP() が利用できない古いカーネルでは、 glibc ラッパー関数は \fBchown\fP() を使用するモードにフォールバックする。 \fIpathname\fP が相対パスの場合、 glibc は \fIdirfd\fP 引き数に対応する \fI/proc/self/fd\fP @@ -281,7 +278,7 @@ Linux の 2.1.81 より前のバージョン (特に 2.1.46 以前) では、 \f Linux 2.1.81 以降では \fBchown\fP() はシンボリックリンクを追跡し、新たなシステムコール \fBlchown\fP() はシンボリックリンクを追跡しない。 Linux 2.1.86 以降ではこの新しいコール (古い \fBchown\fP() と全く同じ動作を行なう) は同じシステムコール番号を持ち \fBchown\fP() は新しく導入された番号を持つ。 -.SH EXAMPLES +.SH 例 以下のプログラムは、 二つ目のコマンドライン引き数で指定された名前のファイルの所有者を、 一つ目のコマンドライン引き数で指定された値に変更する。 新しい所有者は、数字のユーザー ID かユーザー名のいずれかで指定できる (ユーザー名で指定した場合には、 \fBgetpwnam\fP(3) を使ってシステムのパスワードファイルの検索が行われ、 ユーザー ID への変換が行われる)。 diff --git a/manual/LDP_man-pages/draft/man2/dup.2 b/manual/LDP_man-pages/draft/man2/dup.2 new file mode 100644 index 00000000..e5478808 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/dup.2 @@ -0,0 +1,198 @@ +.\" This manpage is Copyright (C) 1992 Drew Eckhardt; +.\" and Copyright (C) 1993 Michael Haardt, Ian Jackson. +.\" and Copyright (C) 2005, 2008 Michael Kerrisk +.\" and Copyright (C) 2014 Michael Kerrisk +.\" +.\" %%%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 1993-07-21, Rik Faith +.\" Modified 1994-08-21, Michael Chastain : +.\" Fixed typos. +.\" Modified 1997-01-31, Eric S. Raymond +.\" Modified 2002-09-28, aeb +.\" 2009-01-12, mtk, reordered text in DESCRIPTION and added some +.\" details for dup2(). +.\" 2008-10-09, mtk: add description of dup3() +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1996 Takeshi Ueno +.\" all rights reserved. +.\" Translated 1996-07-03, Takeshi Ueno +.\" Modified 1997-12-14, HANATAKA Shinya +.\" Modified 2003-01-16, Akihiro Motoki +.\" Updated & Modified 2004-05-19, Yuichi SATO +.\" Updated & Modified 2005-09-07, Akihiro MOTOKI +.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\" +.TH DUP 2 2020\-11\-01 Linux "Linux Programmer's Manual" +.SH 名前 +dup, dup2, dup3 \- ファイルディスクリプターを複製する +.SH 書式 +.nf +\fB#include \fP +.PP +\fBint dup(int \fP\fIoldfd\fP\fB);\fP +\fBint dup2(int \fP\fIoldfd\fP\fB, int \fP\fInewfd\fP\fB);\fP + +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP /* 定数 O_* の定義の取得 */ +\fB#include \fP +.PP +\fBint dup3(int \fP\fIoldfd\fP\fB, int \fP\fInewfd\fP\fB, int \fP\fIflags\fP\fB);\fP +.fi +.SH 説明 +The \fBdup\fP() system call creates a copy of the file descriptor \fIoldfd\fP, +using the lowest\-numbered unused file descriptor for the new descriptor. +.PP +After a successful return, the old and new file descriptors may be used +interchangeably. They refer to the same open file description (see +\fBopen\fP(2)) and thus share file offset and file status flags; for example, +if the file offset is modified by using \fBlseek\fP(2) on one of the file +descriptors, the offset is also changed for the other. +.PP +.\" +The two file descriptors do not share file descriptor flags (the +close\-on\-exec flag). The close\-on\-exec flag (\fBFD_CLOEXEC\fP; see +\fBfcntl\fP(2)) for the duplicate descriptor is off. +.SS dup2() +The \fBdup2\fP() system call performs the same task as \fBdup\fP(), but instead +of using the lowest\-numbered unused file descriptor, it uses the file +descriptor number specified in \fInewfd\fP. If the file descriptor \fInewfd\fP +was previously open, it is silently closed before being reused. +.PP +ファイルディスクリプター \fInewfd\fP をクローズして再利用する処理は +\fIアトミック(不可分)に\fP実行される。これは重要な点である。 なぜなら、 +等価な機能を \fBclose\fP(2) と \fBdup\fP() を使って実装しようとすると、 +2 つの処理の間に \fInewfd\fP が再利用されてしまうという、 +競合状態にさらされることになるからだ。 +このような再利用が起こるのは、 +メインプログラムがファイルディスクリプターを割り当てる +シグナルハンドラーにより割り込まれたり、並行動作するスレッドが +ファイルディスクリプターを割り当てたりすることがあるからだ。 +.PP +以下の点について注意すること: +.IP * 3 +\fIoldfd\fP が有効なファイルディスクリプターでない場合、その呼び出しは失敗し、 \fInewfd\fP はクローズされない。 +.IP * +.\" +\fIoldfd\fP が有効なファイルディスクリプターで、 \fInewfd\fP が \fIoldfd\fP と同じ値の場合、 \fBdup2\fP() は何もせず、 +\fInewfd\fP を返す。 +.SS dup3() +\fBdup3\fP() は \fBdup2\fP() と同じだが、以下の点が異なる。 +.IP * 3 +呼び出し元が、新しいファイルディスクリプターに対して close\-on\-exec フラグを強制的に設定することができる。 これを行うには、 +\fIflags\fP に \fBO_CLOEXEC\fP を指定する。 このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP +フラグの説明を参照のこと。 +.IP * +.\" Ulrich Drepper, LKML, 2008-10-09: +.\" We deliberately decided on this change. Otherwise, what is the +.\" result of dup3(fd, fd, O_CLOEXEC)? +\fIoldfd\fP が \fInewfd\fP と同じ場合、 \fBdup3\fP() は \fBEINVAL\fP エラーで失敗する。 +.SH 返り値 +On success, these system calls return the new file descriptor. On error, \-1 +is returned, and \fIerrno\fP is set appropriately. +.SH エラー +.TP +\fBEBADF\fP +\fIoldfd\fP がオープンされたファイルディスクリプターではない。 +.TP +\fBEBADF\fP +\fInewfd\fP がファイルディスクリプターとして許可されている範囲ではない (\fBgetrlimit\fP(2) の \fBRLIMIT_NOFILE\fP +の議論を参照)。 +.TP +\fBEBUSY\fP +(Linux のみ) \fBopen\fP(2) や \fBdup\fP() との競合状態の場合に、 \fBdup2\fP() や \fBdup3\fP() +はこのエラーを返すかもしれない。 +.TP +\fBEINTR\fP +\fBdup2\fP() や \fBdup3\fP() の呼び出しがシグナルにより割り込まれた。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +(\fBdup3\fP()) \fIflags\fP に無効な値が入っている。 +.TP +\fBEINVAL\fP +(\fBdup3\fP()) \fIoldfd\fP が \fInewfd\fP と同じであった。 +.TP +\fBEMFILE\fP +The per\-process limit on the number of open file descriptors has been +reached (see the discussion of \fBRLIMIT_NOFILE\fP in \fBgetrlimit\fP(2)). +.SH バージョン +\fBdup3\fP() はバージョン 2.6.27 で Linux に追加された。 glibc によるサポートはバージョン 2.9 以降で利用できる。 +.SH 準拠 +\fBdup\fP(), \fBdup2\fP(): POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. +.PP +.\" SVr4 documents additional +.\" EINTR and ENOLINK error conditions. POSIX.1 adds EINTR. +.\" The EBUSY return is Linux-specific. +\fBdup3\fP() は Linux 固有である。 +.SH 注意 +\fInewfd\fP が範囲を超えた時に返されるエラーは、 \fBdup2\fP() と \fBfcntl(\fP..., \fBF_DUPFD\fP, ...\fB)\fP +では異っている。 \fBdup2\fP() が \fBF_DUPFD\fP と同じように \fBEINVAL\fP を返すシステムもある。 +.PP +\fInewfd\fP がオープンされていた場合、 +\fBclose\fP(2) 時に報告されることになるエラーはすべて失われる。 +これが心配で、シングルスレッドかつシグナルハンドラーで +ファイルディスクリプターを割り当てるようなプログラムでない場合には、 +正しい方法は \fBdup2\fP() を呼び出す前に +\fInewfd\fP をクローズ「しない」ことである。 +なぜなら、上で説明した競合状況があるからである。 +代わりに、以下のようなコードが使用できることだろう。 +.PP +.in +4n +.EX +/* Obtain a duplicate of \(aqnewfd\(aq that can subsequently + be used to check for close() errors; an EBADF error + means that \(aqnewfd\(aq was not open. */ + +tmpfd = dup(newfd); +if (tmpfd == \-1 && errno != EBADF) { + /* Handle unexpected dup() error */ +} + +/* Atomically duplicate \(aqoldfd\(aq on \(aqnewfd\(aq */ + +if (dup2(oldfd, newfd) == \-1) { + /* Handle dup2() error */ +} + +/* Now check for close() errors on the file originally + referred to by \(aqnewfd\(aq */ + +if (tmpfd != \-1) { + if (close(tmpfd) == \-1) { + /* Handle errors from close */ + } +} +.EE +.in +.SH 関連項目 +\fBclose\fP(2), \fBfcntl\fP(2), \fBopen\fP(2), \fBpidfd_getfd\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/exit_group.2 b/manual/LDP_man-pages/draft/man2/exit_group.2 index 1db30dfe..d4eebb82 100644 --- a/manual/LDP_man-pages/draft/man2/exit_group.2 +++ b/manual/LDP_man-pages/draft/man2/exit_group.2 @@ -43,9 +43,8 @@ exit_group \- プロセス中の全てのスレッドを exit させる \fBvoid exit_group(int \fP\fIstatus\fP\fB);\fP .fi .SH 説明 -This system call is equivalent to \fB_exit\fP(2) except that it terminates not -only the calling thread, but all threads in the calling process's thread -group. +このシステムコールは、基本的に \fB_exit\fP(2) と等しいが、 呼び出し元のスレッドだけでなく、呼び出し元のプロセスのスレッドグループに +ある全てのスレッドを終了させる点が異なる。 .SH 返り値 このシステムコールは値を返さない。 .SH バージョン @@ -53,8 +52,7 @@ group. .SH 準拠 このシステムコールは Linux 固有である。 .SH 注意 -Since glibc 2.3, this is the system call invoked when the \fB_exit\fP(2) -wrapper function is called. +glibc 2.3 以降では、 \fB_exit\fP(2) のラッパー関数が呼び出された際に、 このシステムコールが起動される。 .SH 関連項目 \fBexit\fP(2) .SH この文書について diff --git a/manual/LDP_man-pages/draft/man2/gethostname.2 b/manual/LDP_man-pages/draft/man2/gethostname.2 new file mode 100644 index 00000000..a0a47472 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/gethostname.2 @@ -0,0 +1,140 @@ +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" %%%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 1995-07-22 by Michael Chastain : +.\" 'gethostname' is real system call on Linux/Alpha. +.\" Modified 1997-01-31 by Eric S. Raymond +.\" Modified 2000-06-04, 2001-12-15 by aeb +.\" Modified 2004-06-17 by mtk +.\" Modified 2008-11-27 by mtk +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-27, SUTO, Mitsuaki +.\" Updated 2000-09-30, Yuichi SATO +.\" Updated & Modified 2002-01-14, Yuichi SATO +.\" Updated & Modified 2004-12-30, Yuichi SATO +.\" Updated & Modified 2006-01-31, Akihiro MOTOKI +.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15 +.\" +.TH GETHOSTNAME 2 2019\-10\-10 Linux "Linux Programmer's Manual" +.SH 名前 +gethostname, sethostname \- ホスト名の取得・設定をする +.SH 書式 +\fB#include \fP +.PP +\fBint gethostname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP +.br +\fBint sethostname(const char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +.ad l +.PD 0 +\fBgethostname\fP(): +.RS 4 +glibc 2.12 以降: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.br +|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200112L +.RE +.br +\fBsethostname\fP(): +.nf +.\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 + Since glibc 2.21: + _DEFAULT_SOURCE + In glibc 2.19 and 2.20: + _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) + Up to and including glibc 2.19: + _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.fi +.PD +.ad +.SH 説明 +These system calls are used to access or to change the system hostname. +More precisely, they operate on the hostname associated with the calling +process's UTS namespace. +.PP +\fBsethostname\fP() は、ホスト名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、 \fIname\fP +のバイト数を指定する (そのため、 \fIname\fP では文字列終端のヌルバイトは必要ない)。 +.PP +\fBgethostname\fP() returns the null\-terminated hostname in the character +array \fIname\fP, which has a length of \fIlen\fP bytes. If the null\-terminated +hostname is too large to fit, then the name is truncated, and no error is +returned (but see NOTES below). POSIX.1 says that if such truncation +occurs, then it is unspecified whether the returned buffer includes a +terminating null byte. +.SH 返り値 +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +.TP +\fBEFAULT\fP +\fIname\fP が不正なアドレスである。 +.TP +\fBEINVAL\fP +.\" Can't occur for gethostbyname() wrapper, since 'len' has an +.\" unsigned type; can occur for the underlying system call. +\fIlen\fP が負である。 \fBsethostname\fP() において \fIlen\fP が許容された最大サイズを越えている。 +.TP +\fBENAMETOOLONG\fP +(glibc \fBgethostname\fP() で) \fIlen\fP が実際のホスト名の長さよりも小さい (glibc バージョン 2.1 +より前では、この状況で \fBEINVAL\fP が使用される)。 +.TP +\fBEPERM\fP +For \fBsethostname\fP(), the caller did not have the \fBCAP_SYS_ADMIN\fP +capability in the user namespace associated with its UTS namespace (see +\fBnamespaces\fP(7)). +.SH 準拠 +SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD). POSIX.1\-2001 and +POSIX.1\-2008 specify \fBgethostname\fP() but not \fBsethostname\fP(). +.SH 注意 +SUSv2 guarantees that "Host names are limited to 255 bytes". POSIX.1 +guarantees that "Host names (not including the terminating null byte) are +limited to \fBHOST_NAME_MAX\fP bytes". On Linux, \fBHOST_NAME_MAX\fP is defined +with the value 64, which has been the limit since Linux 1.0 (earlier kernels +imposed a limit of 8 bytes). +.SS "C ライブラリとカーネルの違い" +GNU C ライブラリは、 \fBgethostname\fP() システムコールを利用していない。その代わり、 \fBgethostname\fP() +をライブラリ関数として実装しており、 この関数は \fBuname\fP(2) を呼び出し、 \fBuname\fP(2) が返した \fInodename\fP +フィールド (の最大 \fIlen\fP バイト) を \fIname\fP にコピーする。 コピーを行った際に、この関数は \fInodename\fP の長さが +\fIlen\fP 以上かの確認を行い、 \fIlen\fP 以上の場合には \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。 +この場合、返された \fIname\fP には終端のヌルバイトは含まれない。 +.PP +.\" At least glibc 2.0 and 2.1, older versions not checked +バージョン 2.2 より前の glibc では、 \fInodename\fP の長さが \fIlen\fP 以上の場合の扱いが異なる; \fIlen\fP +以上の場合には、 \fIname\fP には何もコピーせず、関数は \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。 +.SH 関連項目 +\fBhostname\fP(1), \fBgetdomainname\fP(2), \fBsetdomainname\fP(2), \fBuname\fP(2), +\fButs_namespaces\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/getpagesize.2 b/manual/LDP_man-pages/draft/man2/getpagesize.2 new file mode 100644 index 00000000..bc5e9e40 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/getpagesize.2 @@ -0,0 +1,106 @@ +.\" Copyright (C) 2001 Andries Brouwer +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 2002-04-14, HANATAKA Shinya +.\" Updated 2003-07-03, Akihiro Motoki +.\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43 +.\" Updated 2012-04-30, Akihiro MOTOKI +.\" +.TH GETPAGESIZE 2 2017\-09\-15 Linux "Linux Programmer's Manual" +.SH 名前 +getpagesize \- メモリーのページサイズを取得する +.SH 書式 +\fB#include \fP +.PP +\fBint getpagesize(void);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBgetpagesize\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +Since glibc 2.19: +.nf +_DEFAULT_SOURCE || ! (_POSIX_C_SOURCE\ >=\ 200112L) +.fi +.TP 4 +From glibc 2.12 to 2.19: +.nf +_BSD_SOURCE || ! (_POSIX_C_SOURCE\ >=\ 200112L) +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +.\" .SH HISTORY +.\" This call first appeared in 4.2BSD. +\fBgetpagesize\fP() 関数はメモリーページの大きさをバイト数で返す。 +ここでいう「ページ」は固定長のブロックであり、 +\fBmmap\fP(2) で実行されるメモリー割り当てとファイルマッピングの単位である。 +.SH 準拠 +SVr4, 4.4BSD, SUSv2. +SUSv2 では \fBgetpagesize\fP() システムコールは「過去の遺物 (LEGACY)」とされており、 +POSIX.1\-2001 からは外されている。 HP\-UX にはこのシステムコールは存在しない。 +.SH 注意 +移植性が必要なアプリケーションでは、 +\fBgetpagesize\fP() ではなく \fIsysconf(_SC_PAGESIZE)\fP を利用すべきである。 +.PP +.in +4n +.EX +#include +long sz = sysconf(_SC_PAGESIZE); +.EE +.in +.PP +(ほとんどのシステムでは \fB_SC_PAGESIZE\fP の同義語として +\fB_SC_PAGE_SIZE\fP を使用することができる。) +.PP +\fBgetpagesize\fP() が Linux のシステムコールとして存在するかどうかは、そのアーキテクチャーに 依存している。 +システムコールとして存在する場合には、カーネルシンボルの \fBPAGE_SIZE\fP を返す。 \fBPAGE_SIZE\fP +の値は、アーキテクチャーとマシンモデルに依存する。 一般に、バイナリは、アーキテクチャーごとに1つのバイナリ配布で済ませるために、 +アーキテクチャーには依存しているがマシンモデルには依存していない。 つまり、ユーザープログラムはコンパイル時にヘッダーファイルから +\fBPAGE_SIZE\fP を見つけて使用すべきではない。 少なくとも、マシンモデルについても依存性が存在する (sun4 のような) +アーキテクチャーにおいては本物のシステムコールを使用する必要がある。 尚、 glibc 2.0 では、 \fBgetpagesize\fP() +がシステムコールを使用せず、固定の値を返すために、この方法は 失敗する。glibc 2.1 では大丈夫である。 +.SH 関連項目 +\fBmmap\fP(2), \fBsysconf\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man2/pread.2 b/manual/LDP_man-pages/draft/man2/pread.2 index 06d21677..c7398d0b 100644 --- a/manual/LDP_man-pages/draft/man2/pread.2 +++ b/manual/LDP_man-pages/draft/man2/pread.2 @@ -95,7 +95,7 @@ POSIX.1\-2001, POSIX.1\-2008. .\" システムコール \fBpread\fP() と \fBpwrite\fP() は、特にマルチスレッドアプリケーションで役に立つ。 これらを使うと、 他のスレッドによるファイルオフセットの変更の影響を受けることなく、 複数のスレッドが同じファイルディスクリプターに対して入出力を行うことができる。 -.SS "C library/kernel differences" +.SS "C ライブラリとカーネルの違い" Linux では、裏で呼び出されるシステムコールの名前がカーネル 2.6 で変更された。 \fBpread\fP() は \fBpread64\fP() になり、 \fBpwrite\fP() は \fBpwrite64\fP() になった。 システムコールの番号は変更されていない。 diff --git a/manual/LDP_man-pages/draft/man2/sysctl.2 b/manual/LDP_man-pages/draft/man2/sysctl.2 index 12a7e5a3..f7292fe7 100644 --- a/manual/LDP_man-pages/draft/man2/sysctl.2 +++ b/manual/LDP_man-pages/draft/man2/sysctl.2 @@ -108,7 +108,7 @@ wrapper for this system call, necessitating the use of \fBsyscall\fP(2). 全ての可能な項目が正確に記述されているわけではない。 .PP 今のところ \fI/proc/sys/kernel/ostype\fP に書き込むことでオペーレーティングシステムを変えることはできない。 -.SH EXAMPLES +.SH 例 .EX #define _GNU_SOURCE #include diff --git a/manual/LDP_man-pages/draft/man2/uname.2 b/manual/LDP_man-pages/draft/man2/uname.2 index 69d30325..234b2966 100644 --- a/manual/LDP_man-pages/draft/man2/uname.2 +++ b/manual/LDP_man-pages/draft/man2/uname.2 @@ -98,7 +98,7 @@ POSIX.1\-2001, POSIX.1\-2008, SVr4. There is no \fBuname\fP() call in 4.3BSD. .PP utsname の情報は、 \fI/proc/sys/kernel/\fP{\fIostype\fP, \fIhostname\fP, \fIosrelease\fP, \fIversion\fP, \fIdomainname\fP} を使ってアクセスすることもできる。 -.SS "C library/kernel differences" +.SS "C ライブラリとカーネルの違い" .\" That was back before Linux 1.0 .\" That was also back before Linux 1.0 時間の経過とともに、 \fIutsname\fP 構造体のサイズが大きくなり、この影響で \fBuname\fP() には 3つのバージョンが存在する: diff --git a/manual/LDP_man-pages/draft/man2/vfork.2 b/manual/LDP_man-pages/draft/man2/vfork.2 new file mode 100644 index 00000000..b3298ac7 --- /dev/null +++ b/manual/LDP_man-pages/draft/man2/vfork.2 @@ -0,0 +1,218 @@ +.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl), 1 Nov 1999 +.\" and Copyright 2006, 2012, 2017 Michael Kerrisk +.\" +.\" %%%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 +.\" +.\" 1999-11-10: Merged text taken from the page contributed by +.\" Reed H. Petty (rhp@draper.net) +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya +.\" all rights reserved. +.\" Translated 1999-12-04, HANATAKA Shinya +.\" Updated 2007-01-09, Akihiro MOTOKI , LDP v2.43 +.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\" Updated 2012-04-30, Akihiro MOTOKI +.\" Updated 2013-03-26, Akihiro MOTOKI +.\" +.TH VFORK 2 2017\-09\-15 Linux "Linux Programmer's Manual" +.SH 名前 +vfork \- 子プロセスを生成し親プロセスを停止させる +.SH 書式 +\fB#include \fP +.br +\fB#include \fP +.PP +\fBpid_t vfork(void);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBvfork\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +glibc 2.12 以降: +.nf +(_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200809L) + || /* Since glibc 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +.SS 規格の説明 +(POSIX.1 より引用) \fBvfork\fP() 関数は \fBfork\fP(2) と同じ働きをするが、 \fBvfork\fP() +で作成されたプロセスが \fBvfork\fP() からの返り値を格納している \fIpid_t\fP 型の変数以外を変更したり、 \fBvfork\fP() +を呼び出している関数から return したり、 \fB_exit\fP(2) や \fBexec\fP(3) +族の関数をコールする前に他の関数をコールした場合の動作が 未定義であるという点が異なる。 +.SS "LINUX での説明" +\fBvfork\fP() は \fBfork\fP(2) と全く同じように呼び出したプロセスの子プロセスを生成する。 詳しい説明と返り値、エラーについては +\fBfork\fP(2) を参照すること。 +.PP +\fBvfork\fP() は \fBclone\fP(2) の特殊な場合である。 親プロセスのページテーブルのコピーを行わずに新しいプロセスを +作成するために使用する。これは性能に敏感なアプリケーションにおいて 子プロセスを生成してすぐに \fBexecve\fP(2) する場合に有用かもしれない。 +.PP +\fBvfork\fP() differs from \fBfork\fP(2) in that the calling thread is suspended +until the child terminates (either normally, by calling \fB_exit\fP(2), or +abnormally, after delivery of a fatal signal), or it makes a call to +\fBexecve\fP(2). Until that point, the child shares all memory with its +parent, including the stack. The child must not return from the current +function or call \fBexit\fP(3) (which would have the effect of calling exit +handlers established by the parent process and flushing the parent's +\fBstdio\fP(3) buffers), but may call \fB_exit\fP(2). +.PP +\fBfork\fP(2) と同様に、 \fBvfork\fP() で作成された子プロセスは、 +(ファイルディスクリプター、シグナル配送定義、カレントワーキングディレクトリなどの) +呼び出し元のプロセスの各種の属性を継承する。 +\fBvfork\fP() では、上で説明した仮想アドレス空間の扱いだけが異なる。 +.PP +親プロセスへ送られたシグナルは、子プロセスが親プロセスのメモリーを解放した後 +(すなわち、子プロセスが終了するか \fBexecve\fP(2) を呼んだ後) に到着する。 +.SS 歴史的な説明 +Linux において \fBfork\fP(2) は書き込み時コピー (copy\-on\-write) ページを使用して実装されている。 そのため +\fBfork\fP(2) を使用することによって被る損害は親プロセスのページテーブルを 複製するために必要な時間とメモリーだけである。 +しかしながら、忌しき昔には \fBfork\fP(2) は呼び出したプロセスのデータ空間の全てのコピーしていたが、 +これはしばしば不必要であった。なぜなら、たいていはすぐ後に \fBexec\fP(3) を実行していたからである。 この場合の効率を上げるために BSD は +\fBvfork\fP() システムコールを導入して親プロセスのアドレス空間を完全にコピー するかわりに、 \fBexecve\fP(2) をコールするか +exit が起きるまで親プロセスのメモリーと制御スレッド を借りるようにした。 親プロセスは子プロセスがその資源を使用している間は停止された。 +\fBvfork\fP() は使いにくいものであった: 例えば、親プロセスの変数を変更しな +いようにするためにはどの変数がレジスターに保持されているかを知らな ければならなかった。 +.SH 準拠 +4.3BSD; POSIX.1\-2001 (廃止予定とされている)。 +POSIX.1\-2008 では \fBvfork\fP() の規定が削除されている。 +.PP +.\" In AIXv3.1 vfork is equivalent to fork. +\fBvfork\fP() コールは他のオペレーティングシステムの同名のコールと ちょっと似 +ているかもしれない。規格が \fBvfork\fP() に要求していることは、 \fBfork\fP(2) に要 +求していることよりは弱い。したがって、 両者を同じものとして実装しても、規格に +準拠していることになる。 特にプログラマーは、子プロセスが終了するか +\fBexecve\fP(2) を呼び出すまで親プロセスが停止していることや、メモリーを共有するこ +とによる特殊な動作をあてにすべきではない。 +.SH 注意 +\fBvfork\fP() の動作は構造的な欠陥と考える人もいるだろうし、 +BSD のマニュアルには、「このシステムコールは妥当なシステム共有機構が実装さ +れた場合には削除される。ユーザーは \fBvfork\fP() のメモリー共有機能に依存するべき +ではない。何故ならば、このシステムコール が削除された場合には、それは +\fBfork\fP(2) の同義語とされるからである。」と書かれている。しかしながら、 +最近のメモリー管理ハードウェアにより \fBfork\fP(2) と \fBvfork\fP() の間の性能差が +減ったとはいえ、 Linux や他のシステムで \fBvfork\fP() が残されているのには +いくつか理由がある: +.IP * 3 +性能に厳しいアプリケーションでは、 \fBvfork\fP() により得られる +小さな性能上のメリットが必要な場合がある。 +.IP * +.\" http://stackoverflow.com/questions/4259629/what-is-the-difference-between-fork-and-vfork +.\" http://developers.sun.com/solaris/articles/subprocess/subprocess.html +.\" http://mailman.uclinux.org/pipermail/uclinux-dev/2009-April/000684.html +.\" +\fBvfork\fP() はメモリー管理ユニット (MMU) を持たないシステムでも実装すること +ができるが、そのようなシステムで \fBfork\fP(2) を実装することはできない。 +(POSIX.1\-2008 では \fBvfork\fP() が標準から削除された。 +\fBposix_spawn\fP(3) 関数の POSIX の原理 (rationale) には、 +\fBfork\fP(2)+\fBexec\fP(3) と等価な機能を提供する \fBposix_spawn\fP(3) は、 +MMU を持たないシステムでも実装できるように設計されたとの注記がある。) +.IP * +.\" +On systems where memory is constrained, \fBvfork\fP() avoids the need to +temporarily commit memory (see the description of +\fI/proc/sys/vm/overcommit_memory\fP in \fBproc\fP(5)) in order to execute a new +program. (This can be especially beneficial where a large parent process +wishes to execute a small helper program in a child process.) By contrast, +using \fBfork\fP(2) in this scenario requires either committing an amount of +memory equal to the size of the parent process (if strict overcommitting is +in force) or overcommitting memory with the risk that a process is +terminated by the out\-of\-memory (OOM) killer. +.SS Caveats +The child process should take care not to modify the memory in unintended +ways, since such changes will be seen by the parent process once the child +terminates or executes another program. In this regard, signal handlers can +be especially problematic: if a signal handler that is invoked in the child +of \fBvfork\fP() changes memory, those changes may result in an inconsistent +process state from the perspective of the parent process (e.g., memory +changes would be visible in the parent, but changes to the state of open +file descriptors would not be visible). +.PP +.\" +When \fBvfork\fP() is called in a multithreaded process, only the calling +thread is suspended until the child terminates or executes a new program. +This means that the child is sharing an address space with other running +code. This can be dangerous if another thread in the parent process changes +credentials (using \fBsetuid\fP(2) or similar), since there are now two +processes with different privilege levels running in the same address +space. As an example of the dangers, suppose that a multithreaded program +running as root creates a child using \fBvfork\fP(). After the \fBvfork\fP(), a +thread in the parent process drops the process to an unprivileged user in +order to run some untrusted code (e.g., perhaps via plug\-in opened with +\fBdlopen\fP(3)). In this case, attacks are possible where the parent process +uses \fBmmap\fP(2) to map in code that will be executed by the privileged +child process. +.SS "Linux での注意" +\fBpthread_atfork\fP(3) を使って設定された fork ハンドラーは NPTL +スレッドライブラリコールを採用したマルチスレッドプログラムでは 呼び出されない。一方、LinuxThreads スレッドライブラリを使った +プログラムでは、fork ハンドラーは呼び出される。 (Linux のスレッドライブラリの説明は \fBpthreads\fP(7) を参照。) +.PP +\fBvfork\fP() の呼び出しは、以下の \fIflags\fP を指定して \fBclone\fP(2) を呼び出す +のと等価である。 +.PP + CLONE_VM | CLONE_VFORK | SIGCHLD +.SS 歴史 +.\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still +.\" present, but definitely on its way out'. +The \fBvfork\fP() system call appeared in 3.0BSD. In 4.4BSD it was made +synonymous to \fBfork\fP(2) but NetBSD introduced it again; see +.UR http://www.netbsd.org\:/Documentation\:/kernel\:/vfork.html +.UE . +In +Linux, it has been equivalent to \fBfork\fP(2) until 2.2.0\-pre6 or so. Since +2.2.0\-pre9 (on i386, somewhat later on other architectures) it is an +independent system call. Support was added in glibc 2.0.112. +.SH バグ +.\" +.\" As far as I can tell, the following is not true in 2.6.19: +.\" Currently (Linux 2.3.25), +.\" .BR strace (1) +.\" cannot follow +.\" .BR vfork () +.\" and requires a kernel patch. +シグナルの扱いの詳細は不明瞭でシステムごとに異っている。 BSD のマニュアルには、 「デッドロック状態になる可能性があるので \fBvfork\fP() +の途中の子プロセスに \fBSIGTTOU\fP や \fBSIGTTIN\fP シグナルを送信してはならない; さらに出力や \fIioctl\fP +は許されるが、入力を試みた場合には結果はファイル終端 (EOF) になる。」 と書かれている。 +.SH 関連項目 +\fBclone\fP(2), \fBexecve\fP(2), \fB_exit\fP(2), \fBfork\fP(2), \fBunshare\fP(2), +\fBwait\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/confstr.3 b/manual/LDP_man-pages/draft/man3/confstr.3 new file mode 100644 index 00000000..f33b498e --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/confstr.3 @@ -0,0 +1,129 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" +.\" %%%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 Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu) +.\" +.\" FIXME Many more values for 'name' are supported, some of which +.\" are documented under 'info confstr'. +.\" See for the rest. +.\" These should all be added to this page. +.\" See also the POSIX.1-2001 specification of confstr() +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya +.\" all rights reserved. +.\" Translated by Hiroaki Nagoya +.\" Updated 2005-09-06, Akihiro MOTOKI +.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.36 +.\" +.TH CONFSTR 3 2020\-06\-09 GNU "Linux Programmer's Manual" +.SH 名前 +confstr \- コンフィグレーションに依存した文字列変数の取得 +.SH 書式 +.nf +\fB#include \fP +.PP +\fBsize_t confstr(int \fP\fIname\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBconfstr\fP(): _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +.SH 説明 +\fBconfstr\fP() はコンフィグレーションに依存した文字列変数の値を取得する。 +.PP +引き数 \fIname\fP は、問い合わせ内容を表すシステム変数である。 以下の変数がサポートされている。 +.TP +\fB_CS_GNU_LIBC_VERSION\fP (GNU C library 限定; glibc 2.3.2 以降) +A string which identifies the GNU C library version on this system (e.g., +"glibc 2.3.4"). +.TP +\fB_CS_GNU_LIBPTHREAD_VERSION\fP (GNU C library 限定; glibc 2.3.2 以降) +A string which identifies the POSIX implementation supplied by this C +library (e.g., "NPTL 2.3.4" or "linuxthreads\-0.10"). +.TP +\fB_CS_PATH\fP +すべての POSIX.2 標準ユーティリティが見つかるような \fBPATH\fP の値。 +.PP +\fIbuf\fP が NULL でなく、かつ \fIlen\fP が 0 でなければ \fBconfstr\fP() は取得 +した文字列の内容を \fIbuf\fP にコピーする。必要ならば長さが \fIlen \- 1\fP +バイトに切り捨てられて、NULL バイト (\(aq\e0\(aq) で終端される。 +末尾が切り捨てられたかどうかを判定するには、 \fBconfstr\fP() の返り値を +\fIlen\fP と比較すればよい。 +.PP +\fIlen\fP が 0 で \fIbuf\fP が NULL ならば、 \fBconfstr\fP() は以下で定義された値 (訳注: +切り捨てる前の、取得した文字列の長さ) を返す。 +.SH 返り値 +\fIname\fP が有効なコンフィギュレーション変数の場合、 \fBconfstr\fP() はその変数の値全体を保持するのに必要であったバイト数を返す +(文字列終端のヌルバイトも含む)。この値は \fIlen\fP より大きいこともある。この場合には、 \fIbuf\fP +に格納された値の末尾が切り詰められたことを意味する。 +.PP +\fIname\fP が有効なコンフィギュレーション変数だが、 変数が値を持っていない場合、 \fBconfstr\fP() は 0 を返す。 \fIname\fP +が有効なコンフィグレーション変数に対応していなければ、 \fBconfstr\fP() は 0 を返し、 \fIerrno\fP に \fBEINVAL\fP +を設定する。 +.SH エラー +.TP +\fBEINVAL\fP +\fIname\fP の値が不正である。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBconfstr\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +POSIX.1\-2001, POSIX.1\-2008. +.SH 例 +次の部分的なコードは、 POSIX.2 システムのユーティリティがあるパス を取得するものである。 +.PP +.in +4n +.EX +char *pathbuf; +size_t n; + +n = confstr(_CS_PATH, NULL, (size_t) 0); +pathbuf = malloc(n); +if (pathbuf == NULL) + abort(); +confstr(_CS_PATH, pathbuf, n); +.EE +.in +.SH 関連項目 +\fBgetconf\fP(1), \fBsh\fP(1), \fBexec\fP(3), \fBfpathconf\fP(3), \fBpathconf\fP(3), +\fBsysconf\fP(3), \fBsystem\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/crypt.3 b/manual/LDP_man-pages/draft/man3/crypt.3 new file mode 100644 index 00000000..88747c4a --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/crypt.3 @@ -0,0 +1,238 @@ +.\" Michael Haardt (michael@cantor.informatik.rwth.aachen.de) +.\" Sat Sep 3 22:00:30 MET DST 1994 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" Sun Feb 19 21:32:25 1995, faith@cs.unc.edu edited details away +.\" +.\" TO DO: This manual page should go more into detail how DES is perturbed, +.\" which string will be encrypted, and what determines the repetition factor. +.\" Is a simple repetition using ECB used, or something more advanced? I hope +.\" the presented explanations are at least better than nothing, but by no +.\" means enough. +.\" +.\" added _XOPEN_SOURCE, aeb, 970705 +.\" added GNU MD5 stuff, aeb, 011223 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya and MAEHARA Kouichi all rights reserved. +.\" Translated Sun Sep 27 JST 1998 by Hiroaki Nagoya and MAEHARA Kouichi +.\" Updated 2002-01-19 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" Updated 2008-07-30 by Kentaro Shirakata +.\" Updated 2009-09-28 by Kentaro Shirakata +.\" +.TH CRYPT 3 2018\-04\-30 "" "Linux Programmer's Manual" +.SH 名前 +crypt, crypt_r \- パスワードとデータの暗号化 +.SH 書式 +.nf +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +.PP +\fBchar *crypt(const char *\fP\fIkey\fP\fB, const char *\fP\fIsalt\fP\fB);\fP + +\fB#define _GNU_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP +.PP +\fBchar *crypt_r(const char *\fP\fIkey\fP\fB, const char *\fP\fIsalt\fP\fB,\fP +\fB struct crypt_data *\fP\fIdata\fP\fB);\fP +.fi +.PP +\fI\-lcrypt\fP でリンクする。 +.SH 説明 +\fBcrypt\fP() はパスワード暗号化関数である。 鍵探索のハードウェアによる実装を妨げるように(その他にもいろいろ) 変更した Data +Encryption Standard アルゴリズムを元にしている。 +.PP +\fIkey\fP はユーザーが入力するパスワードである。 +.PP +\fIsalt\fP は集合 [\fBa\-zA\-Z0\-9./\fP] から選ばれた 2 文字の文字列である。 この文字列はアルゴリズムの出力を 4096 +通りにかき乱すのに使われる。 +.PP +\fIkey\fP の最初の 8 文字の各文字から下位 7 ビットをとって 56 ビットの鍵が得られる。 この 56 ビットの鍵は特定の文字列(ふつうはすべて +0 の文字列) を繰り返し暗号化するのに用いられる。 返り値は暗号化されたパスワードへのポインターで、13 の印字可能な ASCII 文字 +からなる(最初の 2 文字は salt そのもの)。 返り値は、関数呼出しのたびに上書きされる静的なデータへのポインターである。 +.PP +Warning: the key space consists of +.if t 2\s-2\u56\s0\d +.if n 2**56 += 7.2e16 の可能な値から成る。 この鍵空間の全探索は強力な並列計算機を使えば可能である。また \fBcrack\fP(1) +のようなソフトウェアはこの鍵空間の中で、多くの人にパスワードとして 使われるような鍵についての全探索が可能である。 +それゆえ、パスワードを選択するときには、すくなくとも、 一般的に使われる単語と名前は避けるべきである。 \fBpasswd\fP(1) +を使う時にはクラックされうるパスワードについての検査をすることが 推奨される。 +.PP +DES アルゴリズムにはいくつかの癖があり、それによってパスワード認証以外に \fBcrypt\fP() を使うのはたいへんよくない選択となっている。もし +\fBcrypt\fP() を暗号プロジェクトに使おうという案をもっているならば、それはやめたほうが よい。暗号化についてのよい本と誰でも入手できる DES +ライブラリのひとつを 手にいれるべきだ。 +.PP +\fBcrypt_r\fP() は \fBcrypt\fP() の再入可能版である。 \fIdata\fP で示される構造体は結果データの保存と情報の管理に使われる。 +この構造体に対して(メモリーを割り当てること以外に)呼び出し元がするべき唯一の ことは、 \fBcrypt_r\fP() の初回の呼び出しの前に +\fIdata\->initialized\fP をゼロにすることだけである。 +.SH 返り値 +成功の場合には、暗号化されたパスワードへのポインターが返される。 エラーの場合には NULL が返される。 +.SH エラー +.TP +\fBEINVAL\fP +\fIsalt\fP が間違ったフォーマットである。 +.TP +\fBENOSYS\fP +.\" This level of detail is not necessary in this man page. . . +.\" .PP +.\" When encrypting a plain text P using DES with the key K results in the +.\" encrypted text C, then the complementary plain text P' being encrypted +.\" using the complementary key K' will result in the complementary encrypted +.\" text C'. +.\" .PP +.\" Weak keys are keys which stay invariant under the DES key transformation. +.\" The four known weak keys 0101010101010101, fefefefefefefefe, +.\" 1f1f1f1f0e0e0e0e and e0e0e0e0f1f1f1f1 must be avoided. +.\" .PP +.\" There are six known half weak key pairs, which keys lead to the same +.\" encrypted data. Keys which are part of such key clusters should be +.\" avoided. +.\" Sorry, I could not find out what they are. +.\"" +.\" .PP +.\" Heavily redundant data causes trouble with DES encryption, when used in the +.\" .I codebook +.\" mode that +.\" .BR crypt () +.\" implements. The +.\" .BR crypt () +.\" interface should be used only for its intended purpose of password +.\" verification, and should not be used as part of a data encryption tool. +.\" .PP +.\" The first and last three output bits of the fourth S-box can be +.\" represented as function of their input bits. Empiric studies have +.\" shown that S-boxes partially compute the same output for similar input. +.\" It is suspected that this may contain a back door which could allow the +.\" NSA to decrypt DES encrypted data. +.\" .PP +.\" Making encrypted data computed using crypt() publicly available has +.\" to be considered insecure for the given reasons. +\fBcrypt\fP() 関数が実装されていない。多分アメリカの輸出規制のために。 +.TP +\fBEPERM\fP +\fI/proc/sys/crypto/fips_enabled\fP が 0 でない値で、 DES などの弱い暗号タイプを利用しようとした。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBcrypt\fP() +T} Thread safety MT\-Unsafe race:crypt +T{ +\fBcrypt_r\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +\fBcrypt\fP(): POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. \fBcrypt_r\fP() is a +GNU extension. +.SH 注意 +.SS "Availability in glibc" +The \fBcrypt\fP(), \fBencrypt\fP(3), and \fBsetkey\fP(3) functions are part of the +POSIX.1\-2008 XSI Options Group for Encryption and are optional. If the +interfaces are not available, then the symbolic constant \fB_XOPEN_CRYPT\fP is +either not defined, or it is defined to \-1 and availability can be checked +at run time with \fBsysconf\fP(3). This may be the case if the downstream +distribution has switched from glibc crypt to \fIlibxcrypt\fP. When +recompiling applications in such distributions, the programmer must detect +if \fB_XOPEN_CRYPT\fP is not available and include \fI\fP for the +function prototypes; otherwise \fIlibxcrypt\fP is an ABI\-compatible drop\-in +replacement. +.SS "Features in glibc" +The glibc version of this function supports additional encryption +algorithms. +.PP +If \fIsalt\fP is a character string starting with the characters "$\fIid\fP$" +followed by a string optionally terminated by "$", then the result has the +form: +.RS +.PP +$\fIid\fP$\fIsalt\fP$\fIencrypted\fP +.RE +.PP +\fIid\fP identifies the encryption method used instead of DES and this then +determines how the rest of the password string is interpreted. The +following values of \fIid\fP are supported: +.RS +.TS +l l. +ID | Method +_ +1 | MD5 +2a | Blowfish (本流の glibc には入っていない; + | いくつかの Linux ディストリビューションで追加されている) +.\" openSUSE has Blowfish, but AFAICS, this option is not supported +.\" natively by glibc -- mtk, Jul 08 +.\" +.\" md5 | Sun MD5 +.\" glibc doesn't appear to natively support Sun MD5; I don't know +.\" if any distros add the support. +5 | SHA\-256 (glibc 2.7 以降) +6 | SHA\-512 (glibc 2.7 以降) +.TE +.RE +.PP +Thus, $5$\fIsalt\fP$\fIencrypted\fP and $6$\fIsalt\fP$\fIencrypted\fP contain the +password encrypted with, respectively, functions based on SHA\-256 and +SHA\-512. +.PP +"\fIsalt\fP" stands for the up to 16 characters following "$\fIid\fP$" in the +salt. The "\fIencrypted\fP" part of the password string is the actual computed +password. The size of this string is fixed: +.TS +l l. +MD5 | 22 characters +SHA\-256 | 43 characters +SHA\-512 | 86 characters +.TE +.sp 1 +"\fIsalt\fP" と "\fIencrypted\fP" の文字は [\fBa\-zA\-Z0\-9./\fP] の集合から 選ばれる。 MD5 と SHA +の実装では、 \fIkey\fP 全体が意味がある (DES の場合には最初の 8 文字だけに意味がある)。 +.PP +.\" glibc commit 9425cb9eea6a62fc21d99aafe8a60f752b934b05 +Since glibc 2.7, the SHA\-256 and SHA\-512 implementations support a +user\-supplied number of hashing rounds, defaulting to 5000. If the +"$\fIid\fP$" characters in the salt are followed by "rounds=\fIxxx\fP$", where +\fIxxx\fP is an integer, then the result has the form +.RS +.PP +$\fIid\fP$\fIrounds=yyy\fP$\fIsalt\fP$\fIencrypted\fP +.RE +.PP +where \fIyyy\fP is the number of hashing rounds actually used. The number of +rounds actually used is 1000 if \fIxxx\fP is less than 1000, 999999999 if +\fIxxx\fP is greater than 999999999, and is equal to \fIxxx\fP otherwise. +.SH 関連項目 +\fBlogin\fP(1), \fBpasswd\fP(1), \fBencrypt\fP(3), \fBgetpass\fP(3), \fBpasswd\fP(5) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/daemon.3 b/manual/LDP_man-pages/draft/man3/daemon.3 new file mode 100644 index 00000000..7fed897b --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/daemon.3 @@ -0,0 +1,121 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" %%%LICENSE_END +.\" +.\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 +.\" Added mentioning of glibc weirdness wrt unistd.h. 5/11/98, Al Viro +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2000-2001 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jun 27 10:54:22 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Mon Jan 14 06:50:04 JST 2002 +.\" by Yuichi SATO +.\" +.TH DAEMON 3 2017\-11\-26 GNU "Linux Programmer's Manual" +.SH 名前 +daemon \- バックグラウンドで動作させる +.SH 書式 +\fB#include \fP +.PP +\fBint daemon(int \fP\fInochdir\fP\fB, int \fP\fInoclose\fP\fB);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBdaemon\fP(): +.nf +.\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 + Since glibc 2.21: + _DEFAULT_SOURCE + In glibc 2.19 and 2.20: + _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) + Up to and including glibc 2.19: + _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.fi +.SH 説明 +\fBdaemon\fP() は、制御端末から分離させてシステムデーモンとして動作させたい プログラムのための関数である。 +.PP +If \fInochdir\fP is zero, \fBdaemon\fP() changes the process's current working +directory to the root directory ("/"); otherwise, the current working +directory is left unchanged. +.PP +\fInoclose\fP が 0 の場合、 \fBdaemon\fP() は標準入力・標準出力・標準エラーを \fI/dev/null\fP にリダイレクトする。 +それ以外の場合、これらのファイルディスクリプターは変更されない。 +.SH 返り値 +.\" not .IR in order not to underline _ +(この関数が fork して \fBfork\fP(2) が成功すると、親プロセスでは \fB_exit\fP(2) +を呼び出すので、これ以降のエラーは子プロセスからしか見れない)。 成功した場合、 \fBdaemon\fP() は 0 を返す。 エラーが起こった場合、 +\fBdaemon\fP() は \-1 を返す。 さらに、 \fIerrno\fP に \fBfork\fP(2) と \fBsetsid\fP(2) +に関して規定されたエラーを設定する。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBdaemon\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +Not in POSIX.1. A similar function appears on the BSDs. The \fBdaemon\fP() +function first appeared in 4.4BSD. +.SH 注意 +The glibc implementation can also return \-1 when \fI/dev/null\fP exists but is +not a character device with the expected major and minor numbers. In this +case, \fIerrno\fP need not be set. +.SH バグ +.\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=19144 +.\" Tested using a program that uses daemon() and then opens an +.\" otherwise unused console device (/dev/ttyN) that does not +.\" have an associated getty process. +The GNU C library implementation of this function was taken from BSD, and +does not employ the double\-fork technique (i.e., \fBfork\fP(2), \fBsetsid\fP(2), +\fBfork\fP(2)) that is necessary to ensure that the resulting daemon process +is not a session leader. Instead, the resulting daemon \fIis\fP a session +leader. On systems that follow System V semantics (e.g., Linux), this means +that if the daemon opens a terminal that is not already a controlling +terminal for another session, then that terminal will inadvertently become +the controlling terminal for the daemon. +.SH 関連項目 +\fBfork\fP(2), \fBsetsid\fP(2), \fBdaemon\fP(7), \fBlogrotate\fP(8) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/des_crypt.3 b/manual/LDP_man-pages/draft/man3/des_crypt.3 new file mode 100644 index 00000000..c2dc75c3 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/des_crypt.3 @@ -0,0 +1,106 @@ +.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI; +.\" +.\" Taken from libc4 sources, which say: +.\" Copyright (C) 1993 Eric Young - can be distributed under GPL. +.\" +.\" However, the above header line suggests that this file in fact is +.\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use, +.\" see other Sun RPC sources). +.\" +.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) +.\" can be distributed under GPL. +.\" %%%LICENSE_END +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Fri Jul 23 05:53:35 JST 2004 +.\" by Yuichi SATO +.\" +.TH DES_CRYPT 3 2020\-04\-11 "" "Linux Programmer's Manual" +.SH 名前 +des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- 高速な DES 暗号化 +.SH 書式 +.nf +.\" Sun version +.\" .B #include +\fB#include \fP +.PP +\fBint ecb_crypt(char *\fP\fIkey\fP\fB, char *\fP\fIdata\fP\fB, unsigned \fP\fIdatalen\fP\fB,\fP +\fB unsigned \fP\fImode\fP\fB);\fP +.PP +\fBint cbc_crypt(char *\fP\fIkey\fP\fB, char *\fP\fIdata\fP\fB, unsigned \fP\fIdatalen\fP\fB,\fP +\fB unsigned \fP\fImode\fP\fB, char *\fP\fIivec\fP\fB);\fP +.PP +\fBvoid des_setparity(char *\fP\fIkey\fP\fB);\fP +.PP +\fBint DES_FAILED(int \fP\fIstatus\fP\fB);\fP +.fi +.SH 説明 +\fBecb_crypt\fP() と \fBcbc_crypt\fP() は NBS DES (Data Encryption Standard, +データ暗号化規格) を実装している。 これらのルーチンは \fBcrypt\fP(3) よりも高速でより一般的な目的に使用できる。 +利用可能であれば、これらのルーチンは DES ハードウェアを使用することもできる。 \fBecb_crypt\fP() は ECB (Electronic +Code Book) モードで暗号化する。 このモードでは (個々の) データのブロックを独立して暗号化する \fBcbc_crypt\fP() は CBC +(Cipher Block Chaining) モードで暗号化する。 このモードでは連続するブロックを互いに連鎖させて暗号化する。 CBC +はブロックの挿入・削除・置き換えから保護する。 また平文の規則性が暗号文に現れない。 +.PP +これらのルーチンの使用法を示す。 第 1 引き数 \fIkey\fP はパリティ付きの 8 バイトの暗号化鍵である。 鍵のパリティを設定するには +\fBdes_setparity\fP() を使うこと。 DES の場合、鍵のパリティは各バイトの最下位ビットである。 第 2 引き数 \fIdata\fP +は暗号化または復号化されるデータを含む。 第 3 引き数 \fIdatalen\fP は \fIdata\fP のバイト長であり、8 の倍数でなければならない。 第 +4 引き数 \fImode\fP はいくつかの値を OR することで作成する。 暗号化の方向 (訳註: 暗号化なのか復号化なのか) を指定するため、 +\fBDES_ENCRYPT\fP または \fBDES_DECRYPT\fP を OR する。 暗号化をソフトウェアで行うかハードウェアで行うかを指定するため、 +\fBDES_HW\fP または \fBDES_SW\fP を OR する。 \fBDES_HW\fP が指定されていて、かつハードウェアがない場合、 +暗号化はソフトウェアで実行されて、ルーチンは \fBDESERR_NOHWDEVICE\fP を返す。 \fBcbc_crypt\fP() において、引き数 +\fIivec\fP はデータブロックを連鎖させる際の 8 バイトの初期化ベクトルである。 この引き数はルーチンから戻るときに次の初期化ベクトルに更新される。 +.SH 返り値 +.TP +\fBDESERR_NONE\fP +エラーなし。 +.TP +\fBDESERR_NOHWDEVICE\fP +暗号化は成功したが、要求されたハードウェアの代わりにソフトウェアで実行された。 +.TP +\fBDESERR_HWERROR\fP +ハードウェアまたはドライバでエラーが発生した。 +.TP +\fBDESERR_BADPARAM\fP +ルーチンへの引き数が不正である。 +.PP +.\" .BR DES_FAILED\c +.\" .BR ( stat ) +.\" So far the Sun page +.\" Some additions - aeb +結果の状態 \fIstat\fP を与えたとき、マクロ \fBDES_FAILED(\fP\fIstat\fP\fB)\fP が false になるのは、最初の 2 +つだけである。 +.SH バージョン +These functions were added to glibc in version 2.1. +.PP +Because they employ the DES block cipher, which is no longer considered +secure, \fBecb_crypt\fP(), \fBecb_crypt\fP(), \fBcrypt_r\fP(), and \fBdes_setparity\fP() +were removed in glibc 2.28. Applications should switch to a modern +cryptography library, such as \fBlibgcrypt\fP. +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lbw25 lb lb +l l l. +インターフェース 属性 値 +T{ +\fBecb_crypt\fP(), +\fBcbc_crypt\fP(), +\fBdes_setparity\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +4.3BSD. POSIX.1 にはない。 +.SH 関連項目 +\fBdes\fP(1), \fBcrypt\fP(3), \fBxcrypt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/encrypt.3 b/manual/LDP_man-pages/draft/man3/encrypt.3 new file mode 100644 index 00000000..a5730f57 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/encrypt.3 @@ -0,0 +1,187 @@ +.\" Copyright 2000 Nicolás Lichtmaier +.\" Created 2000-07-22 00:52-0300 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" Modified 2002-07-23 19:21:35 CEST 2002 Walter Harms +.\" +.\" +.\" Modified 2003-04-04, aeb +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2000-2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sun Sep 24 06:18:14 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Sun Sep 7 13:20:43 JST 2003 +.\" by Yuichi SATO +.\" Updated & Modified Sat Jan 17 01:27:31 JST 2004 by Yuichi SATO +.\" +.TH ENCRYPT 3 2020\-11\-01 "" "Linux Programmer's Manual" +.SH 名前 +encrypt, setkey, encrypt_r, setkey_r \- 64 ビットのメッセージを暗号化する +.SH 書式 +.nf +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +.PP +\fBvoid encrypt(char \fP\fIblock\fP\fB[64], int \fP\fIedflag\fP\fB);\fP + +\fB#define _XOPEN_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP +.PP +\fBvoid setkey(const char *\fP\fIkey\fP\fB);\fP + +\fB#define _GNU_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP +.PP +\fBvoid setkey_r(const char *\fP\fIkey\fP\fB, struct crypt_data *\fP\fIdata\fP\fB);\fP +\fBvoid encrypt_r(char *\fP\fIblock\fP\fB, int \fP\fIedflag\fP\fB, struct crypt_data *\fP\fIdata\fP\fB);\fP +.fi +.PP +これらの関数は \fI\-lcrypt\fP でリンクする必要がある。 +.SH 説明 +これらの関数は、64 ビットのメッセージの暗号化と復号化を行う。 \fBsetkey\fP() 関数は \fBencrypt\fP() +によって使われる暗号鍵を設定する。 ここで使われる引き数 \fIkey\fP は 64 バイトの配列であり、各バイトは数値 1 または 0 である。 +n=8*i\-1 に対するバイト key[n] は無視されるので、 有効な暗号鍵の長さは 56 ビットになる。 +.PP +\fBencrypt\fP() 関数は、 \fIedflag\fP が 0 の場合は暗号化し、1 が渡された場合は復号化するというように、 +渡されたバッファーを変更する。 引き数 \fIkey\fP と同様に、 \fIblock\fP はエンコードされた実際の値を表現するビットの配列である。 +結果はこの同じ配列を使って返される。 +.PP +これら 2 つの関数はリエントラント (reentrant) ではない。 つまり暗号鍵データは静的な領域に保存される。 関数 \fBsetkey_r\fP() +と \fBencrypt_r\fP() はリエントラントなバージョンである。 これらの関数は暗号鍵データを保持するために以下のような構造体を使う。 +.PP +.in +4n +.EX +struct crypt_data { + char keysched[16 * 8]; + char sb0[32768]; + char sb1[32768]; + char sb2[32768]; + char sb3[32768]; + char crypt_3_buf[14]; + char current_salt[2]; + long current_saltbits; + int direction; + int initialized; +}; +.EE +.in +.PP +\fBsetkey_r\fP() を呼び出す前には、 \fIdata\->initialized\fP を 0 に設定すること。 +.SH 返り値 +これらの関数は、なにも値を返さない。 +.SH エラー +上記の関数を呼び出す前に \fIerrno\fP を 0 に設定すること。 成功した場合、この値は変更されない。 +.TP +\fBENOSYS\fP +(例えば以前のアメリカ合衆国輸出規制などにより) この関数が提供されていない。 +.SH バージョン +Because they employ the DES block cipher, which is no longer considered +secure, \fBcrypt\fP(), \fBcrypt_r\fP(), \fBsetkey\fP(), and \fBsetkey_r\fP() were +removed in glibc 2.28. Applications should switch to a modern cryptography +library, such as \fBlibgcrypt\fP. +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lbw23 lb lb +l l l. +インターフェース 属性 値 +T{ +\fBencrypt\fP(), +\fBsetkey\fP() +T} Thread safety MT\-Unsafe race:crypt +T{ +\fBencrypt_r\fP(), +\fBsetkey_r\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +\fBencrypt\fP(), \fBsetkey\fP(): POSIX.1\-2001, POSIX.1\-2008, SUS, SVr4. +.PP +The functions \fBencrypt_r\fP() and \fBsetkey_r\fP() are GNU extensions. +.SH 注意 +.SS "Availability in glibc" +See \fBcrypt\fP(3). +.SS "Features in glibc" +glibc 2.2 では、これらの関数は DES アルゴリズムを使う。 +.SH 例 +.EX +#define _XOPEN_SOURCE +#include +#include +#include +#include + +int +main(void) +{ + char key[64]; + char orig[9] = "eggplant"; + char buf[64]; + char txt[9]; + + for (int i = 0; i < 64; i++) { + key[i] = rand() & 1; + } + + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j++) { + buf[i * 8 + j] = orig[i] >> j & 1; + } + setkey(key); + } + printf("Before encrypting: %s\en", orig); + + encrypt(buf, 0); + for (int i = 0; i < 8; i++) { + for (int j = 0, txt[i] = \(aq\e0\(aq; j < 8; j++) { + txt[i] |= buf[i * 8 + j] << j; + } + txt[8] = \(aq\e0\(aq; + } + printf("After encrypting: %s\en", txt); + + encrypt(buf, 1); + for (int i = 0; i < 8; i++) { + for (int j = 0, txt[i] = \(aq\e0\(aq; j < 8; j++) { + txt[i] |= buf[i * 8 + j] << j; + } + txt[8] = \(aq\e0\(aq; + } + printf("After decrypting: %s\en", txt); + exit(EXIT_SUCCESS); +} +.EE +.SH 関連項目 +.\" .BR fcrypt (3) +\fBcbc_crypt\fP(3), \fBcrypt\fP(3), \fBecb_crypt\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/euidaccess.3 b/manual/LDP_man-pages/draft/man3/euidaccess.3 new file mode 100644 index 00000000..cef144e7 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/euidaccess.3 @@ -0,0 +1,97 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2007-06-02, Akihiro MOTOKI +.\" Updated 2012-04-30, Akihiro MOTOKI +.\" Updated 2013-03-26, Akihiro MOTOKI +.\" +.TH EUIDACCESS 3 2017\-09\-15 "" "Linux Programmer's Manual" +.SH 名前 +euidaccess, eaccess \- ファイルへのアクセス権を実効ユーザーでチェックする +.SH 書式 +.nf +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +.PP +\fBint euidaccess(const char *\fP\fIpathname\fP\fB, int \fP\fImode\fP\fB);\fP +\fBint eaccess(const char *\fP\fIpathname\fP\fB, int \fP\fImode\fP\fB);\fP +.fi +.SH 説明 +\fBaccess\fP(2) と同様、 \fBeuidaccess\fP() は引き数 \fIpathname\fP で指定されたファイルの許可 +(permission) と存在のチェックを行う。 \fBaccess\fP(2) はプロセスの実 (real) ユーザーID / 実グループID +を用いてチェックを行うのに対し、 \fBeuidaccess\fP() は実効 (effective) ID を用いる。 +.PP +\fImode\fP は \fBR_OK\fP, \fBW_OK\fP, \fBX_OK\fP, \fBF_OK\fP の一つ以上から構成されるマスクである。 \fBR_OK\fP, +\fBW_OK\fP, \fBX_OK\fP, \fBF_OK\fP は \fBaccess\fP(2) と同じ意味を持つ。 +.PP +\fBeaccess\fP() は \fBeuidaccess\fP() の同義語であり、他のいくつかのシステムとの互換性のために提供されている。 +.SH 返り値 +成功した場合 (要求した全てについて許可が得られたら)、ゼロが返される。 エラーの場合 (\fImode\fP +の少なくとも一つのビットで要求した許可がなかった場合や、 他のエラーが起こった場合)、\-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +\fBaccess\fP(2) と同じ。 +.SH バージョン +\fBeaccess\fP() 関数は glibc のバージョン 2.4 で追加された。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lbw23 lb lb +l l l. +インターフェース 属性 値 +T{ +\fBeuidaccess\fP(), +\fBeaccess\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +.\" e.g., FreeBSD 6.1. +これらの関数は非標準である。 他のいくつかのシステムには \fBeaccess\fP() 関数がある。 +.SH 注意 +\fI警告\fP: +ある操作を実行する前にこの関数を使ってファイルに対するプロセスのアクセス許可を +確認してから、その情報に基づいて操作を行うと、競合条件が発生する可能性がある。 +これは二つの操作の間でファイルのアクセス許可が変化する場合があるからである。 +一般的には、必要な操作のみを行い、その際に発生したアクセス許可に関するエラーを +処理する方が安全である。 +.PP +この関数は常にシンボリックリンクの展開を行う。 +シンボリックリンクのアクセス許可を確認する必要がある場合は、 +フラグ \fBAT_EACCESS\fP と \fBAT_SYMLINK_NOFOLLOW\fP を付けて +\fBfaccessat\fP(2) を使うこと。 +.SH 関連項目 +\fBaccess\fP(2), \fBchmod\fP(2), \fBchown\fP(2), \fBfaccessat\fP(2), \fBopen\fP(2), +\fBsetgid\fP(2), \fBsetuid\fP(2), \fBstat\fP(2), \fBcredentials\fP(7), +\fBpath_resolution\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/fexecve.3 b/manual/LDP_man-pages/draft/man3/fexecve.3 new file mode 100644 index 00000000..fa32e1e9 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/fexecve.3 @@ -0,0 +1,132 @@ +.\" Copyright (c) 2006, 2014, Michael Kerrisk +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. +.\" Translated 2006-07-31, Akihiro MOTOKI +.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\" +.TH FEXECVE 3 2019\-10\-10 Linux "Linux Programmer's Manual" +.SH 名前 +fexecve \- ファイルディスクリプターで指定されたプログラムを実行する +.SH 書式 +.nf +\fB#include \fP +.PP +\fBint fexecve(int \fP\fIfd\fP\fB, char *const \fP\fIargv\fP\fB[], char *const \fP\fIenvp\fP\fB[]);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBfexecve\fP(): +.PD 0 +.ad l +.RS 4 +.TP 4 +glibc 2.10 以降: +_POSIX_C_SOURCE\ >=\ 200809L +.TP +glibc 2.10 より前: +_GNU_SOURCE +.RE +.ad +.PD +.SH 説明 +\fBfexecve\fP() performs the same task as \fBexecve\fP(2), with the difference +that the file to be executed is specified via a file descriptor, \fIfd\fP, +rather than via a pathname. The file descriptor \fIfd\fP must be opened +read\-only (\fBO_RDONLY\fP) or with the \fBO_PATH\fP flag and the caller must have +permission to execute the file that it refers to. +.SH 返り値 +\fBfexecve\fP() は呼び出しに成功した場合、戻ることはない。 エラーの場合、返り値 \-1 で関数が返り、 \fIerrno\fP +が適切に設定される。 +.SH エラー +エラーは \fBexecve\fP(2) と同じだが、以下のエラーが追加になっている: +.TP +\fBEINVAL\fP +\fIfd\fP が有効なファイルディスクリプターでない。または \fIargv\fP が NULL である。または \fIenvp\fP が NULL である。 +.TP +\fBENOENT\fP +The close\-on\-exec flag is set on \fIfd\fP, and \fIfd\fP refers to a script. See +BUGS. +.TP +\fBENOSYS\fP +The kernel does not provide the \fBexecveat\fP(2) system call, and the +\fI/proc\fP filesystem could not be accessed. +.SH バージョン +\fBfexecve\fP() は glibc 2.3.2 以降で実装されている。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBfexecve\fP() +T} Thread safety MT\-Safe +.TE +.sp 1 +.SH 準拠 +POSIX.1\-2008. この関数は POSIX.1\-2001 では規定されておらず、 他のシステムで広く利用できるわけではない。 +POSIX.1\-2008 で規定されている。 +.SH 注意 +.\" glibc commit 43ffc53a352a67672210c9dd4959f6c6b7407e60 +On Linux with glibc versions 2.26 and earlier, \fBfexecve\fP() is implemented +using the \fBproc\fP(5) filesystem, so \fI/proc\fP needs to be mounted and +available at the time of the call. Since glibc 2.27, if the underlying +kernel supports the \fBexecveat\fP(2) system call, then \fBfexecve\fP() is +implemented using that system call, with the benefit that \fI/proc\fP does not +need to be mounted. +.PP +\fBfexecve\fP() の裏にある考えは、呼び出し元が、ファイルを実行する前に実行ファイルの内容を検査 (チェックサムを確認) +できるようにすることである。単に、ファイルをオープンして内容のチェックサムを検査し、それから \fBexecve\fP(2) +を行うのは十分ではない。なぜなら、2 つのステップの間で、ファイル名や、パス名のディレクトリの前の方が入れ換えられる可能性があるからだ +(例えば、シンボリックリンクのリンク先を変更するなど)。\fBfexecve\fP() は、チェックサムの検査と \fBfexecve\fP() +の呼び出しの間で、ファイルの\fI内容\fPを変更できる可能性があるという問題への対策にはならない。この問題に対する対応策は、確実に、ファイルのアクセス許可を設定し、悪意のあるユーザーがファイルを変更できないようにすることである。 +.PP +\fBfexecve\fP() を使用する際の理にかなった方法は、 \fIfd\fP に close\-on\-exec フラグをセットし、 +実行するプログラムを通じてそのファイルディスクリプターが外部にもれないようにすることである。 この方法は 2 つの理由から理にかなっている。 1 +つ目は、 これにより不必要にファイルディスクリプターが消費されるのを防ぐことができる +(実行されるプログラムは普通プログラム自身が参照するファイルを参照する必要はない)。 2 つ目は、 \fBfexecve\fP() が再帰的に使用された場合、 +close\-on\-exec フラグを利用することで、 再帰の各ステップで新しいプログラムに一つ余計にファイルディスクリプターが渡されることによる、 +ファイルディスクリプターの枯渇を防ぐことができる (ただし「バグ」を参照)。 +.SH バグ +\fIfd\fP がスクリプトを参照していて (つまり、 最初の行に文字 \fI#!\fP +で始まるスクリプトインタープリターの指示がある実行テキストファイルである)、 \fIfd\fP に close\-on\-exec フラグがセットされていた場合、 +\fBfexecve\fP() はエラー \fBENOENT\fP で失敗する。 このエラーが起こるのは、 スクリプトインタープリターが実行される時点までに、 +close\-on\-exec フラグにより \fIfd\fP がすでにクローズされてしまっているからである。 そのため、 スクリプトを参照する場合には、 +close\-on\-exec フラグを \fIfd\fP にセットすることはできず、 「注意」の節で説明されている問題が起こり得る。 +.SH 関連項目 +\fBexecve\fP(2), \fBexecveat\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/get_nprocs_conf.3 b/manual/LDP_man-pages/draft/man3/get_nprocs_conf.3 new file mode 100644 index 00000000..f3ea836e --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/get_nprocs_conf.3 @@ -0,0 +1,108 @@ +.\" Copyright (c) 2012, Petr Benas +.\" and Copyright (c) 2012, Michael Kerrisk +.\" +.\" %%%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 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2012-05-31, Akihiro MOTOKI +.\" +.TH GET_NPROCS 3 2020\-06\-09 GNU "Linux Programmer's Manual" +.SH 名前 +get_nprocs, get_nprocs_conf \- プロセッサ数を取得する +.SH 書式 +\fB#include \fP +.PP +\fBint get_nprocs(void);\fP +.br +\fBint get_nprocs_conf(void);\fP +.SH 説明 +\fBget_nprocs_conf\fP() 関数は、オペレーティングシステムで +設定されているプロセッサ数を返す。 +.PP +\fBget_nprocs\fP() 関数は、システムで現在利用可能なプロセッサ数を返す。 +(例えば、ホットプラグが可能なシステムでは) +オフラインになっているプロセッサがある場合があるので、 +この数は \fBget_nprocs_conf\fP() が返す数より小さい場合がある。 +.SH 返り値 +「説明」の節で説明した通りである。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBget_nprocs\fP(), +.br +\fBget_nprocs_conf\fP() +T} Thread safety MT\-Safe +.TE +.sp 1 +.SH 準拠 +これらの関数は GNU による拡張である。 +.SH 注意 +.\" glibc 2.15 +これらの関数の現在の実装はかなりコストがかかる実装になっている。 +関数が呼ばれる度に \fI/sys\fP ファイルシステム内のファイルをオープンして +解析するようになっているからである。 +.PP +以下の \fBsysconf\fP(3) の呼び出しで、このページに書かれている関数を使った +場合に返されるのと同じ情報を得ることができる。 +.PP +.in +4n +.EX +np = sysconf(_SC_NPROCESSORS_CONF); /* processors configured */ +np = sysconf(_SC_NPROCESSORS_ONLN); /* processors available */ +.EE +.in +.SH 例 +以下の例は、 \fBget_nprocs\fP() と \fBget_nprocs_conf\fP() が +どのように利用できるかを示すものである。 +.PP +.EX +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + printf("This system has %d processors configured and " + "%d processors available.\en", + get_nprocs_conf(), get_nprocs()); + exit(EXIT_SUCCESS); +} +.EE +.SH 関連項目 +\fBnproc\fP(1) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/getcwd.3 b/manual/LDP_man-pages/draft/man3/getcwd.3 new file mode 100644 index 00000000..efef1588 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/getcwd.3 @@ -0,0 +1,221 @@ +.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) +.\" +.\" %%%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 Wed Jul 21 22:35:42 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 18 Mar 1996 by Martin Schulze (joey@infodrom.north.de): +.\" Corrected description of getwd(). +.\" Modified Sat Aug 21 12:32:12 MET 1999 by aeb - applied fix by aj +.\" Modified Mon Dec 11 13:32:51 MET 2000 by aeb +.\" Modified Thu Apr 22 03:49:15 CEST 2002 by Roger Luethi +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka +.\" all rights reserved. +.\" Translated Fri Feb 14 12:40:22 JST 1997 +.\" by IMAMURA Nobutaka +.\" Modified Thu Dec 8 05:08:44 JST 1999 +.\" by Kentaro Shirakata +.\" Modified Sun Mar 12 21:08:44 JST 2000 +.\" by HANATAKA Shinya +.\" Updated 2001-01-29 by Kentaro Shirakata +.\" Updated 2002-03-23 by Kentaro Shirakata +.\" Updated 2002-10-17 by Kentaro Shirakata +.\" Updated 2007-01-01 by Kentaro Shirakata +.\" Updated 2008-08-21, Akihiro MOTOKI , LDP v3.07 +.\" +.TH GETCWD 3 2018\-04\-30 GNU "Linux Programmer's Manual" +.SH 名前 +getcwd, getwd, get_current_dir_name \- カレントワーキングディレクトリ名の取得 +.SH 書式 +.nf +\fB#include \fP +.PP +\fBchar *getcwd(char *\fP\fIbuf\fP\fB, size_t \fP\fIsize\fP\fB);\fP +.PP +\fBchar *getwd(char *\fP\fIbuf\fP\fB);\fP +.PP +\fBchar *get_current_dir_name(void);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBget_current_dir_name\fP(): +.RS +_GNU_SOURCE +.RE +.PP +\fBgetwd\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +glibc 2.12 以降: +.nf +(_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200809L) + || /* Glibc since 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +これらの関数は、呼び出したプロセスのカレントワーキングディレクトリの 絶対パス名 (absolute pathname) が入った文字列を返す。 +返される文字列はヌルで終端される。 パス名は関数の結果として返され、引数 \fIbuf\fP がある場合は \fIbuf\fP 経由でも返される。 +.PP +\fBgetcwd\fP() 関数はカレントワーキングディレクトリの絶対パス名を \fIbuf\fP で示された \fIsize\fP 長の配列にコピーする。 +.PP +終端のヌルバイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが \fIsize\fP バイトを超えている場合は、返り値として NULL が返り +\fIerrno\fP に \fBERANGE\fP がセットされる。 アプリケーションはこのエラーをチェックし、 +必要に応じてより長いバッファーを用意すべきである。 +.PP +POSIX.1\-2001 標準の拡張として、 glibc では \fIbuf\fP が NULL の場合、 \fBgetcwd\fP() は必要なバッファーを +\fBmalloc\fP(3) を用いて動的に割り当てる。 この場合、 \fIsize\fP が 0 の場合を除き、バッファーの長さは \fIsize\fP となる。 +\fIsize\fP が 0 の場合には必要な大きさが確保される。 呼び出し側で、返されたバッファーを \fBfree\fP(3) すべきである。 +.PP +\fBget_current_dir_name\fP() はカレントワーキングディレクトリの絶対パス名を収めるのに 十分な大きさの配列を +\fBmalloc\fP(3) で獲得する。環境変数 \fBPWD\fP が設定されておりその値が正しければ、その値が返される。 +呼び出し側で、返されたバッファーを \fBfree\fP(3) すべきである。 +.PP +\fBgetwd\fP() は \fBmalloc\fP(3) によるメモリー獲得を一切行なわない。 \fIbuf\fP 引数は少なくとも \fBPATH_MAX\fP +バイトの長さを持つ配列へのポインターである必要がある。 終端のヌルバイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが +\fBPATH_MAX\fP バイトを超えている場合、 NULL が返され、 \fIerrno\fP に \fBENAMETOOLONG\fP が設定される。 +(システムによっては、 \fBPATH_MAX\fP は必ずしもコンパイル時に決まる定数ではない点に注意すること。 +また、ファイルシステムに依存する場合もある。 \fBpathconf\fP(3) を参照。) 移植性とセキュリティ上の理由から、 \fBgetwd\fP() +の利用は推奨されない。 +.SH 返り値 +On success, these functions return a pointer to a string containing the +pathname of the current working directory. In the case of \fBgetcwd\fP() and +\fBgetwd\fP() this is the same value as \fIbuf\fP. +.PP +失敗した場合、これらの関数は NULL を返し、 \fIerrno\fP にエラーを示す値を設定する。 \fIbuf\fP が指す配列の内容は未定義である。 +.SH エラー +.TP +\fBEACCES\fP +ファイル名の構成要素に対する読み込みあるいは検索の権限がない。 +.TP +\fBEFAULT\fP +\fIbuf\fP が不正なアドレスを指している。 +.TP +\fBEINVAL\fP +\fIsize\fP 引数が 0 かつ、 \fIbuf\fP 引数がヌルポインターでない。 +.TP +\fBEINVAL\fP +\fBgetwd\fP(): \fIbuf\fP が NULL である。 +.TP +\fBENAMETOOLONG\fP +\fBgetwd\fP(): 絶対パス名が入ったヌル終端された文字列の長さが \fBPATH_MAX\fP バイトを超えている。 +.TP +\fBENOENT\fP +カレントワーキングディレクトリが削除されている。 +.TP +\fBENOMEM\fP +メモリー不足。 +.TP +\fBERANGE\fP +\fIsize\fP 引数の値がワーキングディレクトリの絶対パス名の長さより小さい。 長さには文字列の終端バイトも含まれる。 +より大きい配列を確保してもう一度実行する必要がある。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lbw22 lb lb +l l l. +インターフェース 属性 値 +T{ +\fBgetcwd\fP(), +\fBgetwd\fP() +T} Thread safety MT\-Safe +T{ +\fBget_current_dir_name\fP() +T} Thread safety MT\-Safe env +.TE +.SH 準拠 +\fBgetcwd\fP() は POSIX.1\-2001 に準拠している。 POSIX.1\-2001 は、 \fIbuf\fP が NULL の場合の +\fBgetcwd\fP() の動作を規定しないままとしている。 +.PP +\fBgetwd\fP() は POSIX.1\-2001 に存在しているが、「過去の名残(LEGACY)」とされている。 POSIX.1\-2008 では、 +\fBgetwd\fP() の仕様が削除されている。 代わりに \fBgetcwd\fP() を使うこと。 POSIX.1\-2001 は \fBgetwd\fP() +に関するエラーを定義していない。 +.PP +\fBget_current_dir_name\fP() は GNU 拡張である。 +.SH 注意 +Under Linux, these functions make use of the \fBgetcwd\fP() system call +(available since Linux 2.1.92). On older systems they would query +\fI/proc/self/cwd\fP. If both system call and proc filesystem are missing, a +generic implementation is called. Only in that case can these calls fail +under Linux with \fBEACCES\fP. +.PP +.\" +これらの関数はしばしばカレントワーキングディレクトリの位置を保存し、 後で戻ってくるために利用される。 +未使用のファイルディスクリプターが十分ある場合は、 現在のディレクトリ (".") を開いて \fBfchdir\fP(2) +を呼び出すほうが普通は高速で信頼性がある。 特に Linux 以外のプラットフォームの場合はそうである。 +.SS "C ライブラリとカーネルの違い" +.\" commit 3272c544da48f8915a0e34189182aed029bd0f2b +On Linux, the kernel provides a \fBgetcwd\fP() system call, which the +functions described in this page will use if possible. The system call +takes the same arguments as the library function of the same name, but is +limited to returning at most \fBPATH_MAX\fP bytes. (Before Linux 3.12, the +limit on the size of the returned pathname was the system page size. On +many architectures, \fBPATH_MAX\fP and the system page size are both 4096 +bytes, but a few architectures have a larger page size.) If the length of +the pathname of the current working directory exceeds this limit, then the +system call fails with the error \fBENAMETOOLONG\fP. In this case, the library +functions fall back to a (slower) alternative implementation that returns +the full pathname. +.PP +.\" commit 8df9d1a4142311c084ffeeacb67cd34d190eff74 +Following a change in Linux 2.6.36, the pathname returned by the \fBgetcwd\fP() +system call will be prefixed with the string "(unreachable)" if the current +directory is not below the root directory of the current process (e.g., +because the process set a new filesystem root using \fBchroot\fP(2) without +changing its current directory into the new root). Such behavior can also +be caused by an unprivileged user by changing the current directory into +another mount namespace. When dealing with pathname from untrusted sources, +callers of the functions described in this page should consider checking +whether the returned pathname starts with '/' or '(' to avoid +misinterpreting an unreachable path as a relative pathname. +.SH バグ +Since the Linux 2.6.36 change that added "(unreachable)" in the +circumstances described above, the glibc implementation of \fBgetcwd\fP() has +failed to conform to POSIX and returned a relative pathname when the API +contract requires an absolute pathname. With glibc 2.27 onwards this is +corrected; calling \fBgetcwd\fP() from such a pathname will now result in +failure with \fBENOENT\fP. +.SH 関連項目 +\fBpwd\fP(1), \fBchdir\fP(2), \fBfchdir\fP(2), \fBopen\fP(2), \fBunlink\fP(2), \fBfree\fP(3), +\fBmalloc\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/getdtablesize.3 b/manual/LDP_man-pages/draft/man3/getdtablesize.3 new file mode 100644 index 00000000..78ccbb02 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/getdtablesize.3 @@ -0,0 +1,100 @@ +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" %%%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 2002-04-15 by Roger Luethi and aeb +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2013 Akihiro MOTOKI +.\" all rights reserved. +.\" Translated 2013-03-25, Akihiro MOTOKI +.\" +.TH GETDTABLESIZE 3 2020\-06\-09 Linux "Linux Programmer's Manual" +.SH 名前 +getdtablesize \- get file descriptor table size +.SH 書式 +\fB#include \fP +.PP +\fBint getdtablesize(void);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBgetdtablesize\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +glibc 2.12 以降: +.nf +/* Glibc since 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE + || ! (_POSIX_C_SOURCE\ >=\ 200112L) +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +\fBgetdtablesize\fP() は 1 つのプロセスのオープンできるファイル数の最大値を返す。 +返り値はファイルディスクリプターの取り得る最大値より 1 大きい値である。 +.SH 返り値 +プロセス毎にオープンできるファイル数の現在の制限値。 +.SH エラー +Linux では、 \fBgetdtablesize\fP() は \fBgetrlimit\fP(2) で説明されているエラーを返すことがある。 +下記の「注意」を参照のこと。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBgetdtablesize\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +SVr4, 4.4BSD (the \fBgetdtablesize\fP() function first appeared in 4.2BSD). +It is not specified in POSIX.1; portable applications should employ +\fIsysconf(_SC_OPEN_MAX)\fP instead of this call. +.SH 注意 +.\" The libc4 and libc5 versions return +.\" .B OPEN_MAX +.\" (set to 256 since Linux 0.98.4). +The glibc version of \fBgetdtablesize\fP() calls \fBgetrlimit\fP(2) and returns +the current \fBRLIMIT_NOFILE\fP limit, or \fBOPEN_MAX\fP when that fails. +.SH 関連項目 +\fBclose\fP(2), \fBdup\fP(2), \fBgetrlimit\fP(2), \fBopen\fP(2) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/gethostid.3 b/manual/LDP_man-pages/draft/man3/gethostid.3 new file mode 100644 index 00000000..e3f5ed79 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/gethostid.3 @@ -0,0 +1,126 @@ +.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) +.\" +.\" Updated with additions from Mitchum DSouza +.\" Portions Copyright 1993 Mitchum DSouza +.\" +.\" %%%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 Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki +.\" all rights reserved. +.\" Translated 1997-06-27, SUTO, Mitsuaki +.\" Modified 1999-05-21, HANATAKA Shinya +.\" +.TH GETHOSTID 3 2017\-09\-15 Linux "Linux Programmer's Manual" +.SH 名前 +gethostid, sethostid \- 現在のホストの固有の識別子を取得/設定する +.SH 書式 +\fB#include \fP +.PP +\fBlong gethostid(void);\fP +.br +\fBint sethostid(long \fP\fIhostid\fP\fB);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +.ad l +\fBgethostid\fP(): +.RS 4 +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.RE +\fBsethostid\fP(): +.nf +.\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 + Since glibc 2.21: + _DEFAULT_SOURCE + In glibc 2.19 and 2.20: + _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) + Up to and including glibc 2.19: + _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.fi +.ad b +.SH 説明 +\fBgethostid\fP() and \fBsethostid\fP() respectively get or set a unique 32\-bit +identifier for the current machine. The 32\-bit identifier was intended to +be unique among all UNIX systems in existence. This normally resembles the +Internet address for the local machine, as returned by \fBgethostbyname\fP(3), +and thus usually never needs to be set. +.PP +\fBsethostid\fP() はスーパーユーザーしか使用できない。 +.SH 返り値 +\fBgethostid\fP() は、 \fBsethostid\fP() によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。 +.PP +成功すると、 \fBsethostid\fP() は 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値を設定する。 +.SH エラー +\fBsethostid\fP() は以下のエラーで失敗する可能性がある。 +.TP +\fBEACCES\fP +呼び出し元がホスト ID を保存するのに使用されるファイルへの 書き込み許可を持っていなかった。 +.TP +\fBEPERM\fP +呼び出し元プロセスの実効 UID/GID が対応する実 UID/GID と同じではない。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lbw25 +l l l. +インターフェース 属性 値 +T{ +\fBgethostid\fP() +T} Thread safety MT\-Safe hostid env locale +T{ +\fBsethostid\fP() +T} Thread safety MT\-Unsafe const:hostid +.TE +.sp 1 +.SH 準拠 +4.2BSD; these functions were dropped in 4.4BSD. SVr4 includes +\fBgethostid\fP() but not \fBsethostid\fP(). +.PP +POSIX.1\-2001 and POSIX.1\-2008 specify \fBgethostid\fP() but not +\fBsethostid\fP(). +.SH 注意 +.\" libc5 used /etc/hostid; libc4 didn't have these functions +glibc の実装では、 \fIhostid\fP はファイル \fI/etc/hostid\fP に保存される (バージョン 2.2 より前の glibc では、 +\fI/var/adm/hostid\fP が使用されていた)。 +.PP +glibc の実装では、ホスト ID を保存したファイルを オープンできなかった場合、 \fBgethostid\fP() は +\fBgethostname\fP(2) を使ってホスト名を入手し、そのホスト名を \fBgethostbyname_r\fP(3) に渡しホストの IPv4 +アドレスを取得して、 その IPv4 アドレスのビット入れ替えを行った値を返す。 +.SH バグ +識別子が世界中で一意であることを保証することはできない。 +.SH 関連項目 +\fBhostid\fP(1), \fBgethostbyname\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/getopt.3 b/manual/LDP_man-pages/draft/man3/getopt.3 index 20b3ed65..298ef502 100644 --- a/manual/LDP_man-pages/draft/man3/getopt.3 +++ b/manual/LDP_man-pages/draft/man3/getopt.3 @@ -217,12 +217,12 @@ struct option { したがってオプションとみなすべきでないかを知らせるものである。 この機能は \fBbash\fP(1) のバージョン 2.01 で削除されたが、glibc にはまだ残っている。 .SH 属性 -For an explanation of the terms used in this section, see \fBattributes\fP(7). +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw24 lb lb l l l. -Interface Attribute Value +インターフェース 属性 値 T{ \fBgetopt\fP(), \fBgetopt_long\fP(), @@ -253,7 +253,7 @@ require the declaration to appear in \fI\fP. \fBPOSIXLY_CORRECT\fP の値を変更したりする場合には、 \fIoptind\fP を伝統的な 1 ではなく 0 にリセットすることで \fBgetopt\fP() を再初期化しなければならない (0 にリセットすることで、 \fBPOSIXLY_CORRECT\fP や \fIoptstring\fP の GNU 拡張機能のチェックを行う内部初期化ルーチンが起動される)。 -.SH EXAMPLES +.SH 例 .SS getopt() 以下に示す簡単なサンプルプログラムでは、 二種類のプログラムオプションを扱うのに \fBgetopt\fP() を使用している。一つは値を伴わない \fI\-n\fP で、もう一つは対応する値が必要な \fI\-t val\fP である。 diff --git a/manual/LDP_man-pages/draft/man3/getusershell.3 b/manual/LDP_man-pages/draft/man3/getusershell.3 new file mode 100644 index 00000000..0971dd69 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/getusershell.3 @@ -0,0 +1,134 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" %%%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 +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 ISHIOKA Takashi +.\" all rights reserved. +.\" Translated Mon Sep 8 15:02:18 1997 +.\" by ISHIOKA Takashi +.\"O .SH NAME +.\"O getusershell, setusershell, endusershell \- get permitted user shells +.\"O .SH SYNOPSIS +.\"O Feature Test Macro Requirements for glibc (see +.\"O .BR feature_test_macros (7)): +.\"O .SH DESCRIPTION +.\"O The +.\"O .BR getusershell () +.\"O function returns the next line from the file +.\"O \fI/etc/shells\fP, opening the file if necessary. +.\"O The line should contain +.\"O the pathname of a valid user shell. +.\"O If \fI/etc/shells\fP does not exist or +.\"O is unreadable, +.\"O .BR getusershell () +.\"O behaves as if \fI/bin/sh\fP and +.\"O \fI/bin/csh\fP were listed in the file. +.\"O The +.\"O .BR setusershell () +.\"O function rewinds \fI/etc/shells\fP. +.\"O The +.\"O .BR endusershell () +.\"O function closes \fI/etc/shells\fP. +.\"O .SH "RETURN VALUE" +.\"O The +.\"O .BR getusershell () +.\"O function returns a NULL pointer on end-of-file. +.\"O .SH FILES +.\"O .SH "CONFORMING TO" +.\"O .SH "SEE ALSO" +.\" +.TH GETUSERSHELL 3 2016\-03\-15 GNU "Linux Programmer's Manual" +.SH 名前 +getusershell, setusershell, endusershell \- 許可されたユーザーシェルを得る +.SH 書式 +.nf +\fB#include \fP +.PP +\fBchar *getusershell(void);\fP +.PP +\fBvoid setusershell(void);\fP +.PP +\fBvoid endusershell(void);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +.ad l +\fBgetusershell\fP(), \fBsetusershell\fP(), \fBendusershell\fP(): +.nf +.\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 + Since glibc 2.21: + _DEFAULT_SOURCE + In glibc 2.19 and 2.20: + _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) + Up to and including glibc 2.19: + _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +.fi +.ad b +.SH 説明 +\fBgetusershell\fP() 関数は \fI/etc/shells\fP ファイルから (開く必要があればこのファイルを開いてから) +現在行の次の一行を返す。 返された行の中身は有効なユーザーシェルのうちの一つのパス名である。 (訳注. 一行に付き一つのシェルのパス名が書かれている。) +もし \fI/etc/shells\fP が存在しないか、読み込み不可の場合には、 \fBgetusershell\fP() は \fI/bin/sh\fP と +\fI/bin/csh\fP がファイルに記されているかのようにふるまう。 +.PP +\fBsetusershell\fP() 関数は \fI/etc/shells\fP ファイルの ファイルポインターを先頭に戻す。 +.PP +\fBendusershell\fP() 関数は \fI/etc/shells\fP ファイルを閉じる。 +.SH 返り値 +\fBgetusershell\fP() 関数はファイルの終端では NULL を返す。 +.SH ファイル +\fI/etc/shells\fP +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lbw31 lb lb +l l l. +インターフェース 属性 値 +T{ +\fBgetusershell\fP(), +\fBsetusershell\fP(), +.br +\fBendusershell\fP() +T} Thread safety MT\-Unsafe +.TE +.SH 準拠 +4.3BSD. +.SH 関連項目 +\fBshells\fP(5) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/lockf.3 b/manual/LDP_man-pages/draft/man3/lockf.3 new file mode 100644 index 00000000..b11c8208 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/lockf.3 @@ -0,0 +1,138 @@ +.\" Copyright 1997 Nicolás Lichtmaier +.\" Created Thu Aug 7 00:44:00 ART 1997 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" Added section stuff, aeb, 2002-04-22. +.\" Corrected include file, drepper, 2003-06-15. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO +.\" all rights reserved. +.\" Translated Tue Jul 11 19:02:58 JST 2000 +.\" by Yuichi SATO +.\" Updated & Modified Mon Jul 15 02:10:29 JST 2002 by Yuichi SATO +.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\" +.TH LOCKF 3 2019\-03\-06 GNU "Linux Programmer's Manual" +.SH 名前 +lockf \- オープンされたファイルに対する POSIX ロックの適用・テスト・解除を行う +.SH 書式 +\fB#include \fP +.PP +\fBint lockf(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, off_t \fP\fIlen\fP\fB);\fP +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBlockf\fP(): +.ad l +.RS 4 +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_XOPEN_SOURCE\ >=\ 500 + || /* Glibc since 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE +.RE +.ad +.SH 説明 +オープンされたファイルのセクションに対して、 POSIX ロックの適用・テスト・解除をする。 ファイルは \fIfd\fP で指定される。 \fIfd\fP +は書き込みのためにオープンしたファイルディスクリプターである。 アクションは \fIcmd\fP で指定される。 \fIpos\fP を現在のファイル位置とすると、 +\fIlen\fP が正の場合、セクションはバイト位置 \fIpos\fP..\fIpos\fP+\fIlen\fP\-1 となり、 \fIlen\fP +が負の場合、セクションはバイト位置 \fIpos\fP\-\fIlen\fP..\fIpos\fP\-1 となる。 \fIlen\fP が 0 +の場合、セクションは現在のファイル位置から無限大までとなる (つまり現在の、あるいは変更された場合は将来の、ファイル終端位置まで)。 +どの場合においても、セクションは以前のファイル終端よりも拡大されうる。 +.PP +On Linux, \fBlockf\fP() is just an interface on top of \fBfcntl\fP(2) locking. +Many other systems implement \fBlockf\fP() in this way, but note that POSIX.1 +leaves the relationship between \fBlockf\fP() and \fBfcntl\fP(2) locks +unspecified. A portable application should probably avoid mixing calls to +these interfaces. +.PP +有効なオプションを以下に挙げる。 +.TP +\fBF_LOCK\fP +ファイルの指定されたセクションに排他ロックを設定する。 そのセクション (の一部) が既にロックされていた場合、 +前のロックが解除されるまで関数の呼び出しがブロックされる。 このセクションが前にロックされているセクションと重なった場合、 2 +つのセクションは結合される。 ロックを保持しているプロセスが、 そのファイルのファイルディスクリプターをクローズすると、 ファイルロックは解放される。 +子プロセスはロックを継承しない。 +.TP +\fBF_TLOCK\fP +\fBF_LOCK\fP と同様であるが、ファイルが既にロックされている場合、 関数の呼び出しはブロックを行わずにエラーを返す。 +.TP +\fBF_ULOCK\fP +ファイルの指定されたセクションのロックを解除する。 これによりロックされたセクションが 2 つに分割されるかもしれない。 +.TP +\fBF_TEST\fP +次のようにロックのテストをする。 指定されたセクションがロックされていないか、 このプロセスによりロックされている場合、0 を返す。 +他のプロセスがロックを保持している場合、\-1 を返し、 \fIerrno\fP を \fBEAGAIN\fP (いくつかの他のシステムでは \fBEACCES\fP) +に設定する。 +.SH 返り値 +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +.TP +\fBEACCES\fP か \fBEAGAIN\fP +ロックされたファイルに対して、 \fBF_TLOCK\fP または \fBF_TEST\fP が指定されている。 +または、ファイルが他のプロセスによりメモリーマップされており、 指定された操作が禁止されている。 +.TP +\fBEBADF\fP +\fIfd\fP がオープンされたファイルのディスクリプターではない。 または、 \fIcmd\fP が \fBF_LOCK\fP か \fBF_TLOCK\fP で、 +\fIfd\fP が書き込み可能なファイルディスクリプターでない。 +.TP +\fBEDEADLK\fP +コマンドが \fBF_LOCK\fP であり、このロック操作を行うとデッドロックが発生してしまう。 +.TP +\fBEINTR\fP +ロックの獲得を待っている間に、ハンドラーにより捕捉されたシグナルを 受信し、 \fBflock\fP() が中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIcmd\fP に無効な操作が指定された。 +.TP +\fBENOLCK\fP +非常に多くのセグメントロックが開かれ、ロックテーブルが一杯である。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBlockf\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +POSIX.1\-2001, POSIX.1\-2008, SVr4. +.SH 関連項目 +\fBfcntl\fP(2), \fBflock\fP(2) +.PP +Linux カーネルソースの \fIDocumentation/filesystems\fP ディレクトリにある \fIlocks.txt\fP と +\fImandatory\-locking.txt\fP (以前のカーネルでは、これらのファイルは \fIDocumentation\fP ディレクトリ直下にあり、 +\fImandatory\-locking.txt\fP は \fImandatory.txt\fP という名前であった。) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/swab.3 b/manual/LDP_man-pages/draft/man3/swab.3 new file mode 100644 index 00000000..cd31e255 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/swab.3 @@ -0,0 +1,78 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" %%%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 +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified Sat Jul 24 17:52:15 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-12-15, aeb +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka +.\" all rights reserved. +.\" Translated Fri Dec 19 13:24:02 JST 1997 +.\" by HIROFUMI Nishizuka +.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" +.TH SWAB 3 2015\-08\-08 "" "Linux Programmer's Manual" +.SH 名前 +swab \- 隣接するバイトを交換する +.SH 書式 +.nf +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +.PP +\fBvoid swab(const void *\fP\fIfrom\fP\fB, void *\fP\fIto\fP\fB, ssize_t \fP\fIn\fP\fB);\fP +.fi +.SH 説明 +\fBswab\fP() 関数は、\fIfrom\fP で指された配列から \fIn\fP バイトを \fIto\fP +で指された配列に、隣接した偶数/奇数バイトを交換しながらコピーする。 この関数は異なるバイトオーダーを持つマシン間でのデータ交換に 使用される。 +.PP +\fIn\fP が負の数の場合、この関数は何もしない。 \fIn\fP が正でかつ奇数の場合、\fIn\-1\fP バイトは上記の通り扱い、 +最後のバイトについては未規定の動作をする (言い換えれば、\fIn\fP は偶数にするべきである)。 +.SH 返り値 +\fBswab\fP() 関数は、値を返さない。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBswab\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. +.SH 関連項目 +\fBbstring\fP(3) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/sysconf.3 b/manual/LDP_man-pages/draft/man3/sysconf.3 index 8a9ae574..94f9b48c 100644 --- a/manual/LDP_man-pages/draft/man3/sysconf.3 +++ b/manual/LDP_man-pages/draft/man3/sysconf.3 @@ -233,12 +233,12 @@ the application was compiled. \fBEINVAL\fP \fIname\fP is invalid. .SH 属性 -For an explanation of the terms used in this section, see \fBattributes\fP(7). +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. -Interface Attribute Value +インターフェース 属性 値 T{ \fBsysconf\fP() T} Thread safety MT\-Safe env diff --git a/manual/LDP_man-pages/draft/man3/tcgetpgrp.3 b/manual/LDP_man-pages/draft/man3/tcgetpgrp.3 index 22c69ce8..c04bf66e 100644 --- a/manual/LDP_man-pages/draft/man3/tcgetpgrp.3 +++ b/manual/LDP_man-pages/draft/man3/tcgetpgrp.3 @@ -78,12 +78,12 @@ tcgetpgrp, tcsetpgrp \- 端末のフォアグラウンドプロセスグルー \fBEPERM\fP \fIpgrp\fP が有効な値だが、呼び出しを行ったプロセスと同じセッションに属する プロセスのプロセスグループ ID には該当するものがない。 .SH 属性 -For an explanation of the terms used in this section, see \fBattributes\fP(7). +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw24 lb lb l l l. -Interface Attribute Value +インターフェース 属性 値 T{ \fBtcgetpgrp\fP(), \fBtcsetpgrp\fP() diff --git a/manual/LDP_man-pages/draft/man3/ualarm.3 b/manual/LDP_man-pages/draft/man3/ualarm.3 new file mode 100644 index 00000000..2623c667 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/ualarm.3 @@ -0,0 +1,122 @@ +.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 2004 Yuichi SATO +.\" all rights reserved. +.\" Translated Sat Sep 11 07:32:05 JST 2004 +.\" by Yuichi SATO +.\" Updated 2007-05-04, Akihiro MOTOKI +.\" Updated 2013-05-01, Akihiro MOTOKI +.\" +.TH UALARM 3 2017\-09\-15 "" "Linux Programmer's Manual" +.SH 名前 +ualarm \- 指定したマイクロ秒後にシグナルを送る予定をする +.SH 書式 +.nf +\fB#include \fP +.PP +\fBuseconds_t ualarm(useconds_t \fP\fIusecs\fP\fB, useconds_t \fP\fIinterval\fP\fB);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBualarm\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +glibc 2.12 以降: +.nf +(_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200809L) + || /* Glibc since 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +\fBualarm\fP() 関数は、呼び出し元のプロセスに対して \fIusecs\fP マイクロ秒 (以上) 後に \fBSIGALRM\fP シグナルを送る。 +遅れはシステムの活性度・呼び出しの処理時間・ システムタイマーの粒度によって長くなるかもしれない。 +.PP +捕捉または無視されない限り、 \fBSIGALRM\fP シグナルはプロセスを終了させる。 +.PP +\fIinterval\fP 引き数が 0 でない場合、最初の \fBSIGALRM\fP シグナルの後、 さらに \fIinterval\fP マイクロ秒毎に +SIGALRM シグナルが送られる。 +.SH 返り値 +この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 実行中の alarm がない場合は 0 を返す。 +.SH エラー +.TP +\fBEINTR\fP +シグナルによって中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIusecs\fP または \fIinterval\fP が 1000000 未満でない (これがエラーとして扱われるシステムの場合)。 +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBualarm\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +4.3BSD, POSIX.1\-2001. POSIX.1\-2001 では \fBualarm\fP() は過去のものとされている。 +POSIX.1\-2008 では、 \fBualarm\fP() の仕様が削除されている。 4.3BSD, SUSv2, POSIX +はエラーを定義していない。 +.SH 注意 +.\" This case is not documented in HP-US, Solar, FreeBSD, NetBSD, or OpenBSD! +POSIX.1\-2001 では、 \fIusecs\fP 引き数が 0 の場合、何が起こるかは規定されていない。 Linux +(やおそらく他ほとんどのシステム) では、 \fIusecs\fP 引き数が 0 の場合、処理待ちのアラームがキャンセルされる。 +.PP +\fIuseconds_t\fP 型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 もともとの BSD での実装や、バージョン +2.1 より前の glibc では、 \fBualarm\fP() の引き数の型は \fIunsigned int\fP であった。 プログラム中に明示的に +\fIuseconds_t\fP と書かない方が、移植性が高くなる。 +.PP +この関数と \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), \fBsetitimer\fP(2), +\fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_getoverrun\fP(2), +\fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), \fBusleep\fP(3) +のような他のタイマー関数との相互作用は規定されていない。 +.PP +この関数は廃止予定である。 代わりに \fBsetitimer\fP(2) もしくは POSIX インターバルタイマー +(\fBtimer_create\fP(2) など) を使うこと。 +.SH 関連項目 +\fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2), +\fBsetitimer\fP(2), \fBusleep\fP(3), \fBtime\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man3/usleep.3 b/manual/LDP_man-pages/draft/man3/usleep.3 new file mode 100644 index 00000000..8a554d86 --- /dev/null +++ b/manual/LDP_man-pages/draft/man3/usleep.3 @@ -0,0 +1,135 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" %%%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 +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-04-01 by aeb +.\" Modified 2003-07-23 by aeb +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi +.\" all rights reserved. +.\" Translated Mon Jan 20 18:47:50 JST 1997 +.\" by YOSHINO Takashi +.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata +.\" Updated Mon Sep 1 JST 2003 by Kentaro Shirakata +.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\" Updated 2013-07-22, Akihiro MOTOKI +.\" +.TH USLEEP 3 2017\-09\-15 "" "Linux Programmer's Manual" +.SH 名前 +usleep \- マイクロ秒単位で実行を延期する +.SH 書式 +.nf +\fB#include \fP +.PP +\fBint usleep(useconds_t \fP\fIusec\fP\fB);\fP +.fi +.PP +.RS -4 +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.RE +.PP +\fBusleep\fP(): +.ad l +.RS 4 +.PD 0 +.TP 4 +glibc 2.12 以降: +.nf +(_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200809L) + || /* Glibc since 2.19: */ _DEFAULT_SOURCE + || /* Glibc versions <= 2.19: */ _BSD_SOURCE +.fi +.TP 4 +glibc 2.12 より前: +.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +.PD +.RE +.ad b +.SH 説明 +\fBusleep\fP() 関数は (少なくとも) \fIusec\fPマイクロ秒の間、 呼び出し元スレッドの実行を延期する。 +システムの動作状況や呼び出しによる時間の消費やシステムタイマーの粒度によって、 停止時間は設定した値よりも少し延ばされるかもしれない。 +.SH 返り値 +\fBusleep\fP() 関数は成功すると 0 を返す。 エラーの場合、 \-1 が返され、 \fIerrno\fP にエラーの原因を示す値が設定される。 +.SH エラー +.TP +\fBEINTR\fP +シグナルによって中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIusec\fP is greater than or equal to 1000000. (On systems where that is +considered an error.) +.SH 属性 +この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 +.TS +allbox; +lb lb lb +l l l. +インターフェース 属性 値 +T{ +\fBusleep\fP() +T} Thread safety MT\-Safe +.TE +.SH 準拠 +4.3BSD, POSIX.1\-2001. POSIX.1\-2001 では、この関数は過去のものと宣言されている。 代わりに +\fBnanosleep\fP(2) を使うこと。 POSIX.1\-2008 では、 \fBusleep\fP() の規定が削除されている。 +.PP +もともとの BSD の実装や、バージョン 2.2.2 より前の glibc では、 この関数の返り値の型は \fIvoid\fP である。 POSIX 版は +\fIint\fP を返し、このプロトタイプは glibc 2.2.2 以降で使用されている。 +.PP +エラーとして \fBEINVAL\fP を返すというのは SUSv2 と POSIX.1\-2001 でのみ文書化されている。 +.SH 注意 +\fIuseconds_t\fP 型は [0,1000000] の範囲の整数を扱うことができる 符号なし整数型である。 +明示的にこの型を使わないことでプログラムの移植性がより高まる。 以下のように使うこと。 +.PP +.in +4n +.EX +#include +\&... + unsigned int usecs; +\&... + usleep(usecs); +.EE +.in +.PP +この関数と、 \fBSIGALRM\fP シグナルあるいは \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), +\fBsetitimer\fP(2), \fBtimer_create\fP(2), \fBtimer_delete\fP(2), +\fBtimer_getoverrun\fP(2), \fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), +\fBualarm\fP(3) といったその他のタイマー関数を同時に使った場合の動作は未定義である。 +.SH 関連項目 +\fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2), +\fBsetitimer\fP(2), \fBsleep\fP(3), \fBualarm\fP(3), \fBtime\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。 diff --git a/manual/LDP_man-pages/draft/man5/shells.5 b/manual/LDP_man-pages/draft/man5/shells.5 new file mode 100644 index 00000000..0965e3ae --- /dev/null +++ b/manual/LDP_man-pages/draft/man5/shells.5 @@ -0,0 +1,65 @@ +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), +.\" Thu May 20 20:45:48 MET DST 1993 +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.\" Modified Sat Jul 24 17:11:07 1993 by Rik Faith (faith@cs.unc.edu) +.\" Modified Sun Nov 21 10:49:38 1993 by Michael Haardt +.\" Modified Sun Feb 26 15:09:15 1995 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" +.\" Japanese Version Copyright (c) 1996-2000 +.\" Takashi ISHIOKA and NAKANO Takeo, all rights reserved. +.\" Translated 9 Sep 1996 by Takashi ISHIOKA +.\" Modified Sat 25 Jul 1998 by NAKANO Takeo +.\" Updated Mon 11 Dec 2000 by NAKANO Takeo +.\" +.TH SHELLS 5 2020\-06\-09 "" "Linux Programmer's Manual" +.SH 名前 +shells \- ログインシェルとして有効なファイルのパス名 +.SH 説明 +\fI/etc/shells\fP はログインシェルとして有効なファイルのフルパスが書かれた テキストファイルである。 \fBchsh\fP(1) +はこのファイルを参照する。 他のプログラムもこのファイルを参照できる。 +.PP +注意して欲しいのだが、プログラムによっては、 ユーザーが通常のユーザーかどうかを判断する際に、このファイルの内容を参考にすることがある。例えば FTP +デーモンは、ログインシェルがこのファイルに書かれていないユーザーからのアクセスを許さないのが以前から一般的である。 +.SH ファイル +\fI/etc/shells\fP +.SH 例 +\fI/etc/shells\fP には以下のようなパスが含まれているだろう。 +.PP +.in +4n +.EX +\fI/bin/sh\fP +\fI/bin/bash\fP +\fI/bin/csh\fP +.EE +.in +.SH 関連項目 +\fBchsh\fP(1), \fBgetusershell\fP(3), \fBpam_shells\fP(8) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は +\%https://www.kernel.org/doc/man\-pages/ に書かれている。