OSDN Git Service

(split) LDP: Add new releases for LDP v3.40.
authorAkihiro MOTOKI <amotoki@gmail.com>
Mon, 7 May 2012 17:23:02 +0000 (02:23 +0900)
committerAkihiro MOTOKI <amotoki@gmail.com>
Mon, 7 May 2012 17:23:02 +0000 (02:23 +0900)
release/man3/CPU_SET.3 [new file with mode: 0644]
release/man3/getnetent_r.3 [new file with mode: 0644]
release/man3/getprotoent_r.3 [new file with mode: 0644]
release/man3/getrpcent_r.3 [new file with mode: 0644]
release/man3/getservent_r.3 [new file with mode: 0644]
release/man3/getutmp.3 [new file with mode: 0644]
release/man5/networks.5 [new file with mode: 0644]
release/man7/hostname.7 [new file with mode: 0644]

diff --git a/release/man3/CPU_SET.3 b/release/man3/CPU_SET.3
new file mode 100644 (file)
index 0000000..6be6271
--- /dev/null
@@ -0,0 +1,257 @@
+.\" Copyright (C) 2006 Michael Kerrisk
+.\" and Copyright (C) 2008 Linux Foundation, written by Michael Kerrisk
+.\"     <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH CPU_SET 3 2012\-03\-15 Linux "Linux Programmer's Manual"
+.SH 名前
+CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, CPU_AND, CPU_OR, CPU_XOR,
+CPU_EQUAL, CPU_ALLOC, CPU_ALLOC_SIZE, CPU_FREE, CPU_SET_S, CPU_CLR_S,
+CPU_ISSET_S, CPU_ZERO_S, CPU_COUNT_S, CPU_AND_S, CPU_OR_S, CPU_XOR_S,
+CPU_EQUAL_S \- macros for manipulating CPU sets
+.SH 書式
+.nf
+\fB#define _GNU_SOURCE\fP             /* feature_test_macros(7) 参照 */
+\fB#include <sched.h>\fP
+.sp
+\fBvoid CPU_ZERO(cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBvoid CPU_SET(int \fP\fIcpu\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+\fBvoid CPU_CLR(int \fP\fIcpu\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+\fBint  CPU_ISSET(int \fP\fIcpu\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBint  CPU_COUNT(cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBvoid CPU_AND(cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+\fBvoid CPU_OR(cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+\fBvoid CPU_XOR(cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+.sp
+\fBint  CPU_EQUAL(cpu_set_t *\fP\fIset1\fP\fB, cpu_set_t *\fP\fIset2\fP\fB);\fP
+.sp
+\fBcpu_set_t *CPU_ALLOC(int \fP\fInum_cpus\fP\fB);\fP
+\fBvoid CPU_FREE(cpu_set_t *\fP\fIset\fP\fB);\fP
+\fBsize_t CPU_ALLOC_SIZE(int \fP\fInum_cpus\fP\fB);\fP
+.sp
+\fBvoid CPU_ZERO_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBvoid CPU_SET_S(int \fP\fIcpu\fP\fB, size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+\fBvoid CPU_CLR_S(int \fP\fIcpu\fP\fB, size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+\fBint  CPU_ISSET_S(int \fP\fIcpu\fP\fB, size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBint  CPU_COUNT_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset\fP\fB);\fP
+.sp
+\fBvoid CPU_AND_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+\fBvoid CPU_OR_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+\fBvoid CPU_XOR_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIdestset\fP\fB,\fP
+\fB             cpu_set_t *\fP\fIsrcset1\fP\fB, cpu_set_t *\fP\fIsrcset2\fP\fB);\fP
+.sp
+\fBint  CPU_EQUAL_S(size_t \fP\fIsetsize\fP\fB, cpu_set_t *\fP\fIset1\fP\fB, cpu_set_t *\fP\fIset2\fP\fB);\fP
+.fi
+.SH 説明
+The \fIcpu_set_t\fP data structure represents a set of CPUs.  CPU sets are used
+by \fBsched_setaffinity\fP(2)  and similar interfaces.
+
+The \fIcpu_set_t\fP data type is implemented as a bitset.  However, the data
+structure treated as considered opaque: all manipulation of CPU sets should
+be done via the macros described in this page.
+
+The following macros are provided to operate on the CPU set \fIset\fP:
+.TP  17
+\fBCPU_ZERO\fP()
+Clears \fIset\fP, so that it contains no CPUs.
+.TP 
+\fBCPU_SET\fP()
+Add CPU \fIcpu\fP to \fIset\fP.
+.TP 
+\fBCPU_CLR\fP()
+Remove CPU \fIcpu\fP from \fIset\fP.
+.TP 
+\fBCPU_ISSET\fP()
+Test to see if CPU \fIcpu\fP is a member of \fIset\fP.
+.TP 
+\fBCPU_COUNT\fP()
+Return the number of CPUs in \fIset\fP.
+.PP
+Where a \fIcpu\fP argument is specified, it should not produce side effects,
+since the above macros may evaluate the argument more than once.
+.PP
+The first available CPU on the system corresponds to a \fIcpu\fP value of 0,
+the next CPU corresponds to a \fIcpu\fP value of 1, and so on.  The constant
+\fBCPU_SETSIZE\fP (currently 1024) specifies a value one greater than the
+maximum CPU number that can be stored in \fIcpu_set_t\fP.
+
+The following macros perform logical operations on CPU sets:
+.TP  17
+\fBCPU_AND\fP()
+Store the intersection of the sets \fIsrcset1\fP and \fIsrcset2\fP in \fIdestset\fP
+(which may be one of the source sets).
+.TP 
+\fBCPU_OR\fP()
+Store the union of the sets \fIsrcset1\fP and \fIsrcset2\fP in \fIdestset\fP (which
+may be one of the source sets).
+.TP 
+\fBCPU_XOR\fP()
+Store the XOR of the sets \fIsrcset1\fP and \fIsrcset2\fP in \fIdestset\fP (which may
+be one of the source sets).  The XOR means the set of CPUs that are in
+either \fIsrcset1\fP or \fIsrcset2\fP, but not both.
+.TP 
+\fBCPU_EQUAL\fP()
+Test whether two CPU set contain exactly the same CPUs.
+.SS "Dynamically sized CPU sets"
+Because some applications may require the ability to dynamically size CPU
+sets (e.g., to allocate sets larger than that defined by the standard
+\fIcpu_set_t\fP data type), glibc nowadays provides a set of macros to support
+this.
+
+The following macros are used to allocate and deallocate CPU sets:
+.TP  17
+\fBCPU_ALLOC\fP()
+Allocate a CPU set large enough to hold CPUs in the range 0 to
+\fInum_cpus\-1\fP.
+.TP 
+\fBCPU_ALLOC_SIZE\fP()
+Return the size in bytes of the CPU set that would be needed to hold CPUs in
+the range 0 to \fInum_cpus\-1\fP.  This macro provides the value that can be
+used for the \fIsetsize\fP argument in the \fBCPU_*_S\fP()  macros described
+below.
+.TP 
+\fBCPU_FREE\fP()
+Free a CPU set previously allocated by \fBCPU_ALLOC\fP().
+.PP
+The macros whose names end with "_S" are the analogs of the similarly named
+macros without the suffix.  These macros perform the same tasks as their
+analogs, but operate on the dynamically allocated CPU set(s) whose size is
+\fIsetsize\fP bytes.
+.SH 返り値
+\fBCPU_ISSET\fP()  and \fBCPU_ISSET_S\fP()  return nonzero if \fIcpu\fP is in \fIset\fP;
+otherwise, it returns 0.
+
+\fBCPU_COUNT\fP()  and \fBCPU_COUNT_S\fP()  return the number of CPUs in \fIset\fP.
+
+\fBCPU_EQUAL\fP()  and \fBCPU_EQUAL_S\fP()  return nonzero if the two CPU sets are
+equal; otherwise it returns 0.
+
+\fBCPU_ALLOC\fP()  returns a pointer on success, or NULL on failure.  (Errors
+are as for \fBmalloc\fP(3).)
+
+\fBCPU_ALLOC_SIZE\fP()  returns the number of bytes required to store a CPU set
+of the specified cardinality.
+
+The other functions do not return a value.
+.SH バージョン
+The \fBCPU_ZERO\fP(), \fBCPU_SET\fP(), \fBCPU_CLR\fP(), and \fBCPU_ISSET\fP()  macros
+were added in glibc 2.3.3.
+
+\fBCPU_COUNT\fP()  first appeared in glibc 2.6.
+
+\fBCPU_AND\fP(), \fBCPU_OR\fP(), \fBCPU_XOR\fP(), \fBCPU_EQUAL\fP(), \fBCPU_ALLOC\fP(),
+\fBCPU_ALLOC_SIZE\fP(), \fBCPU_FREE\fP(), \fBCPU_ZERO_S\fP(), \fBCPU_SET_S\fP(),
+\fBCPU_CLR_S\fP(), \fBCPU_ISSET_S\fP(), \fBCPU_AND_S\fP(), \fBCPU_OR_S\fP(),
+\fBCPU_XOR_S\fP(), and \fBCPU_EQUAL_S\fP()  first appeared in glibc 2.7.
+.SH 準拠
+These interfaces are Linux\-specific.
+.SH 注意
+To duplicate a CPU set, use \fBmemcpy\fP(3).
+
+Since CPU sets are bitsets allocated in units of long words, the actual
+number of CPUs in a dynamically allocated CPU set will be rounded up to the
+next multiple of \fIsizeof(unsigned long)\fP.  An application should consider
+the contents of these extra bits to be undefined.
+
+Notwithstanding the similarity in the names, note that the constant
+\fBCPU_SETSIZE\fP indicates the number of CPUs in the \fIcpu_set_t\fP data type
+(thus, it is effectively a count of bits in the bitset), while the
+\fIsetsize\fP argument of the \fBCPU_*_S\fP()  macros is a size in bytes.
+
+The data types for arguments and return values shown in the SYNOPSIS are
+hints what about is expected in each case.  However, since these interfaces
+are implemented as macros, the compiler won't necessarily catch all type
+errors if you violate the suggestions.
+.SH バグ
+.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7029
+On 32\-bit platforms with glibc 2.8 and earlier, \fBCPU_ALLOC\fP()  allocates
+twice as much space as is required, and \fBCPU_ALLOC_SIZE\fP()  returns a value
+twice as large as it should.  This bug should not affect the semantics of a
+program, but does result in wasted memory and less efficient operation of
+the macros that operate on dynamically allocated CPU sets.  These bugs are
+fixed in glibc 2.9.
+.SH EXAMPLE
+The following program demonstrates the use of some of the macros used for
+dynamically allocated CPU sets.
+
+.nf
+#define _GNU_SOURCE
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <assert.h>
+
+int
+main(int argc, char *argv[])
+{
+    cpu_set_t *cpusetp;
+    size_t size;
+    int num_cpus, cpu;
+
+    if (argc < 2) {
+        fprintf(stderr, "Usage: %s <num\-cpus>\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    num_cpus = atoi(argv[1]);
+
+    cpusetp = CPU_ALLOC(num_cpus);
+    if (cpusetp == NULL) {
+        perror("CPU_ALLOC");
+        exit(EXIT_FAILURE);
+    }
+
+    size = CPU_ALLOC_SIZE(num_cpus);
+
+    CPU_ZERO_S(size, cpusetp);
+    for (cpu = 0; cpu < num_cpus; cpu += 2)
+        CPU_SET_S(cpu, size, cpusetp);
+
+    printf("CPU_COUNT() of set:    %d\en", CPU_COUNT_S(size, cpusetp));
+
+    CPU_FREE(cpusetp);
+    exit(EXIT_SUCCESS);
+}
+.fi
+.SH 関連項目
+\fBsched_setaffinity\fP(2), \fBpthread_attr_setaffinity_np\fP(3),
+\fBpthread_setaffinity_np\fP(3), \fBcpuset\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man3/getnetent_r.3 b/release/man3/getnetent_r.3
new file mode 100644 (file)
index 0000000..fa65473
--- /dev/null
@@ -0,0 +1,116 @@
+.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
+.\"    <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETNETENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
+.SH 名前
+getnetent_r, getnetbyname_r, getnetbyaddr_r \- ネットワークエントリを
+取得する (リエントラント版)
+.SH 書式
+.nf
+\fB#include <netdb.h>\fP
+.sp
+\fBint getnetent_r(struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
+\fB                int *\fP\fIh_errnop\fP\fB);\fP
+.sp
+\fBint getnetbyname_r(const char *\fP\fIname\fP\fB,\fP
+\fB                struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
+\fB                int *\fP\fIh_errnop\fP\fB);\fP
+.sp
+\fBint getnetbyaddr_r(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB,\fP
+\fB                struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
+\fB                int *\fP\fIh_errnop\fP\fB);\fP
+.sp
+.fi
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.ad l
+.in
+.sp
+\fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP():
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+関数 \fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP() は、
+それぞれ \fBgetnetent\fP(3), \fBgetnetbyname\fP(3), \fBgetnetbynumber\fP(3) の
+リエントラント版である。
+\fInetent\fP 構造体の返し方と、関数呼び出し時の引き数と返り値が異なる。
+このマニュアルページでは、リエントラントでない関数との違いだけを
+説明する。
+
+これらの関数は、関数の結果として静的に割り当てられた \fInetent\fP 構造体
+へのポインタを返すのではなく、 \fInetent\fP 構造体を \fIresult_buf\fP が
+指す場所にコピーする。
+
+.\" I can find no information on the required/recommended buffer size;
+.\" the nonreentrant functions use a 1024 byte buffer -- mtk.
+配列 \fIbuf\fP は、返される \fInetent\fP 構造体が指す文字列フィールドを格納
+するのに使用される (リエントラントでない関数の場合は、
+これらの文字列は静的な領域に格納される)。
+この配列の大きさは \fIbuflen\fP で指定される。
+\fIbuf\fP が小さすぎる場合、関数呼び出しはエラー \fBERANGE\fP で失敗し、
+呼び出し側ではもっと大きなバッファで再度呼び出す必要がある (ほとんどの
+アプリケーションでは、長さ 1024 バイトのバッファで十分なはずである)。
+
+関数呼び出しでネットワークレコードの取得に成功すると、
+\fI*result\fP は \fIresult_buf\fP を指すように設定される。
+それ以外の場合は \fI*result\fP に NULL が設定される。
+
+.\" getnetent.3 doesn't document any use of h_errno, but nevertheless
+.\" the nonreentrant functions no seem to set h_errno.
+\fIh_errnop\fP が指すバッファは、リエントラントでない関数では
+グローバル変数 \fIh_errno\fP に格納されていた値を返すのに使用される。
+.SH 返り値
+成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の
+リストにある正のエラー番号のいずれかを返す。
+
+エラーの場合、レコードが見つからなかった場合 (\fBgetnetbyname_r\fP(),
+\fBgetnetbyaddr_r\fP()) やこれ以上レコードがない場合 (\fBgetnetent_r\fP())、
+\fIresult\fP には NULL が設定される。
+.SH エラー
+.TP 
+\fBENOENT\fP
+(\fBgetnetent_r\fP())  データベースにこれ以上レコードがない。
+.TP 
+\fBERANGE\fP
+\fIbuf\fP が小さすぎる。もっと大きなバッファにして
+(または \fIbuflen\fP を増やして) 再度呼び出すこと。
+.SH 準拠
+これらの関数は GNU による拡張である。
+他のシステムにも同様の名前の関数が存在する場合があるが、
+通常は関数の引き数が異なる。
+.SH 関連項目
+\fBgetnetent\fP(3), \fBnetworks\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man3/getprotoent_r.3 b/release/man3/getprotoent_r.3
new file mode 100644 (file)
index 0000000..7ea2dfa
--- /dev/null
@@ -0,0 +1,205 @@
+.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
+.\"    <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETPROTOENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
+.SH 名前
+getprotoent_r, getprotobyname_r, getprotobynumber_r \- プロトコル
+エントリを取得する (リエントラント版)
+.SH 書式
+.nf
+\fB#include <netdb.h>\fP
+.sp
+\fBint getprotoent_r(struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getprotobyname_r(const char *\fP\fIname\fP\fB,\fP
+\fB                struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getprotobynumber_r(int \fP\fIproto\fP\fB,\fP
+\fB                struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP
+.sp
+.fi
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.ad l
+.in
+.sp
+\fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(), \fBgetprotobynumber_r\fP():
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+関数 \fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(),
+\fBgetprotobynumber_r\fP() は、それぞれ \fBgetprotoent\fP(3),
+\fBgetprotobyname\fP(3), \fBgetprotobynumber\fP(3) のリエントラント版である。
+\fIprotoent\fP 構造体の返し方と、関数呼び出し時の引き数と返り値が異なる。
+このマニュアルページでは、リエントラントでない関数との違いだけを
+説明する。
+
+これらの関数は、関数の結果として静的に割り当てられた \fIprotoent\fP 構造体
+へのポインタを返すのではなく、 \fIprotoent\fP 構造体を \fIresult_buf\fP が
+指す場所にコピーする。
+
+.\" I can find no information on the required/recommended buffer size;
+.\" the nonreentrant functions use a 1024 byte buffer.
+.\" The 1024 byte value is also what the Solaris man page suggests. -- mtk
+配列 \fIbuf\fP は、返される \fIprotoent\fP 構造体が指す文字列フィールドを
+格納するのに使用される (リエントラントでない関数の場合は、
+これらの文字列は静的な領域に格納される)。
+この配列の大きさは \fIbuflen\fP で指定される。
+\fIbuf\fP が小さすぎる場合、関数呼び出しはエラー \fBERANGE\fP で失敗し、
+呼び出し側ではもっと大きなバッファで再度呼び出す必要がある (ほとんどの
+アプリケーションでは、長さ 1024 バイトのバッファで十分なはずである)。
+
+関数呼び出しでプロトコルレコードの取得に成功すると、
+\fI*result\fP は \fIresult_buf\fP を指すように設定される。
+それ以外の場合は \fI*result\fP に NULL が設定される。
+.SH 返り値
+成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の
+リストにある正のエラー番号のいずれかを返す。
+
+エラーの場合、レコードが見つからなかった場合 (\fBgetprotobyname_r\fP(),
+\fBgetprotobyaddr_r\fP()) やこれ以上レコードがない場合
+(\fBgetprotoent_r\fP())、\fIresult\fP には NULL が設定される。
+.SH エラー
+.TP 
+\fBENOENT\fP
+(\fBgetprotoent_r\fP())  データベースにこれ以上レコードがない。
+.TP 
+\fBERANGE\fP
+\fIbuf\fP が小さすぎる。もっと大きなバッファにして
+(または \fIbuflen\fP を増やして) 再度呼び出すこと。
+.SH 準拠
+これらの関数は GNU による拡張である。
+他のシステムにも同様の名前の関数が存在する場合があるが、
+通常は関数の引き数が異なる。
+.SH 例
+以下のプログラムは、 \fBgetprotobyname_r\fP() を使って、最初のコマンド
+ライン引き数で指定された名前のプロトコルのレコードを取得する。
+二番目のコマンドライン引き数 (整数値) が指定された場合は、
+その値が \fIbuflen\fP の初期値として使用される。
+\fBgetprotobyname_r\fP() がエラー \fBERANGE\fP で失敗すると、プログラムは
+より大きなバッファサイズで再度 \fBgetprotobyname_r\fP を呼び出す。
+下記のシェルのセッションは、実行例を示している。
+.in +4n
+.nf
+
+$\fB ./a.out tcp 1\fP
+ERANGE! Retrying with larger buffer
+getprotobyname_r() returned: 0 (success)  (buflen=78)
+p_name=tcp; p_proto=6; aliases=TCP
+$\fB ./a.out xxx 1\fP
+ERANGE! Retrying with larger buffer
+getprotobyname_r() returned: 0 (success)  (buflen=100)
+Call failed/record not found
+.fi
+.in
+.SS プログラムのソース
+\&
+.nf
+#define _GNU_SOURCE
+#include <ctype.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#define MAX_BUF 10000
+
+int
+main(int argc, char *argv[])
+{
+    int buflen, erange_cnt, s;
+    struct protoent result_buf;
+    struct protoent *result;
+    char buf[MAX_BUF];
+    char **p;
+
+    if (argc < 2) {
+        printf("Usage: %s proto\-name [buflen]\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    buflen = 1024;
+    if (argc > 2)
+        buflen = atoi(argv[2]);
+
+    if (buflen > MAX_BUF) {
+        printf("Exceeded buffer limit (%d)\en", MAX_BUF);
+        exit(EXIT_FAILURE);
+    }
+
+    erange_cnt = 0;
+    do {
+        s = getprotobyname_r(argv[1], &result_buf,
+                     buf, buflen, &result);
+        if (s == ERANGE) {
+            if (erange_cnt == 0)
+                printf("ERANGE! Retrying with larger buffer\en");
+            erange_cnt++;
+
+            /* Increment a byte at a time so we can see exactly
+               what size buffer was required */
+
+            buflen++;
+
+            if (buflen > MAX_BUF) {
+                printf("Exceeded buffer limit (%d)\en", MAX_BUF);
+                exit(EXIT_FAILURE);
+            }
+        }
+    } while (s == ERANGE);
+
+    printf("getprotobyname_r() returned: %s  (buflen=%d)\en",
+            (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" :
+            strerror(s), buflen);
+
+    if (s != 0 || result == NULL) {
+        printf("Call failed/record not found\en");
+        exit(EXIT_FAILURE);
+    }
+
+    printf("p_name=%s; p_proto=%d; aliases=",
+                result_buf.p_name, result_buf.p_proto);
+    for (p = result_buf.p_aliases; *p != NULL; p++)
+        printf("%s ", *p);
+    printf("\en");
+
+    exit(EXIT_SUCCESS);
+}
+.fi
+.SH 関連項目
+\fBgetprotoent\fP(3), \fBprotocols\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man3/getrpcent_r.3 b/release/man3/getrpcent_r.3
new file mode 100644 (file)
index 0000000..450c98a
--- /dev/null
@@ -0,0 +1,108 @@
+.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
+.\"    <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETRPCENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
+.SH 名前
+getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- RPC エントリを
+取得する (リエントラント版)
+.SH 書式
+.nf
+\fB#include <netdb.h>\fP
+.sp
+\fBint getrpcent_r(struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getrpcbyname_r(const char *\fP\fIname\fP\fB,\fP
+\fB                struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getrpcbynumber_r(int \fP\fInumber\fP\fB,\fP
+\fB                struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP
+.sp
+.fi
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
+.ad l
+.in
+.sp
+\fBgetrpcent_r\fP(), \fBgetrpcbyname_r\fP(), \fBgetrpcbynumber_r\fP():
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+関数 \fBgetrpcent_r\fP(), \fBgetrpcbyname_r\fP(), \fBgetrpcbynumber_r\fP() は、
+それぞれ \fBgetrpcent\fP(3), \fBgetrpcbyname\fP(3), \fBgetrpcbynumber\fP(3) の
+リエントラント版である。
+\fIrpcent\fP 構造体の返し方と、関数呼び出し時の引き数と返り値が異なる。
+このマニュアルページでは、リエントラントでない関数との違いだけを
+説明する。
+
+これらの関数は、関数の結果として静的に割り当てられた \fIrpcent\fP 構造体
+へのポインタを返すのではなく、 \fIrpcent\fP 構造体を \fIresult_buf\fP が
+指す場所にコピーする。
+
+.\" I can find no information on the required/recommended buffer size;
+.\" the nonreentrant functions use a 1024 byte buffer -- mtk.
+配列 \fIbuf\fP は、返される \fIrpcent\fP 構造体が指す文字列フィールドを
+格納するのに使用される (リエントラントでない関数の場合は、
+これらの文字列は静的な領域に格納される)。
+この配列の大きさは \fIbuflen\fP で指定される。
+\fIbuf\fP が小さすぎる場合、関数呼び出しはエラー \fBERANGE\fP で失敗し、
+呼び出し側ではもっと大きなバッファで再度呼び出す必要がある (ほとんどの
+アプリケーションでは、長さ 1024 バイトのバッファで十分なはずである)。
+
+関数呼び出しで RPC レコードの取得に成功すると、
+\fI*result\fP は \fIresult_buf\fP を指すように設定される。
+それ以外の場合は \fI*result\fP に NULL が設定される。
+.SH 返り値
+成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の
+リストにある正のエラー番号のいずれかを返す。
+
+エラーの場合、レコードが見つからなかった場合 (\fBgetrpcbyname_r\fP(),
+\fBgetrpcbyaddr_r\fP()) やこれ以上レコードがない場合 (\fBgetrpcent_r\fP())、
+\fIresult\fP には NULL が設定される。
+.SH エラー
+.TP 
+\fBENOENT\fP
+(\fBgetrpcent_r\fP())  データベースにこれ以上レコードがない。
+.TP 
+\fBERANGE\fP
+\fIbuf\fP が小さすぎる。もっと大きなバッファにして
+(または \fIbuflen\fP を増やして) 再度呼び出すこと。
+.SH 準拠
+これらの関数は GNU による拡張である。
+他のシステムにも同様の名前の関数が存在する場合があるが、
+通常は関数の引き数が異なる。
+.SH 関連項目
+\fBgetrpcent\fP(3), \fBrpc\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man3/getservent_r.3 b/release/man3/getservent_r.3
new file mode 100644 (file)
index 0000000..5b62584
--- /dev/null
@@ -0,0 +1,210 @@
+.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
+.\"    <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETSERVENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
+.SH 名前
+getservent_r, getservbyname_r, getservbyport_r \- サービスエントリを
+取得する (リエントラント版)
+.SH 書式
+.nf
+\fB#include <netdb.h>\fP
+.sp
+\fBint getservent_r(struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getservbyname_r(const char *\fP\fIname\fP\fB, const char *\fP\fIproto\fP\fB,\fP
+\fB                struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP
+.sp
+\fBint getservbyport_r(int \fP\fIport\fP\fB, const char *\fP\fIproto\fP\fB,\fP
+\fB                struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
+\fB                size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP
+.sp
+.fi
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
+.ad l
+.in
+.sp
+\fBgetservent_r\fP(), \fBgetservbyname_r\fP(), \fBgetservbyport_r\fP():
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE
+.RE
+.ad b
+.SH 説明
+関数 \fBgetservent_r\fP(), \fBgetservbyname_r\fP(), \fBgetservbyport_r\fP() は、
+それぞれ \fBgetservent\fP(3), \fBgetservbyname\fP(3), \fBgetservbyport\fP(3) の
+リエントラント版である。
+\fIservent\fP 構造体の返し方と、関数呼び出し時の引き数と返り値が異なる。
+このマニュアルページでは、リエントラントでない関数との違いだけを
+説明する。
+
+これらの関数は、関数の結果として静的に割り当てられた \fIservent\fP 構造体
+へのポインタを返すのではなく、 \fIservent\fP 構造体を \fIresult_buf\fP が
+指す場所にコピーする。
+
+.\" I can find no information on the required/recommended buffer size;
+.\" the nonreentrant functions use a 1024 byte buffer -- mtk.
+配列 \fIbuf\fP は、返される \fIservent\fP 構造体が指す文字列フィールドを
+格納するのに使用される (リエントラントでない関数の場合は、
+これらの文字列は静的な領域に格納される)。
+この配列の大きさは \fIbuflen\fP で指定される。
+\fIbuf\fP が小さすぎる場合、関数呼び出しはエラー \fBERANGE\fP で失敗し、
+呼び出し側ではもっと大きなバッファで再度呼び出す必要がある (ほとんどの
+アプリケーションでは、長さ 1024 バイトのバッファで十分なはずである)。
+
+関数呼び出しでサービスレコードの取得に成功すると、
+\fI*result\fP は \fIresult_buf\fP を指すように設定される。
+それ以外の場合は \fI*result\fP に NULL が設定される。
+.SH 返り値
+成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の
+リストにある正のエラー番号のいずれかを返す。
+
+エラーの場合、レコードが見つからなかった場合 (\fBgetservbyname_r\fP(),
+\fBgetservbyaddr_r\fP()) やこれ以上レコードがない場合 (\fBgetservent_r\fP())、
+\fIresult\fP には NULL が設定される。
+.SH エラー
+.TP 
+\fBENOENT\fP
+(\fBgetservent_r\fP())  データベースにこれ以上レコードがない。
+.TP 
+\fBERANGE\fP
+\fIbuf\fP が小さすぎる。もっと大きなバッファにして
+(または \fIbuflen\fP を増やして) 再度呼び出すこと。
+.SH 準拠
+これらの関数は GNU による拡張である。
+他のシステムにも同様の名前の関数が存在する場合があるが、
+通常は関数の引き数が異なる。
+.SH 例
+以下のプログラムは、 \fBgetservbyport_r\fP() を使って、コマンド
+ライン引き数で指定されたポート番号とプロトコル名を持つ
+サービスレコードを取得する。
+三番目のコマンドライン引き数 (整数値) が指定された場合は、
+その値が \fIbuflen\fP の初期値として使用される。
+\fBgetservbyport_r\fP() がエラー \fBERANGE\fP で失敗すると、プログラムは
+より大きなバッファサイズで再度 \fBgetservbyport_r\fP を呼び出す。
+下記のシェルのセッションは実行例を示している。
+.in +4n
+.nf
+
+$\fB ./a.out 7 tcp 1\fP
+ERANGE! Retrying with larger buffer
+getservbyport_r() returned: 0 (success)  (buflen=87)
+s_name=echo; s_proto=tcp; s_port=7; aliases=
+$\fB ./a.out 77777 tcp\fP
+getservbyport_r() returned: 0 (success)  (buflen=1024)
+Call failed/record not found
+.fi
+.in
+.SS プログラムのソース
+\&
+.nf
+#define _GNU_SOURCE
+#include <ctype.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#define MAX_BUF 10000
+
+int
+main(int argc, char *argv[])
+{
+    int buflen, erange_cnt, port, s;
+    struct servent result_buf;
+    struct servent *result;
+    char buf[MAX_BUF];
+    char *protop;
+    char **p;
+
+    if (argc < 3) {
+        printf("Usage: %s port\-num proto\-name [buflen]\en", argv[0]);
+        exit(EXIT_FAILURE);
+    }
+
+    port = htons(atoi(argv[1]));
+    protop = (strcmp(argv[2], "null") == 0 ||
+             strcmp(argv[2], "NULL") == 0) ?  NULL : argv[2];
+
+    buflen = 1024;
+    if (argc > 3)
+        buflen = atoi(argv[3]);
+
+    if (buflen > MAX_BUF) {
+        printf("Exceeded buffer limit (%d)\en", MAX_BUF);
+        exit(EXIT_FAILURE);
+    }
+
+    erange_cnt = 0;
+    do {
+        s = getservbyport_r(port, protop, &result_buf,
+                     buf, buflen, &result);
+        if (s == ERANGE) {
+            if (erange_cnt == 0)
+                printf("ERANGE! Retrying with larger buffer\en");
+            erange_cnt++;
+
+            /* Increment a byte at a time so we can see exactly
+               what size buffer was required */
+
+            buflen++;
+
+            if (buflen > MAX_BUF) {
+                printf("Exceeded buffer limit (%d)\en", MAX_BUF);
+                exit(EXIT_FAILURE);
+            }
+        }
+    } while (s == ERANGE);
+
+    printf("getservbyport_r() returned: %s  (buflen=%d)\en",
+            (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" :
+            strerror(s), buflen);
+
+    if (s != 0 || result == NULL) {
+        printf("Call failed/record not found\en");
+        exit(EXIT_FAILURE);
+    }
+
+    printf("s_name=%s; s_proto=%s; s_port=%d; aliases=",
+                result_buf.s_name, result_buf.s_proto,
+                ntohs(result_buf.s_port));
+    for (p = result_buf.s_aliases; *p != NULL; p++)
+        printf("%s ", *p);
+    printf("\en");
+
+    exit(EXIT_SUCCESS);
+}
+.fi
+.SH 関連項目
+\fBgetservent\fP(3), \fBservices\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man3/getutmp.3 b/release/man3/getutmp.3
new file mode 100644 (file)
index 0000000..0d884a1
--- /dev/null
@@ -0,0 +1,65 @@
+.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
+.\"     <mtk.manpages@gmail.com>
+.\"
+.\" 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.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETUTMP 3 2010\-09\-10 Linux "Linux Programmer's Manual"
+.SH 名前
+getutmp, getutmpx \- utmp 構造体から utmpx 構造体、その逆のコピーを行う
+.SH 書式
+.nf
+\fB#define _GNU_SOURCE\fP             /* feature_test_macros(7) 参照 */
+\fB#include <utmpx.h>\fP
+
+\fB void getutmp(const struct utmpx *\fP\fIux\fP\fB, struct utmp *\fP\fIu\fP\fB);\fP
+\fB void getutmpx(const struct utmp *\fP\fIu\fP\fB, struct utmpx *\fP\fIux\fP\fB);\fP
+.fi
+.SH 説明
+\fBgetutmp\fP() 関数は、 \fIux\fP が指す \fIutmpx\fP 構造体の各フィールドを、
+\fIu\fP が指す \fIutmp\fP 構造体の対応するフィールドにコピーする。
+\fBgetutmpx\fP() 関数は逆の操作を行う。
+.SH 返り値
+これらの関数は値を返さない。
+.SH バージョン
+これらの関数は glibc バージョン 2.1.1 で初めて登場した。
+.SH 準拠
+これらの関数は非標準である。
+Linux 以外にも、これらの関数が存在するシステムもいくつかある
+(Solaris や NetBSD など)。
+.SH 注意
+.\" e.g., on Solaris, the utmpx structure is rather larger than utmp.
+これらの関数が存在する一番の目的は、
+\fIutmp\fP 構造体と \fIutmpx\fP 構造体が異なるフィールドを持たり、
+対応するフィールドの大きさが異なっている、他のシステムとの
+互換性のためである。
+Linux では、これらの構造体は同じフィールドを持っており、
+各フィールドのサイズも同じである。
+.SH 関連項目
+\fBgetutent\fP(3), \fButmp\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man5/networks.5 b/release/man5/networks.5
new file mode 100644 (file)
index 0000000..3150d03
--- /dev/null
@@ -0,0 +1,76 @@
+.\" Copyright (c) 2001 Martin Schulze <joey@infodrom.org>
+.\"
+.\" 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, write to the Free
+.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
+.\" USA.
+.\" 2008-09-04, mtk, taken from Debian downstream, with a few light edits
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH NETWORKS 5 2008\-09\-04 GNU/Linux "Linux System Administration"
+.SH 名前
+networks \- ネットワーク名の情報
+.SH 説明
+\fI/etc/networks\fP ファイルは、通常の ASCII ファイルで、よく使われる
+DARPA ネットワークとその分かりやすい名前を記載したファイルである。
+各行が一つのネットワークを表し、以下の構造となっている。
+
+.RS
+\fIname number aliases ...\fP
+.RE
+
+フィールドはスペースかタブで区切られる。空行は無視される。
+ハッシュ文字 (\fB#\fP) はコメントの開始を示し、このファイルを処理する
+ライブラリ関数はこの文字とその行のそれ以降の文字を無視する。
+
+フィールドの説明は以下のとおり。
+
+.TP 
+\fIname\fP
+ネットワークの分かりやすい名前 (symbolic name)。
+ネットワーク名には、ホワイトスペースとコメント文字以外の
+印字可能な文字を使うことができる。
+.TP 
+\fInumber\fP
+このネットワークの正式な数字での値。
+ドット区切りの数字表記 (\fBinet\fP(3) 参照) で記載する。
+末尾の ".0" (ネットワークアドレスのホスト部分) は省略してもよい。
+.TP 
+\fIaliases\fP
+そのネットワークの別名 (省略可能)。
+.LP
+
+このファイルは、 \fBroute\fP(8) と \fBnetstat\fP(8) ユーティリティにより
+利用される。クラス A, B, C のネットワークだけがサポートされており、
+(network/26 や network/28 といった) 分割されたネットワークは
+このファイルではサポートされていない。
+.SH ファイル
+.TP 
+\fI/etc/networks\fP
+ネットワーク定義ファイル。
+.SH 関連項目
+\fBgetnetbyaddr\fP(3), \fBgetnetbyname\fP(3), \fBgetnetent\fP(3), \fBnetstat\fP(8),
+\fBroute\fP(8)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
diff --git a/release/man7/hostname.7 b/release/man7/hostname.7
new file mode 100644 (file)
index 0000000..5562cf5
--- /dev/null
@@ -0,0 +1,93 @@
+.\" Copyright (c) 1987, 1990, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" 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.
+.\"
+.\"     @(#)hostname.7 8.2 (Berkeley) 12/30/93
+.\" $FreeBSD: src/share/man/man7/hostname.7,v 1.7 2004/07/03 18:29:23 ru Exp $
+.\"
+.\" 2008-06-11, mtk, Taken from FreeBSD 6.2 and modified for Linux.
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH HOSTNAME 7 2010\-11\-07 Linux "Linux Programmer's Manual"
+.SH 名前
+hostname \- ホスト名の名前解決の説明
+.SH 説明
+ホスト名は、階層構造でドット区切りのサブドメインである。
+例えば、 EDU ドメインの Berkeley サブドメインのマシン monet は、
+"monet.Berkeley.EDU" と表現される。
+
+ホスト名は、ネットワーククライアントやサーバのプログラムでは一般的に
+使用され、使用する際には名前からアドレスに変換しなければならない (一般
+的にはアドレスへの変換処理は \fBgetaddrinfo\fP(3) か (廃止予定の)
+\fBgethostbyname\fP(3) で行われる)。ホスト名の解決は、
+インターネット・ネームリゾルバによって以下の方法で実行される。
+
+ホスト名がドットを含まない単一要素で構成されていて、環境変数
+\fBHOSTALIASES\fP にファイル名が設定されている場合、入力されたホスト名に
+マッチする文字列を検索するのに指定されたファイルが使用される。
+そのファイルの各行は、ホワイトスペースで区切られた文字列 2 つで
+構成され、各行の最初の文字列がホスト名のエイリアス (別名) で、
+二番目の文字列がそのエイリアスに対応する完全なホスト名である。
+解決するホスト名と一致するホスト名のエイリアス (ファイルの各行の最初の
+フィールド) が見つかれば、完全なホスト名に置き換えられ、
+それ以上の変換処理は行わずに、そのホスト名で検索処理が行われる
+(ホスト名とエイリアスの照合では大文字、小文字の違いは無視される)。
+
+入力されたホスト名の末尾がドットの場合、
+末尾のドットは削除され、それ以上の処理は行われず、
+(末尾のドットを削除した) 残りの名前で検索が行われる。
+
+入力された名前の末尾がドットでない場合、
+マッチするものが見つかるまでドメインのリストの検索が行われる。
+デフォルトのドメインの検索リストは、先頭ローカルのドメインで、
+親ドメインが (長いものから順に) 続く (親ドメインはドット区切りで
+少なくとも 2 要素あるものだけが使用される)。
+例えば、 CS.Berkeley.EDU ドメインで、
+lithium.CChem というホスト名の場合には、
+最初に lithium.CChem.CS.Berkeley.EDU が確認され、
+次に lithium.CChem.Berkeley.EDU が確認される。
+Lithium.CChem.EDU はチェックされない。
+なぜなら、ローカルドメイン CS.Berkeley.EDU で残っているドメインは
+EDU で、これは一つしか要素がないからである。
+検索リストはシステム全体で共通の設定ファイルでデフォルト値から
+変更できる (\fBresolver\fP(5) 参照)。
+.SH 関連項目
+.\" .SH HISTORY
+.\" Hostname appeared in
+.\" 4.2BSD.
+\fBgethostbyname\fP(3), \fBresolver\fP(5), \fBmailaddr\fP(7), \fBnamed\fP(8)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。