Lines Matching defs:uap

121 static int oshmctl(void *p, void *uap, void *retval);
122 static int shmget_allocate_segment(struct proc *p, struct shmget_args *uap, int mode, int * retval);
123 static int shmget_existing(struct shmget_args *uap, int mode, int segnum, int * retval);
311 shmdt(struct proc *p, struct shmdt_args *uap, int32_t *retval)
320 AUDIT_ARG(svipc_addr, uap->shmaddr);
335 shmmap_s->va == (mach_vm_offset_t)uap->shmaddr)
362 shmat(struct proc *p, struct shmat_args *uap, user_addr_t *retval)
379 AUDIT_ARG(svipc_id, uap->shmid);
380 AUDIT_ARG(svipc_addr, uap->shmaddr);
401 shmseg = shm_find_segment_by_shmid(uap->shmid);
409 (uap->shmflg & SHM_RDONLY) ? IPC_R : IPC_R|IPC_W);
416 error = mac_sysvshm_check_shmat(kauth_cred_get(), shmseg, uap->shmflg);
434 if ((uap->shmflg & SHM_RDONLY) == 0)
437 if (uap->shmaddr)
440 attach_va = (mach_vm_address_t)uap->shmaddr;
441 if (uap->shmflg & SHM_RND)
498 shmmap_s->shmid = uap->shmid;
529 oshmctl(__unused void *p, __unused void *uap, __unused void *retval)
543 shmctl(__unused struct proc *p, struct shmctl_args *uap, int32_t *retval)
552 AUDIT_ARG(svipc_cmd, uap->cmd);
553 AUDIT_ARG(svipc_id, uap->shmid);
561 shmseg = shm_find_segment_by_shmid(uap->shmid);
573 error = mac_sysvshm_check_shmctl(cred, shmseg, uap->cmd);
579 switch (uap->cmd) {
588 error = copyout((caddr_t)&shmseg->u, uap->buf, sizeof(struct user_shmid_ds));
592 error = copyout(&shmid_ds32, uap->buf, sizeof(shmid_ds32));
606 error = copyin(uap->buf, &inbuf, sizeof(struct user_shmid_ds));
609 error = copyin(uap->buf, &shmid_ds32, sizeof(shmid_ds32));
634 shm_last_free = IPCID_TO_IX(uap->shmid);
653 shmget_existing(struct shmget_args *uap, int mode, int segnum, int *retval)
684 error = mac_sysvshm_check_shmget(kauth_cred_get(), shmseg, uap->shmflg);
689 if (uap->size && uap->size > shmseg->u.shm_segsz)
692 if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL))
700 shmget_allocate_segment(struct proc *p, struct shmget_args *uap, int mode,
712 if (uap->size < (user_size_t)shminfo.shmmin ||
713 uap->size > (user_size_t)shminfo.shmmax)
717 total_size = mach_vm_round_page(uap->size);
739 shmseg->u.shm_perm._key = uap->key;
780 shmseg->u.shm_segsz = uap->size;
827 shmget(struct proc *p, struct shmget_args *uap, int32_t *retval)
840 mode = uap->shmflg & ACCESSPERMS;
841 if (uap->key != IPC_PRIVATE) {
843 segnum = shm_find_segment_by_key(uap->key);
845 error = shmget_existing(uap, mode, segnum, retval);
851 if ((uap->shmflg & IPC_CREAT) == 0) {
856 shmget_ret = shmget_allocate_segment(p, uap, mode, retval);
870 * uap User argument descriptor (see below)
873 * Indirect parameters: uap->which msg call to invoke (index in array of shm calls)
874 * uap->a2 User argument descriptor
886 shmsys(struct proc *p, struct shmsys_args *uap, int32_t *retval)
891 if (uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0]))
893 return ((*shmcalls[uap->which])(p, &uap->a2, retval));