syscall

syscall LISTThis function calls the system call (meaning a syscall, not a
shell command) specified as the first element of the list passes the
remaining elements as arguments to the system call. (Many of these calls
are now more readily available through modules like POSIX.) The function raises an exception if
syscall(2) is unimplemented.
The arguments are interpreted as follows: if a given argument is
numeric, the argument is passed as a C integer. If not, a pointer to the
string value is passed. You are responsible for making sure the string
is long enough to receive any result that might be written into it;
otherwise, you’re looking at a core dump. You can’t use a string literal
(or other read-only string) as an argument to syscall because Perl has to assume that any
string pointer might be written through. If your integer arguments are
not literals and have never been interpreted in a numeric context, you
may need to add 0 to them to force them to look like numbers.
syscall returns whatever value was returned by the system call invoked. By C coding conventions, if that system ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access