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

Function pgsigio

freebsd/kern/kern_sig.c:3904–3940  ·  view source on GitHub ↗

* Send a SIGIO or SIGURG signal to a process or process group using stored * credentials rather than those of the current process. */

Source from the content-addressed store, hash-verified

3902 * credentials rather than those of the current process.
3903 */
3904void
3905pgsigio(struct sigio **sigiop, int sig, int checkctty)
3906{
3907 ksiginfo_t ksi;
3908 struct sigio *sigio;
3909
3910 ksiginfo_init(&ksi);
3911 ksi.ksi_signo = sig;
3912 ksi.ksi_code = SI_KERNEL;
3913
3914 SIGIO_LOCK();
3915 sigio = *sigiop;
3916 if (sigio == NULL) {
3917 SIGIO_UNLOCK();
3918 return;
3919 }
3920 if (sigio->sio_pgid > 0) {
3921 PROC_LOCK(sigio->sio_proc);
3922 if (CANSIGIO(sigio->sio_ucred, sigio->sio_proc->p_ucred))
3923 kern_psignal(sigio->sio_proc, sig);
3924 PROC_UNLOCK(sigio->sio_proc);
3925 } else if (sigio->sio_pgid < 0) {
3926 struct proc *p;
3927
3928 PGRP_LOCK(sigio->sio_pgrp);
3929 LIST_FOREACH(p, &sigio->sio_pgrp->pg_members, p_pglist) {
3930 PROC_LOCK(p);
3931 if (p->p_state == PRS_NORMAL &&
3932 CANSIGIO(sigio->sio_ucred, p->p_ucred) &&
3933 (checkctty == 0 || (p->p_flag & P_CONTROLT)))
3934 kern_psignal(p, sig);
3935 PROC_UNLOCK(p);
3936 }
3937 PGRP_UNLOCK(sigio->sio_pgrp);
3938 }
3939 SIGIO_UNLOCK();
3940}
3941
3942static int
3943filt_sigattach(struct knote *kn)

Callers 12

logtimeoutFunction · 0.70
tty_wakeupFunction · 0.70
kqueue_wakeupFunction · 0.70
pipeselwakeupFunction · 0.70
devctl_queueFunction · 0.70
sowakeupFunction · 0.70
solisten_wakeupFunction · 0.70
sohasoutofbandFunction · 0.70
audit_pipe_appendFunction · 0.50
tunstartFunction · 0.50
tunstart_l2Function · 0.50
bpf_wakeupFunction · 0.50

Calls 1

kern_psignalFunction · 0.85

Tested by

no test coverage detected