.TH SYSCALL 1 .SH NAME syscall \- test a system call .SH SYNOPSIS .B syscall [ .B -o ] .I entry [ .I arg ... ] .SH DESCRIPTION .I Syscall invokes the system call .I entry with the given arguments. It prints the return value and the error string, if there was an error. An argument is either an integer constant as in C (its value is passed), a string (its address is passed), or the literal .B buf (a pointer to a 1 Kbyte buffer is passed). If .B -o is given, the contents of the 1 Kbyte buffer are printed as a zero-terminated string after the system call is done. .SH EXAMPLES Write a string to standard output .IP .EX syscall write 1 hello 5 .EE .PP Print the name of the file connected to standard input .IP .EX syscall -o fstat 0 buf .EE .SH SOURCE .B /sys/src/cmd/syscall .SH "SEE ALSO" Section 2 of this manual. .SH DIAGNOSTICS If .I entry is not a system call name, the exit status is .LR unknown . If the system call succeeds, the exit status is null; otherwise the exit status is the string that .IR errstr (2) returns.