Changes in uspace/lib/c/generic/cap.c [6b10dab:63f8966] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/cap.c
r6b10dab r63f8966 31 31 */ 32 32 /** 33 * @file 34 * @brief 33 * @file cap.c 34 * @brief Functions to grant/revoke capabilities to/from a task. 35 35 */ 36 36 … … 38 38 #include <task.h> 39 39 #include <libc.h> 40 #include <kernel/syscall/sysarg64.h> 40 41 41 42 /** Grant capabilities to a task. 42 43 * 43 * @param id 44 * @param id Destination task ID. 44 45 * @param caps Capabilities to grant. 45 46 * 46 47 * @return Zero on success or a value from @ref errno.h on failure. 47 *48 48 */ 49 49 int cap_grant(task_id_t id, unsigned int caps) 50 50 { 51 #ifdef __32_BITS__ 52 sysarg64_t arg = (sysarg64_t) id; 51 sysarg64_t arg; 52 53 arg.value = (unsigned long long) id; 54 53 55 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps); 54 #endif55 56 #ifdef __64_BITS__57 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) id, (sysarg_t) caps);58 #endif59 56 } 60 57 61 58 /** Revoke capabilities from a task. 62 59 * 63 * @param id 60 * @param id Destination task ID. 64 61 * @param caps Capabilities to revoke. 65 62 * 66 63 * @return Zero on success or a value from @ref errno.h on failure. 67 *68 64 */ 69 65 int cap_revoke(task_id_t id, unsigned int caps) 70 66 { 71 #ifdef __32_BITS__ 72 sysarg64_t arg = (sysarg64_t) id; 67 sysarg64_t arg; 68 69 arg.value = (unsigned long long) id; 70 73 71 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps); 74 #endif75 76 #ifdef __64_BITS__77 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) id, (sysarg_t) caps);78 #endif79 72 } 80 73
Note:
See TracChangeset
for help on using the changeset viewer.