OSDN Git Service

(split) LDP: Update drafts based on LDP 3.52 release
[linuxjm/LDP_man-pages.git] / draft / man2 / uname.2
index e1788d7..e775b50 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
 .\"
+.\" %%%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.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" 2007-07-05 mtk: Added details on underlying system call interfaces
 .\"
-.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
-.\"         all rights reserved.
-.\" Translated Thu Jun 26 21:23:19 JST 1997
-.\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
-.\" Updated & Modified Thu Feb 14 21:53:41 JST 2002
-.\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
-.\" Updated 2007-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
+.\"*******************************************************************
 .\"
-.TH UNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O uname \- get name and information about current kernel
-uname \- ¸½ºß²ÔƯÃæ¤Î¥«¡¼¥Í¥ë¤Ë¤Ä¤¤¤Æ¤Î̾Á°¤È¾ðÊó¤òÆÀ¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <sys/utsname.h>
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH UNAME 2 2008\-12\-03 Linux "Linux Programmer's Manual"
+.SH 名前
+uname \- 現在稼働中のカーネルについての名前と情報を得る
+.SH 書式
+\fB#include <sys/utsname.h>\fP
 .sp
-.BI "int uname(struct utsname *" buf );
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR uname ()
-.\"O returns system information in the structure pointed to by
-.\"O .IR buf .
-.BR uname ()
-¤Ï
-.I buf
-¤Ç»Ø¤µ¤ì¤ë¹½Â¤ÂΤ˥·¥¹¥Æ¥à¾ðÊó¤òÊÖ¤¹¡£
-.\"O The
-.\"O .I utsname
-.\"O struct is defined in
-.\"O .IR <sys/utsname.h> :
-.I utsname
-¹½Â¤ÂΤÏ
-.I <sys/utsname.h>
-¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
+\fBint uname(struct utsname *\fP\fIbuf\fP\fB);\fP
+.SH 説明
+\fBuname\fP()  は \fIbuf\fP で指される構造体にシステム情報を返す。 \fIutsname\fP 構造体は
+\fI<sys/utsname.h>\fP で以下のように定義されている。
 .in +4n
 .nf
 
 struct utsname {
-.\"O     char sysname[];    /* Operating system name (e.g., "Linux") */
-.\"O     char nodename[];   /* Name within "some implementation-defined
-.\"O                           network" */
-.\"O     char release[];    /* OS release (e.g., "2.6.28") */
-.\"O     char version[];    /* OS version */
-.\"O     char machine[];    /* Hardware identifier */
-    char sysname[];    /* OS ¤Î̾Á° (Îã: "Linux") */
-    char nodename[];   /* ¡Ö¼ÂÁõ»þ¤ËÄêµÁ¤µ¤ì¤¿¡¢²¿¤é¤«¤Î
-                          ¥Í¥Ã¥È¥ï¡¼¥¯¡×¤Ë¤ª¤±¤ë¥Þ¥·¥ó̾ */
-    char release[];    /* OS ¤Î¥ê¥ê¡¼¥¹ (Îã: "2.6.28") */
-    char version[];    /* OS ¤Î¥Ð¡¼¥¸¥ç¥ó */
-    char machine[];    /* ¥Ï¡¼¥É¥¦¥§¥¢¼±Ê̻Ҡ*/
+    char sysname[];    /* OS の名前 (例: "Linux") */
+    char nodename[];   /* 「実装時に定義された、何らかの
+                          ネットワーク」におけるマシン名 */
+    char release[];    /* オペレーションシステムのリリース番号 (例: "2.6.28") */
+    char version[];    /* オペレーティングシステムのバージョン */
+    char machine[];    /* ハードウェア識別子 */
 #ifdef _GNU_SOURCE
-.\"O     char domainname[]; /* NIS or YP domain name */
-    char domainname[]; /* NIS ¤ä YP ¤Î¥É¥á¥¤¥ó̾ */
+    char domainname[]; /* NIS や YP のドメイン名 */
 #endif
 };
 
 .fi
 .in
