akaros/tests/sleep.c
<<
>>
Prefs
   1#include <stdio.h>
   2#include <stdlib.h>
   3#include <unistd.h>
   4#include <limits.h>
   5
   6int main(int argc, char **argv)
   7{
   8        int sleep_time;
   9
  10        if (argc < 2) {
  11                printf("Usage: %s SEC\n", argv[0]);
  12                exit(-1);
  13        }
  14        sleep_time = atoi(argv[1]);
  15        if (sleep_time < 0)
  16                sleep_time = UINT_MAX;
  17        return sleep(sleep_time);
  18}
  19