]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/syscall
audiohda: fix syntax error
[plan9front.git] / sys / man / 1 / syscall
1 .TH SYSCALL 1 
2 .SH NAME
3 syscall \- test a system call
4 .SH SYNOPSIS
5 .B syscall
6 [
7 .B -os
8 ]
9 .I entry
10 [
11 .I arg ...
12 ]
13 .SH DESCRIPTION
14 .I Syscall
15 invokes the system call
16 .I entry
17 with the given arguments.
18 The return value is printed.
19 If an error occured, the error string is also printed.
20 .PP
21 For convenience,
22 .IR write (2)
23 and
24 .IR read (2)
25 are included in
26 .IR entries ,
27 even though they are not strictly syscalls.
28 .PP
29 .I Syscall
30 arguments are integer constants, strings, or the literal
31 .BR buf .
32 The literal
33 .B buf
34 refers to a writable 1 megabyte buffer.
35 Strings and 
36 .B buf
37 are passed as pointers.
38 Integers are passed as values.
39 .PP
40 The
41 .B -o
42 option prints contents of the 1MB buffer.
43 For
44 .IR errstr (2)
45 and
46 .IR fd2path (2),
47 the buffer is treated as a 0-terminated string.
48 For other calls, the number of bytes printed is
49 determined by the system call's return value.
50 .PP
51 The
52 .B -s
53 option is similar, but interprets the data as a
54 .IR stat (5)
55 message and formats it to standard output.
56 .SH EXAMPLES
57 Write a string to standard output:
58 .IP
59 .EX
60 syscall write 1 hello 5
61 .EE
62 .PP
63 Print information about the file connected to standard input:
64 .IP
65 .EX
66 syscall -s fstat 0 buf 1024
67 .EE
68 .SH SOURCE
69 .B /sys/src/cmd/syscall
70 .SH "SEE ALSO"
71 Section 2 of this manual.
72 .SH DIAGNOSTICS
73 If
74 .I entry
75 is not known to
76 .IR syscall ,
77 the exit status is
78 .LR unknown .
79 If the system call succeeds, the exit status is null;
80 otherwise the exit status is the string that
81 .IR errstr (2)
82 returns.