| 1 | package SPVM::Sys::Ioctl; | ||
| 2 | |||
| 3 | 1; | ||
| 4 | |||
| 5 | =head1 Name | ||
| 6 | |||
| 7 | SPVM::Sys::Ioctl - The ioctl System Call | ||
| 8 | |||
| 9 | =head1 Description | ||
| 10 | |||
| 11 | Sys::Ioctl class in L<SPVM> has methods to call the ioctl functions. | ||
| 12 | |||
| 13 | =head1 Usage | ||
| 14 | |||
| 15 | use Sys::Ioctl; | ||
| 16 | use Sys::Ioctl::Constant as IOCTL; | ||
| 17 | |||
| 18 | my $nonblocking_ref = [1]; | ||
| 19 | Sys::Ioctl->ioctl($socket_fd, IOCTL->FIONBIO, $nonblocking_ref); | ||
| 20 | |||
| 21 | =head1 Class Methods | ||
| 22 | |||
| 23 | =head2 ioctl | ||
| 24 | |||
| 25 | C<static method ioctl : int ($fd : int, $request : int, $request_arg_ref : object of byte[]|short[]|int[]|long[]|float[]|double[]|object = undef);> | ||
| 26 | |||
| 27 | Calls the L<ioctl|https://linux.die.net/man/2/ioctl> function and returns its return value. | ||
| 28 | |||
| 29 | See L<Sys::Ioctl::Constant|SPVM::Sys::Ioctl::Constant> about constant values given to the value of $request_arg_ref. | ||
| 30 | |||
| 31 | Exceptions: | ||
| 32 | |||
| 33 | $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. | ||
| 34 | |||
| 35 | If the ioctl function failed, an exception is thrown with C<eval_error_id> is set to the basic type ID of the L<Error::System|SPVM::Error::System> class. | ||
| 36 | |||
| 37 | =head2 ioctlsocket | ||
| 38 | |||
| 39 | C<static method ioctlsocket : int ($fd : int, $request : int, $request_arg_ref : int[] = undef);> | ||
| 40 | |||
| 41 | Calls the L<ioctlsocket|https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-ioctlsocket> function and returns its return value. | ||
| 42 | |||
| 43 | See L<Sys::Ioctl::Constant|SPVM::Sys::Ioctl::Constant> about constant values given to the value of $request_arg_ref. | ||
| 44 | |||
| 45 | Exceptions: | ||
| 46 | |||
| 47 | If the ioctlsocket function failed, an exception is thrown with C<eval_error_id> is set to the basic type ID of the L<Error::System|SPVM::Error::System> class. | ||
| 48 | |||
| 49 | =head1 See Also | ||
| 50 | |||
| 51 | =over 2 | ||
| 52 | |||
| 53 | =item * L<Sys|SPVM::Sys> | ||
| 54 | |||
| 55 | =back | ||
| 56 | |||
| 57 | =head1 Copyright & License | ||
| 58 | |||
| 59 | Copyright (c) 2023 Yuki Kimoto | ||
| 60 | |||
| 61 | MIT License | ||
| 62 |