summaryrefslogtreecommitdiff
path: root/Base/usr/share/man/man1/syscall.md
diff options
context:
space:
mode:
authorMauri de Souza Nunes <mauri870@gmail.com>2019-12-24 09:37:41 -0300
committerAndreas Kling <awesomekling@gmail.com>2019-12-24 20:23:37 +0100
commitcb4e51a7a58d1c536d51484f83239d8cd9009616 (patch)
tree8cea8ad73324727017d27562487fc479a9a619e3 /Base/usr/share/man/man1/syscall.md
parentb6eba388e33af245f9a456b17bdf64679989d4ec (diff)
downloadserenity-cb4e51a7a58d1c536d51484f83239d8cd9009616.zip
Userland: Add syscall -l option and man page
Diffstat (limited to 'Base/usr/share/man/man1/syscall.md')
-rw-r--r--Base/usr/share/man/man1/syscall.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/Base/usr/share/man/man1/syscall.md b/Base/usr/share/man/man1/syscall.md
new file mode 100644
index 0000000000..84dc3efe97
--- /dev/null
+++ b/Base/usr/share/man/man1/syscall.md
@@ -0,0 +1,62 @@
+## Name
+
+syscall - test a system call
+
+## Synopsis
+
+```**sh
+$ syscall [-o] [-l] [-h] <syscall-name> <args...> [buf==BUFSIZ buffer]`
+```
+
+## Description
+
+The `syscall` utility can be used to invoke a system call with the given arguments.
+
+## Options
+
+* `-o`: Output the contents of the buffer argument specified as buf to stdout.
+* `-l`: Print a space separated list of all the Serenity system calls and exit. Note that not all the system calls can be invoked using this tool.
+* `-h`: Print a help message and exit.
+
+## Examples
+
+Write a string to standard output:
+
+```sh
+$ syscall write 1 hello 5
+```
+
+Read a string from the standard input into a buffer and output the buffer contents to stdout:
+
+```sh
+$ syscall -o read 0 buf 3
+```
+
+Get the pid of the current running process:
+
+```sh
+$ syscall getpid
+```
+
+Sleep for 3 seconds:
+
+```sh
+$ syscall sleep 3
+```
+
+Create a directory:
+
+```sh
+$ syscall mkdir my-dir 0755
+```
+
+Exit the program with status 2:
+
+```sh
+$ syscall exit 2
+```
+
+## History
+
+This is a direct port of a utility with the same name originated from the Plan 9 operating system.
+