MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kern_getsid

Function kern_getsid

freebsd/kern/kern_prot.c:198–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198int
199kern_getsid(struct thread *td, pid_t pid)
200{
201 struct proc *p;
202 int error;
203
204 if (pid == 0) {
205 p = td->td_proc;
206 PROC_LOCK(p);
207 } else {
208 p = pfind(pid);
209 if (p == NULL)
210 return (ESRCH);
211 error = p_cansee(td, p);
212 if (error) {
213 PROC_UNLOCK(p);
214 return (error);
215 }
216 }
217 td->td_retval[0] = p->p_session->s_sid;
218 PROC_UNLOCK(p);
219 return (0);
220}
221
222#ifndef _SYS_SYSPROTO_H_
223struct getuid_args {

Callers 1

sys_getsidFunction · 0.85

Calls 2

pfindFunction · 0.70
p_canseeFunction · 0.70

Tested by

no test coverage detected