… | |
… | |
2681 | |
2681 | |
2682 | int |
2682 | int |
2683 | pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) |
2683 | pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) |
2684 | PPCODE: |
2684 | PPCODE: |
2685 | { |
2685 | { |
2686 | #if HAVE_SIGINFO_T |
|
|
2687 | int res; |
2686 | int res; |
|
|
2687 | #if HAVE_SIGINFO_T |
2688 | siginfo_t si = { 0 }; |
2688 | siginfo_t si = { 0 }; |
2689 | |
2689 | |
2690 | if (SvOK (siginfo)) |
2690 | if (SvOK (siginfo)) |
2691 | { |
2691 | { |
2692 | HV *hv; |
2692 | HV *hv; |
… | |
… | |
2704 | 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); |
2705 | } |
2705 | } |
2706 | |
2706 | |
2707 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2707 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2708 | 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 |
2709 | #else |
2710 | res = (errno = ENOSYS, -1); |
2710 | res = (errno = ENOSYS, -1); |
2711 | #endif |
2711 | #endif |
2712 | |
2712 | |
2713 | XPUSHs (sv_2mortal (newSViv (res))); |
2713 | XPUSHs (sv_2mortal (newSViv (res))); |
2714 | } |
2714 | } |
2715 | |
2715 | |
2716 | void |
2716 | void |