# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2015-01-23 22:25+0900\n" "PO-Revision-Date: 2015-01-25 07:23+0900\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: build/C/man3/getcontext.3:25 #, no-wrap msgid "GETCONTEXT" msgstr "GETCONTEXT" #. type: TH #: build/C/man3/getcontext.3:25 #, no-wrap msgid "2014-04-08" msgstr "2014-04-08" #. type: TH #: build/C/man3/getcontext.3:25 build/C/man3/pthread_attr_init.3:26 #: build/C/man3/pthread_attr_setaffinity_np.3:26 #: build/C/man3/pthread_attr_setdetachstate.3:26 #: build/C/man3/pthread_attr_setguardsize.3:26 #: build/C/man3/pthread_attr_setinheritsched.3:26 #: build/C/man3/pthread_attr_setschedparam.3:26 #: build/C/man3/pthread_attr_setschedpolicy.3:26 #: build/C/man3/pthread_attr_setscope.3:26 #: build/C/man3/pthread_attr_setstack.3:26 #: build/C/man3/pthread_attr_setstackaddr.3:26 #: build/C/man3/pthread_attr_setstacksize.3:26 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26 #: build/C/man3/pthread_cleanup_push_defer_np.3:26 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26 #: build/C/man3/pthread_getattr_np.3:26 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26 #: build/C/man3/pthread_kill.3:26 #: build/C/man3/pthread_kill_other_threads_np.3:26 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26 #: build/C/man3/pthread_setcancelstate.3:26 #: build/C/man3/pthread_setconcurrency.3:25 #: build/C/man3/pthread_setname_np.3:26 #: build/C/man3/pthread_setschedparam.3:26 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25 #: build/C/man7/pthreads.7:26 #, no-wrap msgid "Linux" msgstr "Linux" #. type: TH #: build/C/man3/getcontext.3:25 build/C/man3/makecontext.3:28 #: build/C/man3/pthread_attr_init.3:26 #: build/C/man3/pthread_attr_setaffinity_np.3:26 #: build/C/man3/pthread_attr_setdetachstate.3:26 #: build/C/man3/pthread_attr_setguardsize.3:26 #: build/C/man3/pthread_attr_setinheritsched.3:26 #: build/C/man3/pthread_attr_setschedparam.3:26 #: build/C/man3/pthread_attr_setschedpolicy.3:26 #: build/C/man3/pthread_attr_setscope.3:26 #: build/C/man3/pthread_attr_setstack.3:26 #: build/C/man3/pthread_attr_setstackaddr.3:26 #: build/C/man3/pthread_attr_setstacksize.3:26 #: build/C/man3/pthread_cancel.3:26 build/C/man3/pthread_cleanup_push.3:26 #: build/C/man3/pthread_cleanup_push_defer_np.3:26 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_detach.3:26 #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26 #: build/C/man3/pthread_getattr_np.3:26 #: build/C/man3/pthread_getcpuclockid.3:26 build/C/man3/pthread_join.3:26 #: build/C/man3/pthread_kill.3:26 #: build/C/man3/pthread_kill_other_threads_np.3:26 #: build/C/man3/pthread_rwlockattr_setkind_np.3:25 #: build/C/man3/pthread_self.3:26 build/C/man3/pthread_setaffinity_np.3:26 #: build/C/man3/pthread_setcancelstate.3:26 #: build/C/man3/pthread_setconcurrency.3:25 #: build/C/man3/pthread_setname_np.3:26 #: build/C/man3/pthread_setschedparam.3:26 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigmask.3:26 #: build/C/man3/pthread_sigqueue.3:25 build/C/man3/pthread_testcancel.3:26 #: build/C/man3/pthread_tryjoin_np.3:26 build/C/man3/pthread_yield.3:25 #: build/C/man7/pthreads.7:26 #, no-wrap msgid "Linux Programmer's Manual" msgstr "Linux Programmer's Manual" #. type: SH #: build/C/man3/getcontext.3:26 build/C/man3/makecontext.3:29 #: build/C/man3/pthread_attr_init.3:27 #: build/C/man3/pthread_attr_setaffinity_np.3:27 #: build/C/man3/pthread_attr_setdetachstate.3:27 #: build/C/man3/pthread_attr_setguardsize.3:27 #: build/C/man3/pthread_attr_setinheritsched.3:27 #: build/C/man3/pthread_attr_setschedparam.3:27 #: build/C/man3/pthread_attr_setschedpolicy.3:27 #: build/C/man3/pthread_attr_setscope.3:27 #: build/C/man3/pthread_attr_setstack.3:27 #: build/C/man3/pthread_attr_setstackaddr.3:27 #: build/C/man3/pthread_attr_setstacksize.3:27 #: build/C/man3/pthread_cancel.3:27 build/C/man3/pthread_cleanup_push.3:27 #: build/C/man3/pthread_cleanup_push_defer_np.3:27 #: build/C/man3/pthread_create.3:27 build/C/man3/pthread_detach.3:27 #: build/C/man3/pthread_equal.3:27 build/C/man3/pthread_exit.3:27 #: build/C/man3/pthread_getattr_np.3:27 #: build/C/man3/pthread_getcpuclockid.3:27 build/C/man3/pthread_join.3:27 #: build/C/man3/pthread_kill.3:27 #: build/C/man3/pthread_kill_other_threads_np.3:27 #: build/C/man3/pthread_rwlockattr_setkind_np.3:26 #: build/C/man3/pthread_self.3:27 build/C/man3/pthread_setaffinity_np.3:27 #: build/C/man3/pthread_setcancelstate.3:27 #: build/C/man3/pthread_setconcurrency.3:26 #: build/C/man3/pthread_setname_np.3:27 #: build/C/man3/pthread_setschedparam.3:27 #: build/C/man3/pthread_setschedprio.3:27 build/C/man3/pthread_sigmask.3:27 #: build/C/man3/pthread_sigqueue.3:26 build/C/man3/pthread_testcancel.3:27 #: build/C/man3/pthread_tryjoin_np.3:27 build/C/man3/pthread_yield.3:26 #: build/C/man7/pthreads.7:27 #, no-wrap msgid "NAME" msgstr "名前" #. type: Plain text #: build/C/man3/getcontext.3:28 msgid "getcontext, setcontext - get or set the user context" msgstr "getcontext, setcontext - ユーザーコンテキストを取得/設定する" #. type: SH #: build/C/man3/getcontext.3:28 build/C/man3/makecontext.3:31 #: build/C/man3/pthread_attr_init.3:30 #: build/C/man3/pthread_attr_setaffinity_np.3:30 #: build/C/man3/pthread_attr_setdetachstate.3:30 #: build/C/man3/pthread_attr_setguardsize.3:30 #: build/C/man3/pthread_attr_setinheritsched.3:30 #: build/C/man3/pthread_attr_setschedparam.3:30 #: build/C/man3/pthread_attr_setschedpolicy.3:30 #: build/C/man3/pthread_attr_setscope.3:30 #: build/C/man3/pthread_attr_setstack.3:30 #: build/C/man3/pthread_attr_setstackaddr.3:30 #: build/C/man3/pthread_attr_setstacksize.3:30 #: build/C/man3/pthread_cancel.3:29 build/C/man3/pthread_cleanup_push.3:30 #: build/C/man3/pthread_cleanup_push_defer_np.3:30 #: build/C/man3/pthread_create.3:29 build/C/man3/pthread_detach.3:29 #: build/C/man3/pthread_equal.3:29 build/C/man3/pthread_exit.3:29 #: build/C/man3/pthread_getattr_np.3:29 #: build/C/man3/pthread_getcpuclockid.3:29 build/C/man3/pthread_join.3:29 #: build/C/man3/pthread_kill.3:29 #: build/C/man3/pthread_kill_other_threads_np.3:29 #: build/C/man3/pthread_rwlockattr_setkind_np.3:29 #: build/C/man3/pthread_self.3:29 build/C/man3/pthread_setaffinity_np.3:30 #: build/C/man3/pthread_setcancelstate.3:30 #: build/C/man3/pthread_setconcurrency.3:29 #: build/C/man3/pthread_setname_np.3:29 #: build/C/man3/pthread_setschedparam.3:30 #: build/C/man3/pthread_setschedprio.3:29 build/C/man3/pthread_sigmask.3:29 #: build/C/man3/pthread_sigqueue.3:28 build/C/man3/pthread_testcancel.3:29 #: build/C/man3/pthread_tryjoin_np.3:30 build/C/man3/pthread_yield.3:28 #, no-wrap msgid "SYNOPSIS" msgstr "書式" #. type: Plain text #: build/C/man3/getcontext.3:30 build/C/man3/makecontext.3:33 msgid "B<#include Eucontext.hE>" msgstr "B<#include Eucontext.hE>" #. type: Plain text #: build/C/man3/getcontext.3:32 msgid "BIB<);>" msgstr "BIB<);>" #. type: Plain text #: build/C/man3/getcontext.3:34 msgid "BIB<);>" msgstr "BIB<);>" #. type: SH #: build/C/man3/getcontext.3:34 build/C/man3/makecontext.3:38 #: build/C/man3/pthread_attr_init.3:39 #: build/C/man3/pthread_attr_setaffinity_np.3:42 #: build/C/man3/pthread_attr_setdetachstate.3:41 #: build/C/man3/pthread_attr_setguardsize.3:41 #: build/C/man3/pthread_attr_setinheritsched.3:41 #: build/C/man3/pthread_attr_setschedparam.3:41 #: build/C/man3/pthread_attr_setschedpolicy.3:41 #: build/C/man3/pthread_attr_setscope.3:41 #: build/C/man3/pthread_attr_setstack.3:54 #: build/C/man3/pthread_attr_setstackaddr.3:41 #: build/C/man3/pthread_attr_setstacksize.3:41 #: build/C/man3/pthread_cancel.3:37 build/C/man3/pthread_cleanup_push.3:40 #: build/C/man3/pthread_cleanup_push_defer_np.3:53 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37 #: build/C/man3/pthread_equal.3:37 build/C/man3/pthread_exit.3:37 #: build/C/man3/pthread_getattr_np.3:38 #: build/C/man3/pthread_getcpuclockid.3:38 build/C/man3/pthread_join.3:37 #: build/C/man3/pthread_kill.3:49 #: build/C/man3/pthread_kill_other_threads_np.3:35 #: build/C/man3/pthread_rwlockattr_setkind_np.3:54 #: build/C/man3/pthread_self.3:37 build/C/man3/pthread_setaffinity_np.3:42 #: build/C/man3/pthread_setcancelstate.3:39 #: build/C/man3/pthread_setconcurrency.3:38 #: build/C/man3/pthread_setname_np.3:39 #: build/C/man3/pthread_setschedparam.3:41 #: build/C/man3/pthread_setschedprio.3:37 build/C/man3/pthread_sigmask.3:50 #: build/C/man3/pthread_sigqueue.3:46 build/C/man3/pthread_testcancel.3:37 #: build/C/man3/pthread_tryjoin_np.3:42 build/C/man3/pthread_yield.3:37 #: build/C/man7/pthreads.7:29 #, no-wrap msgid "DESCRIPTION" msgstr "説明" #. type: Plain text #: build/C/man3/getcontext.3:49 msgid "In a System V-like environment, one has the two types I and I defined in Iucontext.hE> and the four functions B(), B(), B(3), and B(3) that allow user-level context switching between multiple threads of control within a process." msgstr "System V 的な環境では、 I および I という 2 つの型と、 B(), B(), B(3), B(3) という 4 つの関数が Iucontext.hE> で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができるようになっている。" #. type: Plain text #: build/C/man3/getcontext.3:57 msgid "The I type is machine-dependent and opaque. The I type is a structure that has at least the following fields:" msgstr "I 型はマシン依存で、外部からは隠蔽されている。 I 型は構造体で、少なくとも以下の 4 つのフィールドを持つ。" #. type: Plain text #: build/C/man3/getcontext.3:67 #, no-wrap msgid "" "typedef struct ucontext {\n" " struct ucontext *uc_link;\n" " sigset_t uc_sigmask;\n" " stack_t uc_stack;\n" " mcontext_t uc_mcontext;\n" " ...\n" "} ucontext_t;\n" msgstr "" "typedef struct ucontext {\n" " struct ucontext *uc_link;\n" " sigset_t uc_sigmask;\n" " stack_t uc_stack;\n" " mcontext_t uc_mcontext;\n" " ...\n" "} ucontext_t;\n" #. type: Plain text #: build/C/man3/getcontext.3:94 msgid "with I and I defined in Isignal.hE>. Here I points to the context that will be resumed when the current context terminates (in case the current context was created using B(3)), I is the set of signals blocked in this context (see B(2)), I is the stack used by this context (see B(2)), and I is the machine-specific representation of the saved context, that includes the calling thread's machine registers." msgstr "I と I は Isignal.hE> で定義されている。 ここで I は、 現在のコンテキストが終了したとき、 続いて切り替わるコンテキストへのポインターである (現在のコンテキストが B(3) で生成されたものの場合)。 I はこのコンテキストでブロックされている シグナル群である (B(2) を見よ)。 I はこのコンテキストが用いているスタックである (B(2) を見よ)。 I は保存されているコンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシンレジスタが格納される。" #. type: Plain text #: build/C/man3/getcontext.3:101 msgid "The function B() initializes the structure pointed at by I to the currently active context." msgstr "B() 関数は、 ポインター I が指す構造体を、 現在アクティブなコンテキストに初期化する。" #. type: Plain text #: build/C/man3/getcontext.3:114 msgid "The function B() restores the user context pointed at by I. A successful call does not return. The context should have been obtained by a call of B(), or B(3), or passed as third argument to a signal handler." msgstr "B() 関数は、ポインター I が指すユーザーコンテキストをリストアする。 呼び出しに成功すると返らない。 このコンテキストは、以前に B() または B(3) で得られたものか、 あるいはシグナルの第三引数として与えられたものになる。" #. type: Plain text #: build/C/man3/getcontext.3:118 msgid "If the context was obtained by a call of B(), program execution continues as if this call just returned." msgstr "コンテキストが B() の呼び出しによって得られていたものの場合は、 プログラムはこの呼び出しから返った直後からのように実行を継続する。" #. type: Plain text #: build/C/man3/getcontext.3:135 msgid "If the context was obtained by a call of B(3), program execution continues by a call to the function I specified as the second argument of that call to B(3). When the function I returns, we continue with the I member of the structure I specified as the first argument of that call to B(3). When this member is NULL, the thread exits." msgstr "コンテキストが B(3) の呼び出しによって得られていたものの場合は、 プログラムの実行はその B(3) 呼び出しの第二引数で指定された関数 I を呼び出すかたちで継続する。 I から返ると、 B(3) 呼び出しの第一引数で指定されていた I 構造体の I メンバで継続する。 このメンバが NULL だった場合は、そのスレッドは終了する。" #. type: Plain text #: build/C/man3/getcontext.3:142 msgid "If the context was obtained by a call to a signal handler, then old standard text says that \"program execution continues with the program instruction following the instruction interrupted by the signal\". However, this sentence was removed in SUSv2, and the present verdict is \"the result is unspecified\"." msgstr "コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古い標準によれば 「プログラムの実行はシグナルによって割り込まれた命令の次の命令から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果は定義されていない」である。" #. type: SH #: build/C/man3/getcontext.3:142 build/C/man3/makecontext.3:84 #: build/C/man3/pthread_attr_init.3:68 #: build/C/man3/pthread_attr_setaffinity_np.3:76 #: build/C/man3/pthread_attr_setdetachstate.3:77 #: build/C/man3/pthread_attr_setguardsize.3:90 #: build/C/man3/pthread_attr_setinheritsched.3:93 #: build/C/man3/pthread_attr_setschedparam.3:85 #: build/C/man3/pthread_attr_setschedpolicy.3:83 #: build/C/man3/pthread_attr_setscope.3:103 #: build/C/man3/pthread_attr_setstack.3:85 #: build/C/man3/pthread_attr_setstackaddr.3:74 #: build/C/man3/pthread_attr_setstacksize.3:61 #: build/C/man3/pthread_cancel.3:112 build/C/man3/pthread_cleanup_push.3:121 #: build/C/man3/pthread_create.3:115 build/C/man3/pthread_detach.3:49 #: build/C/man3/pthread_equal.3:41 build/C/man3/pthread_exit.3:71 #: build/C/man3/pthread_getattr_np.3:73 #: build/C/man3/pthread_getcpuclockid.3:46 build/C/man3/pthread_join.3:70 #: build/C/man3/pthread_kill.3:63 #: build/C/man3/pthread_rwlockattr_setkind_np.3:96 #: build/C/man3/pthread_self.3:46 build/C/man3/pthread_setaffinity_np.3:77 #: build/C/man3/pthread_setcancelstate.3:92 #: build/C/man3/pthread_setconcurrency.3:56 #: build/C/man3/pthread_setname_np.3:72 #: build/C/man3/pthread_setschedparam.3:104 #: build/C/man3/pthread_setschedprio.3:53 build/C/man3/pthread_sigmask.3:61 #: build/C/man3/pthread_sigqueue.3:66 build/C/man3/pthread_testcancel.3:50 #: build/C/man3/pthread_tryjoin_np.3:85 build/C/man3/pthread_yield.3:44 #, no-wrap msgid "RETURN VALUE" msgstr "返り値" #. type: Plain text #: build/C/man3/getcontext.3:151 msgid "When successful, B() returns 0 and B() does not return. On error, both return -1 and set I appropriately." msgstr "成功すると、 B() は 0 を返し、 B() は返らない。 失敗すると、両者とも -1 を返し、I をエラーに応じて設定する。" #. type: SH #: build/C/man3/getcontext.3:151 build/C/man3/makecontext.3:96 #: build/C/man3/pthread_attr_init.3:71 #: build/C/man3/pthread_attr_setaffinity_np.3:79 #: build/C/man3/pthread_attr_setdetachstate.3:80 #: build/C/man3/pthread_attr_setguardsize.3:93 #: build/C/man3/pthread_attr_setinheritsched.3:96 #: build/C/man3/pthread_attr_setschedparam.3:88 #: build/C/man3/pthread_attr_setschedpolicy.3:86 #: build/C/man3/pthread_attr_setscope.3:106 #: build/C/man3/pthread_attr_setstack.3:88 #: build/C/man3/pthread_attr_setstackaddr.3:77 #: build/C/man3/pthread_attr_setstacksize.3:64 #: build/C/man3/pthread_cancel.3:117 build/C/man3/pthread_cleanup_push.3:123 #: build/C/man3/pthread_create.3:122 build/C/man3/pthread_detach.3:54 #: build/C/man3/pthread_equal.3:45 build/C/man3/pthread_exit.3:73 #: build/C/man3/pthread_getattr_np.3:76 #: build/C/man3/pthread_getcpuclockid.3:49 build/C/man3/pthread_join.3:75 #: build/C/man3/pthread_kill.3:68 #: build/C/man3/pthread_rwlockattr_setkind_np.3:104 #: build/C/man3/pthread_self.3:48 build/C/man3/pthread_setaffinity_np.3:80 #: build/C/man3/pthread_setcancelstate.3:95 #: build/C/man3/pthread_setconcurrency.3:68 #: build/C/man3/pthread_setname_np.3:75 #: build/C/man3/pthread_setschedparam.3:112 #: build/C/man3/pthread_setschedprio.3:61 build/C/man3/pthread_sigmask.3:66 #: build/C/man3/pthread_sigqueue.3:71 build/C/man3/pthread_testcancel.3:54 #: build/C/man3/pthread_tryjoin_np.3:89 build/C/man3/pthread_yield.3:49 #, no-wrap msgid "ERRORS" msgstr "エラー" #. type: Plain text #: build/C/man3/getcontext.3:153 msgid "None defined." msgstr "定義されていない。" #. type: SH #: build/C/man3/getcontext.3:153 build/C/man3/makecontext.3:105 #: build/C/man3/pthread_attr_setdetachstate.3:87 #: build/C/man3/pthread_attr_setguardsize.3:106 #: build/C/man3/pthread_attr_setinheritsched.3:110 #: build/C/man3/pthread_attr_setschedparam.3:100 #: build/C/man3/pthread_attr_setschedpolicy.3:100 #: build/C/man3/pthread_attr_setscope.3:119 #: build/C/man3/pthread_attr_setstack.3:112 #: build/C/man3/pthread_attr_setstackaddr.3:83 #: build/C/man3/pthread_attr_setstacksize.3:83 build/C/man3/pthread_equal.3:47 #: build/C/man3/pthread_exit.3:75 build/C/man3/pthread_getcpuclockid.3:65 #: build/C/man3/pthread_kill.3:72 #: build/C/man3/pthread_kill_other_threads_np.3:47 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_setaffinity_np.3:121 #: build/C/man3/pthread_setcancelstate.3:113 #: build/C/man3/pthread_setconcurrency.3:83 #: build/C/man3/pthread_setschedparam.3:141 #: build/C/man3/pthread_setschedprio.3:83 build/C/man3/pthread_sigmask.3:69 #: build/C/man3/pthread_sigqueue.3:94 build/C/man3/pthread_testcancel.3:58 #: build/C/man3/pthread_yield.3:53 #, no-wrap msgid "ATTRIBUTES" msgstr "属性" #. type: SS #: build/C/man3/getcontext.3:154 build/C/man3/makecontext.3:106 #: build/C/man3/pthread_attr_setdetachstate.3:88 #: build/C/man3/pthread_attr_setguardsize.3:107 #: build/C/man3/pthread_attr_setinheritsched.3:111 #: build/C/man3/pthread_attr_setschedparam.3:101 #: build/C/man3/pthread_attr_setschedpolicy.3:101 #: build/C/man3/pthread_attr_setscope.3:120 #: build/C/man3/pthread_attr_setstack.3:113 #: build/C/man3/pthread_attr_setstackaddr.3:84 #: build/C/man3/pthread_attr_setstacksize.3:84 build/C/man3/pthread_equal.3:48 #: build/C/man3/pthread_exit.3:76 build/C/man3/pthread_getcpuclockid.3:66 #: build/C/man3/pthread_kill.3:73 #: build/C/man3/pthread_kill_other_threads_np.3:48 #: build/C/man3/pthread_self.3:51 build/C/man3/pthread_setaffinity_np.3:122 #: build/C/man3/pthread_setcancelstate.3:114 #: build/C/man3/pthread_setconcurrency.3:84 #: build/C/man3/pthread_setschedparam.3:142 #: build/C/man3/pthread_setschedprio.3:84 build/C/man3/pthread_sigmask.3:70 #: build/C/man3/pthread_sigqueue.3:95 build/C/man3/pthread_testcancel.3:59 #: build/C/man3/pthread_yield.3:54 #, no-wrap msgid "Multithreading (see pthreads(7))" msgstr "マルチスレッディング (pthreads(7) 参照)" #. type: Plain text #: build/C/man3/getcontext.3:160 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: SH #: build/C/man3/getcontext.3:160 build/C/man3/makecontext.3:112 #: build/C/man3/pthread_attr_init.3:79 #: build/C/man3/pthread_attr_setaffinity_np.3:108 #: build/C/man3/pthread_attr_setdetachstate.3:94 #: build/C/man3/pthread_attr_setguardsize.3:113 #: build/C/man3/pthread_attr_setinheritsched.3:117 #: build/C/man3/pthread_attr_setschedparam.3:107 #: build/C/man3/pthread_attr_setschedpolicy.3:107 #: build/C/man3/pthread_attr_setscope.3:126 #: build/C/man3/pthread_attr_setstack.3:119 #: build/C/man3/pthread_attr_setstackaddr.3:90 #: build/C/man3/pthread_attr_setstacksize.3:90 #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_cleanup_push.3:127 #: build/C/man3/pthread_cleanup_push_defer_np.3:114 #: build/C/man3/pthread_create.3:153 build/C/man3/pthread_detach.3:64 #: build/C/man3/pthread_equal.3:52 build/C/man3/pthread_exit.3:80 #: build/C/man3/pthread_getattr_np.3:98 #: build/C/man3/pthread_getcpuclockid.3:70 build/C/man3/pthread_join.3:98 #: build/C/man3/pthread_kill.3:77 #: build/C/man3/pthread_kill_other_threads_np.3:52 #: build/C/man3/pthread_rwlockattr_setkind_np.3:127 #: build/C/man3/pthread_self.3:55 build/C/man3/pthread_setaffinity_np.3:128 #: build/C/man3/pthread_setcancelstate.3:120 #: build/C/man3/pthread_setconcurrency.3:90 #: build/C/man3/pthread_setname_np.3:102 #: build/C/man3/pthread_setschedparam.3:148 #: build/C/man3/pthread_setschedprio.3:88 build/C/man3/pthread_sigmask.3:74 #: build/C/man3/pthread_sigqueue.3:99 build/C/man3/pthread_testcancel.3:63 #: build/C/man3/pthread_tryjoin_np.3:120 build/C/man3/pthread_yield.3:58 #, no-wrap msgid "CONFORMING TO" msgstr "準拠" #. type: Plain text #: build/C/man3/getcontext.3:166 msgid "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specification of B(), citing portability issues, and recommending that applications be rewritten to use POSIX threads instead." msgstr "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B() の仕様が削除された。 代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。" #. type: SH #: build/C/man3/getcontext.3:166 build/C/man3/makecontext.3:120 #: build/C/man3/pthread_attr_init.3:81 #: build/C/man3/pthread_attr_setaffinity_np.3:111 #: build/C/man3/pthread_attr_setdetachstate.3:96 #: build/C/man3/pthread_attr_setguardsize.3:115 #: build/C/man3/pthread_attr_setschedparam.3:109 #: build/C/man3/pthread_attr_setscope.3:128 #: build/C/man3/pthread_attr_setstack.3:121 #: build/C/man3/pthread_attr_setstackaddr.3:93 #: build/C/man3/pthread_attr_setstacksize.3:92 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100 #: build/C/man3/pthread_kill.3:79 #: build/C/man3/pthread_kill_other_threads_np.3:55 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setaffinity_np.3:131 #: build/C/man3/pthread_setcancelstate.3:122 #: build/C/man3/pthread_setconcurrency.3:92 #: build/C/man3/pthread_setname_np.3:104 #: build/C/man3/pthread_setschedparam.3:150 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76 #: build/C/man3/pthread_yield.3:64 #, no-wrap msgid "NOTES" msgstr "注意" #. type: Plain text #: build/C/man3/getcontext.3:183 msgid "The earliest incarnation of this mechanism was the B(3)/B(3) mechanism. Since that does not define the handling of the signal context, the next stage was the B(3)/B(3) pair. The present mechanism gives much more control. On the other hand, there is no easy way to detect whether a return from B() is from the first call, or via a B() call. The user has to invent her own bookkeeping device, and a register variable won't do since registers are restored." msgstr "このメカニズムの最古の実装は、 B(3)/B(3) 機構であった。 これらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階では B(3)/B(3) のペアが現われた。 現在の機構ではずっと細かな制御ができる。 一方 B() から返ったとき、 これが最初の呼び出しであったか、 それとも B() 呼び出しからのものであるかを 区別する容易な方法がなくなってしまった。 ユーザーは「しおり」機構を自分で作らなければならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやってくれない。" #. type: Plain text #: build/C/man3/getcontext.3:194 msgid "When a signal occurs, the current user context is saved and a new context is created by the kernel for the signal handler. Do not leave the handler using B(3): it is undefined what would happen with contexts. Use B(3) or B() instead." msgstr "シグナルが発生すると、 現在のユーザーコンテキストは保存され、 シグナルハンドラ用のコンテキストがカーネルによって生成される。 今後はハンドラに B(3) を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 代わりに B(3) か B() を使うこと。" #. type: SH #: build/C/man3/getcontext.3:194 build/C/man3/makecontext.3:227 #: build/C/man3/pthread_attr_init.3:297 #: build/C/man3/pthread_attr_setaffinity_np.3:118 #: build/C/man3/pthread_attr_setdetachstate.3:118 #: build/C/man3/pthread_attr_setguardsize.3:165 #: build/C/man3/pthread_attr_setinheritsched.3:138 #: build/C/man3/pthread_attr_setschedparam.3:116 #: build/C/man3/pthread_attr_setschedpolicy.3:112 #: build/C/man3/pthread_attr_setscope.3:139 #: build/C/man3/pthread_attr_setstack.3:162 #: build/C/man3/pthread_attr_setstackaddr.3:117 #: build/C/man3/pthread_attr_setstacksize.3:118 #: build/C/man3/pthread_cancel.3:226 build/C/man3/pthread_cleanup_push.3:315 #: build/C/man3/pthread_cleanup_push_defer_np.3:117 #: build/C/man3/pthread_create.3:376 build/C/man3/pthread_detach.3:97 #: build/C/man3/pthread_equal.3:61 build/C/man3/pthread_exit.3:110 #: build/C/man3/pthread_getattr_np.3:345 #: build/C/man3/pthread_getcpuclockid.3:175 build/C/man3/pthread_join.3:127 #: build/C/man3/pthread_kill.3:99 #: build/C/man3/pthread_kill_other_threads_np.3:71 #: build/C/man3/pthread_rwlockattr_setkind_np.3:130 #: build/C/man3/pthread_self.3:81 build/C/man3/pthread_setaffinity_np.3:213 #: build/C/man3/pthread_setcancelstate.3:186 #: build/C/man3/pthread_setconcurrency.3:107 #: build/C/man3/pthread_setname_np.3:200 #: build/C/man3/pthread_setschedparam.3:440 #: build/C/man3/pthread_setschedprio.3:96 build/C/man3/pthread_sigmask.3:152 #: build/C/man3/pthread_sigqueue.3:101 build/C/man3/pthread_testcancel.3:68 #: build/C/man3/pthread_tryjoin_np.3:143 build/C/man3/pthread_yield.3:67 #: build/C/man7/pthreads.7:893 #, no-wrap msgid "SEE ALSO" msgstr "関連項目" #. type: Plain text #: build/C/man3/getcontext.3:201 msgid "B(2), B(2), B(2), B(3), B(3), B(3)" msgstr "B(2), B(2), B(2), B(3), B(3), B(3)" #. type: SH #: build/C/man3/getcontext.3:201 build/C/man3/makecontext.3:233 #: build/C/man3/pthread_attr_init.3:313 #: build/C/man3/pthread_attr_setaffinity_np.3:124 #: build/C/man3/pthread_attr_setdetachstate.3:124 #: build/C/man3/pthread_attr_setguardsize.3:173 #: build/C/man3/pthread_attr_setinheritsched.3:150 #: build/C/man3/pthread_attr_setschedparam.3:128 #: build/C/man3/pthread_attr_setschedpolicy.3:123 #: build/C/man3/pthread_attr_setscope.3:149 #: build/C/man3/pthread_attr_setstack.3:174 #: build/C/man3/pthread_attr_setstackaddr.3:123 #: build/C/man3/pthread_attr_setstacksize.3:125 #: build/C/man3/pthread_cancel.3:238 build/C/man3/pthread_cleanup_push.3:321 #: build/C/man3/pthread_cleanup_push_defer_np.3:123 #: build/C/man3/pthread_create.3:389 build/C/man3/pthread_detach.3:104 #: build/C/man3/pthread_equal.3:65 build/C/man3/pthread_exit.3:114 #: build/C/man3/pthread_getattr_np.3:361 #: build/C/man3/pthread_getcpuclockid.3:183 build/C/man3/pthread_join.3:134 #: build/C/man3/pthread_kill.3:108 #: build/C/man3/pthread_kill_other_threads_np.3:77 #: build/C/man3/pthread_rwlockattr_setkind_np.3:132 #: build/C/man3/pthread_self.3:85 build/C/man3/pthread_setaffinity_np.3:221 #: build/C/man3/pthread_setcancelstate.3:191 #: build/C/man3/pthread_setconcurrency.3:110 #: build/C/man3/pthread_setname_np.3:206 #: build/C/man3/pthread_setschedparam.3:454 #: build/C/man3/pthread_setschedprio.3:110 build/C/man3/pthread_sigmask.3:161 #: build/C/man3/pthread_sigqueue.3:109 build/C/man3/pthread_testcancel.3:73 #: build/C/man3/pthread_tryjoin_np.3:148 build/C/man3/pthread_yield.3:71 #: build/C/man7/pthreads.7:927 #, no-wrap msgid "COLOPHON" msgstr "この文書について" #. type: Plain text #: build/C/man3/getcontext.3:209 build/C/man3/makecontext.3:241 #: build/C/man3/pthread_attr_init.3:321 #: build/C/man3/pthread_attr_setaffinity_np.3:132 #: build/C/man3/pthread_attr_setdetachstate.3:132 #: build/C/man3/pthread_attr_setguardsize.3:181 #: build/C/man3/pthread_attr_setinheritsched.3:158 #: build/C/man3/pthread_attr_setschedparam.3:136 #: build/C/man3/pthread_attr_setschedpolicy.3:131 #: build/C/man3/pthread_attr_setscope.3:157 #: build/C/man3/pthread_attr_setstack.3:182 #: build/C/man3/pthread_attr_setstackaddr.3:131 #: build/C/man3/pthread_attr_setstacksize.3:133 #: build/C/man3/pthread_cancel.3:246 build/C/man3/pthread_cleanup_push.3:329 #: build/C/man3/pthread_cleanup_push_defer_np.3:131 #: build/C/man3/pthread_create.3:397 build/C/man3/pthread_detach.3:112 #: build/C/man3/pthread_equal.3:73 build/C/man3/pthread_exit.3:122 #: build/C/man3/pthread_getattr_np.3:369 #: build/C/man3/pthread_getcpuclockid.3:191 build/C/man3/pthread_join.3:142 #: build/C/man3/pthread_kill.3:116 #: build/C/man3/pthread_kill_other_threads_np.3:85 #: build/C/man3/pthread_rwlockattr_setkind_np.3:140 #: build/C/man3/pthread_self.3:93 build/C/man3/pthread_setaffinity_np.3:229 #: build/C/man3/pthread_setcancelstate.3:199 #: build/C/man3/pthread_setconcurrency.3:118 #: build/C/man3/pthread_setname_np.3:214 #: build/C/man3/pthread_setschedparam.3:462 #: build/C/man3/pthread_setschedprio.3:118 build/C/man3/pthread_sigmask.3:169 #: build/C/man3/pthread_sigqueue.3:117 build/C/man3/pthread_testcancel.3:81 #: build/C/man3/pthread_tryjoin_np.3:156 build/C/man3/pthread_yield.3:79 #: build/C/man7/pthreads.7:935 msgid "This page is part of release 3.78 of the Linux I project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/." msgstr "" "この man ページは Linux I プロジェクトのリリース 3.78 の一部\n" "である。プロジェクトの説明とバグ報告に関する情報は\n" "http://www.kernel.org/doc/man-pages/ に書かれている。" #. type: TH #: build/C/man3/makecontext.3:28 #, no-wrap msgid "MAKECONTEXT" msgstr "MAKECONTEXT" #. type: TH #: build/C/man3/makecontext.3:28 build/C/man3/pthread_attr_setaffinity_np.3:26 #: build/C/man3/pthread_attr_setdetachstate.3:26 #: build/C/man3/pthread_attr_setguardsize.3:26 #: build/C/man3/pthread_attr_setscope.3:26 #: build/C/man3/pthread_attr_setstack.3:26 #: build/C/man3/pthread_attr_setstackaddr.3:26 #: build/C/man3/pthread_attr_setstacksize.3:26 #: build/C/man3/pthread_cleanup_push_defer_np.3:26 #: build/C/man3/pthread_create.3:26 build/C/man3/pthread_setname_np.3:26 #: build/C/man3/pthread_setschedprio.3:26 build/C/man3/pthread_sigqueue.3:25 #, no-wrap msgid "2014-05-28" msgstr "2014-05-28" #. type: TH #: build/C/man3/makecontext.3:28 #, no-wrap msgid "GNU" msgstr "GNU" #. type: Plain text #: build/C/man3/makecontext.3:31 msgid "makecontext, swapcontext - manipulate user context" msgstr "makecontext, swapcontext - ユーザーコンテキストを操作する" #. type: Plain text #: build/C/man3/makecontext.3:36 msgid "BIB<, void (*>IB<)(),> BIB<, ...);>" msgstr "BIB<, void (*>IB<)(),> BIB<, ...);>" #. type: Plain text #: build/C/man3/makecontext.3:38 msgid "BIB<, const ucontext_t *>IB<);>" msgstr "BIB<, const ucontext_t *>IB<);>" #. type: Plain text #: build/C/man3/makecontext.3:49 msgid "In a System V-like environment, one has the type I defined in Iucontext.hE> and the four functions B(3), B(3), B() and B() that allow user-level context switching between multiple threads of control within a process." msgstr "System V 的な環境では、 B および B という 2 つの型と、 B(3), B(3), B(), B() という 4 つの関数が Iucontext.hE> で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザーレベルのコンテキスト切替えができるようになっている。" #. type: Plain text #: build/C/man3/makecontext.3:52 msgid "For the type and the first two functions, see B(3)." msgstr "これらの型と、最初の 2 つの関数については、 B(3) を参照のこと。" #. type: Plain text #: build/C/man3/makecontext.3:64 msgid "The B() function modifies the context pointed to by I (which was obtained from a call to B(3)). Before invoking B(), the caller must allocate a new stack for this context and assign its address to Iuc_stack>, and define a successor context and assign its address to Iuc_link>." msgstr "B() 関数は、ポインター I が指すコンテキストを変更する (I は以前の B(3) 呼び出しで得られたものである)。 B() を起動する前には、呼び出し者は、このコンテキスト用に 新しいスタックを確保し、そのアドレスを Iuc_stack> に代入し、 さらに後継のコンテキストを定義し、そのアドレスを Iuc_link> に 代入しなければならない。" #. type: Plain text #: build/C/man3/makecontext.3:78 msgid "When this context is later activated (using B(3) or B()) the function I is called, and passed the series of integer (I) arguments that follow I; the caller must specify the number of these arguments in I. When this function returns, the successor context is activated. If the successor context pointer is NULL, the thread exits." msgstr "このコンテキストが将来 (B(3) または B() によって) 有効にされると、関数 I が呼ばれ、 引き数として I 以降の整数 (I) 引き数の列が渡される。 呼び出し者は I にこれらの引き数の個数を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効になる。 後継コンテキストのポインターが NULL の場合、そのスレッドが終了する。" #. type: Plain text #: build/C/man3/makecontext.3:84 msgid "The B() function saves the current context in the structure pointed to by I, and then activates the context pointed to by I." msgstr "B() 関数は現在のコンテキストを ポインター I が指す構造体に保存し、 ポインター I が指すコンテキストを有効にする。" #. type: Plain text #: build/C/man3/makecontext.3:96 msgid "When successful, B() does not return. (But we may return later, in case I is activated, in which case it looks like B() returns 0.) On error, B() returns -1 and sets I appropriately." msgstr "成功すると、 B() は返らない (しかし後に I が有効になった場合には返ることがある。 このときには B() は 0 を返すように見える。) 失敗すると、 B() は -1 を返し、 I をエラーに応じて設定する。" #. type: TP #: build/C/man3/makecontext.3:97 #: build/C/man3/pthread_attr_setaffinity_np.3:102 #: build/C/man3/pthread_getattr_np.3:77 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/makecontext.3:100 msgid "Insufficient stack space left." msgstr "スタックに割り当てる空間が残っていない。" #. type: SH #: build/C/man3/makecontext.3:100 #: build/C/man3/pthread_attr_setaffinity_np.3:106 #: build/C/man3/pthread_attr_setguardsize.3:104 #: build/C/man3/pthread_attr_setstack.3:110 #: build/C/man3/pthread_attr_setstackaddr.3:81 #: build/C/man3/pthread_attr_setstacksize.3:81 #: build/C/man3/pthread_getattr_np.3:96 #: build/C/man3/pthread_getcpuclockid.3:63 #: build/C/man3/pthread_rwlockattr_setkind_np.3:121 #: build/C/man3/pthread_setaffinity_np.3:119 #: build/C/man3/pthread_setconcurrency.3:81 #: build/C/man3/pthread_setname_np.3:100 #: build/C/man3/pthread_setschedprio.3:81 build/C/man3/pthread_sigqueue.3:90 #: build/C/man3/pthread_tryjoin_np.3:118 #, no-wrap msgid "VERSIONS" msgstr "バージョン" #. type: Plain text #: build/C/man3/makecontext.3:105 msgid "B() and B() are provided in glibc since version 2.1." msgstr "B() と B() は、バージョン 2.1 以降の glibc で提供されている。" #. type: Plain text #: build/C/man3/makecontext.3:112 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/makecontext.3:120 msgid "SUSv2, POSIX.1-2001. POSIX.1-2008 removes the specifications of B() and B(), citing portability issues, and recommending that applications be rewritten to use POSIX threads instead." msgstr "SUSv2, POSIX.1-2001. POSIX.1-2008 では、移植性の問題から B() と B() の仕様が削除されている。 代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。" #. type: Plain text #: build/C/man3/makecontext.3:128 msgid "The interpretation of Iuc_stack> is just as in B(2), namely, this struct contains the start and length of a memory area to be used as the stack, regardless of the direction of growth of the stack. Thus, it is not necessary for the user program to worry about this direction." msgstr "Iuc_stack> の解釈は B(2) の場合と同じである。 すなわちこの構造体には、 スタックとして用いられるメモリ領域の開始アドレスと長さが含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがって、ユーザープログラムはこの件については心配しなくてよい。" #. type: Plain text #: build/C/man3/makecontext.3:144 msgid "On architectures where I and pointer types are the same size (e.g., x86-32, where both types are 32 bits), you may be able to get away with passing pointers as arguments to B() following I. However, doing this is not guaranteed to be portable, is undefined according to the standards, and won't work on architectures where pointers are larger than Is. Nevertheless, starting with version 2.8, glibc makes some changes to B(), to permit this on some 64-bit architectures (e.g., x86-64)." msgstr "I とポインター型が同じ大きさであるアーキテクチャーでは (x86-32 はその例であり、両方の型とも 32 ビットである)、 B() の I 以降の引き数としてポインターを渡してもうまく動くかもしれない。 しかしながら、このようにすると、移植性は保証されず、 標準に従えば動作は未定義であり、ポインターが I よりも大きいアーキテクチャーでは正しく動作しないことだろう。 それにも関わらず、バージョン 2.8 以降の glibc では、 B() に変更が行われ、(x86-64 などの) いくつかの 64 ビットアーキテクチャーで 引き数としてポインターを渡すことができるようになっている。" #. type: SH #: build/C/man3/makecontext.3:144 build/C/man3/pthread_attr_init.3:87 #: build/C/man3/pthread_attr_setdetachstate.3:115 #: build/C/man3/pthread_attr_setguardsize.3:162 #: build/C/man3/pthread_attr_setinheritsched.3:135 #: build/C/man3/pthread_attr_setschedparam.3:113 #: build/C/man3/pthread_attr_setschedpolicy.3:109 #: build/C/man3/pthread_attr_setstack.3:159 #: build/C/man3/pthread_attr_setstacksize.3:115 #: build/C/man3/pthread_cancel.3:135 build/C/man3/pthread_cleanup_push.3:155 #: build/C/man3/pthread_create.3:209 build/C/man3/pthread_detach.3:93 #: build/C/man3/pthread_getattr_np.3:101 #: build/C/man3/pthread_getcpuclockid.3:83 build/C/man3/pthread_join.3:124 #: build/C/man3/pthread_setaffinity_np.3:161 #: build/C/man3/pthread_setcancelstate.3:183 #: build/C/man3/pthread_setname_np.3:114 #: build/C/man3/pthread_setschedparam.3:156 build/C/man3/pthread_sigmask.3:78 #: build/C/man3/pthread_testcancel.3:65 build/C/man3/pthread_tryjoin_np.3:123 #, no-wrap msgid "EXAMPLE" msgstr "例" #. type: Plain text #: build/C/man3/makecontext.3:152 msgid "The example program below demonstrates the use of B(3), B(), and B(). Running the program produces the following output:" msgstr "以下のサンプルプログラムは、 B(3), B(), B() の使用方法の例を示すものである。 このプログラムを実行すると、以下のような出力が得られる:" #. type: Plain text #: build/C/man3/makecontext.3:164 #, no-wrap msgid "" "$B< ./a.out>\n" "main: swapcontext(&uctx_main, &uctx_func2)\n" "func2: started\n" "func2: swapcontext(&uctx_func2, &uctx_func1)\n" "func1: started\n" "func1: swapcontext(&uctx_func1, &uctx_func2)\n" "func2: returning\n" "func1: returning\n" "main: exiting\n" msgstr "" "$B< ./a.out>\n" "main: swapcontext(&uctx_main, &uctx_func2)\n" "func2: started\n" "func2: swapcontext(&uctx_func2, &uctx_func1)\n" "func1: started\n" "func1: swapcontext(&uctx_func1, &uctx_func2)\n" "func2: returning\n" "func1: returning\n" "main: exiting\n" #. type: SS #: build/C/man3/makecontext.3:166 build/C/man3/pthread_attr_init.3:148 #: build/C/man3/pthread_cancel.3:151 build/C/man3/pthread_cleanup_push.3:231 #: build/C/man3/pthread_create.3:248 build/C/man3/pthread_getattr_np.3:179 #: build/C/man3/pthread_getcpuclockid.3:101 #: build/C/man3/pthread_setname_np.3:140 #: build/C/man3/pthread_setschedparam.3:231 build/C/man3/pthread_sigmask.3:96 #, no-wrap msgid "Program source" msgstr "プログラムのソース" #. type: Plain text #: build/C/man3/makecontext.3:172 #, no-wrap msgid "" "#include Eucontext.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" msgstr "" "#include Eucontext.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" #. type: Plain text #: build/C/man3/makecontext.3:174 #, no-wrap msgid "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n" msgstr "static ucontext_t uctx_main, uctx_func1, uctx_func2;\n" #. type: Plain text #: build/C/man3/makecontext.3:177 #, no-wrap msgid "" "#define handle_error(msg) \\e\n" " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" msgstr "" "#define handle_error(msg) \\e\n" " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" #. type: Plain text #: build/C/man3/makecontext.3:187 #, no-wrap msgid "" "static void\n" "func1(void)\n" "{\n" " printf(\"func1: started\\en\");\n" " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n" " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n" " handle_error(\"swapcontext\");\n" " printf(\"func1: returning\\en\");\n" "}\n" msgstr "" "static void\n" "func1(void)\n" "{\n" " printf(\"func1: started\\en\");\n" " printf(\"func1: swapcontext(&uctx_func1, &uctx_func2)\\en\");\n" " if (swapcontext(&uctx_func1, &uctx_func2) == -1)\n" " handle_error(\"swapcontext\");\n" " printf(\"func1: returning\\en\");\n" "}\n" #. type: Plain text #: build/C/man3/makecontext.3:197 #, no-wrap msgid "" "static void\n" "func2(void)\n" "{\n" " printf(\"func2: started\\en\");\n" " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n" " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n" " handle_error(\"swapcontext\");\n" " printf(\"func2: returning\\en\");\n" "}\n" msgstr "" "static void\n" "func2(void)\n" "{\n" " printf(\"func2: started\\en\");\n" " printf(\"func2: swapcontext(&uctx_func2, &uctx_func1)\\en\");\n" " if (swapcontext(&uctx_func2, &uctx_func1) == -1)\n" " handle_error(\"swapcontext\");\n" " printf(\"func2: returning\\en\");\n" "}\n" #. type: Plain text #: build/C/man3/makecontext.3:203 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " char func1_stack[16384];\n" " char func2_stack[16384];\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " char func1_stack[16384];\n" " char func2_stack[16384];\n" #. type: Plain text #: build/C/man3/makecontext.3:210 #, no-wrap msgid "" " if (getcontext(&uctx_func1) == -1)\n" " handle_error(\"getcontext\");\n" " uctx_func1.uc_stack.ss_sp = func1_stack;\n" " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n" " uctx_func1.uc_link = &uctx_main;\n" " makecontext(&uctx_func1, func1, 0);\n" msgstr "" " if (getcontext(&uctx_func1) == -1)\n" " handle_error(\"getcontext\");\n" " uctx_func1.uc_stack.ss_sp = func1_stack;\n" " uctx_func1.uc_stack.ss_size = sizeof(func1_stack);\n" " uctx_func1.uc_link = &uctx_main;\n" " makecontext(&uctx_func1, func1, 0);\n" #. type: Plain text #: build/C/man3/makecontext.3:218 #, no-wrap msgid "" " if (getcontext(&uctx_func2) == -1)\n" " handle_error(\"getcontext\");\n" " uctx_func2.uc_stack.ss_sp = func2_stack;\n" " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n" " /* Successor context is f1(), unless argc E 1 */\n" " uctx_func2.uc_link = (argc E 1) ? NULL : &uctx_func1;\n" " makecontext(&uctx_func2, func2, 0);\n" msgstr "" " if (getcontext(&uctx_func2) == -1)\n" " handle_error(\"getcontext\");\n" " uctx_func2.uc_stack.ss_sp = func2_stack;\n" " uctx_func2.uc_stack.ss_size = sizeof(func2_stack);\n" " /* Successor context is f1(), unless argc E 1 */\n" " uctx_func2.uc_link = (argc E 1) ? NULL : &uctx_func1;\n" " makecontext(&uctx_func2, func2, 0);\n" #. type: Plain text #: build/C/man3/makecontext.3:222 #, no-wrap msgid "" " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n" " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n" " handle_error(\"swapcontext\");\n" msgstr "" " printf(\"main: swapcontext(&uctx_main, &uctx_func2)\\en\");\n" " if (swapcontext(&uctx_main, &uctx_func2) == -1)\n" " handle_error(\"swapcontext\");\n" #. type: Plain text #: build/C/man3/makecontext.3:226 #, no-wrap msgid "" " printf(\"main: exiting\\en\");\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " printf(\"main: exiting\\en\");\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: build/C/man3/makecontext.3:233 msgid "B(2), B(2), B(2), B(3), B(3)" msgstr "B(2), B(2), B(2), B(3), B(3)" #. type: TH #: build/C/man3/pthread_attr_init.3:26 #, no-wrap msgid "PTHREAD_ATTR_INIT" msgstr "PTHREAD_ATTR_INIT" #. type: TH #: build/C/man3/pthread_attr_init.3:26 #, no-wrap msgid "2008-11-11" msgstr "2008-11-11" #. type: Plain text #: build/C/man3/pthread_attr_init.3:30 msgid "pthread_attr_init, pthread_attr_destroy - initialize and destroy thread attributes object" msgstr "" "pthread_attr_init, pthread_attr_destroy - \n" "スレッド属性オブジェクトの初期化と破棄を行う" #. type: Plain text #: build/C/man3/pthread_attr_init.3:33 #: build/C/man3/pthread_attr_setdetachstate.3:33 #: build/C/man3/pthread_attr_setguardsize.3:33 #: build/C/man3/pthread_attr_setinheritsched.3:33 #: build/C/man3/pthread_attr_setschedparam.3:33 #: build/C/man3/pthread_attr_setschedpolicy.3:33 #: build/C/man3/pthread_attr_setscope.3:33 #: build/C/man3/pthread_attr_setstack.3:33 #: build/C/man3/pthread_attr_setstackaddr.3:33 #: build/C/man3/pthread_attr_setstacksize.3:33 #: build/C/man3/pthread_cancel.3:32 build/C/man3/pthread_cleanup_push.3:33 #: build/C/man3/pthread_cleanup_push_defer_np.3:33 #: build/C/man3/pthread_create.3:32 build/C/man3/pthread_detach.3:32 #: build/C/man3/pthread_equal.3:32 build/C/man3/pthread_exit.3:32 #: build/C/man3/pthread_join.3:32 #: build/C/man3/pthread_kill_other_threads_np.3:32 #: build/C/man3/pthread_rwlockattr_setkind_np.3:32 #: build/C/man3/pthread_self.3:32 build/C/man3/pthread_setcancelstate.3:33 #: build/C/man3/pthread_setconcurrency.3:32 #: build/C/man3/pthread_setschedparam.3:33 #: build/C/man3/pthread_setschedprio.3:32 build/C/man3/pthread_testcancel.3:32 #, no-wrap msgid "B<#include Epthread.hE>\n" msgstr "B<#include Epthread.hE>\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:36 #, no-wrap msgid "" "BIB<);>\n" "BIB<);>\n" msgstr "" "BIB<);>\n" "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:38 #: build/C/man3/pthread_attr_setaffinity_np.3:41 #: build/C/man3/pthread_attr_setdetachstate.3:40 #: build/C/man3/pthread_attr_setguardsize.3:40 #: build/C/man3/pthread_attr_setinheritsched.3:40 #: build/C/man3/pthread_attr_setschedparam.3:40 #: build/C/man3/pthread_attr_setschedpolicy.3:40 #: build/C/man3/pthread_attr_setscope.3:40 #: build/C/man3/pthread_attr_setstack.3:40 #: build/C/man3/pthread_attr_setstackaddr.3:40 #: build/C/man3/pthread_attr_setstacksize.3:40 #: build/C/man3/pthread_cancel.3:36 build/C/man3/pthread_cleanup_push.3:39 #: build/C/man3/pthread_equal.3:36 build/C/man3/pthread_exit.3:36 #: build/C/man3/pthread_getattr_np.3:37 #: build/C/man3/pthread_getcpuclockid.3:37 #: build/C/man3/pthread_rwlockattr_setkind_np.3:39 #: build/C/man3/pthread_self.3:36 build/C/man3/pthread_setaffinity_np.3:41 #: build/C/man3/pthread_setcancelstate.3:38 #: build/C/man3/pthread_setconcurrency.3:37 #: build/C/man3/pthread_setschedparam.3:40 #: build/C/man3/pthread_setschedprio.3:36 build/C/man3/pthread_testcancel.3:36 #, no-wrap msgid "Compile and link with I<-pthread>.\n" msgstr "I<-pthread> でコンパイルしてリンクする。\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:50 msgid "The B() function initializes the thread attributes object pointed to by I with default attribute values. After this call, individual attributes of the object can be set using various related functions (listed under SEE ALSO), and then the object can be used in one or more B(3) calls that create threads." msgstr "" "B() 関数は I が指すスレッド属性オブジェクト\n" "(thread attributes object) をデフォルトの属性値で初期化する。\n" "この呼び出しの後、オブジェクトの各属性は (関連項目に載っている) 種々の\n" "関数を使って設定することができ、このオブジェクトはスレッドの作成を行う\n" "B(3) の呼び出しにおいて使用することができる (一つの\n" "オブジェクトを複数の B(3) に渡してもよい)。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:55 msgid "Calling B() on a thread attributes object that has already been initialized results in undefined behavior." msgstr "" "すでに初期化されているスレッド属性オブジェクトに対して\n" "B() を呼び出した場合、\n" "どのような動作になるかは不定である。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:62 msgid "When a thread attributes object is no longer required, it should be destroyed using the B() function. Destroying a thread attributes object has no effect on threads that were created using that object." msgstr "" "スレッド属性オブジェクトがもはや必要なくなった際には、\n" "そのオブジェクトは B() 関数を使って破棄すべきである。\n" "スレッド属性オブジェクトを破棄しても、\n" "そのオブジェクトを使って作成されたスレッドには影響はない。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:68 msgid "Once a thread attributes object has been destroyed, it can be reinitialized using B(). Any other use of a destroyed thread attributes object has undefined results." msgstr "" "いったん破棄したスレッド属性オブジェクトは、\n" "B() を使って再初期化することができる。\n" "破棄したスレッド属性オブジェクトをこれ以外の用途で\n" "使った場合の結果は不定である。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:71 #: build/C/man3/pthread_attr_setaffinity_np.3:79 #: build/C/man3/pthread_attr_setdetachstate.3:80 #: build/C/man3/pthread_attr_setguardsize.3:93 #: build/C/man3/pthread_attr_setinheritsched.3:96 #: build/C/man3/pthread_attr_setschedparam.3:88 #: build/C/man3/pthread_attr_setschedpolicy.3:86 #: build/C/man3/pthread_attr_setscope.3:106 #: build/C/man3/pthread_attr_setstack.3:88 #: build/C/man3/pthread_attr_setstackaddr.3:77 #: build/C/man3/pthread_attr_setstacksize.3:64 #: build/C/man3/pthread_setaffinity_np.3:80 #: build/C/man3/pthread_setcancelstate.3:95 #: build/C/man3/pthread_setname_np.3:75 msgid "On success, these functions return 0; on error, they return a nonzero error number." msgstr "" "成功すると、これらの関数は 0 を返す。\n" "エラーの場合、0 以外のエラー番号を返す。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:79 msgid "POSIX.1-2001 documents an B error for B(); on Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)." msgstr "" "POSIX.1-2001 では B() にはエラー B が\n" "記載されている。\n" "Linux では、これらの関数は常に成功する\n" "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n" "正のエラーの返り値を処理するようにすべきである)。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:81 #: build/C/man3/pthread_attr_setdetachstate.3:96 #: build/C/man3/pthread_attr_setguardsize.3:115 #: build/C/man3/pthread_attr_setinheritsched.3:119 #: build/C/man3/pthread_attr_setschedparam.3:109 #: build/C/man3/pthread_attr_setschedpolicy.3:109 #: build/C/man3/pthread_attr_setscope.3:128 #: build/C/man3/pthread_attr_setstack.3:121 #: build/C/man3/pthread_attr_setstacksize.3:92 #: build/C/man3/pthread_cancel.3:127 build/C/man3/pthread_cleanup_push.3:129 #: build/C/man3/pthread_create.3:155 build/C/man3/pthread_detach.3:66 #: build/C/man3/pthread_equal.3:54 build/C/man3/pthread_exit.3:82 #: build/C/man3/pthread_getcpuclockid.3:72 build/C/man3/pthread_join.3:100 #: build/C/man3/pthread_self.3:57 build/C/man3/pthread_setcancelstate.3:122 #: build/C/man3/pthread_setconcurrency.3:92 #: build/C/man3/pthread_setschedparam.3:150 #: build/C/man3/pthread_setschedprio.3:90 build/C/man3/pthread_sigmask.3:76 #: build/C/man3/pthread_testcancel.3:65 msgid "POSIX.1-2001." msgstr "POSIX.1-2001." #. type: Plain text #: build/C/man3/pthread_attr_init.3:87 msgid "The I type should be treated as opaque: any access to the object other than via pthreads functions is nonportable and produces undefined results." msgstr "" "I 型の内部構造は意識すべきではない。\n" "pthreads 関数経由以外でのオブジェクトへのアクセスは移植性がなく、\n" "どのような結果が得られるかも分からない。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:96 msgid "The program below optionally makes use of B() and various related functions to initialize a thread attributes object that is used to create a single thread. Once created, the thread uses the B(3) function (a nonstandard GNU extension) to retrieve the thread's attributes, and then displays those attributes." msgstr "" "下記のプログラムは、B() と種々の関連関数を使って、\n" "スレッド属性オブジェクトの初期化を行い、\n" "そのオブジェクトを使ってスレッドを一つ作成する。\n" "作成されたスレッドは、作成後に B(3) 関数 \n" "(非標準の GNU 拡張) を使ってスレッドの属性を取得し、\n" "取得した属性を表示する。" #. type: Plain text #: build/C/man3/pthread_attr_init.3:105 msgid "If the program is run with no command-line argument, then it passes NULL as the I argument of B(3), so that the thread is created with default attributes. Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following:" msgstr "" "コマンドライン引き数なしでプログラムを実行した場合、\n" "B(3) の I 引き数には NULL が渡される。\n" "この場合、スレッドはデフォルトの属性で作成される。\n" "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n" "動作させると、以下のような出力が得られる。" #. Results from glibc 2.8, SUSE 11.0; Oct 2008 #. type: Plain text #: build/C/man3/pthread_attr_init.3:121 #, no-wrap msgid "" "$B< ulimit -s> # No stack limit ==E default stack size is 2MB\n" "unlimited\n" "$B< ./a.out>\n" "Thread attributes:\n" " Detach state = PTHREAD_CREATE_JOINABLE\n" " Scope = PTHREAD_SCOPE_SYSTEM\n" " Inherit scheduler = PTHREAD_INHERIT_SCHED\n" " Scheduling policy = SCHED_OTHER\n" " Scheduling priority = 0\n" " Guard size = 4096 bytes\n" " Stack address = 0x40196000\n" " Stack size = 0x201000 bytes\n" msgstr "" "$B< ulimit -s> # No stack limit ==E default stack size is 2MB\n" "unlimited\n" "$B< ./a.out>\n" "Thread attributes:\n" " Detach state = PTHREAD_CREATE_JOINABLE\n" " Scope = PTHREAD_SCOPE_SYSTEM\n" " Inherit scheduler = PTHREAD_INHERIT_SCHED\n" " Scheduling policy = SCHED_OTHER\n" " Scheduling priority = 0\n" " Guard size = 4096 bytes\n" " Stack address = 0x40196000\n" " Stack size = 0x201000 bytes\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:131 msgid "When we supply a stack size as a command-line argument, the program initializes a thread attributes object, sets various attributes in that object, and passes a pointer to the object in the call to B(3). Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following:" msgstr "" "コマンドライン引き数でスタックサイズが与えられた場合、\n" "このプログラムは、スレッド属性オブジェクトを初期化し、\n" "そのオブジェクトの各種属性を設定し、\n" "B(3) の呼び出しでこのオブジェクトへのポインターを渡す。\n" "このプログラムを NPTL スレッド実装が使われている Linux/x86-32 で\n" "動作させると、以下のような出力が得られる。" #. Results from glibc 2.8, SUSE 11.0; Oct 2008 #. type: Plain text #: build/C/man3/pthread_attr_init.3:146 #, no-wrap msgid "" "$B< ./a.out 0x3000000>\n" "posix_memalign() allocated at 0x40197000\n" "Thread attributes:\n" " Detach state = PTHREAD_CREATE_DETACHED\n" " Scope = PTHREAD_SCOPE_SYSTEM\n" " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n" " Scheduling policy = SCHED_OTHER\n" " Scheduling priority = 0\n" " Guard size = 0 bytes\n" " Stack address = 0x40197000\n" " Stack size = 0x3000000 bytes\n" msgstr "" "$B< ./a.out 0x3000000>\n" "posix_memalign() allocated at 0x40197000\n" "Thread attributes:\n" " Detach state = PTHREAD_CREATE_DETACHED\n" " Scope = PTHREAD_SCOPE_SYSTEM\n" " Inherit scheduler = PTHREAD_EXPLICIT_SCHED\n" " Scheduling policy = SCHED_OTHER\n" " Scheduling priority = 0\n" " Guard size = 0 bytes\n" " Stack address = 0x40197000\n" " Stack size = 0x3000000 bytes\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:157 build/C/man3/pthread_getattr_np.3:188 #, no-wrap msgid "" "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n" "#include Epthread.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" msgstr "" "#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */\n" "#include Epthread.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:160 build/C/man3/pthread_cancel.3:162 #: build/C/man3/pthread_cleanup_push.3:243 build/C/man3/pthread_create.3:261 #: build/C/man3/pthread_getattr_np.3:191 #: build/C/man3/pthread_getcpuclockid.3:119 #: build/C/man3/pthread_setaffinity_np.3:179 #: build/C/man3/pthread_setschedparam.3:244 build/C/man3/pthread_sigmask.3:110 #, no-wrap msgid "" "#define handle_error_en(en, msg) \\e\n" " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" msgstr "" "#define handle_error_en(en, msg) \\e\n" " do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:168 #, no-wrap msgid "" "static void\n" "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n" "{\n" " int s, i;\n" " size_t v;\n" " void *stkaddr;\n" " struct sched_param sp;\n" msgstr "" "static void\n" "display_pthread_attr(pthread_attr_t *attr, char *prefix)\n" "{\n" " int s, i;\n" " size_t v;\n" " void *stkaddr;\n" " struct sched_param sp;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:176 #, no-wrap msgid "" " s = pthread_attr_getdetachstate(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getdetachstate\");\n" " printf(\"%sDetach state = %s\\en\", prefix,\n" " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n" " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n" " \"???\");\n" msgstr "" " s = pthread_attr_getdetachstate(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getdetachstate\");\n" " printf(\"%sDetach state = %s\\en\", prefix,\n" " (i == PTHREAD_CREATE_DETACHED) ? \"PTHREAD_CREATE_DETACHED\" :\n" " (i == PTHREAD_CREATE_JOINABLE) ? \"PTHREAD_CREATE_JOINABLE\" :\n" " \"???\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:184 #, no-wrap msgid "" " s = pthread_attr_getscope(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getscope\");\n" " printf(\"%sScope = %s\\en\", prefix,\n" " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n" " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n" " \"???\");\n" msgstr "" " s = pthread_attr_getscope(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getscope\");\n" " printf(\"%sScope = %s\\en\", prefix,\n" " (i == PTHREAD_SCOPE_SYSTEM) ? \"PTHREAD_SCOPE_SYSTEM\" :\n" " (i == PTHREAD_SCOPE_PROCESS) ? \"PTHREAD_SCOPE_PROCESS\" :\n" " \"???\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:192 #, no-wrap msgid "" " s = pthread_attr_getinheritsched(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getinheritsched\");\n" " printf(\"%sInherit scheduler = %s\\en\", prefix,\n" " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n" " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n" " \"???\");\n" msgstr "" " s = pthread_attr_getinheritsched(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getinheritsched\");\n" " printf(\"%sInherit scheduler = %s\\en\", prefix,\n" " (i == PTHREAD_INHERIT_SCHED) ? \"PTHREAD_INHERIT_SCHED\" :\n" " (i == PTHREAD_EXPLICIT_SCHED) ? \"PTHREAD_EXPLICIT_SCHED\" :\n" " \"???\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:201 #, no-wrap msgid "" " s = pthread_attr_getschedpolicy(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n" " printf(\"%sScheduling policy = %s\\en\", prefix,\n" " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n" " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n" " (i == SCHED_RR) ? \"SCHED_RR\" :\n" " \"???\");\n" msgstr "" " s = pthread_attr_getschedpolicy(attr, &i);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getschedpolicy\");\n" " printf(\"%sScheduling policy = %s\\en\", prefix,\n" " (i == SCHED_OTHER) ? \"SCHED_OTHER\" :\n" " (i == SCHED_FIFO) ? \"SCHED_FIFO\" :\n" " (i == SCHED_RR) ? \"SCHED_RR\" :\n" " \"???\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:206 #, no-wrap msgid "" " s = pthread_attr_getschedparam(attr, &sp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getschedparam\");\n" " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n" msgstr "" " s = pthread_attr_getschedparam(attr, &sp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getschedparam\");\n" " printf(\"%sScheduling priority = %d\\en\", prefix, sp.sched_priority);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:211 #, no-wrap msgid "" " s = pthread_attr_getguardsize(attr, &v);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getguardsize\");\n" " printf(\"%sGuard size = %d bytes\\en\", prefix, v);\n" msgstr "" " s = pthread_attr_getguardsize(attr, &v);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getguardsize\");\n" " printf(\"%sGuard size = %d bytes\\en\", prefix, v);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:218 #, no-wrap msgid "" " s = pthread_attr_getstack(attr, &stkaddr, &v);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getstack\");\n" " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n" " printf(\"%sStack size = 0x%x bytes\\en\", prefix, v);\n" "}\n" msgstr "" " s = pthread_attr_getstack(attr, &stkaddr, &v);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getstack\");\n" " printf(\"%sStack address = %p\\en\", prefix, stkaddr);\n" " printf(\"%sStack size = 0x%x bytes\\en\", prefix, v);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:224 #, no-wrap msgid "" "static void *\n" "thread_start(void *arg)\n" "{\n" " int s;\n" " pthread_attr_t gattr;\n" msgstr "" "static void *\n" "thread_start(void *arg)\n" "{\n" " int s;\n" " pthread_attr_t gattr;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:228 #, no-wrap msgid "" " /* pthread_getattr_np() is a non-standard GNU extension that\n" " retrieves the attributes of the thread specified in its\n" " first argument */\n" msgstr "" " /* pthread_getattr_np() is a non-standard GNU extension that\n" " retrieves the attributes of the thread specified in its\n" " first argument */\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:232 #, no-wrap msgid "" " s = pthread_getattr_np(pthread_self(), &gattr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getattr_np\");\n" msgstr "" " s = pthread_getattr_np(pthread_self(), &gattr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getattr_np\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:235 #, no-wrap msgid "" " printf(\"Thread attributes:\\en\");\n" " display_pthread_attr(&gattr, \"\\et\");\n" msgstr "" " printf(\"Thread attributes:\\en\");\n" " display_pthread_attr(&gattr, \"\\et\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:238 build/C/man3/pthread_getattr_np.3:240 #, no-wrap msgid "" " exit(EXIT_SUCCESS); /* Terminate all threads */\n" "}\n" msgstr "" " exit(EXIT_SUCCESS); /* Terminate all threads */\n" "}\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:246 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thr;\n" " pthread_attr_t attr;\n" " pthread_attr_t *attrp; /* NULL or &attr */\n" " int s;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thr;\n" " pthread_attr_t attr;\n" " pthread_attr_t *attrp; /* NULL or &attr */\n" " int s;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:248 #: build/C/man3/pthread_setschedparam.3:362 #, no-wrap msgid " attrp = NULL;\n" msgstr " attrp = NULL;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:252 #, no-wrap msgid "" " /* If a command-line argument was supplied, use it to set the\n" " stack-size attribute and set a few other thread attributes,\n" " and set attrp pointing to thread attributes object */\n" msgstr "" " /* If a command-line argument was supplied, use it to set the\n" " stack-size attribute and set a few other thread attributes,\n" " and set attrp pointing to thread attributes object */\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:256 #, no-wrap msgid "" " if (argc E 1) {\n" " int stack_size;\n" " void *sp;\n" msgstr "" " if (argc E 1) {\n" " int stack_size;\n" " void *sp;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:258 #, no-wrap msgid " attrp = &attr;\n" msgstr " attrp = &attr;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:262 #, no-wrap msgid "" " s = pthread_attr_init(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" msgstr "" " s = pthread_attr_init(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:266 #, no-wrap msgid "" " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setdetachstate\");\n" msgstr "" " s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setdetachstate\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:270 #, no-wrap msgid "" " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setinheritsched\");\n" msgstr "" " s = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setinheritsched\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:272 #, no-wrap msgid " stack_size = strtoul(argv[1], NULL, 0);\n" msgstr " stack_size = strtoul(argv[1], NULL, 0);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:276 #, no-wrap msgid "" " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"posix_memalign\");\n" msgstr "" " s = posix_memalign(&sp, sysconf(_SC_PAGESIZE), stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"posix_memalign\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:278 #, no-wrap msgid " printf(\"posix_memalign() allocated at %p\\en\", sp);\n" msgstr " printf(\"posix_memalign() allocated at %p\\en\", sp);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:283 #, no-wrap msgid "" " s = pthread_attr_setstack(&attr, sp, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstack\");\n" " }\n" msgstr "" " s = pthread_attr_setstack(&attr, sp, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstack\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:287 build/C/man3/pthread_getattr_np.3:335 #, no-wrap msgid "" " s = pthread_create(&thr, attrp, &thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" msgstr "" " s = pthread_create(&thr, attrp, &thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:293 build/C/man3/pthread_getattr_np.3:341 #, no-wrap msgid "" " if (attrp != NULL) {\n" " s = pthread_attr_destroy(attrp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" " }\n" msgstr "" " if (attrp != NULL) {\n" " s = pthread_attr_destroy(attrp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:296 build/C/man3/pthread_getattr_np.3:344 #, no-wrap msgid "" " pause(); /* Terminates when other thread calls exit() */\n" "}\n" msgstr "" " pause(); /* Terminates when other thread calls exit() */\n" "}\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:313 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setaffinity_np.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETAFFINITY_NP" msgstr "PTHREAD_ATTR_SETAFFINITY_NP" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:30 msgid "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - set/get CPU affinity attribute in thread attributes object" msgstr "" "pthread_attr_setaffinity_np, pthread_attr_getaffinity_np - \n" "スレッド属性オブジェクトの CPU affinity 属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:34 #: build/C/man3/pthread_getattr_np.3:33 #: build/C/man3/pthread_setaffinity_np.3:34 #: build/C/man3/pthread_tryjoin_np.3:34 build/C/man3/pthread_yield.3:32 #, no-wrap msgid "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Epthread.hE>\n" msgstr "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Epthread.hE>\n" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:39 #, no-wrap msgid "" "BIB<,>\n" "B< size_t >IB<, const cpu_set_t *>IB<);>\n" "BIB<,>\n" "B< size_t >IB<, cpu_set_t *>IB<);>\n" msgstr "" "BIB<,>\n" "B< size_t >IB<, const cpu_set_t *>IB<);>\n" "BIB<,>\n" "B< size_t >IB<, cpu_set_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:54 msgid "The B() function sets the CPU affinity mask attribute of the thread attributes object referred to by I to the value specified in I. This attribute determines the CPU affinity mask of a thread created using the thread attributes object I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトの CPU affinity マスク属性を\n" "I で指定された値に設定する。\n" "この属性により、スレッド属性オブジェクト I を使って\n" "作成されたスレッドの CPU affinity マスクが決定される。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:63 msgid "The B() function returns the CPU affinity mask attribute of the thread attributes object referred to by I in the buffer pointed to by I." msgstr "" "B() 関数は、 I が参照する\n" "スレッド属性オブジェクトの CPU affinity マスク属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:70 msgid "The argument I is the length (in bytes) of the buffer pointed to by I. Typically, this argument would be specified as I." msgstr "" "I 引き数は I が指すバッファーの (バイト単位の)\n" "大きさである。通常は、この引き数には I を\n" "指定することだろう。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:76 #: build/C/man3/pthread_setaffinity_np.3:67 msgid "For more details on CPU affinity masks, see B(2). For a description of a set of macros that can be used to manipulate and inspect CPU sets, see B(3)." msgstr "" "CPU affinity マスクの詳細については、 \n" "B(2) を参照してほしい。\n" "CPU 集合の操作や取得を行う際に利用できるマクロ群の説明は \n" "B(3) を参照してほしい。" #. type: TP #: build/C/man3/pthread_attr_setaffinity_np.3:80 #: build/C/man3/pthread_attr_setaffinity_np.3:92 #: build/C/man3/pthread_attr_setdetachstate.3:83 #: build/C/man3/pthread_attr_setinheritsched.3:99 #: build/C/man3/pthread_attr_setschedpolicy.3:89 #: build/C/man3/pthread_attr_setscope.3:109 #: build/C/man3/pthread_attr_setstack.3:91 #: build/C/man3/pthread_attr_setstacksize.3:67 #: build/C/man3/pthread_create.3:144 build/C/man3/pthread_detach.3:55 #: build/C/man3/pthread_join.3:85 build/C/man3/pthread_join.3:89 #: build/C/man3/pthread_kill.3:69 #: build/C/man3/pthread_rwlockattr_setkind_np.3:105 #: build/C/man3/pthread_setaffinity_np.3:84 #: build/C/man3/pthread_setaffinity_np.3:93 #: build/C/man3/pthread_setaffinity_np.3:109 #: build/C/man3/pthread_setcancelstate.3:99 #: build/C/man3/pthread_setcancelstate.3:107 #: build/C/man3/pthread_setconcurrency.3:71 #: build/C/man3/pthread_setschedparam.3:122 #: build/C/man3/pthread_setschedprio.3:62 build/C/man3/pthread_sigqueue.3:78 #: build/C/man3/pthread_tryjoin_np.3:106 #, no-wrap msgid "B" msgstr "B" #. cpumask_t #. The raw sched_getaffinity() system call returns the size (in bytes) #. of the cpumask_t type. #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:92 msgid "(B()) I specified a CPU that was outside the set supported by the kernel. (The kernel configuration option B defines the range of the set supported by the kernel data type used to represent CPU sets.)" msgstr "" "(B())\n" "I がカーネルがサポートする CPU 集合にない CPU を指定していた。\n" "(CPU 集合を表現するのに使われるカーネルのデータ型がサポートする集合の範囲は、\n" "カーネルの設定オプション B により定義される)。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:102 msgid "(B()) A CPU in the affinity mask of the thread attributes object referred to by I lies outside the range specified by I (i.e., I/I is too small)." msgstr "" "(B())\n" "I が参照するスレッド属性オブジェクトの affinity マスク内の CPU が、\n" "I により指定された範囲の中になかった\n" "(すなわち、I/I が小さすぎる)。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:106 msgid "(B()) Could not allocate memory." msgstr "(B()) メモリを割り当てることができなかった。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:108 #: build/C/man3/pthread_setaffinity_np.3:121 msgid "These functions are provided by glibc since version 2.3.4." msgstr "これらの関数は glibc バージョン 2.3.4 以降で提供されている。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:111 #: build/C/man3/pthread_cleanup_push_defer_np.3:117 #: build/C/man3/pthread_setaffinity_np.3:131 #: build/C/man3/pthread_tryjoin_np.3:123 msgid "These functions are nonstandard GNU extensions; hence the suffix \"_np\" (nonportable) in the names." msgstr "" "これらの関数は非標準の GNU による拡張である。\n" "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n" "付いている。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:118 #: build/C/man3/pthread_setaffinity_np.3:157 msgid "In glibc 2.3.3 only, versions of these functions were provided that did not have a I argument. Instead the CPU set size given to the underlying system calls was always I." msgstr "" "(このバージョンだけであるが) glibc 2.3.3 では、\n" "これらの関数は I 引き数を持っていなかった。\n" "内部で呼ばれるシステムコールに渡される CPU セットの大きさは\n" "常に I であった。" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:124 msgid "B(2), B(3), B(3), B(7), B(7)" msgstr "B(2), B(3), B(3), B(7), B(7)" #. type: TH #: build/C/man3/pthread_attr_setdetachstate.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETDETACHSTATE" msgstr "PTHREAD_ATTR_SETDETACHSTATE" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:30 msgid "pthread_attr_setdetachstate, pthread_attr_getdetachstate - set/get detach state attribute in thread attributes object" msgstr "" "pthread_attr_setdetachstate, pthread_attr_getdetachstate - \n" "スレッド属性オブジェクトの detach state 属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:38 #, no-wrap msgid "" "BIB<, int >IB<);>\n" "BIB<, int *>IB<);>\n" msgstr "" "BIB<, int >IB<);>\n" "BIB<, int *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:53 msgid "The B() function sets the detach state attribute of the thread attributes object referred to by I to the value specified in I. The detach state attribute determines whether a thread created using the thread attributes object I will be created in a joinable or a detached state." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトの detach state 属性を\n" "I で指定された値に設定する。\n" "detach state 属性により、スレッド属性オブジェクト I を使って\n" "作成されるスレッドが、 join 可能な状態で作成されるか、\n" "detached (切り離された) 状態で作成されるかが決定される。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:56 msgid "The following values may be specified in I:" msgstr "I には以下の値を指定できる。" #. type: TP #: build/C/man3/pthread_attr_setdetachstate.3:56 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:61 msgid "Threads that are created using I will be created in a detached state." msgstr "I を使って作成されるスレッドは detached 状態で作成される。" #. type: TP #: build/C/man3/pthread_attr_setdetachstate.3:61 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:66 msgid "Threads that are created using I will be created in a joinable state." msgstr "I を使って作成されるスレッドは join 可能な状態で作成される。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:70 msgid "The default setting of the detach state attribute in a newly initialized thread attributes object is B." msgstr "" "新規に初期化されたスレッド属性オブジェクトの detach state 属性の\n" "デフォルト設定は B である。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:77 msgid "The B() returns the detach state attribute of the thread attributes object I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I の detach state 属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:83 msgid "B() can fail with the following error:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:87 msgid "An invalid value was specified in I." msgstr "無効な値が I で指定された。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:94 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:100 msgid "See B(3) for more details on detached and joinable threads." msgstr "" "detached 状態のスレッド、join 可能状態のスレッドの詳細については、\n" "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:108 msgid "A thread that is created in a joinable state should eventually either be joined using B(3) or detached using B(3); see B(3)." msgstr "" "join 可能状態で作成されたスレッドは、最終的に\n" "B(3) を使って join するか、\n" "B(3) を使って切り離すか、\n" "のどちらかを行うべきである。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:115 msgid "It is an error to specify the thread ID of a thread that was created in a detached state in a later call to B(3) or B(3)." msgstr "" "detached 状態で作成されたスレッドのスレッド ID を指定して、\n" "B(3) や B(3) を後から呼び出すのは\n" "エラーである。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:118 #: build/C/man3/pthread_attr_setstack.3:162 msgid "See B(3)." msgstr "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:124 msgid "B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setguardsize.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETGUARDSIZE" msgstr "PTHREAD_ATTR_SETGUARDSIZE" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:30 msgid "pthread_attr_setguardsize, pthread_attr_getguardsize - set/get guard size attribute in thread attributes object" msgstr "" "pthread_attr_setguardsize, pthread_attr_getguardsize - \n" "スレッド属性オブジェクトの guard size 属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:38 #, no-wrap msgid "" "BIB<, size_t >IB<);>\n" "BIB<, size_t *>IB<);>\n" msgstr "" "BIB<, size_t >IB<);>\n" "BIB<, size_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:49 msgid "The B() function sets the guard size attribute of the thread attributes object referred to by I to the value specified in I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトの guard size 属性を\n" "I で指定された値に設定する。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:59 msgid "If I is greater than 0, then for each new thread created using I the system allocates an additional region of at least I bytes at the end of the thread's stack to act as the guard area for the stack (but see BUGS)." msgstr "" "I が 0 より大きい場合、\n" "I を使って新しく作成された各スレッドに対して、\n" "システムはスレッドのスタックの末尾に少なくとも I バイトの\n" "追加領域を割り当てる。この追加領域はスタックに対するガード領域として\n" "機能する (ただし「バグ」の節も参照)。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:65 msgid "If I is 0, then new threads created with I will not have a guard area." msgstr "" "I が 0 の場合、\n" "I を使って新しく作成されたスレッドはガード領域を持たない。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:67 msgid "The default guard size is the same as the system page size." msgstr "デフォルトの guard size はシステムのページサイズと同じである。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:82 msgid "If the stack address attribute has been set in I (using B(3) or B(3)), meaning that the caller is allocating the thread's stack, then the guard size attribute is ignored (i.e., no guard area is created by the system): it is the application's responsibility to handle stack overflow (perhaps by using B(2) to manually define a guard area at the end of the stack that it has allocated)." msgstr "" "(B(3) や B(3)を使って)\n" "I でスタックアドレス属性が設定されている場合には、呼び出し側がそ\n" "のスレッドのスタックを割り当てていることを意味するので、guard size 属性\n" "は無視される (すなわち、システムによるガード領域の作成は行われない)。\n" "この場合、スタックオーバーフローが起こらないように対処するのはアプリ\n" "ケーション側の責任となる (おそらく B(2) を使って、割り当て\n" "られたスタックの最後に手動でガード領域を定義することになるだろう)。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:90 msgid "The B() function returns the guard size attribute of the thread attributes object referred to by I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I の guard size 属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:104 msgid "POSIX.1-2001 documents an B error if I or I is invalid. On Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)." msgstr "" "POSIX.1-2001 では、エラー B が\n" " I か I が無効な場合に対して規定されている。\n" "Linux では、これらの関数は常に成功する\n" "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n" "正のエラーの返り値を処理するようにすべきである)。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:106 #: build/C/man3/pthread_attr_setstackaddr.3:83 #: build/C/man3/pthread_attr_setstacksize.3:83 msgid "These functions are provided by glibc since version 2.1." msgstr "これらの関数は glibc バージョン 2.1 以降で提供されている。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:113 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:129 msgid "A guard area consists of virtual memory pages that are protected to prevent read and write access. If a thread overflows its stack into the guard area, then, on most hard architectures, it receives a B signal, thus notifying it of the overflow. Guard areas start on page boundaries, and the guard size is internally rounded up to the system page size when creating a thread. (Nevertheless, B() returns the guard size that was set by B().)" msgstr "" "ガード領域は、読み出し/書き込みアクセスが行われないように保護がかけ\n" "られた仮想メモリページで構成で構成される。スレッドがスタックをガード\n" "領域までオーバーフローさせた場合、ほとんどのハードウェアアーキテクチャー\n" "では、スレッドに B シグナルが送られ、オーバーフローが発生した\n" "ことが通知される。ガード領域はページ境界から開始され、ガード領域の\n" "大きさはスレッド作成時に内部的にシステムのページサイズに切り上げられる\n" "(その場合も B() では\n" "B() で設定された guard size が返される)。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:133 msgid "Setting a guard size of 0 may be useful to save memory in an application that creates many threads and knows that stack overflow can never occur." msgstr "" "多くのスレッドを作成するアプリケーションで、かつ、スタックオーバーフロー\n" "が決して発生しないことが分かっている場合には、guard size を 0 に設定\n" "することで、メモリを節約できることもある。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:137 msgid "Choosing a guard size larger than the default size may be necessary for detecting stack overflows if a thread allocates large data structures on the stack." msgstr "" "スレッドがスタックに大きなデータ構造を割り当てる場合には、\n" "スタックオーバーフローを検出するためには、デフォルトサイズよりも\n" "大きな guard size を選ぶ必要があるかもしれない。" #. type: SH #: build/C/man3/pthread_attr_setguardsize.3:137 #: build/C/man3/pthread_attr_setinheritsched.3:119 #: build/C/man3/pthread_attr_setstacksize.3:103 #: build/C/man3/pthread_create.3:203 build/C/man3/pthread_exit.3:98 #: build/C/man3/pthread_rwlockattr_setkind_np.3:109 #, no-wrap msgid "BUGS" msgstr "バグ" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:148 msgid "As at glibc 2.8, the NPTL threading implementation includes the guard area within the stack size allocation, rather than allocating extra space at the end of the stack, as POSIX.1 requires. (This can result in an B error from B(3) if the guard size value is too large, leaving no space for the actual stack.)" msgstr "" "glibc 2.8 の時点では、 NPTL スレッド実装ではガード領域はスタックサイズ\n" "で割り当てられる領域の中に含まれている。一方、POSIX.1 では、スタックの\n" "末尾に追加の領域を割り当てることが求められている。\n" "(このため、ガード領域が大きすぎて、\n" "実際のスタック用の場所がなくなってしまう場合、\n" "B(3) で B エラーが発生することになる。)" #. glibc includes the guardsize within the allocated stack size, #. which looks pretty clearly to be in violation of POSIX. #. Filed bug, 22 Oct 2008: #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=6973 #. Older reports: #. https//bugzilla.redhat.com/show_bug.cgi?id=435337 #. Reportedly, LinuxThreads did the right thing, allocating #. extra space at the end of the stack: #. http://sourceware.org/ml/libc-alpha/2008-05/msg00086.html #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:162 msgid "The obsolete LinuxThreads implementation did the right thing, allocating extra space at the end of the stack for the guard area." msgstr "" "廃止予定の LinuxThreads 実装では、\n" "POSIX.1 で求められている通りの動作で、\n" "ガード領域がスタックの末尾に追加の領域が割り当てられる。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:165 msgid "See B(3)." msgstr "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:173 msgid "B(2), B(2), B(3), B(3), B(3), B(3), B(7)" msgstr "B(2), B(2), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setinheritsched.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETINHERITSCHED" msgstr "PTHREAD_ATTR_SETINHERITSCHED" #. type: TH #: build/C/man3/pthread_attr_setinheritsched.3:26 #: build/C/man3/pthread_attr_setschedparam.3:26 #: build/C/man3/pthread_attr_setschedpolicy.3:26 build/C/man7/pthreads.7:26 #, no-wrap msgid "2014-05-21" msgstr "2014-05-21" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:30 msgid "pthread_attr_setinheritsched, pthread_attr_getinheritsched - set/get inherit-scheduler attribute in thread attributes object" msgstr "pthread_attr_setinheritsched, pthread_attr_getinheritsched - スレッド属性オブジェクトの inherit-scheduler 属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:38 #, no-wrap msgid "" "BIB<,>\n" "B< int >IB<);>\n" "BIB<,>\n" "B< int *>IB<);>\n" msgstr "" "BIB<,>\n" "B< int >IB<);>\n" "BIB<,>\n" "B< int *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:55 msgid "The B() function sets the inherit-scheduler attribute of the thread attributes object referred to by I to the value specified in I. The inherit-scheduler attribute determines whether a thread created using the thread attributes object I will inherit its scheduling attributes from the calling thread or whether it will take them from I." msgstr "B() 関数は、 I が参照するスレッド属性オブジェクトの inherit-scheduler 属性を I で指定された値に設定する。 inherit-scheduler 属性により、スレッド属性オブジェクト I を使って作成されるスレッドが、呼び出したスレッドのスケジューリング属性を継承するか、 I からスケジューリング属性を取得するかが決定される。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:64 msgid "The following scheduling attributes are affected by the inherit-scheduler attribute: scheduling policy (B(3)), scheduling priority (B(3)), and contention scope (B(3))." msgstr "次に挙げるスケジューリング属性は inherit-scheduler 属性の影響を受ける: スケジューリングポリシー (B(3))、 スケジューリング優先度 (B(3))、 contention scope (B(3))。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:67 msgid "The following values may be specified in I:" msgstr "以下の値を I に指定できる。" #. type: TP #: build/C/man3/pthread_attr_setinheritsched.3:67 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:75 msgid "Threads that are created using I inherit scheduling attributes from the creating thread; the scheduling attributes in I are ignored." msgstr "" "I を使って作成されたスレッドは、\n" "スレッドを作成するスレッドからスケジューリング属性を継承する。\n" "I 内のスケジューリング属性は無視される。" #. type: TP #: build/C/man3/pthread_attr_setinheritsched.3:75 #, no-wrap msgid "B" msgstr "B" #. FIXME Document the defaults for scheduler settings #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:82 msgid "Threads that are created using I take their scheduling attributes from the values specified by the attributes object." msgstr "" "I を使って作成されたスレッドは、スレッド属性オブジェクトで\n" "指定された値からスケジューリング属性を取得する。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:86 msgid "The default setting of the inherit-scheduler attribute in a newly initialized thread attributes object is B." msgstr "新たに初期化されたスレッド属性オブジェクトの inherit-scheduler 属性のデフォルト設定は B である。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:93 msgid "The B() returns the inherit-scheduler attribute of the thread attributes object I in the buffer pointed to by I." msgstr "B() は、 スレッド属性オブジェクト I の inherit-scheduler 属性を I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:99 msgid "B() can fail with the following error:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:103 msgid "Invalid value in I." msgstr "I に無効な値が指定された。" #. .SH VERSIONS #. Available since glibc 2.0. #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:110 msgid "POSIX.1-2001 also documents an optional B error (\"attempt was made to set the attribute to an unsupported value\") for B()." msgstr "" "POSIX.1-2001 では、 B() に関して\n" "エラー B (\"サポートされていない値を属性に設定しようとした\")\n" "も追加で規定されている。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:117 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. FIXME . Track status of the following bug: #. http://sourceware.org/bugzilla/show_bug.cgi?id=7007 #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:135 msgid "As at glibc 2.8, if a thread attributes object is initialized using B(3), then the scheduling policy of the attributes object is set to B and the scheduling priority is set to 0. However, if the inherit-scheduler attribute is then set to B, then a thread created using the attribute object wrongly inherits its scheduling attributes from the creating thread. This bug does not occur if either the scheduling policy or scheduling priority attribute is explicitly set in the thread attributes object before calling B(3)." msgstr "glibc 2.8 の時点では、スレッド属性オブジェクトが B(3) を使って初期化された場合、 スレッド属性オブジェクトのスケジューリングポリシーが B に、 スケジューリング優先度が 0 に設定される。一方、その後 inherit-scheduler 属性に B が設定されると、このスレッド属性オブジェクトを使って作成されたスレッドでは、スレッドを作成するスレッドのスケジューリング属性が間違って継承されてしまう。 B(3) を呼び出す前にスケジューリングポリシー属性かスケジューリング優先度属性のどちらかが明示的に設定された場合には、 このバグは発生しない。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:138 #: build/C/man3/pthread_attr_setschedparam.3:116 #: build/C/man3/pthread_attr_setschedpolicy.3:112 msgid "See B(3)." msgstr "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:150 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" #. type: TH #: build/C/man3/pthread_attr_setschedparam.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSCHEDPARAM" msgstr "PTHREAD_ATTR_SETSCHEDPARAM" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:30 msgid "pthread_attr_setschedparam, pthread_attr_getschedparam - set/get scheduling parameter attributes in thread attributes object" msgstr "" "pthread_attr_setschedparam, pthread_attr_getschedparam - \n" "スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:38 #, no-wrap msgid "" "BIB<,>\n" "B< const struct sched_param *>IB<);>\n" "BIB<,>\n" "B< struct sched_param *>IB<);>\n" msgstr "" "BIB<,>\n" "B< const struct sched_param *>IB<);>\n" "BIB<,>\n" "B< struct sched_param *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:52 msgid "The B() function sets the scheduling parameter attributes of the thread attributes object referred to by I to the values specified in the buffer pointed to by I. These attributes determine the scheduling parameters of a thread created using the thread attributes object I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトのスケジューリング\n" "パラメーター属性を I が指すバッファーで指定された値に設定する。\n" "これらの属性により、スレッド属性オブジェクト I を使って\n" "作成されるスレッドのスケジューリングパラメーターが決定される。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:59 msgid "The B() returns the scheduling parameter attributes of the thread attributes object I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I のスケジューリングパラメーター属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:61 msgid "Scheduling parameters are maintained in the following structure:" msgstr "スケジューリングパラメーターは以下の構造体で管理される。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:67 #: build/C/man3/pthread_setschedparam.3:69 #, no-wrap msgid "" "struct sched_param {\n" " int sched_priority; /* Scheduling priority */\n" "};\n" msgstr "" "struct sched_param {\n" " int sched_priority; /* Scheduling priority */\n" "};\n" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:74 #: build/C/man3/pthread_setschedparam.3:76 msgid "As can be seen, only one scheduling parameter is supported. For details of the permitted ranges for scheduling priorities in each scheduling policy, see B(7)." msgstr "見て分かる通り、サポートされているスケジューリングパラメーターは一つだけである。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細については、B(7) を参照のこと。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:85 msgid "In order for the parameter setting made by B() to have effect when calling B(3), the caller must use B(3) to set the inherit-scheduler attribute of the attributes object I to B." msgstr "B(3) を呼び出した際に B() で行ったパラメーター設定を有効にするには、 呼び出し側で B(3) を使って 属性オブジェクト I の inherit-scheduler 属性を B に設定しておかなければならない。" #. .SH VERSIONS #. Available since glibc 2.0. #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:100 msgid "POSIX.1 documents B and B errors for B(). On Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return)." msgstr "" "POSIX.1 では、\n" "B() について\n" "B と B が規定されている。\n" "Linux では、これらの関数は常に成功する\n" "(ただし、移植性や将来も動作することを保証したいアプリケーションでは\n" "正のエラーの返り値を処理するようにすべきである)。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:107 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:113 msgid "See B(3) for a list of the thread scheduling policies supported on Linux." msgstr "" "Linux でサポートされているスレッドのスケジューリングポリシーのリストに\n" "ついては、 B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:128 msgid "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" msgstr "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" #. type: TH #: build/C/man3/pthread_attr_setschedpolicy.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSCHEDPOLICY" msgstr "PTHREAD_ATTR_SETSCHEDPOLICY" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:30 msgid "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - set/get scheduling policy attribute in thread attributes object" msgstr "" "pthread_attr_setschedpolicy, pthread_attr_getschedpolicy - スレッド属性\n" "オブジェクトのスケジューリングポリシー属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:38 #, no-wrap msgid "" "BIB<, int >IB<);>\n" "BIB<, int >I<*policy>B<);>\n" msgstr "" "BIB<, int >IB<);>\n" "BIB<, int >I<*policy>B<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:52 msgid "The B() function sets the scheduling policy attribute of the thread attributes object referred to by I to the value specified in I. This attribute determines the scheduling policy of a thread created using the thread attributes object I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトのスケジューリング\n" "ポリシー属性を I で指定された値に設定する。\n" "この属性により、スレッド属性オブジェクト I を使って\n" "作成されるスレッドのスケジューリングポリシーが決定される。" #. FIXME . pthread_setschedparam() places no restriction on the policy, #. but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER #. http://sourceware.org/bugzilla/show_bug.cgi?id=7013 #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:65 msgid "The supported values for I are B, B, and B, with the semantics described in B(7)." msgstr "I に指定できる値は B, B, B である。それぞれの意味は B(7) で説明している通りである。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:72 msgid "The B() returns the scheduling policy attribute of the thread attributes object I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I のスケジューリングポリシー属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:83 msgid "In order for the policy setting made by B() to have effect when calling B(3), the caller must use B(3) to set the inherit-scheduler attribute of the attributes object I to B." msgstr "B(3) を呼び出した際に B() で行ったポリシー設定を有効にするには、 呼び出し側で B(3) を使って 属性オブジェクト I の inherit-scheduler 属性を B に設定しておかなければならない。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:89 msgid "B() can fail with the following error:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:93 msgid "Invalid value in I." msgstr "I に無効な値が指定された。" #. .SH VERSIONS #. Available since glibc 2.0. #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:100 msgid "POSIX.1-2001 also documents an optional B error (\"attempt was made to set the attribute to an unsupported value\") for B()." msgstr "" "POSIX.1-2001 では、 B() に関して\n" "エラー B (\"サポートされていない値を属性に設定しようとした\")\n" "も追加で規定されている。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:107 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:123 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(7), B(7)" #. type: TH #: build/C/man3/pthread_attr_setscope.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSCOPE" msgstr "PTHREAD_ATTR_SETSCOPE" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:30 msgid "pthread_attr_setscope, pthread_attr_getscope - set/get contention scope attribute in thread attributes object" msgstr "" "pthread_attr_setscope, pthread_attr_getscope - \n" "スレッド属性オブジェクトの contention scope 属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:38 #, no-wrap msgid "" "BIB<, int >IB<);>\n" "BIB<, int *>IB<);>\n" msgstr "" "BIB<, int >IB<);>\n" "BIB<, int *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:53 msgid "The B() function sets the contention scope attribute of the thread attributes object referred to by I to the value specified in I. The contention scope attribute defines the set of threads against which a thread competes for resources such as the CPU. POSIX.1-2001 specifies two possible values for I:" msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトの contention scope\n" "属性を I で指定された値に設定する。\n" "contention scope 属性により、\n" "スレッドが CPU などのリソースを取り合うスレッド集合が規定される。\n" "POSIX.1-2001 では I に指定する値として 2 つの値が規定されている。" #. type: TP #: build/C/man3/pthread_attr_setscope.3:53 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:61 msgid "The thread competes for resources with all other threads in all processes on the system that are in the same scheduling allocation domain (a group of one or more processors). B threads are scheduled relative to one another according to their scheduling policy and priority." msgstr "" "スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ\n" "のグループ) にある、システム上の全てのプロセスの自分以外の全ての\n" "スレッドとリソースを取り合う。 \n" "B のスレッドは、スケジューリングポリシーと\n" "優先度に基づき、互いに相対的にスケジューリングされる。" #. type: TP #: build/C/man3/pthread_attr_setscope.3:61 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:76 msgid "The thread competes for resources with all other threads in the same process that were also created with the B contention scope. B threads are scheduled relative to other threads in the process according to their scheduling policy and priority. POSIX.1-2001 leaves it unspecified how these threads contend with other threads in other process on the system or with other threads in the same process that were created with the B contention scope." msgstr "" "スレッドは、contention scope が B で作成された\n" "同じプロセスの自分以外の全てのスレッドとリソースを取り合う。\n" "B のスレッドは、スケジューリングポリシーと優先度\n" "に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。\n" "POSIX.1-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド\n" "や同じプロセス内の contention scope が B で作成\n" "された他のスレッドとどのようにリソースを取り合うかは、\n" "規定されないままになっている。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:83 msgid "POSIX.1-2001 requires that an implementation support at least one of these contention scopes. Linux supports B, but not B." msgstr "POSIX.1-2001 で求められているのは、スレッド実装がこれらの contention scope のうち少なくとも 1 つをサポートすることだけである。 Linux は B をサポートしているが、 B はサポートしていない。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:95 msgid "On systems that support multiple contention scopes, then, in order for the parameter setting made by B() to have effect when calling B(3), the caller must use B(3) to set the inherit-scheduler attribute of the attributes object I to B." msgstr "複数の contention scope をサポートしているシステムで、 B(3) を呼び出した際に B() で行ったパラメーター設定を有効にするには、 呼び出し側で B(3) を使って 属性オブジェクト I の inherit-scheduler 属性を B に設定しておかなければならない。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:103 msgid "The B() function returns the contention scope attribute of the thread attributes object referred to by I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I の contention scope 属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:109 msgid "B() can fail with the following errors:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:113 msgid "An invalid value was specified in I." msgstr "I に無効な値が指定された。" #. type: TP #: build/C/man3/pthread_attr_setscope.3:113 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:119 msgid "I specified the value B, which is not supported on Linux." msgstr "" "I に値 B が指定された。\n" "この値は Linux でサポートされていない。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:126 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:136 msgid "The B contention scope typically indicates that a user-space thread is bound directly to a single kernel-scheduling entity. This is the case on Linux for the obsolete LinuxThreads implementation and the modern NPTL implementation, which are both 1:1 threading implementations." msgstr "" "B contention scope では、通常は、一つの\n" "ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに\n" "直接結び付けられる。\n" "Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに\n" "該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:139 msgid "POSIX.1-2001 specifies that the default contention scope is implementation-defined." msgstr "" "POSIX.1-2001 では、 contention scope 属性のデフォルト値は\n" "実装時で定義されるものと規定されている。" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:149 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setstack.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSTACK" msgstr "PTHREAD_ATTR_SETSTACK" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:30 msgid "pthread_attr_setstack, pthread_attr_getstack - set/get stack attributes in thread attributes object" msgstr "" "pthread_attr_setstack, pthread_attr_getstack - \n" "スレッド属性オブジェクトのスタック属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:38 #, no-wrap msgid "" "BIB<,>\n" "B< void *>IB<, size_t >IB<);>\n" "BIB<,>\n" "B< void **>IB<, size_t *>IB<);>\n" msgstr "" "BIB<,>\n" "B< void *>IB<, size_t >IB<);>\n" "BIB<,>\n" "B< void **>IB<, size_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:45 #: build/C/man3/pthread_cleanup_push_defer_np.3:44 #: build/C/man3/pthread_kill.3:41 #: build/C/man3/pthread_rwlockattr_setkind_np.3:44 #: build/C/man3/pthread_sigmask.3:42 build/C/man3/pthread_sigqueue.3:42 msgid "Feature Test Macro Requirements for glibc (see B(7)):" msgstr "glibc 向けの機能検査マクロの要件 (B(7) 参照):" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:50 msgid "B(), B():" msgstr "B(), B():" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:52 msgid "_POSIX_C_SOURCE\\ E=\\ 200112L || _XOPEN_SOURCE\\ E=\\ 600" msgstr "_POSIX_C_SOURCE\\ E=\\ 200112L || _XOPEN_SOURCE\\ E=\\ 600" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:68 msgid "The B() function sets the stack address and stack size attributes of the thread attributes object referred to by I to the values specified in I and I, respectively. These attributes specify the location and size of the stack that should be used by a thread that is created using the thread attributes object I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトのスタックアドレス属性と\n" "スタックサイズ属性をそれぞれ I と I で\n" "指定された値に設定する。\n" "これらの属性により、スレッド属性オブジェクト I を使って\n" "作成されるスレッドが使用すべきスタックの位置とサイズが指定される。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:74 msgid "I should point to the lowest addressable byte of a buffer of I bytes that was allocated by the caller. The pages of the allocated buffer should be both readable and writable." msgstr "" "I は、呼び出し側で割り当てた、大きさが I バイトの\n" "バッファー内の指定できる最小のアドレスバイトを指すべきである。\n" "割り当てられたバッファーのページは読み書き両方が可能なページとなっている\n" "べきである。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:85 msgid "The B() function returns the stack address and stack size attributes of the thread attributes object referred to by I in the buffers pointed to by I and I, respectively." msgstr "" "B() 関数は、\n" "スレッド属性オブジェクト I のスタックアドレス属性と\n" "スタックサイズ属性をそれぞれ I と I が\n" "指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:91 msgid "B() can fail with the following error:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:102 msgid "I is less than B (16384) bytes. On some systems, this error may also occur if I or I is not suitably aligned." msgstr "" "I が B (16384) よりも小さい。\n" "システムによっては、 I か\n" "I のアライメントが適切でない場合にも\n" "このエラーが発生する。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:110 msgid "POSIX.1-2001 also documents an B error if the stack area described by I and I is not both readable and writable by the caller." msgstr "" "POSIX.1-2001 では エラー B も規定されており、\n" "このエラーは I と I で規定されるスタック領域に\n" "呼び出し側から読み書き両方のアクセスができない状況を表す。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:112 msgid "These functions are provided by glibc since version 2.2." msgstr "これらの関数は glibc バージョン 2.2 以降で提供されている。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:119 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:129 msgid "These functions are provided for applications that must ensure that a thread's stack is placed in a particular location. For most applications, this is not necessary, and the use of these functions should be avoided. (Use B(3) if an application simply requires a stack size other than the default.)" msgstr "" "これらの関数は、スレッドのスタックが特定の場所に配置されることを保証\n" "しなければならないアプリケーションのために提供されている。\n" "ほとんどのアプリケーションでは、このようなことは必要なく、\n" "これらの関数を使うのは避けるべきである。\n" "(アプリケーションが単にスタックサイズだけをデフォルトの値から変更する\n" "必要がある場合には B(3) を使うこと)" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:140 msgid "When an application employs B(), it takes over the responsibility of allocating the stack. Any guard size value that was set using B(3) is ignored. If deemed necessary, it is the application's responsibility to allocate a guard area (one or more pages protected against reading and writing) to handle the possibility of stack overflow." msgstr "" "アプリケーションが B() を利用する際には、\n" "スタックの割り当てに責任を持つ必要がある。\n" "B(3) を使って設定された\n" "guard size の値は無視される。\n" "必要と思われる場合は、アプリケーションが責任を持ってガード領域 (読み書\n" "きが行われないように保護された 1 個かそれ以上のページ) の割り当てを行い、\n" "スタックオーバーフローの可能性に対処するようにする必要がある。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:151 msgid "The address specified in I should be suitably aligned: for full portability, align it on a page boundary (I). B(3) may be useful for allocation. Probably, I should also be a multiple of the system page size." msgstr "" "I に指定するアドレスは適切なアライメントとなっているべきである。\n" "完全な移植性を持たせるためには、\n" "ページ境界 (I) に揃えること。\n" "割り当てには B(3) を使うとよい。\n" "たいていは、 I はシステムのページサイズの倍数とすべきである。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:159 msgid "If I is used to create multiple threads, then the caller must change the stack address attribute between calls to B(3); otherwise, the threads will attempt to use the same memory area for their stacks, and chaos will ensue." msgstr "" "一つの I を使って複数のスレッドを作成する場合、\n" "B(3) の次の呼び出しを行う前に、\n" "呼び出し側でスタックアドレス属性を変更しなければならない。\n" "さもなければ、複数のスレッドがスタックとして同じメモリ領域を\n" "使おうとするため、訳の分からない状況が発生してしまう。" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:174 msgid "B(2), B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(2), B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setstackaddr.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSTACKADDR" msgstr "PTHREAD_ATTR_SETSTACKADDR" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:30 msgid "pthread_attr_setstackaddr, pthread_attr_getstackaddr - set/get stack address attribute in thread attributes object" msgstr "" "pthread_attr_setstackaddr, pthread_attr_getstackaddr - \n" "スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:38 #, no-wrap msgid "" "BIB<, void *>IB<);>\n" "BIB<, void **>IB<);>\n" msgstr "" "BIB<, void *>IB<);>\n" "BIB<, void **>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:49 msgid "These functions are obsolete: B Use B(3) and B(3) instead." msgstr "" "これらの関数は廃止予定であり、B<使用しないこと>。\n" "代わりに B(3) と B(3) を使うこと。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:60 msgid "The B() function sets the stack address attribute of the thread attributes object referred to by I to the value specified in I. This attribute specifies the location of the stack that should be used by a thread that is created using the thread attributes object I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトのスタックアドレス\n" "属性を I で指定された値に設定する。\n" "この属性により、スレッド属性オブジェクト I を使って\n" "作成されるスレッドが使用すべきスタックの位置が指定される。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:66 msgid "I should point to a buffer of at least B bytes that was allocated by the caller. The pages of the allocated buffer should be both readable and writable." msgstr "" "I は呼び出し側が割り当てたバッファー (大きさは\n" "少なくとも B バイト)を指すべきである。\n" "割り当てられたバッファーのページは読み書き両方が可能なページと\n" "なっているべきである。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:74 msgid "The B() function returns the stack address attribute of the thread attributes object referred to by I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I のスタックアドレス属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:81 msgid "No errors are defined (but applications should nevertheless handle a possible error return)." msgstr "" "エラーは定義されていない (ただし、アプリケーションは正のエラーの\n" "返り値を処理するようにすべきである)。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:90 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:93 msgid "POSIX.1-2001 specifies these functions but marks them as obsolete. POSIX.1-2008 removes the specification of these functions." msgstr "" "POSIX.1-2001 では、これらの関数が規定されているが、廃止予定となっている。\n" "POSIX.1-2008 では、これらの関数の規定は削除されている。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:117 msgid "I They cannot be portably used, since they provide no way of specifying the direction of growth or the range of the stack. For example, on architectures with a stack that grows downward, I specifies the next address past the I address of the allocated stack area. However, on architectures with a stack that grows upward, I specifies the I address in the allocated stack area. By contrast, the I used by B(3) and B(3), is always a pointer to the lowest address in the allocated stack area (and the I argument specifies the range of the stack)." msgstr "" "I<これらの関数を使用しないこと!> これらの関数は移植性がある形では使用で\n" "きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの\n" "かを指定する手段が提供されていないからである。\n" "例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャー\n" "では、I には割り当てられたスタック領域のI<最も大きな>アドレ\n" "スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい\n" "方向) に伸びるアーキテクチャーでは、I には割り当てられた\n" "スタック領域のI<最も小さい>アドレスを指定する。これに対して、\n" "B(3) と B(3) が使用する\n" "I は、常に割り当てられたスタック領域の最も小さいアドレス\n" "へのポインターである (I 引き数はスタックの範囲を指定する)。" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:123 msgid "B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setstacksize.3:26 #, no-wrap msgid "PTHREAD_ATTR_SETSTACKSIZE" msgstr "PTHREAD_ATTR_SETSTACKSIZE" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:30 msgid "pthread_attr_setstacksize, pthread_attr_getstacksize - set/get stack size attribute in thread attributes object" msgstr "" "pthread_attr_setstacksize, pthread_attr_getstacksize - \n" "スレッド属性オブジェクトのスタックサイズ属性の設定/取得を行う" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:38 #, no-wrap msgid "" "BIB<, size_t >IB<);>\n" "BIB<, size_t *>IB<);>\n" msgstr "" "BIB<, size_t >IB<);>\n" "BIB<, size_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:49 msgid "The B() function sets the stack size attribute of the thread attributes object referred to by I to the value specified in I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトのスタックアドレス\n" "属性を I で指定された値に設定する。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:53 msgid "The stack size attribute determines the minimum size (in bytes) that will be allocated for threads created using the thread attributes object I." msgstr "" "スタックサイズ属性により、\n" "スレッド属性オブジェクト I を使って作成されたスレッド\n" "に割り当てられる最小サイズ (バイト単位) が決定される。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:61 msgid "The B() function returns the stack size attribute of the thread attributes object referred to by I in the buffer pointed to by I." msgstr "" "B() は、\n" "スレッド属性オブジェクト I のスタックアドレス属性を\n" "I が指すバッファーに入れて返す。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:67 msgid "B() can fail with the following error:" msgstr "B() は以下のエラーで失敗する場合がある。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:72 msgid "The stack size is less than B (16384) bytes." msgstr "スタックサイズが B (16384) バイト未満である。" #. e.g., MacOS #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:81 msgid "On some systems, B() can fail with the error B if I is not a multiple of the system page size." msgstr "" "いくつかのシステムでは、 B() は\n" "I がシステムのページサイズの倍数でない場合にも\n" "エラー B で失敗する。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:90 msgid "The B() and B() functions are thread-safe." msgstr "関数 B() と B() はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:95 msgid "For details on the default stack size of new threads, see B(3)." msgstr "" "新しいスレッドのデフォルトのスタックサイズの詳細については\n" "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:98 msgid "A thread's stack size is fixed at the time of thread creation. Only the main thread can dynamically grow its stack." msgstr "" "スレッドのスタックサイズは、スレッド作成時点では固定である。\n" "メインスレッドだけがスタックを動的に伸ばすことができる。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:103 msgid "The B(3) function allows an application to set both the size and location of a caller-allocated stack that is to be used by a thread." msgstr "" "B(3) 関数を使うと、\n" "アプリケーションは、スレッドが使用するスタックとして、\n" "呼び出し側で割り当てたスタックのサイズと場所を指定できる。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:115 msgid "As at glibc 2.8, if the specified I is not a multiple of B (16 bytes on most architectures), it may be rounded I, in violation of POSIX.1-2001, which says that the allocated stack will be at least I bytes." msgstr "" "glibc 2.8 の時点では、指定された I が B \n" "(ほとんどのアーキテクチャーでは 16 バイト) の倍数でない場合、\n" "I はI<小さくなる方向に>に丸められる。\n" "これは POSIX.1-2001 に違反している。\n" "POSIX.1-2001 では、割り当てらたスタックの大きさは\n" "少なくとも I バイトになると書かれている。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:118 #: build/C/man3/pthread_join.3:127 msgid "See B(3)." msgstr "B(3) を参照。" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:125 msgid "B(2), B(3), B(3), B(3), B(3), B(7)" msgstr "B(2), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_cancel.3:26 #, no-wrap msgid "PTHREAD_CANCEL" msgstr "PTHREAD_CANCEL" #. type: TH #: build/C/man3/pthread_cancel.3:26 #, no-wrap msgid "2008-11-17" msgstr "2008-11-17" #. type: Plain text #: build/C/man3/pthread_cancel.3:29 msgid "pthread_cancel - send a cancellation request to a thread" msgstr "pthread_cancel - スレッドにキャンセル要求を送る" #. type: Plain text #: build/C/man3/pthread_cancel.3:34 #, no-wrap msgid "BIB<);>\n" msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:49 msgid "The B() function sends a cancellation request to the thread I. Whether and when the target thread reacts to the cancellation request depends on two attributes that are under the control of that thread: its cancelability I and I." msgstr "" "B() 関数は指定されたスレッド I にキャンセル要求\n" "を送信する。対象のスレッドがキャンセル要求に反応するかどうか、いつ反応\n" "するかは対象のスレッドの制御下にある 2 つの属性、cancelability\n" "I と Iにより決まる。" #. type: Plain text #: build/C/man3/pthread_cancel.3:61 msgid "A thread's cancelability state, determined by B(3), can be I (the default for new threads) or I. If a thread has disabled cancellation, then a cancellation request remains queued until the thread enables cancellation. If a thread has enabled cancellation, then its cancelability type determines when cancellation occurs." msgstr "" "あるスレッドの cancelability state は B(3) で\n" "設定され、I と I のいずれとなる (I が新しい\n" "スレッドのデフォルト値である)。スレッドがキャンセルを無効にしていた場合、\n" "キャンセル要求はそのスレッドがキャンセルを有効にするまでキューに入れら\n" "れたままになる。スレッドがキャンセルを有効にしていた場合、\n" "cancelability type によって、いつキャンセルが発生するかが決まる。" #. type: Plain text #: build/C/man3/pthread_cancel.3:77 msgid "A thread's cancellation type, determined by B(3), may be either I or I (the default for new threads). Asynchronous cancelability means that the thread can be canceled at any time (usually immediately, but the system does not guarantee this). Deferred cancelability means that cancellation will be delayed until the thread next calls a function that is a I. A list of functions that are or may be cancellation points is provided in B(7)." msgstr "" "スレッドのキャンセル種別 (cancelability type) は\n" "B(3) で設定され、I か I\n" "のいずれかとなる(I が新しいスレッドのデフォルト値である)。\n" "非同期キャンセル (asynchronous cancelability) は、そのスレッドはいつで\n" "もキャンセルされることを意味する (通常はすぐにキャンセルされるが、\n" "システムがそのことを保証しているわけではない)。遅延キャンセル\n" "(deferred cancelability) では、そのスレッドが I<取り消しポイント\n" "(cancellation point)> となっている関数を次に呼び出すまでキャンセルが\n" "遅延される。取り消しポイントに設定されていたり設定\n" "したりできる関数のリストは B(7) に記載している。" #. type: Plain text #: build/C/man3/pthread_cancel.3:81 msgid "When a cancellation requested is acted on, the following steps occur for I (in this order):" msgstr "" "キャンセル要求が実行されると、\n" "I では以下のステップが (この順序で) 行われる。" #. type: IP #: build/C/man3/pthread_cancel.3:81 build/C/man3/pthread_cleanup_push.3:69 #, no-wrap msgid "1." msgstr "1." #. type: Plain text #: build/C/man3/pthread_cancel.3:86 msgid "Cancellation clean-up handlers are popped (in the reverse of the order in which they were pushed) and called. (See B(3).)" msgstr "" "キャンセルクリーンアップハンドラが (push されたのと逆順で)\n" "取り出され (pop され)、呼び出される。\n" "(B(3) 参照)" #. type: IP #: build/C/man3/pthread_cancel.3:86 build/C/man3/pthread_cleanup_push.3:73 #, no-wrap msgid "2." msgstr "2." #. type: Plain text #: build/C/man3/pthread_cancel.3:91 msgid "Thread-specific data destructors are called, in an unspecified order. (See B(3).)" msgstr "" "スレッド固有データのデストラクタ (destructor) が呼び出される。\n" "呼び出し順序は規定されていない。\n" "(B(3) 参照)" #. type: IP #: build/C/man3/pthread_cancel.3:91 build/C/man3/pthread_cleanup_push.3:83 #, no-wrap msgid "3." msgstr "3." #. type: Plain text #: build/C/man3/pthread_cancel.3:95 msgid "The thread is terminated. (See B(3).)" msgstr "スレッドが終了される。 (B(3) 参照)" #. type: Plain text #: build/C/man3/pthread_cancel.3:103 msgid "The above steps happen asynchronously with respect to the B() call; the return status of B() merely informs the caller whether the cancellation request was successfully queued." msgstr "" "上記のステップは B() の呼び出しとは非同期に行われる。\n" "B() の返却ステータスは単にキャンセル要求が正常に\n" "キューに入れられたかどうかを呼び出し元に示すだけのものである。" #. type: Plain text #: build/C/man3/pthread_cancel.3:112 msgid "After a canceled thread has terminated, a join with that thread using B(3) obtains B as the thread's exit status. (Joining with a thread is the only way to know that cancellation has completed.)" msgstr "" "キャンセルされたスレッドが終了された後に、\n" "B(3) でそのスレッドを join すると、\n" "そのスレッドの終了ステータスとして B が得られる。\n" "(スレッドの join はキャンセルが完了したかを知る唯一の方法である)" #. type: Plain text #: build/C/man3/pthread_cancel.3:117 msgid "On success, B() returns 0; on error, it returns a nonzero error number." msgstr "" "成功すると、 B() は 0 を返す。\n" "エラーの場合、0 以外のエラー番号を返す。" #. type: TP #: build/C/man3/pthread_cancel.3:118 build/C/man3/pthread_detach.3:59 #: build/C/man3/pthread_getcpuclockid.3:58 build/C/man3/pthread_join.3:93 #: build/C/man3/pthread_setaffinity_np.3:114 #: build/C/man3/pthread_setschedparam.3:114 #: build/C/man3/pthread_setschedprio.3:70 build/C/man3/pthread_sigqueue.3:86 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_cancel.3:125 build/C/man3/pthread_detach.3:64 #: build/C/man3/pthread_getcpuclockid.3:63 build/C/man3/pthread_join.3:98 #: build/C/man3/pthread_setaffinity_np.3:119 #: build/C/man3/pthread_setschedparam.3:119 #: build/C/man3/pthread_setschedprio.3:75 msgid "No thread with the ID I could be found." msgstr "ID が I のスレッドが見つからなかった。" #. type: Plain text #: build/C/man3/pthread_cancel.3:135 msgid "On Linux, cancellation is implemented using signals. Under the NPTL threading implementation, the first real-time signal (i.e., signal 32) is used for this purpose. On LinuxThreads, the second real-time signal is used, if real-time signals are available, otherwise B is used." msgstr "" "Linux では、キャンセルはシグナルを使って実装されている。NPTL スレッド実装では、\n" "最初のリアルタイムシグナル (つまり、シグナル 32)がこのために使用される。\n" "LinuxThreads では、リアルタイムシグナルが利用可能な場合は2 番目のリアルタイム\n" "シグナルが使用され、そうでない場合は B が使用される。" #. type: Plain text #: build/C/man3/pthread_cancel.3:141 msgid "The program below creates a thread and then cancels it. The main thread joins with the canceled thread to check that its exit status was B. The following shell session shows what happens when we run the program:" msgstr "" "以下のプログラムは、スレッドを一つ作成してから、そのスレッドをキャンセルする。\n" "メインスレッドはキャンセルされたスレッドをジョインし、\n" "キャンセルされたスレッドの終了ステータスが B かどうかを\n" "確認する。以下のシェルセッションはこのプログラムを実行した際の実行例である。" #. type: Plain text #: build/C/man3/pthread_cancel.3:149 #, no-wrap msgid "" "$ ./a.out\n" "thread_func(): started; cancellation disabled\n" "main(): sending cancellation request\n" "thread_func(): about to enable cancellation\n" "main(): thread was canceled\n" msgstr "" "$ ./a.out\n" "thread_func(): started; cancellation disabled\n" "main(): sending cancellation request\n" "thread_func(): about to enable cancellation\n" "main(): thread was canceled\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:159 #, no-wrap msgid "" "#include Epthread.hE\n" "#include Estdio.hE\n" "#include Eerrno.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" msgstr "" "#include Epthread.hE\n" "#include Estdio.hE\n" "#include Eerrno.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:167 #, no-wrap msgid "" "static void *\n" "thread_func(void *ignored_argument)\n" "{\n" " int s;\n" msgstr "" "static void *\n" "thread_func(void *ignored_argument)\n" "{\n" " int s;\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:170 #, no-wrap msgid "" " /* Disable cancellation for a while, so that we don\\(aqt\n" " immediately react to a cancellation request */\n" msgstr "" " /* Disable cancellation for a while, so that we don\\(aqt\n" " immediately react to a cancellation request */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:174 #, no-wrap msgid "" " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_setcancelstate\");\n" msgstr "" " s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_setcancelstate\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:178 #, no-wrap msgid "" " printf(\"thread_func(): started; cancellation disabled\\en\");\n" " sleep(5);\n" " printf(\"thread_func(): about to enable cancellation\\en\");\n" msgstr "" " printf(\"thread_func(): started; cancellation disabled\\en\");\n" " sleep(5);\n" " printf(\"thread_func(): about to enable cancellation\\en\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:182 #, no-wrap msgid "" " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_setcancelstate\");\n" msgstr "" " s = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_setcancelstate\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:184 #, no-wrap msgid " /* sleep() is a cancellation point */\n" msgstr " /* sleep() is a cancellation point */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:186 #, no-wrap msgid " sleep(1000); /* Should get canceled while we sleep */\n" msgstr " sleep(1000); /* Should get canceled while we sleep */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:188 #, no-wrap msgid " /* Should never get here */\n" msgstr " /* Should never get here */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:192 #, no-wrap msgid "" " printf(\"thread_func(): not canceled!\\en\");\n" " return NULL;\n" "}\n" msgstr "" " printf(\"thread_func(): not canceled!\\en\");\n" " return NULL;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:199 #, no-wrap msgid "" "int\n" "main(void)\n" "{\n" " pthread_t thr;\n" " void *res;\n" " int s;\n" msgstr "" "int\n" "main(void)\n" "{\n" " pthread_t thr;\n" " void *res;\n" " int s;\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:201 #, no-wrap msgid " /* Start a thread and then send it a cancellation request */\n" msgstr " /* Start a thread and then send it a cancellation request */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:205 #, no-wrap msgid "" " s = pthread_create(&thr, NULL, &thread_func, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" msgstr "" " s = pthread_create(&thr, NULL, &thread_func, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:207 #, no-wrap msgid " sleep(2); /* Give thread a chance to get started */\n" msgstr " sleep(2); /* Give thread a chance to get started */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:212 #, no-wrap msgid "" " printf(\"main(): sending cancellation request\\en\");\n" " s = pthread_cancel(thr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_cancel\");\n" msgstr "" " printf(\"main(): sending cancellation request\\en\");\n" " s = pthread_cancel(thr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_cancel\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:214 #, no-wrap msgid " /* Join with thread to see what its exit status was */\n" msgstr " /* Join with thread to see what its exit status was */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:218 build/C/man3/pthread_cleanup_push.3:307 #, no-wrap msgid "" " s = pthread_join(thr, &res);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_join\");\n" msgstr "" " s = pthread_join(thr, &res);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_join\");\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:225 #, no-wrap msgid "" " if (res == PTHREAD_CANCELED)\n" " printf(\"main(): thread was canceled\\en\");\n" " else\n" " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " if (res == PTHREAD_CANCELED)\n" " printf(\"main(): thread was canceled\\en\");\n" " else\n" " printf(\"main(): thread wasn\\(aqt canceled (shouldn\\(aqt happen!)\\en\");\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:238 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_cleanup_push.3:26 #, no-wrap msgid "PTHREAD_CLEANUP_PUSH" msgstr "PTHREAD_CLEANUP_PUSH" #. type: TH #: build/C/man3/pthread_cleanup_push.3:26 #, no-wrap msgid "2008-11-24" msgstr "2008-11-24" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:30 msgid "pthread_cleanup_push, pthread_cleanup_pop - push and pop thread cancellation clean-up handlers" msgstr "" "pthread_cleanup_push, pthread_cleanup_pop - スレッドの\n" "キャンセルクリーンアップハンドラの push/pop を行う" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:37 #, no-wrap msgid "" "BIB<)(void *),>\n" "B< void *>IB<);>\n" "BIB<);>\n" msgstr "" "BIB<)(void *),>\n" "B< void *>IB<);>\n" "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:48 msgid "These functions manipulate the calling thread's stack of thread-cancellation clean-up handlers. A clean-up handler is a function that is automatically executed when a thread is canceled (or in various other circumstances described below); it might, for example, unlock a mutex so that it becomes available to other threads in the process." msgstr "" "これらの関数は、呼び出したスレッドのスレッドキャンセル時のクリーンアッ\n" "プハンドラのスタックの操作を行う。クリーンアップハンドラは、スレッドが\n" "キャンセルされた場合 (や以下で説明する他の種々の状況において) 自動的に\n" "実行される関数である。例えば、mutex のロック解除を行い、プロセス内の\n" "他のスレッドが利用できるようにする関数などが考えられる。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:59 msgid "The B() function pushes I onto the top of the stack of clean-up handlers. When I is later invoked, it will be given I as its argument." msgstr "" "B() 関数は、 I をクリーンアップ\n" "ハンドラのスタックの一番上にプッシュする。 I が後で\n" "起動される際には、 I が関数の引き数と渡される。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:66 msgid "The B() function removes the routine at the top of the stack of clean-up handlers, and optionally executes it if I is nonzero." msgstr "" "B() 関数は、クリーンアップハンドラの\n" "スタックの一番上のルーチンを削除する。\n" "I が 0 以外の場合にはそのルーチンを追加で実行する。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:69 msgid "A cancellation clean-up handler is popped from the stack and executed in the following circumstances:" msgstr "" "キャンセルクリーンアップハンドラは、以下に示す場合に\n" "スタックから取り出され実行される。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:73 msgid "When a thread is canceled, all of the stacked clean-up handlers are popped and executed in the reverse of the order in which they were pushed onto the stack." msgstr "" "スレッドがキャンセルされた際に、スタックに登録された全てのクリーン\n" "アップハンドラが取り出されて、実行される。クリーンアップハンドラの\n" "実行は、スタックに登録されたのと逆の順序で行われる。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:83 msgid "When a thread terminates by calling B(3), all clean-up handlers are executed as described in the preceding point. (Clean-up handlers are I called if the thread terminates by performing a I from the thread start function.)" msgstr "" "スレッドが B(3) を呼び出して終了する際に、全てのクリーン\n" "アップハンドラが上の項目で述べたのと同様に実行される。\n" "(スレッドがスレッド開始関数からの I の実行により終了する場合に\n" "は、クリーンアップハンドラはI<呼び出されない>。)" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:89 msgid "When a thread calls B() with a nonzero I argument, the top-most clean-up handler is popped and executed." msgstr "" "スレッドが 0 以外の I 引き数で B() を\n" "呼び出した際に、スタックの一番上のクリーンアップハンドラが取り出されて\n" "実行される。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:101 msgid "POSIX.1 permits B() and B() to be implemented as macros that expand to text containing \\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively. For this reason, the caller must ensure that calls to these functions are paired within the same function, and at the same lexical nesting level. (In other words, a clean-up handler is established only during the execution of a specified section of code.)" msgstr "" "POSIX.1 では、 B() と B() を\n" "それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開するマクロと\n" "して実装することを許容している。\n" "このため、呼び出し側では、これらの関数の呼び出しが同じ関数の中で対と\n" "なり、かつ文法的に同じネストレベル (nesting level) になることを保証\n" "しなければならない。 (言い換えると、クリーンアップハンドラは、コード\n" "の特定のセクションの実行の中でのみ設定するものであると言える。)" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:121 msgid "Calling B(3) (B(3)) produces undefined results if any call has been made to B() or B() without the matching call of the pair since the jump buffer was filled by B(3) (B(3)). Likewise, calling B(3) (B(3)) from inside a clean-up handler produces undefined results unless the jump buffer was also filled by B(3) (B(3)) inside the handler." msgstr "" "B(3) (B(3)) の呼び出しは、\n" "B() や B() の呼び出しが対と\n" "なる呼び出しがない状態で行われた場合には、どのような結果になるかは不定\n" "である。これは jump バッファーは B(3) (B(3)) により設\n" "定されるからである。同様に、クリーンアップハンドラ内からの\n" "B(3) (B(3)) の呼び出しも、jump バッファーがハンドラ\n" "内で B(3) (B(3)) で設定されていない限り、どのような\n" "結果になるかは不定である。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:123 msgid "These functions do not return a value." msgstr "これらの関数は値を返さない。" #. SH VERSIONS #. Available since glibc 2.0 #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:127 msgid "There are no errors." msgstr "エラーはない。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:140 msgid "On Linux, the B() and B() functions I implemented as macros that expand to text containing \\(aqB<{>\\(aq and \\(aqB<}>\\(aq, respectively. This means that variables declared within the scope of paired calls to these functions will be visible within only that scope." msgstr "" "Linux では、関数 B() と B()\n" "は、それぞれ \\(aqB<{>\\(aq と \\(aqB<}>\\(aq を含むテキストに展開する\n" "マクロとして実装されている。このことは、これらの関数を対で呼び出した\n" "スコープ内で宣言された変数は、そのスコープの中でしか参照できない\n" "ということを意味している。" #. The text was actually added in the 2004 TC2 #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:155 msgid "POSIX.1 says that the effect of using I, I, I, or I to prematurely leave a block bracketed B() and B() is undefined. Portable applications should avoid doing this." msgstr "" "POSIX.1 には、括弧を含む B() と\n" "B() のブロックをそのままにしたままで、 \n" "I, I, I, I を使った場合の影響は\n" "不定であると書かれている。\n" "移植性が必要なアプリケーションではこれを行うのは避けるべきである。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:170 msgid "The program below provides a simple example of the use of the functions described in this page. The program creates a thread that executes a loop bracketed by B() and B(). This loop increments a global variable, I, once each second. Depending on what command-line arguments are supplied, the main thread sends the other thread a cancellation request, or sets a global variable that causes the other thread to exit its loop and terminate normally (by doing a I)." msgstr "" "以下のプログラムは、このページで説明した関数の簡単な使用例を示すもので\n" "ある。このプログラムは B() と\n" "B() で囲まれたループを実行するスレッドを作成する。\n" "このループではグローバル変数 I を 1 秒に 1 ずつ増やしていく。\n" "指定されたコマンドライン引き数の内容に基づいて、メインスレッドはもう一\n" "つのスレッドにキャンセル要求を送ったり、もう一つのスレッドがループを\n" "抜けて (I を呼び出して) 正常終了するようにグローバル変数を\n" "設定したりする。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:173 msgid "In the following shell session, the main thread sends a cancellation request to the other thread:" msgstr "" "以下のシェルセッションでは、メインスレッドはもう一つのスレッドに\n" "キャンセル要求を送信する。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:183 #, no-wrap msgid "" "$ B<./a.out>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Canceling thread\n" "Called clean-up handler\n" "Thread was canceled; cnt = 0\n" msgstr "" "$ B<./a.out>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Canceling thread\n" "Called clean-up handler\n" "Thread was canceled; cnt = 0\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:191 msgid "From the above, we see that the thread was canceled, and that the cancellation clean-up handler was called and it reset the value of the global variable I to 0." msgstr "" "上記の実行例から、スレッドがキャンセルされ、\n" "キャンセルクリーンアップハンドラが呼び出され、\n" "グローバル変数 I の値が 0 にリセットされていることが確認できる。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:194 msgid "In the next run, the main program sets a global variable that causes other thread to terminate normally:" msgstr "" "次の実行例では、メインプログラムはグローバル変数を設定して、\n" "もう一つのスレッドが正常終了するようにしている。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:202 #, no-wrap msgid "" "$ B<./a.out x>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Thread terminated normally; cnt = 2\n" msgstr "" "$ B<./a.out x>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Thread terminated normally; cnt = 2\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:210 msgid "From the above, we see that the clean-up handler was not executed (because I was 0), and therefore the value of I was not reset." msgstr "" "上記では、 (I が 0 なので) クリーンアップハンドラは\n" "実行されておらず、その結果 I の値はリセットされていないことが\n" "分かる。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:215 msgid "In the next run, the main program sets a global variable that causes the other thread to terminate normally, and supplies a nonzero value for I:" msgstr "" "次の実行例では、メインプログラムはグローバル変数を設定して、\n" "もう一つのスレッドが正常終了するようにし、さらに\n" "I に 0 以外の値を渡している。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:224 #, no-wrap msgid "" "$ B<./a.out x 1>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Called clean-up handler\n" "Thread terminated normally; cnt = 0\n" msgstr "" "$ B<./a.out x 1>\n" "New thread started\n" "cnt = 0\n" "cnt = 1\n" "Called clean-up handler\n" "Thread terminated normally; cnt = 0\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:231 msgid "In the above, we see that although the thread was not canceled, the clean-up handler was executed, because the argument given to B() was nonzero." msgstr "" "上記では、スレッドはキャンセルされていないが、クリーンアップハンドラが\n" "実行されていないことが分かる。これは B() の引き数\n" "に 0 以外を渡したからである。" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:240 #, no-wrap msgid "" "#include Epthread.hE\n" "#include Esys/types.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" msgstr "" "#include Epthread.hE\n" "#include Esys/types.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:247 #, no-wrap msgid "" "static int done = 0;\n" "static int cleanup_pop_arg = 0;\n" "static int cnt = 0;\n" msgstr "" "static int done = 0;\n" "static int cleanup_pop_arg = 0;\n" "static int cnt = 0;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:254 #, no-wrap msgid "" "static void\n" "cleanup_handler(void *arg)\n" "{\n" " printf(\"Called clean-up handler\\en\");\n" " cnt = 0;\n" "}\n" msgstr "" "static void\n" "cleanup_handler(void *arg)\n" "{\n" " printf(\"Called clean-up handler\\en\");\n" " cnt = 0;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:259 #, no-wrap msgid "" "static void *\n" "thread_start(void *arg)\n" "{\n" " time_t start, curr;\n" msgstr "" "static void *\n" "thread_start(void *arg)\n" "{\n" " time_t start, curr;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:261 #, no-wrap msgid " printf(\"New thread started\\en\");\n" msgstr " printf(\"New thread started\\en\");\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:263 #, no-wrap msgid " pthread_cleanup_push(cleanup_handler, NULL);\n" msgstr " pthread_cleanup_push(cleanup_handler, NULL);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:265 #, no-wrap msgid " curr = start = time(NULL);\n" msgstr " curr = start = time(NULL);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:274 #, no-wrap msgid "" " while (!done) {\n" " pthread_testcancel(); /* A cancellation point */\n" " if (curr E time(NULL)) {\n" " curr = time(NULL);\n" " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n" " cnt++;\n" " }\n" " }\n" msgstr "" " while (!done) {\n" " pthread_testcancel(); /* A cancellation point */\n" " if (curr E time(NULL)) {\n" " curr = time(NULL);\n" " printf(\"cnt = %d\\en\", cnt); /* A cancellation point */\n" " cnt++;\n" " }\n" " }\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:278 #, no-wrap msgid "" " pthread_cleanup_pop(cleanup_pop_arg);\n" " return NULL;\n" "}\n" msgstr "" " pthread_cleanup_pop(cleanup_pop_arg);\n" " return NULL;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:285 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thr;\n" " int s;\n" " void *res;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thr;\n" " int s;\n" " void *res;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:289 #, no-wrap msgid "" " s = pthread_create(&thr, NULL, thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" msgstr "" " s = pthread_create(&thr, NULL, thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:291 #, no-wrap msgid " sleep(2); /* Allow new thread to run a while */\n" msgstr " sleep(2); /* Allow new thread to run a while */\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:296 #, no-wrap msgid "" " if (argc E 1) {\n" " if (argc E 2)\n" " cleanup_pop_arg = atoi(argv[2]);\n" " done = 1;\n" msgstr "" " if (argc E 1) {\n" " if (argc E 2)\n" " cleanup_pop_arg = atoi(argv[2]);\n" " done = 1;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:303 #, no-wrap msgid "" " } else {\n" " printf(\"Canceling thread\\en\");\n" " s = pthread_cancel(thr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_cancel\");\n" " }\n" msgstr "" " } else {\n" " printf(\"Canceling thread\\en\");\n" " s = pthread_cancel(thr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_cancel\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:314 #, no-wrap msgid "" " if (res == PTHREAD_CANCELED)\n" " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n" " else\n" " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " if (res == PTHREAD_CANCELED)\n" " printf(\"Thread was canceled; cnt = %d\\en\", cnt);\n" " else\n" " printf(\"Thread terminated normally; cnt = %d\\en\", cnt);\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:321 msgid "B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_cleanup_push_defer_np.3:26 #, no-wrap msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP" msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:30 msgid "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - push and pop thread cancellation clean-up handlers while saving cancelability type" msgstr "pthread_cleanup_push_defer_np, pthread_cleanup_pop_restore_np - cancelability type を保持したままでスレッドのキャンセルクリーンアップハンドラの push/pop を行う" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:37 #, no-wrap msgid "" "BIB<)(void *),>\n" "B< void *>IB<);>\n" "BIB<);>\n" msgstr "" "BIB<)(void *),>\n" "B< void *>IB<);>\n" "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:40 #: build/C/man3/pthread_create.3:38 build/C/man3/pthread_detach.3:37 #: build/C/man3/pthread_join.3:37 build/C/man3/pthread_kill.3:37 #: build/C/man3/pthread_setname_np.3:39 build/C/man3/pthread_sigmask.3:38 #: build/C/man3/pthread_sigqueue.3:38 build/C/man3/pthread_tryjoin_np.3:42 #: build/C/man3/pthread_yield.3:37 msgid "Compile and link with I<-pthread>." msgstr "I<-pthread> を付けてコンパイルとリンクを行う。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:49 msgid "B(), B():" msgstr "B(), B():" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:51 msgid "_GNU_SOURCE" msgstr "_GNU_SOURCE" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:59 msgid "These functions are the same as B(3) and B(3), except for the differences noted on this page." msgstr "これらの関数は B(3) と B(3) と同じだが、このページで説明する点が異なる。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:72 msgid "Like B(3), B() pushes I onto the thread's stack of cancellation clean-up handlers. In addition, it also saves the thread's current cancelability type, and sets the cancelability type to \"deferred\" (see B(3)); this ensures that cancellation clean-up will occur even if the thread's cancelability type was \"asynchronous\" before the call." msgstr "" "B(3) と同様に、\n" "B() は I をそのスレッドの\n" "クリーンアップハンドラのスタックに追加する。これに加えて、\n" "B() は現在の cancelability type も\n" "保存し、cancelability type は \"deferred\" に設定する\n" "(B(3) 参照)。\n" "これにより、この関数が呼び出される前のスレッドの cancelability type が\n" "\"asynchronous\" であったとしても、キャンセルクリーンアップが行われること\n" "が保証される。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:81 msgid "Like B(3), B() pops the top-most clean-up handler from the thread's stack of cancellation clean-up handlers. In addition, it restores the thread's cancelability type to its value at the time of the matching B()." msgstr "" "B(3) と同様に、\n" "B() はそのスレッドのキャンセル\n" "クリーンアップハンドラのスタックから一番上にあるクリーンアップハンドラ\n" "を取り出す。これに加えて、そのスレッドの cancelability type を、対応\n" "する B() が呼ばれた時点の値に戻す。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:87 msgid "The caller must ensure that calls to these functions are paired within the same function, and at the same lexical nesting level. Other restrictions apply, as described in B(3)." msgstr "" "呼び出し側では、これらの関数の呼び出しが同じ関数の中で対となり、かつ\n" "文法的に同じネストレベル (nesting level) になることを保証しなければ\n" "ならない。 B(3) で説明されている他の制限も\n" "適用される。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:89 msgid "This sequence of calls:" msgstr "以下の一連の呼び出し" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:94 #, no-wrap msgid "" "pthread_cleanup_push_defer_np(routine, arg);\n" "pthread_cleanup_pop_restore_np(execute);\n" msgstr "" "pthread_cleanup_push_defer_np(routine, arg);\n" "pthread_cleanup_pop_restore_np(execute);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:98 msgid "is equivalent to (but shorter and more efficient than):" msgstr "と以下は等価である (但し、上の方がより簡潔で効率的である)。" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:104 #, no-wrap msgid "int oldtype;\n" msgstr "int oldtype;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:110 #, no-wrap msgid "" "pthread_cleanup_push(routine, arg);\n" "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n" "\\&...\n" "pthread_setcanceltype(oldtype, NULL);\n" "pthread_cleanup_pop(execute);\n" msgstr "" "pthread_cleanup_push(routine, arg);\n" "pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);\n" "\\&...\n" "pthread_setcanceltype(oldtype, NULL);\n" "pthread_cleanup_pop(execute);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:123 msgid "B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_create.3:26 #, no-wrap msgid "PTHREAD_CREATE" msgstr "PTHREAD_CREATE" #. type: Plain text #: build/C/man3/pthread_create.3:29 msgid "pthread_create - create a new thread" msgstr "pthread_create - 新しいスレッドを作成する" #. type: Plain text #: build/C/man3/pthread_create.3:35 #, no-wrap msgid "" "BIB<, const pthread_attr_t *>IB<,>\n" "B< void *(*>IB<) (void *), void *>IB<);>\n" msgstr "" "BIB<, const pthread_attr_t *>IB<,>\n" "B< void *(*>IB<) (void *), void *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_create.3:47 msgid "The B() function starts a new thread in the calling process. The new thread starts execution by invoking I(); I is passed as the sole argument of I()." msgstr "" "B() 関数は、呼び出したプロセス内に新しいスレッドを作成する。\n" "新しいスレッドの実行は、 I() を起動することで開始される。\n" "I() は引き数を一つだけ取り、\n" "I が I() の引き数として渡される。" #. type: Plain text #: build/C/man3/pthread_create.3:49 msgid "The new thread terminates in one of the following ways:" msgstr "新しく作成されたスレッドは、以下のいずれかで終了する。" #. type: IP #: build/C/man3/pthread_create.3:49 build/C/man3/pthread_create.3:55 #: build/C/man3/pthread_create.3:63 build/C/man3/pthread_create.3:66 #: build/C/man3/pthread_getattr_np.3:52 build/C/man3/pthread_getattr_np.3:55 #: build/C/man3/pthread_getattr_np.3:58 #, no-wrap msgid "*" msgstr "*" #. type: Plain text #: build/C/man3/pthread_create.3:55 msgid "It calls B(3), specifying an exit status value that is available to another thread in the same process that calls B(3)." msgstr "" "スレッドが B(3) を呼び出す。\n" "B(3) を呼び出す際には終了ステータス値を指定する。\n" "この値は B(3) を呼び出した同じプロセス内の\n" "別のスレッドで参照できる。" #. type: Plain text #: build/C/man3/pthread_create.3:63 msgid "It returns from I(). This is equivalent to calling B(3) with the value supplied in the I statement." msgstr "" "スレッドが I() から返る。これは、\n" "I 文に渡した値で B(3) を呼び出すのと等価である。" #. type: Plain text #: build/C/man3/pthread_create.3:66 msgid "It is canceled (see B(3))." msgstr "スレッドがキャンセルされる (B(3) 参照)。" #. type: Plain text #: build/C/man3/pthread_create.3:72 msgid "Any of the threads in the process calls B(3), or the main thread performs a return from I
(). This causes the termination of all threads in the process." msgstr "" "プロセス内のいずれかのスレッドで B(3) が呼ばれるか、\n" "メインスレッドで I
() 内で return が実行される。\n" "この場合は、プロセス内の全てのスレッドが終了される。" #. type: Plain text #: build/C/man3/pthread_create.3:86 msgid "The I argument points to a I structure whose contents are used at thread creation time to determine attributes for the new thread; this structure is initialized using B(3) and related functions. If I is NULL, then the thread is created with default attributes." msgstr "" "I 引き数は I 構造体へのポインターであり、\n" "I 構造体の内容を使用して、スレッド作成時に\n" "新しいスレッドの属性が決定される。\n" "この構造体は B(3) や関連の関数を使って初期化される。\n" "I が NULL の場合、新しいスレッドはデフォルトの属性で作成される。" #. type: Plain text #: build/C/man3/pthread_create.3:93 msgid "Before returning, a successful call to B() stores the ID of the new thread in the buffer pointed to by I; this identifier is used to refer to the thread in subsequent calls to other pthreads functions." msgstr "" "成功した場合は、 B() は返る前に新しいスレッドの ID を\n" "I が指すバッファーに格納する。この ID は、これ以降に他の\n" "pthreads 関数の呼び出しでスレッドを参照するのに使用される。" #. type: Plain text #: build/C/man3/pthread_create.3:101 msgid "The new thread inherits a copy of the creating thread's signal mask (B(3)). The set of pending signals for the new thread is empty (B(2)). The new thread does not inherit the creating thread's alternate signal stack (B(2))." msgstr "" "新しいスレッドは、スレッドを作成したスレッドのシグナルマスク\n" "(B(3) 参照) のコピーを継承する。\n" "新しいスレッドの処理待ちシグナル (B(2)) の集合は空となる。\n" "新しいスレッドはスレッドを作成したスレッドの代替シグナルスタック\n" "(B(2)) を継承しない。" #. type: Plain text #: build/C/man3/pthread_create.3:104 msgid "The new thread inherits the calling thread's floating-point environment (B(3))." msgstr "" "新しいスレッドは呼び出したスレッドの浮動小数点環境 (B(3))\n" "を継承する。" #. CLOCK_THREAD_CPUTIME_ID in clock_gettime(2) #. type: Plain text #: build/C/man3/pthread_create.3:109 msgid "The initial value of the new thread's CPU-time clock is 0 (see B(3))." msgstr "" "新しいスレッドの CPU 時間時計の初期値は 0 である\n" "(B(3) 参照)。" #. type: SS #: build/C/man3/pthread_create.3:109 #, no-wrap msgid "Linux-specific details" msgstr "Linux 固有の詳細" #. type: Plain text #: build/C/man3/pthread_create.3:115 msgid "The new thread inherits copies of the calling thread's capability sets (see B(7)) and CPU affinity mask (see B(2))." msgstr "" "新しいスレッドは、呼び出したスレッドの\n" "ケーパビリティセット (B(7) 参照) と \n" "CPU affinity マスク (B(2) 参照) の\n" "コピーをを継承しない。" #. type: Plain text #: build/C/man3/pthread_create.3:122 msgid "On success, B() returns 0; on error, it returns an error number, and the contents of I<*thread> are undefined." msgstr "" "成功すると、 B() は 0 を返す。\n" "エラーの場合は、エラー番号が返され、 I<*thread> の内容は不定である。" #. type: TP #: build/C/man3/pthread_create.3:123 build/C/man3/pthread_create.3:126 #: build/C/man3/pthread_sigqueue.3:72 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_create.3:126 msgid "Insufficient resources to create another thread." msgstr "別のスレッドを作成するのに十分なリソースがない。" #. NOTE! The following should match the description in fork(2) #. type: Plain text #: build/C/man3/pthread_create.3:144 msgid "A system-imposed limit on the number of threads was encountered. There are a number of limits that may trigger this error: the B soft resource limit (set via B(2)), which limits the number of processes and threads for a real user ID, was reached; the kernel's system-wide limit on the number of processes and threads, I, was reached (see B(5)); or the maximum number of PIDs, I, was reached (see B(5))." msgstr "システムで設定されたスレッド数の上限に達していた。 このエラーの原因となる上限値はいくつかある。 実ユーザー ID 当たりのプロセス数とスレッド数の上限である、ソフトリソース上限 B に達していた (B(2) で設定できる)。 カーネルのシステム全体のプロセスとスレッドの数の上限値である I が達していた (B(5) 参照)。 PID の最大値 I に達していた (B(5) 参照)。" #. type: Plain text #: build/C/man3/pthread_create.3:148 msgid "Invalid settings in I." msgstr "I で指定された設定が不正である。" #. type: TP #: build/C/man3/pthread_create.3:148 build/C/man3/pthread_setschedparam.3:129 #: build/C/man3/pthread_setschedprio.3:66 #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: build/C/man3/pthread_create.3:153 msgid "No permission to set the scheduling policy and parameters specified in I." msgstr "" "I に指定されたスケジューリングポリシーとパラメーターを\n" "設定する許可がない。" #. type: Plain text #: build/C/man3/pthread_create.3:167 msgid "See B(3) for further information on the thread ID returned in I<*thread> by B(). Unless real-time scheduling policies are being employed, after a call to B(), it is indeterminate which thread\\(emthe caller or the new thread\\(emwill next execute." msgstr "" "B() が I<*thread> で返すスレッド ID についての\n" "詳しい情報は B(3) を参照のこと。\n" "リアルタイムスケジューリングポリシーが使用されない限り、\n" "B() の呼び出し後に、\n" "どのスレッドが\\(em呼び出したスレッドか新しいスレッドか\\(em\n" "次に実行されるかは決まっていない。" #. type: Plain text #: build/C/man3/pthread_create.3:187 msgid "A thread may either be I or I. If a thread is joinable, then another thread can call B(3) to wait for the thread to terminate and fetch its exit status. Only when a terminated joinable thread has been joined are the last of its resources released back to the system. When a detached thread terminates, its resources are automatically released back to the system: it is not possible to join with the thread in order to obtain its exit status. Making a thread detached is useful for some types of daemon threads whose exit status the application does not need to care about. By default, a new thread is created in a joinable state, unless I was set to create the thread in a detached state (using B(3))." msgstr "" "スレッドは Iか I のどちらかに\n" "することができる。スレッドが join 可能な場合、別のスレッドが\n" "B(3) を使って終了したスレッドを待ち、終了ステータスを取得\n" "することができる。終了した join 可能なスレッドは join された場合にのみ、\n" "そのスレッドの最後に残ったリソースが解放されシステムに戻される。\n" "detached 状態のスレッドが終了すると、そのスレッドのリソースは自動的に\n" "システムに戻される。detached 状態のスレッドを join して、その終了\n" "ステータスを取得することはできない。スレッドを detached 状態にするのは、\n" "その終了ステータスをアプリケーションが気にする必要がないある種の\n" "デーモン (daemon) スレッドでは有用である。\n" "デフォルトでは、新しいスレッドは join 可能な状態で作成される。\n" "(B(3) を使って) I でスレッドが\n" "detached 状態で作成されるように設定されていない限り、join 可能な状態で\n" "作成される。" #. FIXME . Perhaps some of the following detail should be in #. a future pthread_attr_setstacksize(3) page. #. type: Plain text #: build/C/man3/pthread_create.3:203 msgid "On Linux/x86-32, the default stack size for a new thread is 2 megabytes. Under the NPTL threading implementation, if the B soft resource limit I has any value other than \"unlimited\", then it determines the default stack size of new threads. Using B(3), the stack size attribute can be explicitly set in the I argument used to create a thread, in order to obtain a stack size other than the default." msgstr "" "Linux/x86-32 では、新しいスレッドのデフォルトのスタックサイズは 2MB で\n" "ある。NPTL スレッド実装の下では、I<プログラム開始時の> B\n" "ソフトリソース上限が\"unlimited\" 以外の場合、その値が新しいスレッドのデ\n" "フォルトのスタックサイズとなる。\n" "B(3) を使って、スレッドを作成する際の\n" "I 引き数に明示的にスタックサイズ属性を設定することで、\n" "デフォルト値以外のスタックサイズを得ることができる。" #. type: Plain text #: build/C/man3/pthread_create.3:209 msgid "In the obsolete LinuxThreads implementation, each of the threads in a process has a different process ID. This is in violation of the POSIX threads specification, and is the source of many other nonconformances to the standard; see B(7)." msgstr "" "廃止予定の LinuxThreads 実装では、プロセス内の各スレッドは異なる\n" "プロセス ID を持つ。これは POSIX スレッドの規格に違反しており、\n" "他の多くの標準非準拠の点の原因になっている。\n" "B(7) を参照のこと。" #. type: Plain text #: build/C/man3/pthread_create.3:213 msgid "The program below demonstrates the use of B(), as well as a number of other functions in the pthreads API." msgstr "" "以下のプログラムは、 B() や\n" "pthreads API の他のいろいろな関数の使用例を示している。" #. type: Plain text #: build/C/man3/pthread_create.3:218 msgid "In the following run, on a system providing the NPTL threading implementation, the stack size defaults to the value given by the \"stack size\" resource limit:" msgstr "" "以下の実行例は、 NPTL スレッド実装が提供されているシステムでのもので、\n" "スタックサイズがデフォルト値の \"stack size\" リソース上限で指定される値\n" "になる。" #. type: Plain text #: build/C/man3/pthread_create.3:230 #, no-wrap msgid "" "$B< ulimit -s>\n" "8192 # The stack size limit is 8 MB (0x800000 bytes)\n" "$B< ./a.out hola salut servus>\n" "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n" "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n" "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n" "Joined with thread 1; returned value was HOLA\n" "Joined with thread 2; returned value was SALUT\n" "Joined with thread 3; returned value was SERVUS\n" msgstr "" "$B< ulimit -s>\n" "8192 # The stack size limit is 8 MB (0x800000 bytes)\n" "$B< ./a.out hola salut servus>\n" "Thread 1: top of stack near 0xb7dd03b8; argv_string=hola\n" "Thread 2: top of stack near 0xb75cf3b8; argv_string=salut\n" "Thread 3: top of stack near 0xb6dce3b8; argv_string=servus\n" "Joined with thread 1; returned value was HOLA\n" "Joined with thread 2; returned value was SALUT\n" "Joined with thread 3; returned value was SERVUS\n" #. type: Plain text #: build/C/man3/pthread_create.3:236 msgid "In the next run, the program explicitly sets a stack size of 1MB (using B(3)) for the created threads:" msgstr "" "次の実行例では、プログラム内で、作成されるスレッドに対して\n" "(B(3) を使って1MB のスタックサイズを\n" "明示的に設定している。" #. type: Plain text #: build/C/man3/pthread_create.3:246 #, no-wrap msgid "" "$B< ./a.out -s 0x100000 hola salut servus>\n" "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n" "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n" "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n" "Joined with thread 1; returned value was HOLA\n" "Joined with thread 2; returned value was SALUT\n" "Joined with thread 3; returned value was SERVUS\n" msgstr "" "$B< ./a.out -s 0x100000 hola salut servus>\n" "Thread 1: top of stack near 0xb7d723b8; argv_string=hola\n" "Thread 2: top of stack near 0xb7c713b8; argv_string=salut\n" "Thread 3: top of stack near 0xb7b703b8; argv_string=servus\n" "Joined with thread 1; returned value was HOLA\n" "Joined with thread 2; returned value was SALUT\n" "Joined with thread 3; returned value was SERVUS\n" #. type: Plain text #: build/C/man3/pthread_create.3:258 #, no-wrap msgid "" "#include Epthread.hE\n" "#include Estring.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" "#include Ectype.hE\n" msgstr "" "#include Epthread.hE\n" "#include Estring.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Eerrno.hE\n" "#include Ectype.hE\n" #. type: Plain text #: build/C/man3/pthread_create.3:264 build/C/man3/pthread_getcpuclockid.3:116 #, no-wrap msgid "" "#define handle_error(msg) \\e\n" " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" msgstr "" "#define handle_error(msg) \\e\n" " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" #. type: Plain text #: build/C/man3/pthread_create.3:270 #, no-wrap msgid "" "struct thread_info { /* Used as argument to thread_start() */\n" " pthread_t thread_id; /* ID returned by pthread_create() */\n" " int thread_num; /* Application-defined thread # */\n" " char *argv_string; /* From command-line argument */\n" "};\n" msgstr "" "struct thread_info { /* Used as argument to thread_start() */\n" " pthread_t thread_id; /* ID returned by pthread_create() */\n" " int thread_num; /* Application-defined thread # */\n" " char *argv_string; /* From command-line argument */\n" "};\n" #. type: Plain text #: build/C/man3/pthread_create.3:273 #, no-wrap msgid "" "/* Thread start function: display address near top of our stack,\n" " and return upper-cased copy of argv_string */\n" msgstr "" "/* Thread start function: display address near top of our stack,\n" " and return upper-cased copy of argv_string */\n" #. type: Plain text #: build/C/man3/pthread_create.3:279 #, no-wrap msgid "" "static void *\n" "thread_start(void *arg)\n" "{\n" " struct thread_info *tinfo = arg;\n" " char *uargv, *p;\n" msgstr "" "static void *\n" "thread_start(void *arg)\n" "{\n" " struct thread_info *tinfo = arg;\n" " char *uargv, *p;\n" #. type: Plain text #: build/C/man3/pthread_create.3:282 #, no-wrap msgid "" " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n" " tinfo-Ethread_num, &p, tinfo-Eargv_string);\n" msgstr "" " printf(\"Thread %d: top of stack near %p; argv_string=%s\\en\",\n" " tinfo-Ethread_num, &p, tinfo-Eargv_string);\n" #. type: Plain text #: build/C/man3/pthread_create.3:286 #, no-wrap msgid "" " uargv = strdup(tinfo-Eargv_string);\n" " if (uargv == NULL)\n" " handle_error(\"strdup\");\n" msgstr "" " uargv = strdup(tinfo-Eargv_string);\n" " if (uargv == NULL)\n" " handle_error(\"strdup\");\n" #. type: Plain text #: build/C/man3/pthread_create.3:289 #, no-wrap msgid "" " for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n" " *p = toupper(*p);\n" msgstr "" " for (p = uargv; *p != \\(aq\\e0\\(aq; p++)\n" " *p = toupper(*p);\n" #. type: Plain text #: build/C/man3/pthread_create.3:292 #, no-wrap msgid "" " return uargv;\n" "}\n" msgstr "" " return uargv;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_create.3:301 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int s, tnum, opt, num_threads;\n" " struct thread_info *tinfo;\n" " pthread_attr_t attr;\n" " int stack_size;\n" " void *res;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int s, tnum, opt, num_threads;\n" " struct thread_info *tinfo;\n" " pthread_attr_t attr;\n" " int stack_size;\n" " void *res;\n" #. type: Plain text #: build/C/man3/pthread_create.3:303 #, no-wrap msgid " /* The \"-s\" option specifies a stack size for our threads */\n" msgstr " /* The \"-s\" option specifies a stack size for our threads */\n" #. type: Plain text #: build/C/man3/pthread_create.3:310 #, no-wrap msgid "" " stack_size = -1;\n" " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n" " switch (opt) {\n" " case \\(aqs\\(aq:\n" " stack_size = strtoul(optarg, NULL, 0);\n" " break;\n" msgstr "" " stack_size = -1;\n" " while ((opt = getopt(argc, argv, \"s:\")) != -1) {\n" " switch (opt) {\n" " case \\(aqs\\(aq:\n" " stack_size = strtoul(optarg, NULL, 0);\n" " break;\n" #. type: Plain text #: build/C/man3/pthread_create.3:317 #, no-wrap msgid "" " default:\n" " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" " }\n" msgstr "" " default:\n" " fprintf(stderr, \"Usage: %s [-s stack-size] arg...\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" " }\n" #. type: Plain text #: build/C/man3/pthread_create.3:319 #, no-wrap msgid " num_threads = argc - optind;\n" msgstr " num_threads = argc - optind;\n" #. type: Plain text #: build/C/man3/pthread_create.3:321 #, no-wrap msgid " /* Initialize thread creation attributes */\n" msgstr " /* Initialize thread creation attributes */\n" #. type: Plain text #: build/C/man3/pthread_create.3:325 #, no-wrap msgid "" " s = pthread_attr_init(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" msgstr "" " s = pthread_attr_init(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" #. type: Plain text #: build/C/man3/pthread_create.3:331 #, no-wrap msgid "" " if (stack_size E 0) {\n" " s = pthread_attr_setstacksize(&attr, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" msgstr "" " if (stack_size E 0) {\n" " s = pthread_attr_setstacksize(&attr, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_create.3:333 #, no-wrap msgid " /* Allocate memory for pthread_create() arguments */\n" msgstr " /* Allocate memory for pthread_create() arguments */\n" #. type: Plain text #: build/C/man3/pthread_create.3:337 #, no-wrap msgid "" " tinfo = calloc(num_threads, sizeof(struct thread_info));\n" " if (tinfo == NULL)\n" " handle_error(\"calloc\");\n" msgstr "" " tinfo = calloc(num_threads, sizeof(struct thread_info));\n" " if (tinfo == NULL)\n" " handle_error(\"calloc\");\n" #. type: Plain text #: build/C/man3/pthread_create.3:339 #, no-wrap msgid " /* Create one thread for each command-line argument */\n" msgstr " /* Create one thread for each command-line argument */\n" #. type: Plain text #: build/C/man3/pthread_create.3:343 #, no-wrap msgid "" " for (tnum = 0; tnum E num_threads; tnum++) {\n" " tinfo[tnum].thread_num = tnum + 1;\n" " tinfo[tnum].argv_string = argv[optind + tnum];\n" msgstr "" " for (tnum = 0; tnum E num_threads; tnum++) {\n" " tinfo[tnum].thread_num = tnum + 1;\n" " tinfo[tnum].argv_string = argv[optind + tnum];\n" #. type: Plain text #: build/C/man3/pthread_create.3:346 #, no-wrap msgid "" " /* The pthread_create() call stores the thread ID into\n" " corresponding element of tinfo[] */\n" msgstr "" " /* The pthread_create() call stores the thread ID into\n" " corresponding element of tinfo[] */\n" #. type: Plain text #: build/C/man3/pthread_create.3:352 #, no-wrap msgid "" " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n" " &thread_start, &tinfo[tnum]);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" " }\n" msgstr "" " s = pthread_create(&tinfo[tnum].thread_id, &attr,\n" " &thread_start, &tinfo[tnum]);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_create.3:355 #, no-wrap msgid "" " /* Destroy the thread attributes object, since it is no\n" " longer needed */\n" msgstr "" " /* Destroy the thread attributes object, since it is no\n" " longer needed */\n" #. type: Plain text #: build/C/man3/pthread_create.3:359 #, no-wrap msgid "" " s = pthread_attr_destroy(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" msgstr "" " s = pthread_attr_destroy(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" #. type: Plain text #: build/C/man3/pthread_create.3:361 #, no-wrap msgid " /* Now join with each thread, and display its returned value */\n" msgstr " /* Now join with each thread, and display its returned value */\n" #. type: Plain text #: build/C/man3/pthread_create.3:366 #, no-wrap msgid "" " for (tnum = 0; tnum E num_threads; tnum++) {\n" " s = pthread_join(tinfo[tnum].thread_id, &res);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_join\");\n" msgstr "" " for (tnum = 0; tnum E num_threads; tnum++) {\n" " s = pthread_join(tinfo[tnum].thread_id, &res);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_join\");\n" #. type: Plain text #: build/C/man3/pthread_create.3:371 #, no-wrap msgid "" " printf(\"Joined with thread %d; returned value was %s\\en\",\n" " tinfo[tnum].thread_num, (char *) res);\n" " free(res); /* Free memory allocated by thread */\n" " }\n" msgstr "" " printf(\"Joined with thread %d; returned value was %s\\en\",\n" " tinfo[tnum].thread_num, (char *) res);\n" " free(res); /* Free memory allocated by thread */\n" " }\n" #. type: Plain text #: build/C/man3/pthread_create.3:375 #, no-wrap msgid "" " free(tinfo);\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " free(tinfo);\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_create.3:389 msgid "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_detach.3:26 #, no-wrap msgid "PTHREAD_DETACH" msgstr "PTHREAD_DETACH" #. type: TH #: build/C/man3/pthread_detach.3:26 build/C/man3/pthread_join.3:26 #, no-wrap msgid "2008-11-27" msgstr "2008-11-27" #. type: Plain text #: build/C/man3/pthread_detach.3:29 msgid "pthread_detach - detach a thread" msgstr "pthread_detach - スレッドを切り離す (detach する)" #. type: Plain text #: build/C/man3/pthread_detach.3:34 #, no-wrap msgid "BIB<);>\n" msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_detach.3:46 msgid "The B() function marks the thread identified by I as detached. When a detached thread terminates, its resources are automatically released back to the system without the need for another thread to join with the terminated thread." msgstr "" "B() 関数は I で識別されるスレッドに\n" "detached (切り離された状態) という印を付ける。\n" "detached 状態のスレッドが終了すると、\n" "別のスレッドが終了されたスレッドを join しなくても、\n" "そのスレッドのリソースは自動的に解放されてシステムに戻される。" #. type: Plain text #: build/C/man3/pthread_detach.3:49 msgid "Attempting to detach an already detached thread results in unspecified behavior." msgstr "" "すでに detach 状態のスレッドを detach しようとした場合に\n" "どのような結果となるかは規定されていない。" #. type: Plain text #: build/C/man3/pthread_detach.3:54 msgid "On success, B() returns 0; on error, it returns an error number." msgstr "" "成功すると、B() は 0 を返す。\n" "エラーの場合、エラー番号を返す。" #. type: Plain text #: build/C/man3/pthread_detach.3:59 build/C/man3/pthread_join.3:89 msgid "I is not a joinable thread." msgstr "I が join 可能なスレッドではない。" #. type: Plain text #: build/C/man3/pthread_detach.3:70 msgid "Once a thread has been detached, it can't be joined with B(3) or be made joinable again." msgstr "" "いったんスレッドを detached 状態にすると、\n" "そのスレッドを B(3) で join したり、\n" "もう一度 join 可能にしたりすることはできない。" #. type: Plain text #: build/C/man3/pthread_detach.3:77 msgid "A new thread can be created in a detached state using B(3) to set the detached attribute of the I argument of B(3)." msgstr "" "B(3) を使って\n" "B(3) の I 引き数の detached 属性を設定することで、\n" "新しいスレッドを detached 状態で作成することができる。" #. type: Plain text #: build/C/man3/pthread_detach.3:84 msgid "The detached attribute merely determines the behavior of the system when the thread terminates; it does not prevent the thread from being terminated if the process terminates using B(3) (or equivalently, if the main thread returns)." msgstr "" "detached 属性は、スレッドが終了した際のシステムの動作を決めるだけである。\n" "プロセスが B(3) を使って終了した場合に、そのスレッドが終了され\n" "なくなるようなことはない (なお、メインスレッドが return した場合も\n" "プロセスが B(3) を使って終了した場合と全く同じである)。 " #. type: Plain text #: build/C/man3/pthread_detach.3:93 msgid "Either B(3) or B() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of all threads are freed when the process terminates.)" msgstr "" "アプリケーションが作成した各スレッドについて、そのスレッドが使用して\n" "いるシステムリソースを解放できるように、B(3) か\n" "B() のどちらかを呼び出すべきである (ただし、プロセスが\n" "終了するときには、全てのスレッドのリソースが解放される)。" #. type: Plain text #: build/C/man3/pthread_detach.3:95 msgid "The following statement detaches the calling thread:" msgstr "以下の文は、呼び出したスレッド自身を detach する。" #. type: Plain text #: build/C/man3/pthread_detach.3:97 #, no-wrap msgid " pthread_detach(pthread_self());\n" msgstr " pthread_detach(pthread_self());\n" #. type: Plain text #: build/C/man3/pthread_detach.3:104 msgid "B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_equal.3:26 #, no-wrap msgid "PTHREAD_EQUAL" msgstr "PTHREAD_EQUAL" #. type: TH #: build/C/man3/pthread_equal.3:26 build/C/man3/pthread_exit.3:26 #: build/C/man3/pthread_getcpuclockid.3:26 #: build/C/man3/pthread_setaffinity_np.3:26 #: build/C/man3/pthread_setconcurrency.3:25 #, no-wrap msgid "2014-05-23" msgstr "2014-05-23" #. type: Plain text #: build/C/man3/pthread_equal.3:29 msgid "pthread_equal - compare thread IDs" msgstr "pthread_equal - スレッド ID を比較する" #. type: Plain text #: build/C/man3/pthread_equal.3:34 #, no-wrap msgid "BIB<, pthread_t >IB<);>\n" msgstr "BIB<, pthread_t >IB<);>\n" #. type: Plain text #: build/C/man3/pthread_equal.3:41 msgid "The B() function compares two thread identifiers." msgstr "B() 関数は 2 つのスレッド識別子の比較を行う。" #. type: Plain text #: build/C/man3/pthread_equal.3:45 msgid "If the two thread IDs are equal, B() returns a nonzero value; otherwise, it returns 0." msgstr "" "B() は、2 つのスレッド ID が等しければ 0 以外の値を返し、\n" "そうでなければ 0 を返す。" #. SH VERSIONS #. Available since glibc 2.0 #. type: Plain text #: build/C/man3/pthread_equal.3:47 build/C/man3/pthread_exit.3:75 #: build/C/man3/pthread_self.3:50 build/C/man3/pthread_testcancel.3:58 msgid "This function always succeeds." msgstr "この関数は常に成功する。" #. type: Plain text #: build/C/man3/pthread_equal.3:52 msgid "The B() function is thread-safe." msgstr "B() 関数はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_equal.3:61 msgid "The B() function is necessary because thread IDs should be considered opaque: there is no portable way for applications to directly compare two I values." msgstr "" "B() 関数が必要なのは、\n" "スレッド ID はその内部構造を意識すべきではないためである。\n" "アプリケーションが 2 つの I の値を直接比較する場合、\n" "移植性を確保できる形で比較する方法はない。" #. type: Plain text #: build/C/man3/pthread_equal.3:65 msgid "B(3), B(3), B(7)" msgstr "B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_exit.3:26 #, no-wrap msgid "PTHREAD_EXIT" msgstr "PTHREAD_EXIT" #. type: Plain text #: build/C/man3/pthread_exit.3:29 msgid "pthread_exit - terminate calling thread" msgstr "pthread_exit - 呼び出したスレッドを終了する" #. type: Plain text #: build/C/man3/pthread_exit.3:34 #, no-wrap msgid "BIB<);>\n" msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_exit.3:45 msgid "The B() function terminates the calling thread and returns a value via I that (if the thread is joinable) is available to another thread in the same process that calls B(3)." msgstr "" "B() 関数は、呼び出したスレッドを終了し、\n" "I 経由で値を返す。\n" "この値は (そのスレッドが join 可能な場合に) B(3) を\n" "呼び出した同じプロセス内の別のスレッドが参照できる値と同じである。" #. type: Plain text #: build/C/man3/pthread_exit.3:55 msgid "Any clean-up handlers established by B(3) that have not yet been popped, are popped (in the reverse of the order in which they were pushed) and executed. If the thread has any thread-specific data, then, after the clean-up handlers have been executed, the corresponding destructor functions are called, in an unspecified order." msgstr "" "B(3) で設定されたクリーンアップハンドラのうち、\n" "まだ pop (取り出されていない) ハンドラを (push されたのと逆の順序で)\n" "取り出して実行する。そのスレッドがスレッド固有のデータを持っている\n" "場合は、クリーンアップハンドラが実行された後に、スレッド固有のデータ\n" "に対応するデストラクタ (destructor) 関数が呼び出される (呼び出し順序\n" "は規定されていない)。" #. type: Plain text #: build/C/man3/pthread_exit.3:62 msgid "When a thread terminates, process-shared resources (e.g., mutexes, condition variables, semaphores, and file descriptors) are not released, and functions registered using B(3) are not called." msgstr "" "スレッドが終了する際に、プロセスの共有リソース (例えば、mutex、状態変数\n" "(condition variables)、セマフォ、ファイルディスクリプター)が解放される。\n" "B(3) を使って登録された関数は呼び出されない。" #. type: Plain text #: build/C/man3/pthread_exit.3:71 msgid "After the last thread in a process terminates, the process terminates as by calling B(3) with an exit status of zero; thus, process-shared resources are released and functions registered using B(3) are called." msgstr "" "プロセスの最後のスレッドが終了すると、そのプロセスは、終了ステータス 0\n" "で B(3) を呼び出した場合と全く同じように終了する。したがって、\n" "プロセスの共有リソースは解放され、B(3) を使って登録された関数\n" "が呼び出される。" #. type: Plain text #: build/C/man3/pthread_exit.3:73 msgid "This function does not return to the caller." msgstr "この関数は呼び出し側には返らない。" #. type: Plain text #: build/C/man3/pthread_exit.3:80 msgid "The B() function is thread-safe." msgstr "B() 関数はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_exit.3:87 msgid "Performing a return from the start function of any thread other than the main thread results in an implicit call to B(), using the function's return value as the thread's exit status." msgstr "" "メインスレッド以外のスレッドの開始関数 (start function) がreturn を\n" "行うと、暗黙のうちに B() が呼び出され、\n" "関数の返り値がスレッドの終了ステータスとして使用される。" #. type: Plain text #: build/C/man3/pthread_exit.3:93 msgid "To allow other threads to continue execution, the main thread should terminate by calling B() rather than B(3)." msgstr "" "他のスレッドが実行を継続できるように、メインスレッドは B(3) では\n" "なく B() を呼び出して終了すべきである。" #. type: Plain text #: build/C/man3/pthread_exit.3:98 msgid "The value pointed to by I should not be located on the calling thread's stack, since the contents of that stack are undefined after the thread terminates." msgstr "" "I が指す値は、呼び出したスレッドのスタックに置くべきではない。\n" "呼び出したスレッドが終了した後は、そのスタックの内容が不定となるから\n" "である。" #. Linux 2.6.27 #. FIXME . review a later kernel to see if this gets fixed #. http://thread.gmane.org/gmane.linux.kernel/611611 #. http://marc.info/?l=linux-kernel&m=122525468300823&w=2 #. type: Plain text #: build/C/man3/pthread_exit.3:110 msgid "Currently, there are limitations in the kernel implementation logic for B(2)ing on a stopped thread group with a dead thread group leader. This can manifest in problems such as a locked terminal if a stop signal is sent to a foreground process whose thread group leader has already called B()." msgstr "" "現在のところ、停止 (stop) されたスレッドグループを、すでに終了した\n" "(dead) スレッドグループリーダーで B(2) する場合の、\n" "カーネル実装の論理には制限がある。\n" "この制限は、すでにスレッドグループリーダーが B() を\n" "呼び出しているようなフォアグラウンドプロセスにストップシグナルが送信\n" "された場合に、端末がロックされてしまう、といった問題として表に見える\n" "場合がある。" #. type: Plain text #: build/C/man3/pthread_exit.3:114 msgid "B(3), B(3), B(7)" msgstr "B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_getattr_np.3:26 #, no-wrap msgid "PTHREAD_GETATTR_NP" msgstr "PTHREAD_GETATTR_NP" #. type: TH #: build/C/man3/pthread_getattr_np.3:26 #, no-wrap msgid "2010-09-10" msgstr "2010-09-10" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:29 msgid "pthread_getattr_np - get attributes of created thread" msgstr "pthread_getattr_np - 作成されたスレッドの属性を取得する" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:35 #, no-wrap msgid "BIB<, pthread_attr_t *>IB<);>\n" msgstr "BIB<, pthread_attr_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:45 msgid "The B() function initializes the thread attributes object referred to by I so that it contains actual attribute values describing the running thread I." msgstr "" "B() 関数は、\n" "I が参照するスレッド属性オブジェクトを初期化し、\n" "そのオブジェクトに実行中のスレッド I の実際の属性値を\n" "格納して返す。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:52 msgid "The returned attribute values may differ from the corresponding attribute values passed in the I object that was used to create the thread using B(3). In particular, the following attributes may differ:" msgstr "" "返される属性値は、B(3) でスレッドを作成する際に\n" "使われたI オブジェクトで渡された属性値と異なる場合がある。\n" "特に、以下の属性は異なる場合がある。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:55 msgid "the detach state, since a joinable thread may have detached itself after creation;" msgstr "" "detach state. join 可能なスレッドは作成後に自分自身を\n" "切り離す (detach する) ことができるからである。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:58 msgid "the stack size, which the implementation may align to a suitable boundary." msgstr "" "スタックサイズ。\n" "スレッドの実装によって適切な境界に揃えられる可能があるためである。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:63 msgid "and the guard size, which the implementation may round upward to a multiple of the page size, or ignore (i.e., treat as 0), if the application is allocating its own stack." msgstr "" "guard size.\n" "スレッドの実装によりページサイズの倍数に切り上げられたり、\n" "アプリケーションが自分でスタックを割り当てる場合には無視される\n" "(0 として扱われる) ことがあるからである。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:68 msgid "Furthermore, if the stack address attribute was not set in the thread attributes object used to create the thread, then the returned thread attributes object will report the actual stack address that the implementation selected for the thread." msgstr "" "さらに、スレッドを作成する際に使用されたスレッド属性オブジェクトで\n" "スタックアドレスが設定されていなかった場合、\n" "返されたスレッド属性オブジェクトではスレッドの実装がそのスレッドに\n" "割り当てた実際のスタックアドレスが報告される。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:73 msgid "When the thread attributes object returned by B() is no longer required, it should be destroyed using B(3)." msgstr "" "B() が返したスレッド属性オブジェクトが\n" "必要なくなった際には、 B(3) を使って\n" "そのオブジェクトを破棄すべきである。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:76 #: build/C/man3/pthread_getcpuclockid.3:49 msgid "On success, this function returns 0; on error, it returns a nonzero error number." msgstr "" "成功すると、この関数は 0 を返す。\n" "エラーの場合、 0 以外のエラー番号を返す。" #. Can happen (but unlikely) while trying to allocate memory for cpuset #. type: Plain text #: build/C/man3/pthread_getattr_np.3:81 msgid "Insufficient memory." msgstr "メモリが十分になかった。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:96 msgid "In addition, if I refers to the main thread, then B() can fail because of errors from various underlying calls: B(3), if I can't be opened; and B(2), if the B resource limit is not supported." msgstr "" "さらに、 I がメインスレッドを参照している場合には、\n" "B() は内部で行われる様々な呼び出しでの\n" "エラーで失敗する可能性がある。\n" "I がオープンできない場合には B(3)\n" "でエラーが発生し、リソース上限 B が\n" "サポートされていない場合には B(2) でエラーが発生する。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:98 msgid "This function is available in glibc since version 2.2.3." msgstr "この関数は glibc バージョン 2.2.3 以降で利用できる。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:101 #: build/C/man3/pthread_kill_other_threads_np.3:55 msgid "This function is a nonstandard GNU extension; hence the suffix \"_np\" (nonportable) in the name." msgstr "" "この関数は非標準の GNU による拡張である。\n" "そのため、名前に \"_np\" (nonportable; 移植性がない) という接尾辞が\n" "付いている。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:111 msgid "The program below demonstrates the use of B(). The program creates a thread that then uses B() to retrieve and display its guard size, stack address, and stack size attributes. Command-line arguments can be used to set these attributes to values other than the default when creating the thread. The shell sessions below demonstrate the use of the program." msgstr "" "以下のプログラムは B() の使用例を示したものである。\n" "このプログラムは、スレッドを作成し、それから\n" "B() を使ってそのスレッドの属性 guard size、\n" "スタックアドレス、スタックサイズを取得し表示する。\n" "コマンドライン引き数での指定で、スレッドを作成する際に\n" "上記の属性にデフォルト値以外の値を設定することができる。\n" "下記のシェルのセッションはこのプログラムの使用例である。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:114 msgid "In the first run, on an x86-32 system, a thread is created using default attributes:" msgstr "" "最初の実行例は、デフォルトの属性でスレッドが作成されている\n" "(x86-32 システム上で実行)。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:124 #, no-wrap msgid "" "$B< ulimit -s> # No stack limit ==E default stack size is 2MB\n" "unlimited\n" "$B< ./a.out>\n" "Attributes of created thread:\n" " Guard size = 4096 bytes\n" " Stack address = 0x40196000 (EOS = 0x40397000)\n" " Stack size = 0x201000 (2101248) bytes\n" msgstr "" "$B< ulimit -s> # No stack limit ==E default stack size is 2MB\n" "unlimited\n" "$B< ./a.out>\n" "Attributes of created thread:\n" " Guard size = 4096 bytes\n" " Stack address = 0x40196000 (EOS = 0x40397000)\n" " Stack size = 0x201000 (2101248) bytes\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:130 msgid "In the following run, we see that if a guard size is specified, it is rounded up to the next multiple of the system page size (4096 bytes on x86-32):" msgstr "" "次の実行例では、guard size が指定された場合、\n" "guard size はシステムのページサイズの倍数に切り上げられることが分かる\n" "(x86-32 ではシステムのページサイズは 4096 バイトである)。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:138 #, no-wrap msgid "" "$B< ./a.out -g 4097>\n" "Thread attributes object after initializations:\n" " Guard size = 4097 bytes\n" " Stack address = (nil)\n" " Stack size = 0x0 (0) bytes\n" msgstr "" "$B< ./a.out -g 4097>\n" "Thread attributes object after initializations:\n" " Guard size = 4097 bytes\n" " Stack address = (nil)\n" " Stack size = 0x0 (0) bytes\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:143 #, no-wrap msgid "" "Attributes of created thread:\n" " Guard size = 8192 bytes\n" " Stack address = 0x40196000 (EOS = 0x40397000)\n" " Stack size = 0x201000 (2101248) bytes\n" msgstr "" "Attributes of created thread:\n" " Guard size = 8192 bytes\n" " Stack address = 0x40196000 (EOS = 0x40397000)\n" " Stack size = 0x201000 (2101248) bytes\n" #. .in +4n #. .nf #. $ ./a.out \-s 0x8000 #. Thread attributes object after initializations: #. Guard size = 4096 bytes #. Stack address = 0xffff8000 (EOS = (nil)) #. Stack size = 0x8000 (32768) bytes #. Attributes of created thread: #. Guard size = 4096 bytes #. Stack address = 0x4001e000 (EOS = 0x40026000) #. Stack size = 0x8000 (32768) bytes #. .fi #. .in #. type: Plain text #: build/C/man3/pthread_getattr_np.3:162 msgid "In the last run, the program manually allocates a stack for the thread. In this case, the guard size attribute is ignored." msgstr "" "最後の実行例では、プログラムでスレッド用のスタックを手動で割り当てている。\n" "この場合には、guard size 属性は無視される。" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:167 #, no-wrap msgid "" "$B< ./a.out -g 4096 -s 0x8000 -a>\n" "Allocated thread stack at 0x804d000\n" msgstr "" "$B< ./a.out -g 4096 -s 0x8000 -a>\n" "Allocated thread stack at 0x804d000\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:172 #, no-wrap msgid "" "Thread attributes object after initializations:\n" " Guard size = 4096 bytes\n" " Stack address = 0x804d000 (EOS = 0x8055000)\n" " Stack size = 0x8000 (32768) bytes\n" msgstr "" "Thread attributes object after initializations:\n" " Guard size = 4096 bytes\n" " Stack address = 0x804d000 (EOS = 0x8055000)\n" " Stack size = 0x8000 (32768) bytes\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:177 #, no-wrap msgid "" "Attributes of created thread:\n" " Guard size = 0 bytes\n" " Stack address = 0x804d000 (EOS = 0x8055000)\n" " Stack size = 0x8000 (32768) bytes\n" msgstr "" "Attributes of created thread:\n" " Guard size = 0 bytes\n" " Stack address = 0x804d000 (EOS = 0x8055000)\n" " Stack size = 0x8000 (32768) bytes\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:198 #, no-wrap msgid "" "static void\n" "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n" "{\n" " int s;\n" " size_t stack_size, guard_size;\n" " void *stack_addr;\n" msgstr "" "static void\n" "display_stack_related_attributes(pthread_attr_t *attr, char *prefix)\n" "{\n" " int s;\n" " size_t stack_size, guard_size;\n" " void *stack_addr;\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:203 #, no-wrap msgid "" " s = pthread_attr_getguardsize(attr, &guard_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getguardsize\");\n" " printf(\"%sGuard size = %d bytes\\en\", prefix, guard_size);\n" msgstr "" " s = pthread_attr_getguardsize(attr, &guard_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getguardsize\");\n" " printf(\"%sGuard size = %d bytes\\en\", prefix, guard_size);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:214 #, no-wrap msgid "" " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getstack\");\n" " printf(\"%sStack address = %p\", prefix, stack_addr);\n" " if (stack_size E 0)\n" " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n" " printf(\"\\en\");\n" " printf(\"%sStack size = 0x%x (%d) bytes\\en\",\n" " prefix, stack_size, stack_size);\n" "}\n" msgstr "" " s = pthread_attr_getstack(attr, &stack_addr, &stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_getstack\");\n" " printf(\"%sStack address = %p\", prefix, stack_addr);\n" " if (stack_size E 0)\n" " printf(\" (EOS = %p)\", (char *) stack_addr + stack_size);\n" " printf(\"\\en\");\n" " printf(\"%sStack size = 0x%x (%d) bytes\\en\",\n" " prefix, stack_size, stack_size);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:220 #, no-wrap msgid "" "static void\n" "display_thread_attributes(pthread_t thread, char *prefix)\n" "{\n" " int s;\n" " pthread_attr_t attr;\n" msgstr "" "static void\n" "display_thread_attributes(pthread_t thread, char *prefix)\n" "{\n" " int s;\n" " pthread_attr_t attr;\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:224 #, no-wrap msgid "" " s = pthread_getattr_np(thread, &attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getattr_np\");\n" msgstr "" " s = pthread_getattr_np(thread, &attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getattr_np\");\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:226 #, no-wrap msgid " display_stack_related_attributes(&attr, prefix);\n" msgstr " display_stack_related_attributes(&attr, prefix);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:231 #, no-wrap msgid "" " s = pthread_attr_destroy(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" "}\n" msgstr "" " s = pthread_attr_destroy(&attr);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_destroy\");\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:237 #, no-wrap msgid "" "static void * /* Start function for thread we create */\n" "thread_start(void *arg)\n" "{\n" " printf(\"Attributes of created thread:\\en\");\n" " display_thread_attributes(pthread_self(), \"\\et\");\n" msgstr "" "static void * /* Start function for thread we create */\n" "thread_start(void *arg)\n" "{\n" " printf(\"Attributes of created thread:\\en\");\n" " display_thread_attributes(pthread_self(), \"\\et\");\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:251 #, no-wrap msgid "" "static void\n" "usage(char *pname, char *msg)\n" "{\n" " if (msg != NULL)\n" " fputs(msg, stderr);\n" " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n" " \" [-g guard-size]\\en\", pname);\n" " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n" " exit(EXIT_FAILURE);\n" "}\n" msgstr "" "static void\n" "usage(char *pname, char *msg)\n" "{\n" " if (msg != NULL)\n" " fputs(msg, stderr);\n" " fprintf(stderr, \"Usage: %s [-s stack-size [-a]]\"\n" " \" [-g guard-size]\\en\", pname);\n" " fprintf(stderr, \"\\et\\et-a means program should allocate stack\\en\");\n" " exit(EXIT_FAILURE);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:264 #, no-wrap msgid "" "static pthread_attr_t * /* Get thread attributes from command line */\n" "get_thread_attributes_from_cl(int argc, char *argv[],\n" " pthread_attr_t *attrp)\n" "{\n" " int s, opt, allocate_stack;\n" " long stack_size, guard_size;\n" " void *stack_addr;\n" " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n" " a thread attributes object */\n" " allocate_stack = 0;\n" " stack_size = -1;\n" " guard_size = -1;\n" msgstr "" "static pthread_attr_t * /* Get thread attributes from command line */\n" "get_thread_attributes_from_cl(int argc, char *argv[],\n" " pthread_attr_t *attrp)\n" "{\n" " int s, opt, allocate_stack;\n" " long stack_size, guard_size;\n" " void *stack_addr;\n" " pthread_attr_t *ret_attrp = NULL; /* Set to attrp if we initialize\n" " a thread attributes object */\n" " allocate_stack = 0;\n" " stack_size = -1;\n" " guard_size = -1;\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:273 #, no-wrap msgid "" " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n" " switch (opt) {\n" " case \\(aqa\\(aq: allocate_stack = 1; break;\n" " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n" " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n" " default: usage(argv[0], NULL);\n" " }\n" " }\n" msgstr "" " while ((opt = getopt(argc, argv, \"ag:s:\")) != -1) {\n" " switch (opt) {\n" " case \\(aqa\\(aq: allocate_stack = 1; break;\n" " case \\(aqg\\(aq: guard_size = strtoul(optarg, NULL, 0); break;\n" " case \\(aqs\\(aq: stack_size = strtoul(optarg, NULL, 0); break;\n" " default: usage(argv[0], NULL);\n" " }\n" " }\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:276 #, no-wrap msgid "" " if (allocate_stack && stack_size == -1)\n" " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n" msgstr "" " if (allocate_stack && stack_size == -1)\n" " usage(argv[0], \"Specifying -a without -s makes no sense\\en\");\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:279 #, no-wrap msgid "" " if (argc E optind)\n" " usage(argv[0], \"Extraneous command-line arguments\\en\");\n" msgstr "" " if (argc E optind)\n" " usage(argv[0], \"Extraneous command-line arguments\\en\");\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:282 #, no-wrap msgid "" " if (stack_size E= 0 || guard_size E 0) {\n" " ret_attrp = attrp;\n" msgstr "" " if (stack_size E= 0 || guard_size E 0) {\n" " ret_attrp = attrp;\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:287 #, no-wrap msgid "" " s = pthread_attr_init(attrp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" " }\n" msgstr "" " s = pthread_attr_init(attrp);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_init\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:299 #, no-wrap msgid "" " if (stack_size E= 0) {\n" " if (!allocate_stack) {\n" " s = pthread_attr_setstacksize(attrp, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " } else {\n" " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n" " stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"posix_memalign\");\n" " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n" msgstr "" " if (stack_size E= 0) {\n" " if (!allocate_stack) {\n" " s = pthread_attr_setstacksize(attrp, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " } else {\n" " s = posix_memalign(&stack_addr, sysconf(_SC_PAGESIZE),\n" " stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"posix_memalign\");\n" " printf(\"Allocated thread stack at %p\\en\\en\", stack_addr);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:305 #, no-wrap msgid "" " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" " }\n" msgstr "" " s = pthread_attr_setstack(attrp, stack_addr, stack_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" " }\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:311 #, no-wrap msgid "" " if (guard_size E= 0) {\n" " s = pthread_attr_setguardsize(attrp, guard_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" msgstr "" " if (guard_size E= 0) {\n" " s = pthread_attr_setguardsize(attrp, guard_size);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_attr_setstacksize\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:314 #, no-wrap msgid "" " return ret_attrp;\n" "}\n" msgstr "" " return ret_attrp;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:323 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int s;\n" " pthread_t thr;\n" " pthread_attr_t attr;\n" " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n" " a thread attributes object */\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int s;\n" " pthread_t thr;\n" " pthread_attr_t attr;\n" " pthread_attr_t *attrp = NULL; /* Set to &attr if we initialize\n" " a thread attributes object */\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:325 #, no-wrap msgid " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" msgstr " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:331 #, no-wrap msgid "" " if (attrp != NULL) {\n" " printf(\"Thread attributes object after initializations:\\en\");\n" " display_stack_related_attributes(attrp, \"\\et\");\n" " printf(\"\\en\");\n" " }\n" msgstr "" " if (attrp != NULL) {\n" " printf(\"Thread attributes object after initializations:\\en\");\n" " display_stack_related_attributes(attrp, \"\\et\");\n" " printf(\"\\en\");\n" " }\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:361 msgid "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_getcpuclockid.3:26 #, no-wrap msgid "PTHREAD_GETCPUCLOCKID" msgstr "PTHREAD_GETCPUCLOCKID" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:29 msgid "pthread_getcpuclockid - retrieve ID of a thread's CPU time clock" msgstr "pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:33 #, no-wrap msgid "" "B<#include Epthread.hE>\n" "B<#include Etime.hE>\n" msgstr "" "B<#include Epthread.hE>\n" "B<#include Etime.hE>\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:35 #, no-wrap msgid "BIB<, clockid_t *>IB<);>\n" msgstr "BIB<, clockid_t *>IB<);>\n" #. The clockid is constructed as follows: #. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE) #. where CLOCK_IDFIELD_SIZE is 3. #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:46 msgid "The B() function returns the clock ID for the CPU time clock of the thread I." msgstr "" "B() 関数は、\n" "スレッド I の CPU 時間時計のクロック ID を返す。" #. type: TP #: build/C/man3/pthread_getcpuclockid.3:50 #, no-wrap msgid "B" msgstr "B" #. CLOCK_THREAD_CPUTIME_ID not defined #. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would #. be possible if kernel thread IDs took more than 29 bits (which #. they currently cannot). #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:58 msgid "Per-thread CPU time clocks are not supported by the system." msgstr "スレッド単位の CPU 時間時計はこのシステムではサポートされていない。" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:65 msgid "This function is available in glibc since version 2.2." msgstr "この関数は glibc バージョン 2.2 以降で利用できる。" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:70 msgid "The B() function is thread-safe." msgstr "B() 関数はスレッドセーフである。" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:83 msgid "When I refers to the calling thread, this function returns an identifier that refers to the same clock manipulated by B(2) and B(2) when given the clock ID B." msgstr "" "I が呼び出したスレッドを参照している場合、\n" "クロック ID B が指定されていれば、\n" "B(2) と B(2) が操作するのと同じ時計\n" "を参照する ID が返される。" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:89 msgid "The program below creates a thread and then uses B(2) to retrieve the total process CPU time, and the per-thread CPU time consumed by the two threads. The following shell session shows an example run:" msgstr "" "以下のプログラムは、スレッドを作成し、それから\n" "B(2) を使ってプロセス全体の CPU 時間を取得し、\n" "B(3) を使って 2 つのスレッドが消費した\n" "スレッド毎の CPU 時間を取得する。\n" "下記のシェルのセッションは実行例である。" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:99 #, no-wrap msgid "" "$ B<./a.out>\n" "Main thread sleeping\n" "Subthread starting infinite loop\n" "Main thread consuming some CPU time...\n" "Process total CPU time: 1.368\n" "Main thread CPU time: 0.376\n" "Subthread CPU time: 0.992\n" msgstr "" "$ B<./a.out>\n" "Main thread sleeping\n" "Subthread starting infinite loop\n" "Main thread consuming some CPU time...\n" "Process total CPU time: 1.368\n" "Main thread CPU time: 0.376\n" "Subthread CPU time: 0.992\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:105 #, no-wrap msgid "/* Link with \"-lrt\" */\n" msgstr "/* \"-lrt\" でリンクする */\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:113 #, no-wrap msgid "" "#include Etime.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Epthread.hE\n" "#include Estring.hE\n" "#include Eerrno.hE\n" msgstr "" "#include Etime.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "#include Epthread.hE\n" "#include Estring.hE\n" "#include Eerrno.hE\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:127 #, no-wrap msgid "" "static void *\n" "thread_start(void *arg)\n" "{\n" " printf(\"Subthread starting infinite loop\\en\");\n" " for (;;)\n" " continue;\n" "}\n" msgstr "" "static void *\n" "thread_start(void *arg)\n" "{\n" " printf(\"Subthread starting infinite loop\\en\");\n" " for (;;)\n" " continue;\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:132 #, no-wrap msgid "" "static void\n" "pclock(char *msg, clockid_t cid)\n" "{\n" " struct timespec ts;\n" msgstr "" "static void\n" "pclock(char *msg, clockid_t cid)\n" "{\n" " struct timespec ts;\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:138 #, no-wrap msgid "" " printf(\"%s\", msg);\n" " if (clock_gettime(cid, &ts) == -1)\n" " handle_error(\"clock_gettime\");\n" " printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n" "}\n" msgstr "" " printf(\"%s\", msg);\n" " if (clock_gettime(cid, &ts) == -1)\n" " handle_error(\"clock_gettime\");\n" " printf(\"%4ld.%03ld\\en\", ts.tv_sec, ts.tv_nsec / 1000000);\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:145 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thread;\n" " clockid_t cid;\n" " int j, s;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " pthread_t thread;\n" " clockid_t cid;\n" " int j, s;\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:149 #, no-wrap msgid "" " s = pthread_create(&thread, NULL, thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" msgstr "" " s = pthread_create(&thread, NULL, thread_start, NULL);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:152 #, no-wrap msgid "" " printf(\"Main thread sleeping\\en\");\n" " sleep(1);\n" msgstr "" " printf(\"Main thread sleeping\\en\");\n" " sleep(1);\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:156 #, no-wrap msgid "" " printf(\"Main thread consuming some CPU time...\\en\");\n" " for (j = 0; j E 2000000; j++)\n" " getppid();\n" msgstr "" " printf(\"Main thread consuming some CPU time...\\en\");\n" " for (j = 0; j E 2000000; j++)\n" " getppid();\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:158 #, no-wrap msgid " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" msgstr " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:163 #, no-wrap msgid "" " s = pthread_getcpuclockid(pthread_self(), &cid);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getcpuclockid\");\n" " pclock(\"Main thread CPU time: \", cid);\n" msgstr "" " s = pthread_getcpuclockid(pthread_self(), &cid);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getcpuclockid\");\n" " pclock(\"Main thread CPU time: \", cid);\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:166 #, no-wrap msgid "" " /* The preceding 4 lines of code could have been replaced by:\n" " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" msgstr "" " /* The preceding 4 lines of code could have been replaced by:\n" " pclock(\"Main thread CPU time: \", CLOCK_THREAD_CPUTIME_ID); */\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:171 #, no-wrap msgid "" " s = pthread_getcpuclockid(thread, &cid);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getcpuclockid\");\n" " pclock(\"Subthread CPU time: 1 \", cid);\n" msgstr "" " s = pthread_getcpuclockid(thread, &cid);\n" " if (s != 0)\n" " handle_error_en(s, \"pthread_getcpuclockid\");\n" " pclock(\"Subthread CPU time: 1 \", cid);\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:174 #, no-wrap msgid "" " exit(EXIT_SUCCESS); /* Terminates both threads */\n" "}\n" msgstr "" " exit(EXIT_SUCCESS); /* Terminates both threads */\n" "}\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:183 msgid "B(2), B(2), B(2), B(3), B(3), B(7), B