Performs a specified subroutine call.
The syscall command executes a system call interface program, which performs the subroutine call specified by the Name parameter. If you specify the -n flag, the syscall command performs the call n times. Arguments specified by the Argument parameter are passed to the subroutine without error checking. The Argument parameter can be expressed in the following formats:
| Item | Description |
|---|---|
| 0x nnn | Hexadecimal constant nnn. |
| 0 nnn | Octal constant nnn. |
| nnn | Decimal constant nnn. |
| +nnn | Decimal constant nnn. |
| -nnn | Decimal constant nnn. |
| "string | The character string "string". |
| 'string | The character string "string". |
| \string | The character string "string". |
| #string | The length of the character string "string". |
| &&n | The address of the nth argument to this subroutine. (n=0 is the subroutine name.) |
| &n | The address of the nth byte in an internal 10KB buffer. |
| $n | The result of the nth subroutine. (n=0 is the first subroutine.) |
| string | Anything else is a literal character string. |
The syscall command prints a message and exits for unknown subroutines and for subroutines that return a value of -1.
Note: The syscall command understands the sleep subroutine as a special case subroutine.
| Item | Description |
|---|---|
| -n | Specifies the number of times the syscall command performs the specified subroutine. |
| ; | Separates multiple subroutines (up to a maximum of 20) issued by the same invocation of the syscall command. |
To simulate the C program fragment:
output=open("x", 401, 0755);
write(output, "hello", strlen("hello"));
enter:
syscall open x 401 0755 \; write \$0 hello \#hello
Note: Special shell characters must be escaped.
| Item | Description |
|---|---|
| /usr/bin/syscall | Contains the syscall command. |