Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/security/perm.c

    r719a208 ra53ed3a  
    8484 *
    8585 */
    86 static sysarg_t perm_grant(task_id_t taskid, perm_t perms)
     86static errno_t perm_grant(task_id_t taskid, perm_t perms)
    8787{
    8888        if (!(perm_get(TASK) & PERM_PERM))
    89                 return (sysarg_t) EPERM;
     89                return EPERM;
    9090       
    9191        irq_spinlock_lock(&tasks_lock, true);
     
    9494        if ((!task) || (!container_check(CONTAINER, task->container))) {
    9595                irq_spinlock_unlock(&tasks_lock, true);
    96                 return (sysarg_t) ENOENT;
     96                return ENOENT;
    9797        }
    9898       
     
    102102       
    103103        irq_spinlock_unlock(&tasks_lock, true);
    104         return 0;
     104        return EOK;
    105105}
    106106
     
    116116 *
    117117 */
    118 static sysarg_t perm_revoke(task_id_t taskid, perm_t perms)
     118static errno_t perm_revoke(task_id_t taskid, perm_t perms)
    119119{
    120120        irq_spinlock_lock(&tasks_lock, true);
     
    123123        if ((!task) || (!container_check(CONTAINER, task->container))) {
    124124                irq_spinlock_unlock(&tasks_lock, true);
    125                 return (sysarg_t) ENOENT;
     125                return ENOENT;
    126126        }
    127127       
     
    136136                irq_spinlock_unlock(&TASK->lock, false);
    137137                irq_spinlock_unlock(&tasks_lock, true);
    138                 return (sysarg_t) EPERM;
     138                return EPERM;
    139139        }
    140140       
     
    143143       
    144144        irq_spinlock_unlock(&tasks_lock, true);
    145         return 0;
     145        return EOK;
    146146}
    147147
     
    158158 *
    159159 */
    160 sysarg_t sys_perm_grant(sysarg64_t *uspace_taskid, perm_t perms)
     160sys_errno_t sys_perm_grant(sysarg64_t *uspace_taskid, perm_t perms)
    161161{
    162162        sysarg64_t taskid;
    163         int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
    164         if (rc != 0)
    165                 return (sysarg_t) rc;
     163        errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
     164        if (rc != EOK)
     165                return (sys_errno_t) rc;
    166166       
    167167        return perm_grant((task_id_t) taskid, perms);
     
    179179 *
    180180 */
    181 sysarg_t sys_perm_revoke(sysarg64_t *uspace_taskid, perm_t perms)
     181sys_errno_t sys_perm_revoke(sysarg64_t *uspace_taskid, perm_t perms)
    182182{
    183183        sysarg64_t taskid;
    184         int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
    185         if (rc != 0)
    186                 return (sysarg_t) rc;
     184        errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
     185        if (rc != EOK)
     186                return (sys_errno_t) rc;
    187187       
    188188        return perm_revoke((task_id_t) taskid, perms);
     
    203203 *
    204204 */
    205 sysarg_t sys_perm_grant(sysarg_t taskid, perm_t perms)
     205sys_errno_t sys_perm_grant(sysarg_t taskid, perm_t perms)
    206206{
    207207        return perm_grant((task_id_t) taskid, perms);
     
    219219 *
    220220 */
    221 sysarg_t sys_perm_revoke(sysarg_t taskid, perm_t perms)
     221sys_errno_t sys_perm_revoke(sysarg_t taskid, perm_t perms)
    222222{
    223223        return perm_revoke((task_id_t) taskid, perms);
Note: See TracChangeset for help on using the changeset viewer.