JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... include < stdlib.h > #include < pthread.h > #include < malloc.h > #include < errno.h > static size_t blockSize; static int numThreads, numBlocks; #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ } while (0) static void * thread_func(void *arg) ... me; if (argc < 4) { fprintf(stderr, "%s num-threads num-blocks block-size [sleep-time]\n", argv[0]); exit(EXIT_FAILURE); } numThreads = atoi(argv[1]); numBlocks = atoi(argv[2]); blockSize = atoi(argv[3]); sleepTime = (argc > 4) ? atoi(argv[4]) : 0; pthread ... _t *thr = calloc(numThreads, sizeof(*thr)); if (thr == NULL) errExit("calloc"); printf("============ Before allocating blocks ============\n"); malloc ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。