X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8f6c56a50524aa785f7e596d52dddfb331e18961..4452a7af2eac33dbad800bcc91f2399d62c18f53:/bsd/kern/sysv_shm.c diff --git a/bsd/kern/sysv_shm.c b/bsd/kern/sysv_shm.c index b8dfa9934..37822b44e 100644 --- a/bsd/kern/sysv_shm.c +++ b/bsd/kern/sysv_shm.c @@ -835,12 +835,10 @@ sysv_shm_lock_init( void ) { sysv_shm_subsys_lck_grp_attr = lck_grp_attr_alloc_init(); - lck_grp_attr_setstat(sysv_shm_subsys_lck_grp_attr); sysv_shm_subsys_lck_grp = lck_grp_alloc_init("sysv_shm_subsys_lock", sysv_shm_subsys_lck_grp_attr); sysv_shm_subsys_lck_attr = lck_attr_alloc_init(); - /* lck_attr_setdebug(sysv_shm_subsys_lck_attr); */ lck_mtx_init(&sysv_shm_subsys_mutex, sysv_shm_subsys_lck_grp, sysv_shm_subsys_lck_attr); } @@ -853,14 +851,14 @@ sysctl_shminfo(__unused struct sysctl_oid *oidp, void *arg1, int error = 0; int sysctl_shminfo_ret = 0; - error = SYSCTL_OUT(req, arg1, sizeof(user_ssize_t)); + error = SYSCTL_OUT(req, arg1, sizeof(int64_t)); if (error || req->newptr == USER_ADDR_NULL) return(error); SYSV_SHM_SUBSYS_LOCK(); /* Set the values only if shared memory is not initialised */ if (!shm_inited) { - if ((error = SYSCTL_IN(req, arg1, sizeof(user_ssize_t))) + if ((error = SYSCTL_IN(req, arg1, sizeof(int64_t))) != 0) { sysctl_shminfo_ret = error; goto sysctl_shminfo_out; @@ -868,18 +866,18 @@ sysctl_shminfo(__unused struct sysctl_oid *oidp, void *arg1, if (arg1 == &shminfo.shmmax) { if (shminfo.shmmax & PAGE_MASK_64) { - shminfo.shmmax = (user_ssize_t)-1; + shminfo.shmmax = (int64_t)-1; sysctl_shminfo_ret = EINVAL; goto sysctl_shminfo_out; } } /* Initialize only when all values are set */ - if ((shminfo.shmmax != (user_ssize_t)-1) && - (shminfo.shmmin != (user_ssize_t)-1) && - (shminfo.shmmni != (user_ssize_t)-1) && - (shminfo.shmseg != (user_ssize_t)-1) && - (shminfo.shmall != (user_ssize_t)-1)) { + if ((shminfo.shmmax != (int64_t)-1) && + (shminfo.shmmin != (int64_t)-1) && + (shminfo.shmmni != (int64_t)-1) && + (shminfo.shmseg != (int64_t)-1) && + (shminfo.shmall != (int64_t)-1)) { shminit(NULL); } }