-.\"O The length of the arrays in a
-.\"O .I struct utsname
-.\"O is unspecified (see NOTES);
-.\"O the fields are terminated by a null byte (\(aq\\0\(aq).
-.I struct utsname
-¤Ë¤¢¤ëÇÛÎó¤ÎŤµ¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤ (¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£
-¥Õ¥£¡¼¥ë¥É¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success, zero is returned.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ
-.I errno
-¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EFAULT
-.\"O .I buf
-.\"O is not valid.
-.I buf
-¤¬Í­¸ú¤Ç¤Ê¤¤¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-SVr4, POSIX.1-2001.
-.\"O There is no
-.\"O .BR uname ()
-.\"O call in 4.3BSD.
-4.3BSD ¤Ë¤Ï
-.BR uname ()
-¥³¡¼¥ë¤¬¤Ê¤¤¡£
+\fIstruct utsname\fP にある配列の長さは指定されていない (「注意」の節を参照)。 フィールドは NULL バイト
+(\(aq\e0\(aq) で終端される。
+.SH 返り値
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEFAULT\fP
+\fIbuf\fP が有効でない。
+.SH 準拠
+SVr4, POSIX.1\-2001.  4.3BSD には \fBuname\fP()  コールがない。
 .PP
-.\"O The
-.\"O .I domainname
-.\"O member (the NIS or YP domain name) is a GNU extension.
-.I domainname
-¥á¥ó¥Ð¡¼ (NIS ¤Þ¤¿¤Ï YP ¥É¥á¥¤¥ó̾) ¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O This is a system call, and the operating system presumably knows
-.\"O its name, release and version.
-.\"O It also knows what hardware it runs on.
-.\"O So, four of the fields of the struct are meaningful.
-¤³¤ì¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¤¢¤ê¡¢OS ¤Ï̾Á°¡¦¥ê¥ê¡¼¥¹¡¦¥Ð¡¼¥¸¥ç¥ó¤Ê¤É¤ò
-¤¿¤Ö¤óʬ¤«¤Ã¤Æ¤¤¤ë¤À¤í¤¦¡£
-¤µ¤é¤Ë¤½¤ì¤¬²ÔƯ¤·¤Æ¤¤¤ë¥Ï¡¼¥É¥¦¥§¥¢¤âʬ¤«¤Ã¤Æ¤¤¤ë¤À¤í¤¦¡£
-¤è¤Ã¤Æ¹½Â¤ÂΤΠ4 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ï°ÕÌ£¤¬¤¢¤ë¡£
-.\"O On the other hand, the field \fInodename\fP is meaningless:
-.\"O it gives the name of the present machine in some undefined
-.\"O network, but typically machines are in more than one network
-.\"O and have several names.
-.\"O Moreover, the kernel has no way of knowing
-.\"O about such things, so it has to be told what to answer here.
-.\"O The same holds for the additional \fIdomainname\fP field.
-°ìÊý¡¢\fInodename\fP ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï°ÕÌ£¤¬¤Ê¤¤:
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¸½ºß¤Î¥Þ¥·¥ó¤Î (ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤)
-¤É¤³¤«¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë¤ª¤±¤ë̾Á°¤òÍ¿¤¨¤ë¤¬¡¢
-Ä̾ï¥Þ¥·¥ó¤ÏÊ£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤·¡¢Ê£¿ô¤Î̾Á°¤ò»ý¤Ä¡£
-¤µ¤é¤Ë¡¢¥«¡¼¥Í¥ë¤Ï¤³¤Î¤è¤¦¤Ê¾ðÊó¤òÃΤë½Ñ¤ò»ý¤¿¤Ê¤¤¤Î¤Ç¡¢
-¤³¤³¤Ç¤ÎÅú¤¨¤ÏÁ°¤â¤Ã¤Æ¶µ¤¨¤Æ¤ä¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-¤³¤ì¤ÏÄɲåե£¡¼¥ë¥É¤Ç¤¢¤ë \fIdomainname\fP ¤Ë¤Ä¤¤¤Æ¤âƱÍͤǤ¢¤ë¡£
+\fIdomainname\fP メンバー (NIS または YP ドメイン名) は GNU の拡張である。
+.SH 注意
+これはシステムコールであり、OS は名前・リリース・バージョンなどを たぶん分かっているだろう。
+さらにそれが稼働しているハードウェアも分かっているだろう。 よって構造体の 4 つのフィールドには意味がある。 一方、\fInodename\fP
+フィールドには意味がない: このフィールドは現在のマシンの (定義されていない)  どこかのネットワークにおける名前を与えるが、
+通常マシンは複数のネットワークに属し、複数の名前を持つ。 さらに、カーネルはこのような情報を知る術を持たないので、
+ここでの答えは前もって教えてやらなければならない。 これは追加フィールドである \fIdomainname\fP についても同様である。
 .LP
-.\"O To this end Linux uses the system calls
-.\"O .BR sethostname (2)
-.\"O and
-.\"O .BR setdomainname (2).
-¤³¤Î¤¿¤á Linux ¤Ç¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë
-.BR sethostname (2)
-¤È
-.BR setdomainname (2)
-¤¬»È¤ï¤ì¤ë¡£
-.\"O Note that there is no standard that says that the hostname set by
-.\"O .BR sethostname (2)
-.\"O is the same string as the \fInodename\fP field of the struct returned by
-.\"O .BR uname ()
-.RB ¡Ö sethostname (2)
-¤ÇÀßÄꤵ¤ì¤ë¥Û¥¹¥È̾¤Ï¡¢
-.BR uname ()
-¤ÇÊÖ¤µ¤ì¤ë¹½Â¤ÂΤΠ\fInodename\fP ¥Õ¥£¡¼¥ë¥É¤ÈƱ¤¸Ê¸»úÎó¤Ç¤¢¤ë¡×
-¤Èµ¬Äꤷ¤Æ¤¤¤ëɸ½àµ¬³Ê¤Ï¤Ê¤¤
-.\"O (indeed, some systems allow a 256-byte hostname and an 8-byte nodename),
-.\"O but this is true on Linux.
-.\"O The same holds for
-.\"O .BR setdomainname (2)
-.\"O and the \fIdomainname\fP field.
-(¼ÂºÝ¡¢256 ¥Ð¥¤¥È¤Î¥Û¥¹¥È̾¤È 8 ¥Ð¥¤¥È¤Î¥Î¡¼¥É̾¤òµö²Ä¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë)¡£
-¤·¤«¤·¡¢Linux ¤Ç¤ÏƱ¤¸Ê¸»úÎó¤¬ÊÖ¤µ¤ì¤ë¡£
-.BR setdomainname (2)
-¤È \fIdomainname\fP ¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¤³¤È¤¬À®¤êΩ¤Ä¡£
+このため Linux ではシステムコール \fBsethostname\fP(2)  と \fBsetdomainname\fP(2)  が使われる。
+「\fBsethostname\fP(2)  で設定されるホスト名は、 \fBuname\fP()  で返される構造体の \fInodename\fP
+フィールドと同じ文字列である」 と規定している標準規格はない (実際、256 バイトのホスト名と 8 バイトのノード名を許可しているシステムもある)。
+しかし、Linux では同じ文字列が返される。 \fBsetdomainname\fP(2)  と \fIdomainname\fP
+フィールドについても同じことが成り立つ。
 .LP
-.\"O The length of the fields in the struct varies.
-.\"O Some operating systems
-.\"O or libraries use a hardcoded 9 or 33 or 65 or 257.
-.\"O Other systems use
-.\"O .B SYS_NMLN
-.\"O or
-.\"O .B _SYS_NMLN
-.\"O or
-.\"O .B UTSLEN
-.\"O or
-.\"O .BR _UTSNAME_LENGTH .
-.\"O Clearly, it is a bad
-.\"O idea to use any of these constants; just use sizeof(...).
-.\"O Often 257 is chosen in order to have room for an internet hostname.
-¹½Â¤ÂΤΥե£¡¼¥ë¥É¤ÎŤµ¤Ï¤µ¤Þ¤¶¤Þ¤Ç¤¢¤ë¡£
-OS ¤ä¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ë¤Ï¡¢
-¥Ï¡¼¥É¥³¡¼¥É¤µ¤ì¤¿ 9, 33, 65, 257 ¤Ê¤É¤ÎÃͤò»È¤Ã¤Æ¤¤¤ë¤â¤Î¤â¤¢¤ë¡£
-¤Þ¤¿
-.BR SYS_NMLN ,
-.BR _SYS_NMLN ,
-.BR UTSLEN ,
-.B _UTSNAME_LENGTH
-¤Ê¤É¤ò»È¤Ã¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë¡£
-¤Ï¤Ã¤­¤ê¸À¤Ã¤Æ¡¢¤³¤ì¤é¤ÎÄê¿ô¤ò»È¤¦¤Î¤Ï°­¤¤¹Í¤¨Êý¤Ç¤¢¤ê¡¢
-sizeof(...) ¤ò»È¤¦¤Ù¤­¤Ç¤¢¤ë¡£
-¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥Û¥¹¥È̾¤Ç»È¤¦Îΰè¤ò»ý¤¿¤»¤ë¤¿¤á¤Ë¡¢
-257 ¤¬Áª¤Ð¤ì¤ë¤³¤È¤¬Â¿¤¤¡£
+構造体のフィールドの長さはさまざまである。 OS やライブラリの中には、 ハードコードされた 9, 33, 65, 257
+などの値を使っているものもある。 また \fBSYS_NMLN\fP, \fB_SYS_NMLN\fP, \fBUTSLEN\fP, \fB_UTSNAME_LENGTH\fP
+などを使っているシステムもある。 はっきり言って、これらの定数を使うのは悪い考え方であり、 sizeof(...) を使うべきである。
+インターネットホスト名で使う領域を持たせるために、 257 が選ばれることが多い。
 .LP
-.\"O Part of the utsname information is also accessible via
-.\"O .IR /proc/sys/kernel/ { ostype ,
-.\"O .IR hostname ,
-.\"O .IR osrelease ,
-.\"O .IR version ,
-.\"O .IR domainname }.
-utsname ¤Î¾ðÊó¤Ï¡¢
-.IR /proc/sys/kernel/ { ostype ,
-.IR hostname ,
-.IR osrelease ,
-.IR version ,
-.IR domainname }
-¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£
-.\"O .SS Underlying kernel interface
-.SS Çظå¤Î¥«¡¼¥Í¥ë¡¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹
+utsname の情報は、 \fI/proc/sys/kernel/\fP{\fIostype\fP, \fIhostname\fP, \fIosrelease\fP,
+\fIversion\fP, \fIdomainname\fP} を使ってアクセスすることもできる。
+.SS 背後のカーネル・インタフェース
 .LP
-.\"O Over time, increases in the size of the
-.\"O .I utsname
-.\"O structure have led to three successive versions of
-.\"O .BR uname ():
-»þ´Ö¤Î·Ð²á¤È¤È¤â¤Ë¡¢
-.I utsname
-¹½Â¤ÂΤΥµ¥¤¥º¤¬Â礭¤¯¤Ê¤ê¡¢¤³¤Î±Æ¶Á¤Ç
-.BR uname ()
-¤Ë¤Ï 3¤Ä¤Î¥Ð¡¼¥¸¥ç¥ó¤¬Â¸ºß¤¹¤ë:
-.\"O .IR sys_olduname ()
-.\"O (slot
-.\"O .IR __NR_oldolduname ),
-.\"O .IR sys_uname ()
-.\"O (slot
-.\"O .IR __NR_olduname ),
-.\"O and
-.\"O .IR sys_newuname ()
-.\"O (slot
-.\"O .IR __NR_uname) .
-.IR sys_olduname ()
-(¥¹¥í¥Ã¥È¤Ï
-.IR __NR_oldolduname )¡¢
-.IR sys_uname ()
-(¥¹¥í¥Ã¥È¤Ï
-.IR __NR_olduname )¡¢
-.IR sys_newuname ()
-(¥¹¥í¥Ã¥È¤Ï
-.IR __NR_uname )¡£
-.\"O The first one
-.\"O .\" That was back before Linux 1.0
-.\"O used length 9 for all fields;
-.\"O the second
-.\"O .\" That was also back before Linux 1.0
-.\"O used 65;
-.\"O the third also uses 65 but adds the \fIdomainname\fP field.
-.IR sys_olduname ()
-.\" ¤³¤ì¤Ï Linux 1.0 ¤è¤êÁ°¤ËÁ̤ëÏäǤ¢¤ë¡£
-¤Ï¤¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬Ä¹¤µ 9 ¤ò»È¤Ã¤Æ¤¤¤¿¡£
-.IR sys_uname ()
-.\" ¤³¤ì¤â Linux 1.0 ¤è¤êÁ°¤ËÁ̤ëÏäǤ¢¤ë¡£
-¤ÏŤµ 65 ¤ò»È¤Ã¤Æ¤¤¤¿¡£
-.IR sys_newuname ()
-¤âŤµ 65 ¤ò»È¤Ã¤Æ¤¤¤ë¤¬¡¢
-\fIdomainname\fP ¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤Æ¤¤¤ë¡£
-.\"O The glibc
-.\"O .BR uname ()
-.\"O wrapper function hides these details from applications,
-.\"O invoking the most recent version of the system call provided by the kernel.
-glibc ¤Î
-.BR uname ()
-¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¡¢¤³¤ì¤é¤Î¾ÜºÙ¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é±£Êä·¡¢
-¥«¡¼¥Í¥ë¤¬Ä󶡤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¤¦¤ÁºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤òµ¯Æ°¤¹¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR uname (1),
-.BR getdomainname (2),
-.BR gethostname (2)
+.\" That was back before Linux 1.0
+.\" That was also back before Linux 1.0
+時間の経過とともに、 \fIutsname\fP 構造体のサイズが大きくなり、この影響で \fBuname\fP()  には 3つのバージョンが存在する:
+\fIsys_olduname\fP()  (スロットは \fI__NR_oldolduname\fP)、 \fIsys_uname\fP()  (スロットは
+\fI__NR_olduname\fP)、 \fIsys_newuname\fP()  (スロットは \fI__NR_uname\fP)。
+\fIsys_olduname\fP()  はすべてのフィールドが長さ 9 を使っていた。 \fIsys_uname\fP()  は長さ 65 を使っていた。
+\fIsys_newuname\fP()  も長さ 65 を使っているが、 \fIdomainname\fP フィールドが追加されている。 glibc の
+\fBuname\fP()  ラッパー関数は、これらの詳細をアプリケーションから隠蔽し、
+カーネルが提供しているシステムコールのうち最新のバージョンを起動する。
+.SH 関連項目
+\fBuname\fP(1), \fBgetdomainname\fP(2), \fBgethostname\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。