The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Sys::Select - Select System Call

Description

The Sys::Select class has methods to call the select system call.

Usage

  use Sys::Select;

Details

In Windows, FD_SETSIZE is set to 1024.

Class Methods

FD_ZERO

static method FD_ZERO : void ($set : Sys::Select::Fd_set);

Calls the FD_ZERO function.

Exceptions:

$set must be defined. Otherwise an exception is thrown.

FD_SET

static method FD_SET : void ($fd : int, $set : Sys::Select::Fd_set);

Calls the FD_SET function.

Exceptions:

$fd must be greater than or equal to 0. Otherwise an exception is thrown.

$fd must be less than FD_SETSIZE. Otherwise an exception is thrown.

$set must be defined. Otherwise an exception is thrown.

FD_CLR

static method FD_CLR : void ($fd : int, $set : Sys::Select::Fd_set);

Calls the FD_CLR function.

Exceptions:

$fd must be greater than or equal to 0. Otherwise an exception is thrown.

$fd must be less than FD_SETSIZE. Otherwise an exception is thrown.

$set must be defined. Otherwise an exception is thrown.

FD_ISSET

static method FD_ISSET : int ($fd : int, $set : Sys::Select::Fd_set);

Calls the FD_ISSET function and returns its return value.

Exceptions:

$fd must be greater than or equal to 0. Otherwise an exception is thrown.

$fd must be less than FD_SETSIZE. Otherwise an exception is thrown.

$set must be defined. Otherwise an exception is thrown.

select

static method select : int ($nfds : int, $readfds : Sys::Select::Fd_set, $writefds : Sys::Select::Fd_set, $exceptfds : Sys::Select::Fd_set, $timeout : Sys::Time::Timeval);

Calls the select function and returns its return value.

Exceptions:

$fd must be greater than or equal to 0. Otherwise an exception is thrown.

$fd must be less than FD_SETSIZE. Otherwise an exception is thrown.

If the select function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License