… | |
… | |
1203 | const_iv (MAP_NONBLOCK) |
1203 | const_iv (MAP_NONBLOCK) |
1204 | const_iv (MAP_GROWSDOWN) |
1204 | const_iv (MAP_GROWSDOWN) |
1205 | const_iv (MAP_32BIT) |
1205 | const_iv (MAP_32BIT) |
1206 | const_iv (MAP_HUGETLB) |
1206 | const_iv (MAP_HUGETLB) |
1207 | const_iv (MAP_STACK) |
1207 | const_iv (MAP_STACK) |
|
|
1208 | const_iv (MAP_FIXED_NOREPLACE) |
|
|
1209 | const_iv (MAP_SHARED_VALIDATE) |
|
|
1210 | const_iv (MAP_SYNC) |
|
|
1211 | const_iv (MAP_UNINITIALIZED) |
1208 | |
1212 | |
1209 | const_iv (MREMAP_MAYMOVE) |
1213 | const_iv (MREMAP_MAYMOVE) |
1210 | const_iv (MREMAP_FIXED) |
1214 | const_iv (MREMAP_FIXED) |
1211 | |
1215 | |
1212 | const_iv (MSG_CMSG_CLOEXEC) |
1216 | const_iv (MSG_CMSG_CLOEXEC) |
… | |
… | |
2678 | int |
2682 | int |
2679 | 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) |
2680 | PPCODE: |
2684 | PPCODE: |
2681 | { |
2685 | { |
2682 | int res; |
2686 | int res; |
|
|
2687 | #if HAVE_SIGINFO_T |
2683 | siginfo_t si = { 0 }; |
2688 | siginfo_t si = { 0 }; |
2684 | |
2689 | |
2685 | if (SvOK (siginfo)) |
2690 | if (SvOK (siginfo)) |
2686 | { |
2691 | { |
2687 | HV *hv; |
2692 | HV *hv; |
2688 | SV **svp; |
2693 | SV **svp; |
2689 | |
2694 | |
2690 | if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV) |
2695 | if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV) |
2691 | 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"); |
2692 | |
2697 | |
2693 | hv = (HV *)SvRV (siginfo); |
2698 | hv = (HV *)SvRV (siginfo); |
2694 | |
2699 | |
2695 | 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); |
2696 | 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); |
… | |
… | |
2699 | 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); |
2700 | } |
2705 | } |
2701 | |
2706 | |
2702 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2707 | /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ |
2703 | 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 |
2704 | |
2712 | |
2705 | XPUSHs (sv_2mortal (newSViv (res))); |
2713 | XPUSHs (sv_2mortal (newSViv (res))); |
2706 | } |
2714 | } |
2707 | |
2715 | |
2708 | void |
2716 | void |