JM Project

JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。

Linux マニュアル 一覧

全文・高度検索

per page, with , order by , clip by
Results of 1 - 10 of about 383 for main (0.002 sec.)
Man page of MAKECONTEXT 11023
MAKECONTEXT Section: Linux Programmer's Manual (3) Updated: 2020-12-21 Index JM Home Page 名前 makecontext, swapcontext - ユーザーコンテキストを操作する 書式 #include < ucontext.h > void makecontext(ucontext_t * ucp , void (* func )(), int ... text (), swapcontext () の使用方法の例を示すものである。 このプログラムを実行すると、以下のような出力が得られる: $ ./a.out main: swapcontext(&uctx_main, &uctx_func2) func2: started func2: swapcontext(&uctx_func2, &uctx_func1) func1: started func1: sw ... apcontext(&uctx_func1, &uctx_func2) func2: returning func1: returning main: exiting プログラムのソース #include < ucontext.h > #include < stdio.h > #include < stdlib.h > static ucontext_t uctx_main ... c1)\n"); if (swapcontext(&uctx_func2, &uctx_func1) == -1) handle_error("swapcontext"); printf("func2: returning\n"); } int main(int argc, char *argv[]) { char func1_stack[16384]; char func2_stack[16384]; if (getcontext(&uctx_func1) == -1) handle_erro ...
https://man.mtool.work/man/20260915/man3/makecontext.3.html
Man page of PTHREAD_GETCPUCLOCKID 11023
PTHREAD_GETCPUCLOCKID Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 pthread_getcpuclockid - スレッドの CPU 時間時計の ID を取得する 書式 #include < pthread.h > #include < time.h > int pthread_getcpuclock ... (3) を使って 2 つのスレッドが消費した スレッド毎の CPU 時間を取得する。 下記のシェルのセッションは実行例である。 $ ./a.out Main thread sleeping Subthread starting infinite loop Main thread consuming some CPU time... Process total CPU time: 1.368 Main ... (cid, &ts) == -1) handle_error("clock_gettime"); printf("%4jd.%03ld\n", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000); } int main(int argc, char *argv[]) { pthread_t thread; clockid_t cid; int s; s = pthread_create(&thread, NULL, thread_start, NULL); i ... f (s != 0) handle_error_en(s, "pthread_create"); printf("Main thread sleeping\n"); sleep (1); printf("Main thread consuming some CPU time...\n"); for (int j = 0; j < 2000000; j++) getp ...
https://man.mtool.work/man/20260915/man3/pthread_getcpuclockid.3.html
Man page of MAKECONTEXT 11023
MAKECONTEXT Section: Linux Programmer's Manual (3) Updated: 2020-12-21 Index JM Home Page 名前 makecontext, swapcontext - ユーザーコンテキストを操作する 書式 #include < ucontext.h > void makecontext(ucontext_t * ucp , void (* func )(), int ... text (), swapcontext () の使用方法の例を示すものである。 このプログラムを実行すると、以下のような出力が得られる: $ ./a.out main: swapcontext(&uctx_main, &uctx_func2) func2: started func2: swapcontext(&uctx_func2, &uctx_func1) func1: started func1: sw ... apcontext(&uctx_func1, &uctx_func2) func2: returning func1: returning main: exiting プログラムのソース #include < ucontext.h > #include < stdio.h > #include < stdlib.h > static ucontext_t uctx_main ... c1)\n"); if (swapcontext(&uctx_func2, &uctx_func1) == -1) handle_error("swapcontext"); printf("func2: returning\n"); } int main(int argc, char *argv[]) { char func1_stack[16384]; char func2_stack[16384]; if (getcontext(&uctx_func1) == -1) handle_erro ...
https://man.mtool.work/man/20260915/man3/swapcontext.3.html
Man page of PTHREAD_SETSCHEDPARAM 10622
PTHREAD_SETSCHEDPARAM Section: Linux Programmer's Manual (3) Updated: 2020-06-09 Index JM Home Page 名前 pthread_setschedparam, pthread_getschedparam - スレッドの スケジューリングポリシーとパラメーターを設定/取得する 書式 #include < pthread ... する。 $ su # Need privilege to set real-time scheduling policies Password: # ./a.out -mf10 -ar20 -i e Scheduler settings of main thread policy=SCHED_FIFO, priority=10 Scheduler settings in 'attr' policy=SCHED_RR, priority=20 inheritsched is EXPLICIT S ... わりに呼び出したスレッドからスケジューリング属性を取得する ことを意味する。 # ./a.out -mf10 -ar20 -i i Scheduler settings of main thread policy=SCHED_FIFO, priority=10 Scheduler settings in 'attr' policy=SCHED_RR, priority=20 inheritsched is INHERIT Sc ... ttribute to\n"); fpe(" 'explicit' or 'inherit'\n"); fpe("-m<policy><prio> Set scheduling policy and priority on\n"); fpe(" main thread before pthread_create() call\n"); exit(EXIT_FAILURE); } static int get_policy(char p, int *policy) { switch (p) { c ...
https://man.mtool.work/man/20260915/man3/pthread_getschedparam.3.html
Man page of PTHREAD_SETSCHEDPARAM 10622
PTHREAD_SETSCHEDPARAM Section: Linux Programmer's Manual (3) Updated: 2020-06-09 Index JM Home Page 名前 pthread_setschedparam, pthread_getschedparam - スレッドの スケジューリングポリシーとパラメーターを設定/取得する 書式 #include < pthread ... する。 $ su # Need privilege to set real-time scheduling policies Password: # ./a.out -mf10 -ar20 -i e Scheduler settings of main thread policy=SCHED_FIFO, priority=10 Scheduler settings in 'attr' policy=SCHED_RR, priority=20 inheritsched is EXPLICIT S ... わりに呼び出したスレッドからスケジューリング属性を取得する ことを意味する。 # ./a.out -mf10 -ar20 -i i Scheduler settings of main thread policy=SCHED_FIFO, priority=10 Scheduler settings in 'attr' policy=SCHED_RR, priority=20 inheritsched is INHERIT Sc ... ttribute to\n"); fpe(" 'explicit' or 'inherit'\n"); fpe("-m<policy><prio> Set scheduling policy and priority on\n"); fpe(" main thread before pthread_create() call\n"); exit(EXIT_FAILURE); } static int get_policy(char p, int *policy) { switch (p) { c ...
https://man.mtool.work/man/20260915/man3/pthread_setschedparam.3.html
Man page of PTHREAD_CANCEL 7853
PTHREAD_CANCEL Section: Linux Programmer's Manual (3) Updated: 2020-06-09 Index JM Home Page 名前 pthread_cancel - スレッドにキャンセル要求を送る 書式 #include < pthread.h > int pthread_cancel(pthread_t thread ); -pthread でコンパイルしてリ ... 。以下のシェルセッションはこのプログラムを実行した際の実行例である。 $ ./a.out thread_func(): started; cancellation disabled main(): sending cancellation request thread_func(): about to enable cancellation main(): thread was canceled プログラムのソース ... ld get canceled while we sleep */ /* Should never get here */ printf("thread_func(): not canceled!\n"); return NULL; } int main(void) { pthread_t thr; void *res; int s; /* Start a thread and then send it a cancellation request */ s = pthread_create(& ... unc, NULL); if (s != 0) handle_error_en(s, "pthread_create"); sleep (2); /* Give thread a chance to get started */ printf("main(): sending cancellation request\n"); s = pthread_cancel(thr); if (s != 0) handle_error_en(s, "pthread_cancel"); /* Join wi ...
https://man.mtool.work/man/20260915/man3/pthread_cancel.3.html
Man page of PTHREAD_SIGMASK 6399
PTHREAD_SIGMASK Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 pthread_sigmask - 禁止するシグナルマスクの確認と変更を行う 書式 #include < signal.h > int pthread_sigmask(int how , const sigset_t * set , si ... wait(set, &sig); if (s != 0) handle_error_en(s, "sigwait"); printf("Signal handling thread got signal %d\n", sig); } } int main(int argc, char *argv[]) { pthread_t thread; sigset_t set; int s; /* Block SIGQUIT and SIGUSR1; other threads created by ma ... read_sigmask"); s = pthread_create(&thread, NULL, &sig_thread, &set); if (s != 0) handle_error_en(s, "pthread_create"); /* Main thread carries on to create other threads and/or do other work */ pause(); /* Dummy pause so we can test program */ } 関連 ...
https://man.mtool.work/man/20260915/man3/pthread_sigmask.3.html
Man page of EXECVE 6269
EXECVE Section: Linux Programmer's Manual (2) Updated: 2020-08-13 Index JM Home Page 名前 execve - プログラムを実行する 書式 #include < unistd.h > int execve(const char * pathname , char *const argv [], char *const envp []); 説明 execve () ... envp array must be terminated by a NULL pointer. The argument vector and environment can be accessed by the new program's main function, when it is defined as: int main(int argc, char *argv[], char *envp[]) Note, however, that the use of a third arg ... ument to the main function is not specified in POSIX.1; according to POSIX.1, the environment should be accessed via the external variable e ... (2)) that is in force at the time of the execve () call. (Architectures with no memory management unit are excepted: they maintain the limit that was in effect before kernel 2.6.23.) This change allows programs to have a much larger argument and/or ...
https://man.mtool.work/man/20260915/man2/execve.2.html
Man page of MALLOC_INFO 6269
MALLOC_INFO Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 malloc_info - malloc の状態をストリームに出力する 書式 #include < malloc.h > int malloc_info(int options , FILE * stream ); 説明 malloc_info () 関 ... c void * thread_func(void *arg) { int tn = (int) arg; /* The multiplier '(2 + tn)' ensures that each thread (including the main thread) allocates a different amount of memory */ for (int j = 0; j < numBlocks; j++) if (malloc(blockSize * (2 + tn)) == ... NULL) errExit("malloc-thread"); sleep(100); /* Sleep until main thread terminates */ return NULL; } int main(int argc, char *argv[]) { int sleepTime; if (argc < 4) { fprintf(stderr, "%s ... xes, and therefore additional arenas won't be allocated (see malloc (3)). */ if (sleepTime > 0) sleep(sleepTime); } /* The main thread also allocates some memory */ for (int j = 0; j < numBlocks; j++) if (malloc(blockSize) == NULL) errExit("malloc"); ...
https://man.mtool.work/man/20260915/man3/malloc_info.3.html
Man page of MALLOC_TRIM 5868
MALLOC_TRIM Section: Linux Programmer's Manual (3) Updated: 2020-08-13 Index JM Home Page 名前 malloc_trim - ヒープから未使用メモリーを解放する 書式 #include < malloc.h > int malloc_trim(size_t pad ); 説明 malloc_trim () 関数は (適切な引数で ... 特定の状況では free (3) により自動的に呼び出される。 mallopt (3) の M_TOP_PAD と M_TRIM_THRESHOLD の議論を参照。 Only the main heap (using sbrk (2)) honors the pad argument; thread heaps do not. Since glibc 2.8 this function frees memory in all aren ... as and in all chunks with whole free pages. Before glibc 2.8 this function only freed memory at the top of the heap in the main arena. 関連項目 sbrk (2), malloc (3), mallopt (3) この文書について この man ページは Linux man-pages プロジェクトのリリース ...
https://man.mtool.work/man/20260915/man3/malloc_trim.3.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT

リンク

日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。