OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / getpid.2
index ef298a5..14b3881 100644 (file)
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\"*******************************************************************
 .\"
-.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
-.\"     and Copyright(c) 2008 Akihiro MOTOKI
-.\"         all rights reserved.
-.\" Translated Thu Jun 26 20:33:01 JST 1997
-.\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
-.\" Updated 2008-10-03, Akihiro MOTOKI, LDP v3.10
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH GETPID 2 2008-09-23 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH GETPID 2 2008\-09\-23 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O getpid, getppid \- get process identification
 getpid, getppid \- プロセス ID を得る
-.\"O .SH SYNOPSIS
 .SH 書式
-.B #include <sys/types.h>
+\fB#include <sys/types.h>\fP
 .br
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.B pid_t getpid(void);
+\fBpid_t getpid(void);\fP
 .br
-.B pid_t getppid(void);
-.\"O .SH DESCRIPTION
+\fBpid_t getppid(void);\fP
 .SH 説明
-.\"O .BR getpid ()
-.\"O returns the process ID of the calling process.
-.\"O (This is often used by
-.\"O routines that generate unique temporary filenames.)
-.BR getpid ()
-は呼び出し元のプロセスのプロセス ID を返す。(テンポラリ用のファイル名として
+\fBgetpid\fP()  は呼び出し元のプロセスのプロセス ID を返す。(テンポラリ用のファイル名として
 他と重ならない名前を生成するルーチンでしばしば使用される。)
 
-.\"O .BR getppid ()
-.\"O returns the process ID of the parent of the calling process.
-.BR getppid ()
-は呼び出し元のプロセスの親プロセスのプロセス ID を返す。
-.\"O .SH ERRORS
+\fBgetppid\fP()  は呼び出し元のプロセスの親プロセスのプロセス ID を返す。
 .SH エラー
-.\"O These functions are always successful.
 これらの関数は常に成功する。
-.\"O .SH "CONFORMING TO"
 .SH 準拠
-POSIX.1-2001, 4.3BSD, SVr4.
-.\"O .SH NOTES
+POSIX.1\-2001, 4.3BSD, SVr4.
 .SH 注意
-.\"O Since glibc version 2.3.4,
-.\"O the glibc wrapper function for
-.\"O .BR getpid ()
-.\"O caches PIDs,
-.\"O so as to avoid additional system calls when a process calls
-.\"O .BR getpid ()
-.\"O repeatedly.
-glibc バージョン 2.3.4 以降では、
-glibc の
-.BR getpid ()
-のラッパー関数は PID をキャッシュする。
-これは、プロセスが繰り返し
-.BR getpid ()
-を呼び出した場合にその都度システムコールを呼ぶのを避けるためである。
-.\"O Normally this caching is invisible,
-.\"O but its correct operation relies on support in the wrapper functions for
-.\"O .BR fork (2),
-.\"O .BR vfork (2),
-.\"O and
-.\"O .BR clone (2):
-.\"O if an application bypasses the glibc wrappers for these system calls by using
-.\"O .BR syscall (2),
-.\"O then a call to
-.\"O .BR getpid ()
-.\"O in the child will return the wrong value
-.\"O (to be precise: it will return the PID of the parent process).
-通常は、このキャッシュ処理が見えることはないが、
-キャッシュ処理が正しく働くためには
-.BR fork (2),
-.BR vfork (2),
-.BR clone (2)
-のラッパー関数でのサポートが必要である。
-アプリケーションがこれらのシステムコールを呼び出す際に、
-glibc のラッパー関数を経由せずに
-.BR syscall (2)
-を使った場合には、子プロセスで
-.BR getpid ()
-を呼び出すと間違った値が返ることだろう
-(正確にいうと、親プロセスの PID が返される)。
 .\" The following program demonstrates this "feature":
 .\"
 .\" #define _GNU_SOURCE
@@ -129,27 +71,14 @@ glibc のラッパー関数を経由せずに
 .\"    }
 .\"    wait(NULL);
 .\"}
-.\"O See also
-.\"O .BR clone (2)
-.\"O for discussion of a case where
-.\"O .BR getpid ()
-.\"O may return the wrong value even when invoking
-.\"O .BR clone (2)
-.\"O via the glibc wrapper function.
-.BR clone (2)
-を glibc のラッパー関数経由で起動した際にも
-.BR getpid ()
-が間違った値を返す場合があり、これに関する議論は
-.BR clone (2)
+glibc バージョン 2.3.4 以降では、 glibc の \fBgetpid\fP()  のラッパー関数は PID をキャッシュする。
+これは、プロセスが繰り返し \fBgetpid\fP()  を呼び出した場合にその都度システムコールを呼ぶのを避けるためである。
+通常は、このキャッシュ処理が見えることはないが、 キャッシュ処理が正しく働くためには \fBfork\fP(2), \fBvfork\fP(2),
+\fBclone\fP(2)  のラッパー関数でのサポートが必要である。 アプリケーションがこれらのシステムコールを呼び出す際に、 glibc
+のラッパー関数を経由せずに \fBsyscall\fP(2)  を使った場合には、子プロセスで \fBgetpid\fP()
+を呼び出すと間違った値が返ることだろう (正確にいうと、親プロセスの PID が返される)。 \fBclone\fP(2)  を glibc
+のラッパー関数経由で起動した際にも \fBgetpid\fP()  が間違った値を返す場合があり、これに関する議論は \fBclone\fP(2)
 も参照してほしい。
-.\"O .SH "SEE ALSO"
 .SH 関連項目
-.BR clone (2),
-.BR fork (2),
-.BR kill (2),
-.BR exec (3),
-.BR mkstemp (3),
-.BR tempnam (3),
-.BR tmpfile (3),
-.BR tmpnam (3),
-.BR credentials (7)
+\fBclone\fP(2), \fBfork\fP(2), \fBkill\fP(2), \fBexec\fP(3), \fBmkstemp\fP(3),
+\fBtempnam\fP(3), \fBtmpfile\fP(3), \fBtmpnam\fP(3), \fBcredentials\fP(7)