JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... static void print_elapsed_time(void) { static struct timespec start; struct timespec curr; static int first_call = 1; int secs, nsecs; if (first_call) { first_call = 0; if (clock_gettime(CLOCK_MONOTONIC, &start) == -1) handle_error("clock_gettime"); ... } if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1) handle_error("clock_gettime"); secs = curr.tv_sec - start.tv_sec; nsecs = curr.tv_nsec - start.tv_nsec; if (nsecs < 0) { secs--; nsecs += 1000000000; } printf ... ("%d.%03d: ", secs, (nsecs + 500000) / 1000000); } int main(int argc, char *argv[]) { struct itimerspec new_value; int max_exp, fd; struct ti ... ... static void print_elapsed_time(void) { static struct timespec start; struct timespec curr; static int first_call = 1; int secs, nsecs; if (first_call) { first_call = 0; if (clock_gettime(CLOCK_MONOTONIC, &start) == -1) handle_error("clock_gettime"); ... } if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1) handle_error("clock_gettime"); secs = curr.tv_sec - start.tv_sec; nsecs = curr.tv_nsec - start.tv_nsec; if (nsecs < 0) { secs--; nsecs += 1000000000; } printf ... ("%d.%03d: ", secs, (nsecs + 500000) / 1000000); } int main(int argc, char *argv[]) { struct itimerspec new_value; int max_exp, fd; struct ti ... ... static void print_elapsed_time(void) { static struct timespec start; struct timespec curr; static int first_call = 1; int secs, nsecs; if (first_call) { first_call = 0; if (clock_gettime(CLOCK_MONOTONIC, &start) == -1) handle_error("clock_gettime"); ... } if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1) handle_error("clock_gettime"); secs = curr.tv_sec - start.tv_sec; nsecs = curr.tv_nsec - start.tv_nsec; if (nsecs < 0) { secs--; nsecs += 1000000000; } printf ... ("%d.%03d: ", secs, (nsecs + 500000) / 1000000); } int main(int argc, char *argv[]) { struct itimerspec new_value; int max_exp, fd; struct ti ... ... --max-consecutive-size-changes= NUMBER ] [ --max-unchanged-stats= NUMBER ] [ --pid= PID ] [ --retry ] [ --sleep-interval= SECS ] [ --quiet ] [ --silent ] [ --verbose ] [ FILE... ] tail [ --help ] [ --version ] 説明 tail は引数に与えられた FILE それぞ ... このオプションを指定しなければ、 tail は単にファイルが存在しないことを報告して以降のチェックを行わない。 --sleep-interval= SECS 追跡しているファイルのチェックを SECS 秒ごとに行う (デフォルトは 1 秒)。 --help 標準出力に使用方法のメッセージを出力して正 ... ... なかった (つまり、 セマフォの現在の値が 0 であった)。 sem_timedwait () の場合、以下のエラーも起こる。 EINVAL abs_timeout.tv_nsecs の値が 0 未満、もしくは 1,000,000,000 以上である。 ETIMEDOUT セマフォのロックに成功する前に時間切れとなった。 属性 この節で ... t argc, char *argv[]) { struct sigaction sa; struct timespec ts; int s; if (argc != 3) { fprintf(stderr, "Usage: %s <alarm-secs> <wait-secs>\n", argv[0]); exit(EXIT_FAILURE); } if (sem_init(&sem, 0, 0) == -1) handle_error("sem_init"); /* Establish SI ... ... なかった (つまり、 セマフォの現在の値が 0 であった)。 sem_timedwait () の場合、以下のエラーも起こる。 EINVAL abs_timeout.tv_nsecs の値が 0 未満、もしくは 1,000,000,000 以上である。 ETIMEDOUT セマフォのロックに成功する前に時間切れとなった。 属性 この節で ... t argc, char *argv[]) { struct sigaction sa; struct timespec ts; int s; if (argc != 3) { fprintf(stderr, "Usage: %s <alarm-secs> <wait-secs>\n", argv[0]); exit(EXIT_FAILURE); } if (sem_init(&sem, 0, 0) == -1) handle_error("sem_init"); /* Establish SI ... ... なかった (つまり、 セマフォの現在の値が 0 であった)。 sem_timedwait () の場合、以下のエラーも起こる。 EINVAL abs_timeout.tv_nsecs の値が 0 未満、もしくは 1,000,000,000 以上である。 ETIMEDOUT セマフォのロックに成功する前に時間切れとなった。 属性 この節で ... t argc, char *argv[]) { struct sigaction sa; struct timespec ts; int s; if (argc != 3) { fprintf(stderr, "Usage: %s <alarm-secs> <wait-secs>\n", argv[0]); exit(EXIT_FAILURE); } if (sem_init(&sem, 0, 0) == -1) handle_error("sem_init"); /* Establish SI ... ... .h > #include < stdint.h > #include < stdio.h > #include < stdlib.h > #include < sys/types.h > #include < time.h > #define SECS_IN_DAY (24 * 60 * 60) static void displayClock(clockid_t clock, const char *name, bool showRes) { long days; struct timesp ... exit(EXIT_FAILURE); } printf("%-15s: %10jd.%03ld (", name, (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000); days = ts.tv_sec / SECS_IN_DAY; if (days > 0) printf("%ld days + ", days); printf("%2dh %2dm %2ds", (int) (ts.tv_sec % SECS_IN_DAY) / 3600, (int) ... ... .h > #include < stdint.h > #include < stdio.h > #include < stdlib.h > #include < sys/types.h > #include < time.h > #define SECS_IN_DAY (24 * 60 * 60) static void displayClock(clockid_t clock, const char *name, bool showRes) { long days; struct timesp ... exit(EXIT_FAILURE); } printf("%-15s: %10jd.%03ld (", name, (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000); days = ts.tv_sec / SECS_IN_DAY; if (days > 0) printf("%ld days + ", days); printf("%2dh %2dm %2ds", (int) (ts.tv_sec % SECS_IN_DAY) / 3600, (int) ... ... .h > #include < stdint.h > #include < stdio.h > #include < stdlib.h > #include < sys/types.h > #include < time.h > #define SECS_IN_DAY (24 * 60 * 60) static void displayClock(clockid_t clock, const char *name, bool showRes) { long days; struct timesp ... exit(EXIT_FAILURE); } printf("%-15s: %10jd.%03ld (", name, (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000); days = ts.tv_sec / SECS_IN_DAY; if (days > 0) printf("%ld days + ", days); printf("%2dh %2dm %2ds", (int) (ts.tv_sec % SECS_IN_DAY) / 3600, (int) ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。