diff options
author | kvik <kvik@a-b.xyz> | 2020-09-20 14:49:12 +0200 |
---|---|---|
committer | kvik <kvik@a-b.xyz> | 2020-09-20 14:49:12 +0200 |
commit | aa7c8cac1145d0cd6e9117deaa1f8c9f418bca17 (patch) | |
tree | 46e284013e4eaf89b0a436e5a28d34f067c32492 /sys/man/1 | |
parent | e3166b4fe83d12a29c265fe9a8f333369b35c663 (diff) |
syscall: utility overhaul
Following is a list of functional changes:
* The -o flag outputs the entire buffer to the length returned
by the syscall, or, in case of fd2path(2) and errstr(2), to '\0'.
* The -x flag is removed; the above makes it possible to pipe
into xd(1) to get the same result.
* The -s flag uses dirfmt(2) to format the stat message, instead
of trying to imitate ls(1).
* Stderr reports are normalized and made easier to parse.
The code also suffered a number of stylistic changes.
Diffstat (limited to 'sys/man/1')
-rw-r--r-- | sys/man/1/syscall | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/sys/man/1/syscall b/sys/man/1/syscall index 54cf5516d..8f6d3051a 100644 --- a/sys/man/1/syscall +++ b/sys/man/1/syscall @@ -4,7 +4,7 @@ syscall \- test a system call .SH SYNOPSIS .B syscall [ -.B -osx +.B -os ] .I entry [ @@ -15,39 +15,44 @@ syscall \- test a system call invokes the system call .I entry with the given arguments. -(Some functions, such as -.I write +The return value is printed. +If an error occured, the error string is also printed. +.PP +For convenience, +.IR write (2) and -.IR read (2), -although not strictly system calls, are valid -.IR entries .) -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 +.IR read (2) +are included in +.IR entries , +even though they are not strictly syscalls. +.PP +.I Syscall +arguments are integer constants, strings, or the literal +.BR buf . +The literal .B buf -(a pointer to a 1MB buffer is passed). +refers to a writable 1 megabyte buffer. +Strings and +.B buf +are passed as pointers. +Integers are passed as values. .PP -If -.B -o -is given, the contents of the 1MB buffer are printed as a zero-terminated string -after the system call is done. The -.B -x +.B -o +option prints contents of the 1MB buffer. +For +.IR errstr (2) and +.IR fd2path (2), +the buffer is treated as a 0-terminated string. +For other calls, the number of bytes printed is +determined by the system call's return value. +.PP +The .B -s -options are similar, but -.B -x -formats the data as hexadecimal bytes, while -.B -s -interprets the data as a +option is similar, but interprets the data as a .IR stat (5) -message and formats it similar to the style of -.B ls -.B -lqm -(see -.IR ls (1)), -with extra detail about the modify and access times. +message and formats it to standard output. .SH EXAMPLES Write a string to standard output: .IP |