aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-12-16 05:35:23 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-12-16 05:35:23 -0500
commit54dfe4289fd1b9b41f05fca6371c320e6cea35b8 (patch)
treeaff4e024eac5279678cf7836a776a2bb7a0c9ba6 /src
parent68849a8cd97718109dce1e548b099239376f3f2e (diff)
Implement get_job_no() via control page
Diffstat (limited to 'src')
-rw-r--r--src/syscalls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/syscalls.c b/src/syscalls.c
index 0ee1a80..0950ca6 100644
--- a/src/syscalls.c
+++ b/src/syscalls.c
@@ -9,6 +9,7 @@
9#include <unistd.h> 9#include <unistd.h>
10 10
11#include "litmus.h" 11#include "litmus.h"
12#include "internal.h"
12 13
13/* Syscall stub for setting RT mode and scheduling options */ 14/* Syscall stub for setting RT mode and scheduling options */
14 15
@@ -54,7 +55,13 @@ int litmus_unlock(int od)
54 55
55int get_job_no(unsigned int *job_no) 56int get_job_no(unsigned int *job_no)
56{ 57{
57 return syscall(__NR_query_job_no, job_no); 58 struct control_page* cp = get_ctrl_page();
59 if (likely(cp != NULL)) {
60 *job_no = cp->job_index;
61 return 0;
62 } else {
63 return -1;
64 }
58} 65}
59 66
60int wait_for_job_release(unsigned int job_no) 67int wait_for_job_release(unsigned int job_no)