Name

SPVM::Sys::Ioctl - The ioctl System Call

Description

Sys::Ioctl class in SPVM has methods to call the ioctl functions.

Usage

use Sys::Ioctl;
use Sys::Ioctl::Constant as IOCTL;

my $nonblocking_ref = [1];
Sys::Ioctl->ioctl($socket_fd, IOCTL->FIONBIO, $nonblocking_ref);

Class Methods

ioctl

static method ioctl : int ($fd : int, $request : int, $request_arg_ref : object of byte[]|short[]|int[]|long[]|float[]|double[]|object = undef);

Calls the ioctl function and returns its return value.

See Sys::Ioctl::Constant about constant values given to the value of $request_arg_ref.

Exceptions:

$request_arg_ref must be an byte[]/short[]/int[]/long[]/float[]/double[] type object or the object that is a pointer class. Otherwise an exception is thrown.

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

ioctlsocket

static method ioctlsocket : int ($fd : int, $request : int, $request_arg_ref : int[] = undef);

Calls the ioctlsocket function and returns its return value.

See Sys::Ioctl::Constant about constant values given to the value of $request_arg_ref.

Exceptions:

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

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License