… | |
… | |
1311 | const_iv (EFD_SEMAPHORE) |
1311 | const_iv (EFD_SEMAPHORE) |
1312 | |
1312 | |
1313 | const_iv (MFD_CLOEXEC) |
1313 | const_iv (MFD_CLOEXEC) |
1314 | const_iv (MFD_ALLOW_SEALING) |
1314 | const_iv (MFD_ALLOW_SEALING) |
1315 | const_iv (MFD_HUGETLB) |
1315 | const_iv (MFD_HUGETLB) |
|
|
1316 | const_iv (MFD_HUGETLB_2MB) |
|
|
1317 | const_iv (MFD_HUGETLB_1GB) |
1316 | |
1318 | |
1317 | const_iv (CLOCK_REALTIME) |
1319 | const_iv (CLOCK_REALTIME) |
1318 | const_iv (CLOCK_MONOTONIC) |
1320 | const_iv (CLOCK_MONOTONIC) |
1319 | const_iv (CLOCK_BOOTTIME) |
1321 | const_iv (CLOCK_BOOTTIME) |
1320 | const_iv (CLOCK_REALTIME_ALARM) |
1322 | const_iv (CLOCK_REALTIME_ALARM) |
… | |
… | |
2682 | int |
2684 | int |
2683 | pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) |
2685 | pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) |
2684 | PPCODE: |
2686 | PPCODE: |
2685 | { |
2687 | { |
2686 | int res; |
2688 | int res; |
|
|
2689 | #if HAVE_SIGINFO_T |
2687 | siginfo_t si = { 0 }; |
2690 | siginfo_t si = { 0 }; |
2688 | |
2691 | |
2689 | if (SvOK (siginfo)) |
2692 | if (SvOK (siginfo)) |
2690 | { |
2693 | { |
2691 | HV *hv; |
2694 | HV *hv; |
2692 | SV **svp; |
2695 | SV **svp; |
2693 | |
2696 | |
2694 | if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV) |
2697 | 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"); |
2698 | croak ("siginfo argument must be a hashref with 'code', 'pid', 'uid' and 'value_int' or 'value_ptr' members, caught"); |
2696 | |
2699 | |
2697 | hv = (HV *)SvRV (siginfo); |
2700 | hv = (HV *)SvRV (siginfo); |
2698 | |
2701 | |
2699 | if ((svp = hv_fetchs (hv, "code" , 0))) si.si_code = SvIV (*svp); |
2702 | 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); |
2703 | 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); |
2706 | if ((svp = hv_fetchs (hv, "value_ptr", 0))) si.si_value.sival_ptr = (void *)SvIV (*svp); |
2704 | } |
2707 | } |
2705 | |
2708 | |
2706 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2709 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2707 | res = syscall (SYS_pidfd_send_signal, s_fileno_croak (pidfh, 0), sig, SvOK (siginfo) ? &si : 0, flags); |
2710 | res = syscall (SYS_pidfd_send_signal, s_fileno_croak (pidfh, 0), sig, SvOK (siginfo) ? &si : 0, flags); |
|
|
2711 | #else |
|
|
2712 | res = (errno = ENOSYS, -1); |
|
|
2713 | #endif |
2708 | |
2714 | |
2709 | XPUSHs (sv_2mortal (newSViv (res))); |
2715 | XPUSHs (sv_2mortal (newSViv (res))); |
2710 | } |
2716 | } |
2711 | |
2717 | |
2712 | void |
2718 | void |