Skip to content
instance method

Kernel#syscall

(::Integer num, *untyped args) -> untyped
syscall(integer_callno, *arguments) → integer

Invokes Posix system call syscall(2), which calls a specified function.

Calls the operating system function identified by integer_callno; returns the result of the function or raises SystemCallError if it failed. The effect of the call is platform-dependent. The arguments and returned value are platform-dependent.

For each of arguments: if it is an integer, it is passed directly; if it is a string, it is interpreted as a binary sequence of bytes. There may be as many as nine such arguments.

Arguments integer_callno and argument, as well as the returned value, are platform-dependent.

Note: Method syscall is essentially unsafe and unportable. The DL (Fiddle) library is preferred for safer and a bit more portable programming.

Not implemented on all platforms.

See also #sub #system #String #tap also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0