Changes for version v0.2.0 - 2023-01-06

  • features
    • Added accept4 function. Native on linux, emulates on darwin and bsd
    • Added IO::FD::SOCK_NONBLOCK and IO::FD::SOCK_CLOEXEC constants for darwin emulation of accept4 flags.
    • Added sendfile
  • changes
    • All functions returning a new fd to an existing variable now check the variable can be modified. If it cannot a exception is thrown. This is more ie built in perl behaviour.
    • All functions taking an fd now check it is an IV and and warns, returns undef and $! is set to EBADF. This is more like built in perl behaviour.
    • All functions (minus accept4) returning an new fd set CLOEXEC flag if its larger than $^F behaving more like standard perl. accept4 uses an explicit flag to manually set and is not set automatically
    • Function accept_multiple now implemented via accep4 on linux with SOCK_NONBLOCK set
    • Added explicit $^F=1000 to IO::FD and core perl benchmarking code
  • bug fixes
    • Fixed multiple argument handling issues of input fds which would lead to 0 values
  • tests
    • Added better tests for accepting sockets
    • Added sendfile test
    • Added test for bad file descriptors and readonly return variables
  • documentation
    • Documented changes regarding $^F
    • Documented new functions
    • Reformatted changes file

Modules

Faster accept, socket, listen with file descriptors, not handles
Mixed file handle/descriptor functions

Provides

in lib/IO/FD/Constants.pm