ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.290 by root, Sun Feb 7 13:13:44 2021 UTC vs.
Revision 1.293 by root, Tue Jul 27 18:46:06 2021 UTC

2682int 2682int
2683pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) 2683pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0)
2684 PPCODE: 2684 PPCODE:
2685{ 2685{
2686 int res; 2686 int res;
2687#if HAVE_SIGINFO_T
2687 siginfo_t si = { 0 }; 2688 siginfo_t si = { 0 };
2688 2689
2689 if (SvOK (siginfo)) 2690 if (SvOK (siginfo))
2690 { 2691 {
2691 HV *hv; 2692 HV *hv;
2692 SV **svp; 2693 SV **svp;
2693 2694
2694 if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV) 2695 if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV)
2695 croak ("siginfo argument must be a hashref code, pid, uid and value_int or value_ptr members, caught"); 2696 croak ("siginfo argument must be a hashref with 'code', 'pid', 'uid' and 'value_int' or 'value_ptr' members, caught");
2696 2697
2697 hv = (HV *)SvRV (siginfo); 2698 hv = (HV *)SvRV (siginfo);
2698 2699
2699 if ((svp = hv_fetchs (hv, "code" , 0))) si.si_code = SvIV (*svp); 2700 if ((svp = hv_fetchs (hv, "code" , 0))) si.si_code = SvIV (*svp);
2700 if ((svp = hv_fetchs (hv, "pid" , 0))) si.si_pid = SvIV (*svp); 2701 if ((svp = hv_fetchs (hv, "pid" , 0))) si.si_pid = SvIV (*svp);
2703 if ((svp = hv_fetchs (hv, "value_ptr", 0))) si.si_value.sival_ptr = (void *)SvIV (*svp); 2704 if ((svp = hv_fetchs (hv, "value_ptr", 0))) si.si_value.sival_ptr = (void *)SvIV (*svp);
2704 } 2705 }
2705 2706
2706 /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ 2707 /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/
2707 res = syscall (SYS_pidfd_send_signal, s_fileno_croak (pidfh, 0), sig, SvOK (siginfo) ? &si : 0, flags); 2708 res = syscall (SYS_pidfd_send_signal, s_fileno_croak (pidfh, 0), sig, SvOK (siginfo) ? &si : 0, flags);
2709#else
2710 res = (errno = ENOSYS, -1);
2711#endif
2708 2712
2709 XPUSHs (sv_2mortal (newSViv (res))); 2713 XPUSHs (sv_2mortal (newSViv (res)));
2710} 2714}
2711 2715
2712void 2716void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines