- case PROC_PIDLISTFDS:
- size = PROC_PIDLISTFD_SIZE;
- if (buffer == (user_addr_t)0)
- size = 0;
- break;
- case PROC_PIDTBSDINFO:
- size = PROC_PIDTBSDINFO_SIZE;
- break;
- case PROC_PIDTASKINFO:
- size = PROC_PIDTASKINFO_SIZE;
- break;
- case PROC_PIDTASKALLINFO:
- size = PROC_PIDTASKALLINFO_SIZE;
- break;
- case PROC_PIDTHREADINFO:
- size = PROC_PIDTHREADINFO_SIZE;
- break;
- case PROC_PIDLISTTHREADS:
- size = PROC_PIDLISTTHREADS_SIZE;
- break;
- case PROC_PIDREGIONINFO:
- size = PROC_PIDREGIONINFO_SIZE;
- break;
- case PROC_PIDREGIONPATHINFO:
- size = PROC_PIDREGIONPATHINFO_SIZE;
- break;
- case PROC_PIDVNODEPATHINFO:
- size = PROC_PIDVNODEPATHINFO_SIZE;
- break;
- case PROC_PIDTHREADPATHINFO:
- size = PROC_PIDTHREADPATHINFO_SIZE;
- break;
- case PROC_PIDPATHINFO:
- size = MAXPATHLEN;
- break;
- case PROC_PIDWORKQUEUEINFO:
- /* kernel does not have workq info */
- if (pid == 0)
- return(EINVAL);
- else
- size = PROC_PIDWORKQUEUEINFO_SIZE;
- break;
- case PROC_PIDT_SHORTBSDINFO:
- size = PROC_PIDT_SHORTBSDINFO_SIZE;
- break;
- case PROC_PIDLISTFILEPORTS:
- size = PROC_PIDLISTFILEPORTS_SIZE;
- if (buffer == (user_addr_t)0)
- size = 0;
- break;
- case PROC_PIDTHREADID64INFO:
- size = PROC_PIDTHREADID64INFO_SIZE;
- break;
- case PROC_PIDUNIQIDENTIFIERINFO:
- size = PROC_PIDUNIQIDENTIFIERINFO_SIZE;
- break;
- case PROC_PIDT_BSDINFOWITHUNIQID:
- size = PROC_PIDT_BSDINFOWITHUNIQID_SIZE;
- break;
- case PROC_PIDARCHINFO:
- size = PROC_PIDARCHINFO_SIZE;
- break;
- case PROC_PIDCOALITIONINFO:
- size = PROC_PIDCOALITIONINFO_SIZE;
- break;
- case PROC_PIDNOTEEXIT:
- /*
- * Set findzomb explicitly because arg passed
- * in is used as note exit status bits.
- */
- size = PROC_PIDNOTEEXIT_SIZE;
- findzomb = 1;
- break;
- case PROC_PIDREGIONPATHINFO2:
- size = PROC_PIDREGIONPATHINFO2_SIZE;
- break;
- case PROC_PIDREGIONPATHINFO3:
- size = PROC_PIDREGIONPATHINFO3_SIZE;
- break;
- default:
- return(EINVAL);
+ case PROC_PIDLISTFDS:
+ size = PROC_PIDLISTFD_SIZE;
+ if (buffer == USER_ADDR_NULL) {
+ size = 0;
+ }
+ break;
+ case PROC_PIDTBSDINFO:
+ size = PROC_PIDTBSDINFO_SIZE;
+ break;
+ case PROC_PIDTASKINFO:
+ size = PROC_PIDTASKINFO_SIZE;
+ break;
+ case PROC_PIDTASKALLINFO:
+ size = PROC_PIDTASKALLINFO_SIZE;
+ break;
+ case PROC_PIDTHREADINFO:
+ size = PROC_PIDTHREADINFO_SIZE;
+ break;
+ case PROC_PIDLISTTHREADIDS:
+ size = PROC_PIDLISTTHREADIDS_SIZE;
+ break;
+ case PROC_PIDLISTTHREADS:
+ size = PROC_PIDLISTTHREADS_SIZE;
+ break;
+ case PROC_PIDREGIONINFO:
+ size = PROC_PIDREGIONINFO_SIZE;
+ break;
+ case PROC_PIDREGIONPATHINFO:
+ size = PROC_PIDREGIONPATHINFO_SIZE;
+ break;
+ case PROC_PIDVNODEPATHINFO:
+ size = PROC_PIDVNODEPATHINFO_SIZE;
+ break;
+ case PROC_PIDTHREADPATHINFO:
+ size = PROC_PIDTHREADPATHINFO_SIZE;
+ break;
+ case PROC_PIDPATHINFO:
+ size = MAXPATHLEN;
+ break;
+ case PROC_PIDWORKQUEUEINFO:
+ /* kernel does not have workq info */
+ if (pid == 0) {
+ return EINVAL;
+ } else {
+ size = PROC_PIDWORKQUEUEINFO_SIZE;
+ }
+ break;
+ case PROC_PIDT_SHORTBSDINFO:
+ size = PROC_PIDT_SHORTBSDINFO_SIZE;
+ break;
+ case PROC_PIDLISTFILEPORTS:
+ size = PROC_PIDLISTFILEPORTS_SIZE;
+ if (buffer == (user_addr_t)0) {
+ size = 0;
+ }
+ break;
+ case PROC_PIDTHREADID64INFO:
+ size = PROC_PIDTHREADID64INFO_SIZE;
+ break;
+ case PROC_PIDUNIQIDENTIFIERINFO:
+ size = PROC_PIDUNIQIDENTIFIERINFO_SIZE;
+ break;
+ case PROC_PIDT_BSDINFOWITHUNIQID:
+ size = PROC_PIDT_BSDINFOWITHUNIQID_SIZE;
+ break;
+ case PROC_PIDARCHINFO:
+ size = PROC_PIDARCHINFO_SIZE;
+ break;
+ case PROC_PIDCOALITIONINFO:
+ size = PROC_PIDCOALITIONINFO_SIZE;
+ break;
+ case PROC_PIDNOTEEXIT:
+ /*
+ * Set findzomb explicitly because arg passed
+ * in is used as note exit status bits.
+ */
+ size = PROC_PIDNOTEEXIT_SIZE;
+ findzomb = 1;
+ break;
+ case PROC_PIDEXITREASONINFO:
+ size = PROC_PIDEXITREASONINFO_SIZE;
+ findzomb = 1;
+ break;
+ case PROC_PIDEXITREASONBASICINFO:
+ size = PROC_PIDEXITREASONBASICINFOSIZE;
+ findzomb = 1;
+ break;
+ case PROC_PIDREGIONPATHINFO2:
+ size = PROC_PIDREGIONPATHINFO2_SIZE;
+ break;
+ case PROC_PIDREGIONPATHINFO3:
+ size = PROC_PIDREGIONPATHINFO3_SIZE;
+ break;
+ case PROC_PIDLISTUPTRS:
+ size = PROC_PIDLISTUPTRS_SIZE;
+ if (buffer == USER_ADDR_NULL) {
+ size = 0;
+ }
+ break;
+ case PROC_PIDLISTDYNKQUEUES:
+ size = PROC_PIDLISTDYNKQUEUES_SIZE;
+ if (buffer == USER_ADDR_NULL) {
+ size = 0;
+ }
+ break;
+ case PROC_PIDVMRTFAULTINFO:
+ size = sizeof(vm_rtfault_record_t);
+ if (buffer == USER_ADDR_NULL) {
+ size = 0;
+ }
+ break;
+ case PROC_PIDPLATFORMINFO:
+ size = PROC_PIDPLATFORMINFO_SIZE;
+ findzomb = 1;
+ break;
+ case PROC_PIDREGIONPATH:
+ size = PROC_PIDREGIONPATH_SIZE;
+ break;
+ case PROC_PIDIPCTABLEINFO:
+ size = PROC_PIDIPCTABLEINFO_SIZE;
+ break;
+ default:
+ return EINVAL;