From a62274f603ad4afcc25ee2934fa43b32dc6b91e7 Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Fri, 23 Mar 2012 02:35:40 +0900 Subject: [PATCH] (split) LDP: Update pthread ja.po. --- po4a/pthread/po/ja.po | 1245 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 1053 insertions(+), 192 deletions(-) diff --git a/po4a/pthread/po/ja.po b/po4a/pthread/po/ja.po index 2a23dafb..520b3be6 100644 --- a/po4a/pthread/po/ja.po +++ b/po4a/pthread/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2012-03-22 04:26+0900\n" -"PO-Revision-Date: 2012-03-22 03:49+0900\n" +"PO-Revision-Date: 2012-03-22 20:52+0900\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1257,6 +1257,18 @@ msgid "" " Stack address = 0x40196000\n" " Stack size = 0x201000 bytes\n" msgstr "" +"$B< ulimit -s> # No stack imit ==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:128 @@ -1285,6 +1297,17 @@ msgid "" " 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:154 build/C/man3/pthread_getattr_np.3:185 @@ -1297,6 +1320,12 @@ msgid "" "#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:157 build/C/man3/pthread_cancel.3:156 @@ -1310,6 +1339,8 @@ 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:165 @@ -1323,6 +1354,13 @@ msgid "" " 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:173 @@ -1336,6 +1374,13 @@ msgid "" " (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:181 @@ -1349,6 +1394,13 @@ msgid "" " (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:189 @@ -1362,6 +1414,13 @@ msgid "" " (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:198 @@ -1376,6 +1435,14 @@ msgid "" " (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:203 @@ -1386,6 +1453,10 @@ msgid "" " 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:208 @@ -1396,6 +1467,10 @@ msgid "" " 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:215 @@ -1408,6 +1483,12 @@ msgid "" " 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:221 @@ -1419,6 +1500,11 @@ msgid "" " 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:225 @@ -1428,6 +1514,9 @@ msgid "" " 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:229 @@ -1437,6 +1526,9 @@ msgid "" " 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:232 @@ -1445,6 +1537,8 @@ 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:235 build/C/man3/pthread_getattr_np.3:237 @@ -1453,6 +1547,8 @@ 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:243 @@ -1466,13 +1562,20 @@ msgid "" " 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:245 #: build/C/man3/pthread_setschedparam.3:352 #, no-wrap msgid " attrp = NULL;\n" -msgstr "" +msgstr " attrp = NULL;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:249 @@ -1482,6 +1585,9 @@ msgid "" " 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:253 @@ -1491,12 +1597,15 @@ msgid "" " 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:255 #, no-wrap msgid " attrp = &attr;\n" -msgstr "" +msgstr " attrp = &attr;\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:259 @@ -1506,6 +1615,9 @@ msgid "" " 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:263 @@ -1515,6 +1627,9 @@ msgid "" " 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:267 @@ -1524,12 +1639,15 @@ msgid "" " 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:269 #, no-wrap msgid " stack_size = strtoul(argv[1], NULL, 0);\n" -msgstr "" +msgstr " stack_size = strtoul(argv[1], NULL, 0);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:273 @@ -1539,12 +1657,15 @@ msgid "" " 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:275 #, no-wrap msgid " printf(\"posix_memalign() allocated at %p\\en\", sp);\n" -msgstr "" +msgstr " printf(\"posix_memalign() allocated at %p\\en\", sp);\n" #. type: Plain text #: build/C/man3/pthread_attr_init.3:280 @@ -1555,6 +1676,10 @@ msgid "" " 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:284 build/C/man3/pthread_getattr_np.3:332 @@ -1564,6 +1689,9 @@ msgid "" " 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:290 build/C/man3/pthread_getattr_np.3:338 @@ -1575,6 +1703,11 @@ msgid "" " 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:293 build/C/man3/pthread_getattr_np.3:341 @@ -1583,6 +1716,8 @@ 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:308 @@ -1593,13 +1728,13 @@ msgid "" "B(3), B(3), " "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +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:24 #, no-wrap msgid "PTHREAD_ATTR_SETAFFINITY_NP" -msgstr "" +msgstr "PTHREAD_ATTR_SETAFFINITY_NP" #. type: TH #: build/C/man3/pthread_attr_setaffinity_np.3:24 @@ -1608,7 +1743,7 @@ msgstr "" #: build/C/man3/pthread_tryjoin_np.3:24 #, no-wrap msgid "2010-09-10" -msgstr "" +msgstr "2010-09-10" #. type: Plain text #: build/C/man3/pthread_attr_setaffinity_np.3:28 @@ -1627,6 +1762,8 @@ 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:37 @@ -1637,6 +1774,10 @@ msgid "" "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:51 @@ -1693,7 +1834,7 @@ msgstr "" #: build/C/man3/pthread_setschedprio.3:59 build/C/man3/pthread_sigqueue.3:75 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. cpumask_t #. The raw sched_getaffinity() system call returns the size (in bytes) @@ -1750,13 +1891,13 @@ msgstr "" msgid "" "B(2), B(3), B" "(3), B(7), B(7)" -msgstr "" +msgstr "B(2), B(3), B(3), B(7), B(7)" #. type: TH #: build/C/man3/pthread_attr_setdetachstate.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETDETACHSTATE" -msgstr "" +msgstr "PTHREAD_ATTR_SETDETACHSTATE" #. type: TH #: build/C/man3/pthread_attr_setdetachstate.3:24 @@ -1764,7 +1905,7 @@ msgstr "" #: build/C/man3/pthread_attr_setschedpolicy.3:24 #, no-wrap msgid "2010-02-03" -msgstr "" +msgstr "2010-02-03" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:28 @@ -1780,6 +1921,8 @@ 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:50 @@ -1800,7 +1943,7 @@ msgstr "" #: build/C/man3/pthread_attr_setdetachstate.3:53 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:58 @@ -1812,7 +1955,7 @@ msgstr "" #: build/C/man3/pthread_attr_setdetachstate.3:58 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setdetachstate.3:63 @@ -1878,13 +2021,13 @@ msgstr "" msgid "" "B(3), B(3), B(3), " "B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setguardsize.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETGUARDSIZE" -msgstr "" +msgstr "PTHREAD_ATTR_SETGUARDSIZE" #. type: TH #: build/C/man3/pthread_attr_setguardsize.3:24 @@ -1893,7 +2036,7 @@ msgstr "" #: build/C/man3/pthread_attr_setstackaddr.3:24 build/C/man3/pthread_self.3:24 #, no-wrap msgid "2008-10-24" -msgstr "" +msgstr "2008-10-24" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:28 @@ -1909,6 +2052,8 @@ 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:46 @@ -2008,7 +2153,7 @@ msgstr "" #: build/C/man3/pthread_create.3:361 build/C/man3/pthread_exit.3:90 #, no-wrap msgid "BUGS" -msgstr "" +msgstr "バグ" #. type: Plain text #: build/C/man3/pthread_attr_setguardsize.3:138 @@ -2046,19 +2191,19 @@ msgstr "" msgid "" "B(2), B(2), B(3), B" "(3), B(3), B(3), B(7)" -msgstr "" +msgstr "B(2), B(2), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setinheritsched.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETINHERITSCHED" -msgstr "" +msgstr "PTHREAD_ATTR_SETINHERITSCHED" #. type: TH #: build/C/man3/pthread_attr_setinheritsched.3:24 #, no-wrap msgid "2008-11-10" -msgstr "" +msgstr "2008-11-10" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:28 @@ -2076,6 +2221,10 @@ msgid "" "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:52 @@ -2097,7 +2246,7 @@ msgstr "" #: build/C/man3/pthread_attr_setinheritsched.3:55 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setinheritsched.3:63 @@ -2110,7 +2259,7 @@ msgstr "" #: build/C/man3/pthread_attr_setinheritsched.3:63 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. FIXME what are the defaults for scheduler settings? #. type: Plain text @@ -2184,13 +2333,13 @@ msgid "" "B(3), B(3), " "B(3), B(3), B" "(3), B(7)" -msgstr "" +msgstr "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setschedparam.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETSCHEDPARAM" -msgstr "" +msgstr "PTHREAD_ATTR_SETSCHEDPARAM" #. type: Plain text #: build/C/man3/pthread_attr_setschedparam.3:28 @@ -2208,6 +2357,10 @@ msgid "" "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:49 @@ -2241,6 +2394,9 @@ msgid "" " 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:71 @@ -2276,13 +2432,13 @@ msgid "" "(3), B(3), B(3), " "B(3), B(3), B" "(3), B(7)" -msgstr "" +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_setschedpolicy.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETSCHEDPOLICY" -msgstr "" +msgstr "PTHREAD_ATTR_SETSCHEDPOLICY" #. type: Plain text #: build/C/man3/pthread_attr_setschedpolicy.3:28 @@ -2298,6 +2454,8 @@ 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:49 @@ -2353,13 +2511,13 @@ msgid "" "B(3), B(3), " "B(3), B(3), B" "(3), B(7)" -msgstr "" +msgstr "B(2), B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setscope.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETSCOPE" -msgstr "" +msgstr "PTHREAD_ATTR_SETSCOPE" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:28 @@ -2375,6 +2533,8 @@ 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:50 @@ -2390,7 +2550,7 @@ msgstr "" #: build/C/man3/pthread_attr_setscope.3:50 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:58 @@ -2405,7 +2565,7 @@ msgstr "" #: build/C/man3/pthread_attr_setscope.3:58 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:73 @@ -2449,7 +2609,7 @@ msgstr "" #: build/C/man3/pthread_attr_setscope.3:98 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_attr_setscope.3:104 @@ -2480,13 +2640,13 @@ msgid "" "B(3), B(3), " "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setstack.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETSTACK" -msgstr "" +msgstr "PTHREAD_ATTR_SETSTACK" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:28 @@ -2504,6 +2664,10 @@ msgid "" "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:43 build/C/man3/pthread_sigqueue.3:39 @@ -2514,12 +2678,12 @@ msgstr "" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:48 msgid "B(), B():" -msgstr "" +msgstr "B(), B():" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:50 msgid "_POSIX_C_SOURCE\\ E=\\ 200112L || _XOPEN_SOURCE\\ E=\\ 600" -msgstr "" +msgstr "_POSIX_C_SOURCE\\ E=\\ 200112L || _XOPEN_SOURCE\\ E=\\ 600" #. type: Plain text #: build/C/man3/pthread_attr_setstack.3:66 @@ -2618,13 +2782,13 @@ msgid "" "B(2), B(2), B(3), B(3), " "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +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:24 #, no-wrap msgid "PTHREAD_ATTR_SETSTACKADDR" -msgstr "" +msgstr "PTHREAD_ATTR_SETSTACKADDR" #. type: Plain text #: build/C/man3/pthread_attr_setstackaddr.3:28 @@ -2640,6 +2804,8 @@ 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:46 @@ -2708,19 +2874,19 @@ msgstr "" msgid "" "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_attr_setstacksize.3:24 #, no-wrap msgid "PTHREAD_ATTR_SETSTACKSIZE" -msgstr "" +msgstr "PTHREAD_ATTR_SETSTACKSIZE" #. type: TH #: build/C/man3/pthread_attr_setstacksize.3:24 #, no-wrap msgid "2008-11-05" -msgstr "" +msgstr "2008-11-05" #. type: Plain text #: build/C/man3/pthread_attr_setstacksize.3:28 @@ -2736,6 +2902,8 @@ 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:46 @@ -2819,20 +2987,20 @@ msgstr "" msgid "" "B(2), B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +msgstr "B(2), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_cancel.3:24 #, no-wrap msgid "PTHREAD_CANCEL" -msgstr "" +msgstr "PTHREAD_CANCEL" #. type: TH #: build/C/man3/pthread_cancel.3:24 build/C/man3/pthread_setschedparam.3:24 #: build/C/man3/pthread_testcancel.3:24 #, no-wrap msgid "2008-11-17" -msgstr "" +msgstr "2008-11-17" #. type: Plain text #: build/C/man3/pthread_cancel.3:27 @@ -2843,7 +3011,7 @@ msgstr "" #: build/C/man3/pthread_cancel.3:32 #, no-wrap msgid "BIB<);>\n" -msgstr "" +msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:43 @@ -2887,7 +3055,7 @@ msgstr "" #: build/C/man3/pthread_cancel.3:75 build/C/man3/pthread_cleanup_push.3:66 #, no-wrap msgid "1." -msgstr "" +msgstr "1." #. type: Plain text #: build/C/man3/pthread_cancel.3:80 @@ -2900,7 +3068,7 @@ msgstr "" #: build/C/man3/pthread_cancel.3:80 build/C/man3/pthread_cleanup_push.3:70 #, no-wrap msgid "2." -msgstr "" +msgstr "2." #. type: Plain text #: build/C/man3/pthread_cancel.3:85 @@ -2913,7 +3081,7 @@ msgstr "" #: build/C/man3/pthread_cancel.3:85 build/C/man3/pthread_cleanup_push.3:78 #, no-wrap msgid "3." -msgstr "" +msgstr "3." #. type: Plain text #: build/C/man3/pthread_cancel.3:89 @@ -2952,7 +3120,7 @@ msgstr "" #: build/C/man3/pthread_setschedprio.3:67 build/C/man3/pthread_sigqueue.3:83 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_cancel.3:119 build/C/man3/pthread_detach.3:62 @@ -2991,6 +3159,11 @@ msgid "" "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:153 @@ -3002,6 +3175,11 @@ msgid "" "#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:161 @@ -3012,6 +3190,10 @@ msgid "" "{\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:164 @@ -3020,6 +3202,8 @@ 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:168 @@ -3029,6 +3213,9 @@ msgid "" " 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:172 @@ -3038,6 +3225,9 @@ msgid "" " 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:176 @@ -3047,24 +3237,27 @@ msgid "" " 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:178 #, no-wrap msgid " /* sleep() is a cancellation point */\n" -msgstr "" +msgstr " /* sleep() is a cancellation point */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:180 #, no-wrap msgid " sleep(1000); /* Should get canceled while we sleep */\n" -msgstr "" +msgstr " sleep(1000); /* Should get canceled while we sleep */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:182 #, no-wrap msgid " /* Should never get here */\n" -msgstr "" +msgstr " /* Should never get here */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:186 @@ -3074,6 +3267,9 @@ msgid "" " 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:193 @@ -3086,12 +3282,18 @@ msgid "" " 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:195 #, no-wrap msgid " /* Start a thread and then send it a cancellation request */\n" -msgstr "" +msgstr " /* Start a thread and then send it a cancellation request */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:199 @@ -3101,12 +3303,15 @@ msgid "" " if (s != 0)\n" " handle_error_en(s, \"pthread_create\");\n" msgstr "" - -#. type: Plain text +" 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:201 #, no-wrap msgid " sleep(2); /* Give thread a chance to get started */\n" -msgstr "" +msgstr " sleep(2); /* Give thread a chance to get started */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:206 @@ -3117,12 +3322,16 @@ msgid "" " 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:208 #, no-wrap msgid " /* Join with thread to see what its exit status was */\n" -msgstr "" +msgstr " /* Join with thread to see what its exit status was */\n" #. type: Plain text #: build/C/man3/pthread_cancel.3:212 build/C/man3/pthread_cleanup_push.3:300 @@ -3132,6 +3341,9 @@ msgid "" " 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:219 @@ -3144,6 +3356,12 @@ msgid "" " 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:230 @@ -3151,20 +3369,20 @@ msgid "" "B(3), B(3), B(3), " "B(3), B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +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:24 #, no-wrap msgid "PTHREAD_CLEANUP_PUSH" -msgstr "" +msgstr "PTHREAD_CLEANUP_PUSH" #. type: TH #: build/C/man3/pthread_cleanup_push.3:24 #: build/C/man3/pthread_setcancelstate.3:24 #, no-wrap msgid "2008-11-24" -msgstr "" +msgstr "2008-11-24" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:28 @@ -3181,6 +3399,9 @@ msgid "" "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:45 @@ -3325,6 +3546,13 @@ msgid "" "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:184 @@ -3351,6 +3579,11 @@ msgid "" "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:203 @@ -3378,6 +3611,12 @@ msgid "" "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:224 @@ -3398,6 +3637,12 @@ msgid "" "#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:240 @@ -3407,6 +3652,9 @@ msgid "" "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:247 @@ -3419,6 +3667,12 @@ msgid "" " 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:252 @@ -3429,24 +3683,28 @@ msgid "" "{\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:254 #, no-wrap msgid " printf(\"New thread started\\en\");\n" -msgstr "" +msgstr " printf(\"New thread started\\en\");\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:256 #, no-wrap msgid " pthread_cleanup_push(cleanup_handler, NULL);\n" -msgstr "" +msgstr " pthread_cleanup_push(cleanup_handler, NULL);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:258 #, no-wrap msgid " curr = start = time(NULL);\n" -msgstr "" +msgstr " curr = start = time(NULL);\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:267 @@ -3461,6 +3719,14 @@ msgid "" " }\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:271 @@ -3470,6 +3736,9 @@ msgid "" " 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:278 @@ -3482,6 +3751,12 @@ msgid "" " 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:282 @@ -3491,12 +3766,15 @@ msgid "" " 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:284 #, no-wrap msgid " sleep(2); /* Allow new thread to run a while */\n" -msgstr "" +msgstr " sleep(2); /* Allow new thread to run a while */\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push.3:289 @@ -3507,6 +3785,10 @@ msgid "" " 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:296 @@ -3519,6 +3801,12 @@ msgid "" " 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:307 @@ -3531,25 +3819,31 @@ msgid "" " 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:314 msgid "" "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_cleanup_push_defer_np.3:24 #, no-wrap msgid "PTHREAD_CLEANUP_PUSH_DEFER_NP" -msgstr "" +msgstr "PTHREAD_CLEANUP_PUSH_DEFER_NP" #. type: TH #: build/C/man3/pthread_cleanup_push_defer_np.3:24 #, no-wrap msgid "2008-12-04" -msgstr "" +msgstr "2008-12-04" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:28 @@ -3566,6 +3860,9 @@ msgid "" "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:43 @@ -3624,7 +3921,7 @@ msgstr "" #: build/C/man3/pthread_cleanup_push_defer_np.3:88 #, no-wrap msgid "int oldtype;\n" -msgstr "" +msgstr "int oldtype;\n" #. type: Plain text #: build/C/man3/pthread_cleanup_push_defer_np.3:94 @@ -3636,19 +3933,24 @@ msgid "" "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:107 msgid "" "B(3), B(3), B" "(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_create.3:24 #, no-wrap msgid "PTHREAD_CREATE" -msgstr "" +msgstr "PTHREAD_CREATE" #. type: Plain text #: build/C/man3/pthread_create.3:27 @@ -3662,6 +3964,8 @@ 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:36 build/C/man3/pthread_detach.3:35 @@ -3691,7 +3995,7 @@ msgstr "" #: build/C/man3/pthread_getattr_np.3:55 #, no-wrap msgid "*" -msgstr "" +msgstr "*" #. type: Plain text #: build/C/man3/pthread_create.3:53 @@ -3787,7 +4091,7 @@ msgstr "" #: build/C/man3/pthread_create.3:121 build/C/man3/pthread_sigqueue.3:69 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_create.3:135 @@ -3810,7 +4114,7 @@ msgstr "" #: build/C/man3/pthread_setschedprio.3:63 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. type: Plain text #: build/C/man3/pthread_create.3:144 @@ -3887,6 +4191,15 @@ msgid "" "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 (0x80000 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:221 @@ -3907,6 +4220,13 @@ msgid "" "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:243 @@ -3920,6 +4240,13 @@ msgid "" "#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:249 build/C/man3/pthread_getcpuclockid.3:107 @@ -3928,6 +4255,8 @@ 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:255 @@ -3939,6 +4268,11 @@ msgid "" " 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:258 @@ -3947,6 +4281,8 @@ 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:264 @@ -3958,6 +4294,11 @@ msgid "" " struct thread_info *tinfo = (struct thread_info *) arg;\n" " char *uargv, *p;\n" msgstr "" +"static void *\n" +"thread_start(void *arg)\n" +"{\n" +" struct thread_info *tinfo = (struct thread_info *) arg;\n" +" char *uargv, *p;\n" #. type: Plain text #: build/C/man3/pthread_create.3:267 @@ -3966,6 +4307,8 @@ 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:271 @@ -3975,6 +4318,9 @@ msgid "" " 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:274 @@ -3983,6 +4329,8 @@ 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:277 @@ -3991,6 +4339,8 @@ msgid "" " return uargv;\n" "}\n" msgstr "" +" return uargv;\n" +"}\n" #. type: Plain text #: build/C/man3/pthread_create.3:286 @@ -4005,12 +4355,20 @@ msgid "" " 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:288 #, no-wrap msgid " /* The \"-s\" option specifies a stack size for our threads */\n" -msgstr "" +msgstr " /* The \"-s\" option specifies a stack size for our threads */\n" #. type: Plain text #: build/C/man3/pthread_create.3:295 @@ -4023,6 +4381,12 @@ msgid "" " 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:302 @@ -4035,18 +4399,24 @@ msgid "" " }\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:304 #, no-wrap msgid " num_threads = argc - optind;\n" -msgstr "" +msgstr " num_threads = argc - optind;\n" #. type: Plain text #: build/C/man3/pthread_create.3:306 #, no-wrap msgid " /* Initialize thread creation attributes */\n" -msgstr "" +msgstr " /* Initialize thread creation attributes */\n" #. type: Plain text #: build/C/man3/pthread_create.3:310 @@ -4056,6 +4426,9 @@ msgid "" " 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:316 @@ -4067,12 +4440,17 @@ msgid "" " 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:318 #, no-wrap msgid " /* Allocate memory for pthread_create() arguments */\n" -msgstr "" +msgstr " /* Allocate memory for pthread_create() arguments */\n" #. type: Plain text #: build/C/man3/pthread_create.3:322 @@ -4082,12 +4460,15 @@ msgid "" " 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:324 #, no-wrap msgid " /* Create one thread for each command-line argument */\n" -msgstr "" +msgstr " /* Create one thread for each command-line argument */\n" #. type: Plain text #: build/C/man3/pthread_create.3:328 @@ -4097,6 +4478,9 @@ msgid "" " 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:331 @@ -4105,6 +4489,8 @@ 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:337 @@ -4116,6 +4502,11 @@ msgid "" " 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:340 @@ -4124,6 +4515,8 @@ 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:344 build/C/man3/pthread_setschedparam.3:420 @@ -4133,12 +4526,15 @@ msgid "" " 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:346 #, no-wrap msgid " /* Now join with each thread, and display its returned value */\n" -msgstr "" +msgstr " /* Now join with each thread, and display its returned value */\n" #. type: Plain text #: build/C/man3/pthread_create.3:351 @@ -4149,6 +4545,10 @@ msgid "" " 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:356 @@ -4159,6 +4559,10 @@ msgid "" " 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:360 @@ -4168,6 +4572,9 @@ msgid "" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" +" free(tinfo);\n" +" exit(EXIT_SUCCESS);\n" +"}\n" #. type: Plain text #: build/C/man3/pthread_create.3:367 @@ -4185,19 +4592,19 @@ msgid "" "B(3), B(3), B(3), " "B(3), B(3), B(3), B" "(7)" -msgstr "" +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:24 #, no-wrap msgid "PTHREAD_DETACH" -msgstr "" +msgstr "PTHREAD_DETACH" #. type: TH #: build/C/man3/pthread_detach.3:24 build/C/man3/pthread_join.3:24 #, no-wrap msgid "2008-11-27" -msgstr "" +msgstr "2008-11-27" #. type: Plain text #: build/C/man3/pthread_detach.3:27 @@ -4208,7 +4615,7 @@ msgstr "" #: build/C/man3/pthread_detach.3:32 #, no-wrap msgid "BIB<);>\n" -msgstr "" +msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_detach.3:44 @@ -4280,26 +4687,26 @@ msgstr "" #: build/C/man3/pthread_detach.3:95 #, no-wrap msgid " pthread_detach(pthread_self());\n" -msgstr "" +msgstr " pthread_detach(pthread_self());\n" #. type: Plain text #: build/C/man3/pthread_detach.3:102 msgid "" "B(3), B(3), B" "(3), B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(3), B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_equal.3:24 #, no-wrap msgid "PTHREAD_EQUAL" -msgstr "" +msgstr "PTHREAD_EQUAL" #. type: TH #: build/C/man3/pthread_equal.3:24 build/C/man3/pthread_exit.3:24 #, no-wrap msgid "2009-03-30" -msgstr "" +msgstr "2009-03-30" #. type: Plain text #: build/C/man3/pthread_equal.3:27 @@ -4310,7 +4717,7 @@ msgstr "" #: build/C/man3/pthread_equal.3:32 #, no-wrap msgid "BIB<, pthread_t >IB<);>\n" -msgstr "" +msgstr "BIB<, pthread_t >IB<);>\n" #. type: Plain text #: build/C/man3/pthread_equal.3:38 @@ -4343,13 +4750,13 @@ msgstr "" #. type: Plain text #: build/C/man3/pthread_equal.3:57 msgid "B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_exit.3:24 #, no-wrap msgid "PTHREAD_EXIT" -msgstr "" +msgstr "PTHREAD_EXIT" #. type: Plain text #: build/C/man3/pthread_exit.3:27 @@ -4360,7 +4767,7 @@ msgstr "" #: build/C/man3/pthread_exit.3:32 #, no-wrap msgid "BIB<);>\n" -msgstr "" +msgstr "BIB<);>\n" #. type: Plain text #: build/C/man3/pthread_exit.3:42 @@ -4442,13 +4849,13 @@ msgstr "" #. type: Plain text #: build/C/man3/pthread_exit.3:106 msgid "B(3), B(3), B(7)" -msgstr "" +msgstr "B(3), B(3), B(7)" #. type: TH #: build/C/man3/pthread_getattr_np.3:24 #, no-wrap msgid "PTHREAD_GETATTR_NP" -msgstr "" +msgstr "PTHREAD_GETATTR_NP" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:27 @@ -4459,7 +4866,7 @@ msgstr "" #: build/C/man3/pthread_getattr_np.3:33 #, no-wrap msgid "BIB<, pthread_attr_t *>IB<);>\n" -msgstr "" +msgstr "BIB<, pthread_attr_t *>IB<);>\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:42 @@ -4580,6 +4987,13 @@ msgid "" " 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:127 @@ -4599,6 +5013,11 @@ msgid "" " 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:140 @@ -4609,6 +5028,10 @@ msgid "" " 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 @@ -4637,6 +5060,8 @@ 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:169 @@ -4647,6 +5072,10 @@ msgid "" " 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:174 @@ -4657,6 +5086,10 @@ msgid "" " 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:195 @@ -4669,6 +5102,12 @@ msgid "" " 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:200 @@ -4679,6 +5118,10 @@ msgid "" " 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:211 @@ -4695,6 +5138,16 @@ msgid "" " 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:217 @@ -4705,7 +5158,12 @@ msgid "" "{\n" " int s;\n" " pthread_attr_t attr;\n" -msgstr "" +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:221 @@ -4715,12 +5173,15 @@ msgid "" " 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:223 #, no-wrap msgid " display_stack_related_attributes(&attr, prefix);\n" -msgstr "" +msgstr " display_stack_related_attributes(&attr, prefix);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:228 @@ -4731,6 +5192,10 @@ msgid "" " 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:234 @@ -4742,6 +5207,11 @@ msgid "" " 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:248 @@ -4758,6 +5228,16 @@ msgid "" " 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:261 @@ -4776,6 +5256,18 @@ msgid "" " 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:270 @@ -4790,6 +5282,14 @@ msgid "" " }\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:273 @@ -4798,6 +5298,8 @@ 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:276 @@ -4806,6 +5308,8 @@ 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:279 @@ -4814,6 +5318,8 @@ 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:284 @@ -4824,6 +5330,10 @@ msgid "" " 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:296 @@ -4841,6 +5351,17 @@ msgid "" " 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:302 @@ -4852,6 +5373,11 @@ msgid "" " }\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:308 @@ -4863,6 +5389,11 @@ msgid "" " 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:311 @@ -4871,6 +5402,8 @@ msgid "" " return ret_attrp;\n" "}\n" msgstr "" +" return ret_attrp;\n" +"}\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:320 @@ -4885,12 +5418,20 @@ msgid "" " 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:322 #, no-wrap msgid " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" -msgstr "" +msgstr " attrp = get_thread_attributes_from_cl(argc, argv, &attr);\n" #. type: Plain text #: build/C/man3/pthread_getattr_np.3:328 @@ -4902,6 +5443,11 @@ msgid "" " 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:356 @@ -4912,19 +5458,19 @@ msgid "" "B(3), B(3), " "B(3), B(3), " "B(3), B(3), B(7)" -msgstr "" +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:24 #, no-wrap msgid "PTHREAD_GETCPUCLOCKID" -msgstr "" +msgstr "PTHREAD_GETCPUCLOCKID" #. type: TH #: build/C/man3/pthread_getcpuclockid.3:24 #, no-wrap msgid "2009-02-08" -msgstr "" +msgstr "2009-02-08" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:27 @@ -4938,12 +5484,14 @@ 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:33 #, no-wrap msgid "BIB<, clockid_t *>I\n" -msgstr "" +msgstr "BIB<, clockid_t *>I\n" #. The clockid is constructed as follows: #. *clockid = CLOCK_THREAD_CPUTIME_ID | (pd->tid << CLOCK_IDFIELD_SIZE) @@ -4959,7 +5507,7 @@ msgstr "" #: build/C/man3/pthread_getcpuclockid.3:47 #, no-wrap msgid "B" -msgstr "" +msgstr "B" #. CLOCK_THREAD_CPUTIME_ID not defined #. Looking at nptl/pthread_getcpuclockid.c an ERANGE error would @@ -5003,6 +5551,13 @@ msgid "" "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:96 @@ -5022,6 +5577,13 @@ msgid "" "#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:118 @@ -5035,6 +5597,13 @@ msgid "" " 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:123 @@ -5045,6 +5614,10 @@ msgid "" "{\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:129 @@ -5056,6 +5629,11 @@ msgid "" " 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:136 @@ -5068,6 +5646,12 @@ msgid "" " 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:140 @@ -5077,6 +5661,9 @@ msgid "" " 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:143 @@ -5085,6 +5672,8 @@ 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:147 @@ -5094,12 +5683,15 @@ msgid "" " 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:149 #, no-wrap msgid " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" -msgstr "" +msgstr " pclock(\"Process total CPU time: \", CLOCK_PROCESS_CPUTIME_ID);\n" #. type: Plain text #: build/C/man3/pthread_getcpuclockid.3:154 @@ -5110,6 +5702,10 @@ msgid "" " 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:157 @@ -5118,6 +5714,8 @@ 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:162 @@ -5128,6 +5726,10 @@ msgid "" " 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:165 @@ -5136,19 +5738,21 @@ 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:174 msgid "" "B(2), B(2), B(2), " "B(3), B(3), B(7), B