… | |
… | |
1904 | might not be truncated. |
1904 | might not be truncated. |
1905 | |
1905 | |
1906 | To accept name-less sockets, use "undef" for $sockaddr and 0 for |
1906 | To accept name-less sockets, use "undef" for $sockaddr and 0 for |
1907 | $sockaddr_maxlen. |
1907 | $sockaddr_maxlen. |
1908 | |
1908 | |
1909 | The main reasons to use this syscall rather than portable |
1909 | The main reasons to use this syscall rather than portable accept(2) |
1910 | C«accept(2)> are that you can specify "SOCK_NONBLOCK" and/or |
1910 | are that you can specify "SOCK_NONBLOCK" and/or "SOCK_CLOEXEC" flags |
1911 | "SOCK_CLOEXEC" flags and you can accept name-less sockets by |
1911 | and you can accept name-less sockets by specifying 0 for |
1912 | specifying 0 for $sockaddr_maxlen, which is sadly not possible with |
1912 | $sockaddr_maxlen, which is sadly not possible with perl's interface |
1913 | perl's interface to "accept". |
1913 | to "accept". |
1914 | |
1914 | |
1915 | IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
1915 | IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags |
1916 | Calls the GNU/Linux splice(2) syscall, if available. If $r_off or |
1916 | Calls the GNU/Linux splice(2) syscall, if available. If $r_off or |
1917 | $w_off are "undef", then "NULL" is passed for these, otherwise they |
1917 | $w_off are "undef", then "NULL" is passed for these, otherwise they |
1918 | should be the file offset. |
1918 | should be the file offset. |
… | |
… | |
1976 | "IO::AIO::MFD_ALLOW_SEALING" and "IO::AIO::MFD_HUGETLB". |
1976 | "IO::AIO::MFD_ALLOW_SEALING" and "IO::AIO::MFD_HUGETLB". |
1977 | |
1977 | |
1978 | Example: create a new memfd. |
1978 | Example: create a new memfd. |
1979 | |
1979 | |
1980 | my $fh = IO::AIO::memfd_create "somenameforprocfd", IO::AIO::MFD_CLOEXEC |
1980 | my $fh = IO::AIO::memfd_create "somenameforprocfd", IO::AIO::MFD_CLOEXEC |
1981 | or die "m,emfd_create: $!\n"; |
1981 | or die "memfd_create: $!\n"; |
|
|
1982 | |
|
|
1983 | $fh = IO::AIO::pidfd_open $pid[, $flags] |
|
|
1984 | This is an interface to the Linux pidfd_open(2) system call. The |
|
|
1985 | default for $flags is 0. |
|
|
1986 | |
|
|
1987 | On success, a new pidfd filehandle is returned (that is already set |
|
|
1988 | to close-on-exec), otherwise returns "undef". If the syscall is |
|
|
1989 | missing, fails with "ENOSYS". |
|
|
1990 | |
|
|
1991 | Example: open pid 6341 as pidfd. |
|
|
1992 | |
|
|
1993 | my $fh = IO::AIO::pidfd_open 6341 |
|
|
1994 | or die "pidfd_open: $!\n"; |
|
|
1995 | |
|
|
1996 | $status = IO::AIO::pidfd_send_signal $pidfh, $signal[, $siginfo[, |
|
|
1997 | $flags]] |
|
|
1998 | This is an interface to the Linux pidfd_send_signal system call. The |
|
|
1999 | default for $siginfo is "undef" and the default for $flags is 0. |
|
|
2000 | |
|
|
2001 | Returns the system call status. If the syscall is missing, fails |
|
|
2002 | with "ENOSYS". |
|
|
2003 | |
|
|
2004 | When specified, $siginfo must be a reference to a hash with one or |
|
|
2005 | more of the following members: |
|
|
2006 | |
|
|
2007 | code - the "si_code" member |
|
|
2008 | pid - the "si_pid" member |
|
|
2009 | uid - the "si_uid" member |
|
|
2010 | value_int - the "si_value.sival_int" member |
|
|
2011 | value_ptr - the "si_value.sival_ptr" member, specified as an integer |
|
|
2012 | |
|
|
2013 | Example: send a SIGKILL to the specified process. |
|
|
2014 | |
|
|
2015 | my $status = IO::AIO::pidfd_send_signal $pidfh, 9, undef |
|
|
2016 | and die "pidfd_send_signal: $!\n"; |
|
|
2017 | |
|
|
2018 | Example: send a SIGKILL to the specified process with extra data. |
|
|
2019 | |
|
|
2020 | my $status = IO::AIO::pidfd_send_signal $pidfh, 9, { code => -1, value_int => 7 } |
|
|
2021 | and die "pidfd_send_signal: $!\n"; |
|
|
2022 | |
|
|
2023 | $fh = IO::AIO::pidfd_getfd $pidfh, $targetfd[, $flags] |
|
|
2024 | This is an interface to the Linux pidfd_getfd system call. The |
|
|
2025 | default for $flags is 0. |
|
|
2026 | |
|
|
2027 | On success, returns a dup'ed copy of the target file descriptor |
|
|
2028 | (specified as an integer) returned (that is already set to |
|
|
2029 | close-on-exec), otherwise returns "undef". If the syscall is |
|
|
2030 | missing, fails with "ENOSYS". |
|
|
2031 | |
|
|
2032 | Example: get a copy of standard error of another process and print |
|
|
2033 | soemthing to it. |
|
|
2034 | |
|
|
2035 | my $errfh = IO::AIO::pidfd_getfd $pidfh, 2 |
|
|
2036 | or die "pidfd_getfd: $!\n"; |
|
|
2037 | print $errfh "stderr\n"; |
|
|
2038 | |
1982 | =item $fh = IO::AIO::eventfd [$initval, [$flags]] |
2039 | $fh = IO::AIO::eventfd [$initval, [$flags]] |
1983 | |
|
|
1984 | This is a direct interface to the Linux eventfd(2) system call. The |
2040 | This is a direct interface to the Linux eventfd(2) system call. The |
1985 | (unhelpful) defaults for $initval and $flags are 0 for both. |
2041 | (unhelpful) defaults for $initval and $flags are 0 for both. |
1986 | |
2042 | |
1987 | On success, the new eventfd filehandle is returned, otherwise |
2043 | On success, the new eventfd filehandle is returned, otherwise |
1988 | returns "undef". If the eventfd syscall is missing, fails with |
2044 | returns "undef". If the eventfd syscall is missing, fails with |