/* eventSig.c * * Call the eventSig system call implemented in the waitQ module. * Pass the event number. If the event is defined (1,2,3 are pre-defined) * then this should wake up the task issuing the wait system call on that * event number (if any). * * Use the existing unused system calls. * eventWait is sched_setaffinity 241 * eventSig is sched_getaffinity 242 * */ /* Standard include files for syscall, see man syscall */ #include #include #include /* for printf */ #include /* for atoi */ int main(int argc, char **argv) { int i,n,eventId; if (argc != 2) { printf("Usage: ./eventSig eventIdint\n"); return -1; } printf("eventSig - calling my_syscall 242\n"); for (i = 1; i < argc; i++) { eventId = atoi(argv[i]); if (!eventId) { printf("Invalid event Id: %d\n",eventId); return -1; } printf("eventSig %d\n", eventId); n = syscall(__NR_sched_getaffinity, eventId); } printf("eventSig - returned: %d\n",n); printf("eventSig - Done.\n"); return 0; }