Name

SPVM::Sys::Select - Select System Call

Usage

use Sys::Select;

Description

Sys::Select provides the select function and its utility functions.

Class Methods

FD_ZERO

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

FD_ZERO() clears a set.

See the select(2) - Linux man page in Linux.

The $set is a Sys::Select::Fd_set object.

FD_SET

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

See the select(2) - Linux man page in Linux.

The $set is a Sys::Select::Fd_set object.

FD_CLR

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

FD_SET() respectively adds a given file descriptor from a set.

See the select(2) - Linux man page in Linux.

The $set is a Sys::Select::Fd_set object.

FD_ISSET

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

FD_ISSET() tests to see if a file descriptor is part of the set.

See the select(2) - Linux man page in Linux.

The $set is a Sys::Select::Fd_set object.

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);

select() allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation (e.g., input possible). A file descriptor is considered ready if it is possible to perform the corresponding I/O operation (e.g., read(2)) without blocking.

See the select(2) - Linux man page in Linux.

The $readfds is a Sys::Select::Fd_set object.

The $writefds is a Sys::Select::Fd_set object.

The $exceptfds is a Sys::Select::Fd_set object.

The $timeout is a Sys::Time::Timeval object.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License