[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5

syscall Command

Purpose

Performs a specified subroutine call.

Syntax

syscall [ -n ] Name [ Argument1 ... ArgumentN ] [  Name Argument1 ... ArgumentN ] ] ...

Description

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:

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.

Flags

-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.

Security

Access Control: You must have root authority to run this command.

Examples

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.

Files

/usr/bin/syscall Contains the syscall command.

Related Information

The bsh command, Rsh command, csh command, ksh command, sh command.

The open subroutine, sleep subroutine.

Shells Overview in AIX 5L Version 5.2 System User's Guide: Operating System and Devices.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]