JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... tr_t * /* Get thread attributes from command line */ get_thread_attributes_from_cl(int argc, char *argv[], pthread_attr_t *attrp) { int s, opt, allocate_stack; size_t stack_size, guard_size; void *stack_addr; pthread_attr_t *ret_attrp = NULL; /* Set t ... o attrp if we initialize a thread attributes object */ allocate_stack = 0; stack_size = -1; guard_size = -1; while ((opt = getopt( ... "); if (argc > optind) usage(argv[0], "Extraneous command-line arguments\n"); if (stack_size >= 0 || guard_size > 0) { ret_attrp = attrp; s = pthread_attr_init(attrp); if (s != 0) handle_error_en(s, "pthread_attr_init"); } if (stack_size >= 0) { if (! ... ... ESS); /* Terminate all threads */ } int main(int argc, char *argv[]) { pthread_t thr; pthread_attr_t attr; pthread_attr_t *attrp; /* NULL or &attr */ int s; attrp = NULL; /* If a command-line argument was supplied, use it to set the stack-size attribu ... te and set a few other thread attributes, and set attrp pointing to thread attributes object */ if (argc > 1) { size_t stack_size; void *sp; attrp = &attr; s = pthread_attr_init( ... _attr_setstack(&attr, sp, stack_size); if (s != 0) handle_error_en(s, "pthread_attr_setstack"); } s = pthread_create(&thr, attrp, &thread_start, NULL); if (s != 0) handle_error_en(s, "pthread_create"); if (attrp != NULL) { s = pthread_attr_destroy(att ... ... ESS); /* Terminate all threads */ } int main(int argc, char *argv[]) { pthread_t thr; pthread_attr_t attr; pthread_attr_t *attrp; /* NULL or &attr */ int s; attrp = NULL; /* If a command-line argument was supplied, use it to set the stack-size attribu ... te and set a few other thread attributes, and set attrp pointing to thread attributes object */ if (argc > 1) { size_t stack_size; void *sp; attrp = &attr; s = pthread_attr_init( ... _attr_setstack(&attr, sp, stack_size); if (s != 0) handle_error_en(s, "pthread_attr_setstack"); } s = pthread_create(&thr, attrp, &thread_start, NULL); if (s != 0) handle_error_en(s, "pthread_create"); if (attrp != NULL) { s = pthread_attr_destroy(att ... ... char *argv[]) { int s, opt, inheritsched, use_null_attrib, policy; pthread_t thread; pthread_attr_t attr; pthread_attr_t *attrp; char *attr_sched_str, *main_sched_str, *inheritsched_str; struct sched_param param; /* Process command-line options */ us ... ed_attr("Scheduler settings of main thread"); printf("\n"); /* Initialize thread attributes object according to options */ attrp = NULL; if (!use_null_attrib) { s = pthread_attr_init(&attr); if (s != 0) handle_error_en(s, "pthread_attr_init"); attrp = ... ); } /* If we initialized a thread attributes object, display the scheduling attributes that were set in the object */ if (attrp != NULL) { s = pthread_attr_getschedparam(&attr, ¶m); if (s != 0) handle_error_en(s, "pthread_attr_getschedparam"); s ... ... char *argv[]) { int s, opt, inheritsched, use_null_attrib, policy; pthread_t thread; pthread_attr_t attr; pthread_attr_t *attrp; char *attr_sched_str, *main_sched_str, *inheritsched_str; struct sched_param param; /* Process command-line options */ us ... ed_attr("Scheduler settings of main thread"); printf("\n"); /* Initialize thread attributes object according to options */ attrp = NULL; if (!use_null_attrib) { s = pthread_attr_init(&attr); if (s != 0) handle_error_en(s, "pthread_attr_init"); attrp = ... ); } /* If we initialized a thread attributes object, display the scheduling attributes that were set in the object */ if (attrp != NULL) { s = pthread_attr_getschedparam(&attr, ¶m); if (s != 0) handle_error_en(s, "pthread_attr_getschedparam"); s ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。