Skip to content
Snippets Groups Projects
Commit 4d4ab1a7 authored by Paul Sajna's avatar Paul Sajna
Browse files

fix and test

parent e99857d1
No related branches found
No related tags found
No related merge requests found
typedef struct {
time_t tv_sec;
long tv_nsec;
} timespec;
......@@ -24,4 +24,12 @@ typedef long time_t;
typedef int useconds_t;
typedef long suseconds_t;
typedef long clock_t;
typedef int clockid_t;
typedef void* timer_t;
#endif /* _SYS_TYPES_H */
sys_includes = ["sys/types.h"]
sys_includes = ["sys/types.h", "bits/timespec.h", "stdint.h"]
include_guard = "_TIME_H"
language = "C"
......
......@@ -20,7 +20,10 @@
/link
/link.out
/math
/setid
/sleep
/pipe
/printf
/rmdir
/unlink
/write
......@@ -19,6 +19,7 @@ BINS=\
rmdir \
pipe \
printf \
sleep \
write
all: $(BINS)
......@@ -28,7 +29,7 @@ clean:
run: $(BINS)
for bin in $(BINS); \
do
do \
echo "# $${bin} #"; \
"./$${bin}" test args; \
done
......
#include <time.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char** argv) {
sleep(2);
perror("sleep");
usleep(1000);
perror("usleep");
timespec tm = {0, 10000};
nanosleep(&tm, NULL);
perror("nanosleep");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment