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.288 by root, Tue Dec 29 18:00:40 2020 UTC vs.
Revision 1.294 by root, Sat Apr 9 19:34:05 2022 UTC

227 227
228#if PAGESIZE <= 0 228#if PAGESIZE <= 0
229# define PAGESIZE sysconf (_SC_PAGESIZE) 229# define PAGESIZE sysconf (_SC_PAGESIZE)
230#endif 230#endif
231 231
232/* solaris perl seems to declare a wrong syscall function that clashes with system includes */
233#ifdef __sun
234# undef HAVE_SYSCALL
235#endif
236
232#if HAVE_SYSCALL 237#if HAVE_SYSCALL
233#include <sys/syscall.h> 238#include <sys/syscall.h>
234#else 239#else
235# define syscall(nr,...) (errno = ENOSYS, -1) 240# define syscall(nr,...) (errno = ENOSYS, -1)
236#endif 241#endif
1198 const_iv (MAP_NONBLOCK) 1203 const_iv (MAP_NONBLOCK)
1199 const_iv (MAP_GROWSDOWN) 1204 const_iv (MAP_GROWSDOWN)
1200 const_iv (MAP_32BIT) 1205 const_iv (MAP_32BIT)
1201 const_iv (MAP_HUGETLB) 1206 const_iv (MAP_HUGETLB)
1202 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)
1203 1212
1204 const_iv (MREMAP_MAYMOVE) 1213 const_iv (MREMAP_MAYMOVE)
1205 const_iv (MREMAP_FIXED) 1214 const_iv (MREMAP_FIXED)
1206 1215
1207 const_iv (MSG_CMSG_CLOEXEC) 1216 const_iv (MSG_CMSG_CLOEXEC)
1302 const_iv (EFD_SEMAPHORE) 1311 const_iv (EFD_SEMAPHORE)
1303 1312
1304 const_iv (MFD_CLOEXEC) 1313 const_iv (MFD_CLOEXEC)
1305 const_iv (MFD_ALLOW_SEALING) 1314 const_iv (MFD_ALLOW_SEALING)
1306 const_iv (MFD_HUGETLB) 1315 const_iv (MFD_HUGETLB)
1316 const_iv (MFD_HUGETLB_2MB)
1317 const_iv (MFD_HUGETLB_1GB)
1307 1318
1308 const_iv (CLOCK_REALTIME) 1319 const_iv (CLOCK_REALTIME)
1309 const_iv (CLOCK_MONOTONIC) 1320 const_iv (CLOCK_MONOTONIC)
1310 const_iv (CLOCK_BOOTTIME) 1321 const_iv (CLOCK_BOOTTIME)
1311 const_iv (CLOCK_REALTIME_ALARM) 1322 const_iv (CLOCK_REALTIME_ALARM)
2673int 2684int
2674pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0) 2685pidfd_send_signal (SV *pidfh, int sig, SV *siginfo = &PL_sv_undef, unsigned int flags = 0)
2675 PPCODE: 2686 PPCODE:
2676{ 2687{
2677 int res; 2688 int res;
2689#if HAVE_SIGINFO_T
2678 siginfo_t si = { 0 }; 2690 siginfo_t si = { 0 };
2679 2691
2680 if (SvOK (siginfo)) 2692 if (SvOK (siginfo))
2681 { 2693 {
2682 HV *hv; 2694 HV *hv;
2683 SV **svp; 2695 SV **svp;
2684 2696
2685 if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV) 2697 if (!SvROK (siginfo) || SvTYPE (SvRV (siginfo)) != SVt_PVHV)
2686 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");
2687 2699
2688 hv = (HV *)SvRV (siginfo); 2700 hv = (HV *)SvRV (siginfo);
2689 2701
2690 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);
2691 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);
2694 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);
2695 } 2707 }
2696 2708
2697 /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/ 2709 /*GENDEF0_SYSCALL(pidfd_send_signal,424)*/
2698 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
2699 2714
2700 XPUSHs (sv_2mortal (newSViv (res))); 2715 XPUSHs (sv_2mortal (newSViv (res)));
2701} 2716}
2702 2717
2703void 2718void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines