---
name: "Sys::Syscall"
section: "3pm"
platform: "linux"
package: "perl-sys-syscall"
version: "0.25-14"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Sys::Syscall"
---

# Sys::Syscall(3pm)

access system calls that Perl doesn't normally provide access to

## NAME

Sys::Syscall - access system calls that Perl doesn't normally provide access to

## SYNOPSIS

```
  use Sys::Syscall;
```

## DESCRIPTION

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.

## COPYRIGHT

This module is Copyright (c) 2005 Six Apart, Ltd.

All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. If you need more liberal licensing terms, please contact the maintainer.

## Contributing

Want to contribute?  See:

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

## WARRANTY

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

## AUTHORS

Brad Fitzpatrick \<brad@danga.com\>
