#include <stdio.h>
#include <syscall.h>
#include <errno.h>
#include <string.h>

#define __NR_inccount 250
#define __NR_deccount 251
#define __NR_getcount 252

/* If you decided to add the following into a .h file,
   don't forget to guard it by #ifndef __KERNEL and #endif
   so that the kernel code won't get them.
   Otherwise module loading will fail trying to find the errno symbol. */
_syscall0(int, inccount)
_syscall0(int, deccount)
_syscall0(int, getcount)

void printval(int val) {
	printf("%d", val);
	if (val == -1)
		printf(" (Error %d = %s)", errno, strerror(errno));
	printf("\n");
}

int main() {
	printval(getcount());
	printval(deccount());
	printval(inccount());
	printval(deccount());
}

