Sys::Syscall(3pm)

Sys::Syscall3pm

Access system calls that perl doesn't normally provide access to

Usage

  use Sys::Syscall;

Overview

Use epoll, sendfile, from Perl. Mostly Linux-only support now, but more syscalls/OSes planned for future.

Exports

Nothing by default.

May export: sendfile epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD

Export tags: :epoll and :sendfile

Functions

epoll support

$ok = epoll_defined()

Returns true if epoll might be available. (caller must still test with epoll_create)

$epfd = epoll_create([ $start_size ])

Create a new epoll filedescriptor. Returns -1 if epoll isn't available.

$rv = epoll_ctl($epfd, $op, $fd, $events)

See manpage for epoll_ctl

$count = epoll_wait($epfd, $max_events, $timeout, $arrayref)

See manpage for epoll_wait. $arrayref is an arrayref to be modified with the items returned. The values put into $arrayref are arrayrefs of [$fd, $state].

sendfile support

$ok = sendfile_defined()

Returns true if sendfile should work on this operating system.

$sent = sendfile($sock_fd, $file_fd, $max_send)

Sends up to $max_send bytes from $file_fd to $sock_fd. Returns bytes actually sent, or -1 on error.

Contributing

Want to contribute? See:

  L<http://contributing.appspot.com/sys-syscall>

Warranty

This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.

Releases

10 releases since Debian 5.0 (Lenny); the text changed 6 times.

  1. 5.0
  2. 6.0–7
  3. 8
  4. 9–11
  5. 12
  6. 13
  7. Arch

Authors

Brad Fitzpatrick <[email protected]>

From perl-sys-syscall 0.25-14 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.