FreeBSD/sys/kern/sys_procdesc.c
/*
 * System call to return the pid of a process given its process descriptor.
 */
System call to return the pid of a process given its process descriptor.
System call to return the pid of a process given its process descriptor .
int
sys_pdgetpid(struct thread *td, struct pdgetpid_args *uap)
{
	cap_rights_t rights;
	pid_t pid;
	int error;
	AUDIT_ARG_FD(uap->fd);
	error = kern_pdgetpid(td, uap->fd,
	    cap_rights_init(&rights, CAP_PDGETPID), &pid);
	if (error == 0)
		error = copyout(&pid, uap->pidp, sizeof(pid));
	return (error);
}
int sys_pdgetpid ( struct thread * td , struct pdgetpid_args * uap ) { cap_rights_t rights ; pid_t pid ; int error ; AUDIT_ARG_FD ( uap -> fd ) ; error = kern_pdgetpid ( td , uap -> fd , cap_rights_init ( & rights , CAP_PDGETPID ) , & pid ) ; if ( error == 0 ) error = copyout ( & pid , uap -> pidp , sizeof ( pid ) ) ; return ( error ) ; }
System call to return the pid of a process given its process descriptor.
System call to return the pid of a process given its process descriptor .