diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/litmus.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/litmus.c b/src/litmus.c index b32254b..e0d9253 100644 --- a/src/litmus.c +++ b/src/litmus.c | |||
@@ -3,7 +3,10 @@ | |||
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <signal.h> | 5 | #include <signal.h> |
6 | #include <fcntl.h> | ||
6 | #include <sys/mman.h> | 7 | #include <sys/mman.h> |
8 | #include <sys/types.h> | ||
9 | |||
7 | 10 | ||
8 | #include <sched.h> /* for cpu sets */ | 11 | #include <sched.h> /* for cpu sets */ |
9 | 12 | ||
@@ -49,6 +52,23 @@ const char* name_for_lock_protocol(int id) | |||
49 | return "<UNKNOWN>"; | 52 | return "<UNKNOWN>"; |
50 | } | 53 | } |
51 | 54 | ||
55 | int litmus_open_lock( | ||
56 | obj_type_t protocol, | ||
57 | int lock_id, | ||
58 | const char* namespace, | ||
59 | void *config_param) | ||
60 | { | ||
61 | int fd, od; | ||
62 | |||
63 | fd = open(namespace, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); | ||
64 | if (fd < 0) | ||
65 | return -1; | ||
66 | od = od_openx(fd, protocol, lock_id, config_param); | ||
67 | close(fd); | ||
68 | return od; | ||
69 | } | ||
70 | |||
71 | |||
52 | 72 | ||
53 | void show_rt_param(struct rt_task* tp) | 73 | void show_rt_param(struct rt_task* tp) |
54 | { | 74 | { |