2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

test: Add test-counter test

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2011-11-21 21:25:43 +04:00
parent af4eb76bb0
commit 37e73d6a1d
2 changed files with 37 additions and 0 deletions

View File

@@ -1 +1,19 @@
SRCS += test-counter.c
OBJS := $(patsubst %.c,%.o,$(SRCS))
PROGS := $(patsubst %.c,%,$(SRCS))
all: $(PROGS)
$(PROGS): $(OBJS)
$(E) " LINK " $@
$(Q) $(CC) $< -o $@
%.o: %.c
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $< -o $@
clean:
$(Q) $(RM) -f ./*.o
$(Q) $(RM) -f ./$(PROGS)
.PHONY: clean

19
test/test-counter.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main(int argc, char *argv[])
{
int counter = 0;
while (1) {
printf("Pid: %10d Counter: %10d\n",
getpid(), counter++);
sleep(3);
}
return 0;
}