summaryrefslogtreecommitdiff
path: root/Base/usr/share/man/man2/access.md
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-09-21 00:47:00 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-09-28 18:29:42 +0200
commitfed96f455d4ce72b045550fd739412dec7c580eb (patch)
treec1c1bbe441cf63583756090420f3abf08d4a31d8 /Base/usr/share/man/man2/access.md
parent36eea6c04bb3c44c2e938bbb4826b5559ea84078 (diff)
downloadserenity-fed96f455d4ce72b045550fd739412dec7c580eb.zip
Base: Write some initial man pages
It ain't much, but it's honest work!
Diffstat (limited to 'Base/usr/share/man/man2/access.md')
-rw-r--r--Base/usr/share/man/man2/access.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/Base/usr/share/man/man2/access.md b/Base/usr/share/man/man2/access.md
new file mode 100644
index 0000000000..13d7b77027
--- /dev/null
+++ b/Base/usr/share/man/man2/access.md
@@ -0,0 +1,24 @@
+## Name
+
+access - check if a file is accessible
+
+## Synopsis
+
+```**c++
+#include <unistd.h>
+
+int access(const char* path, int mode);
+```
+
+## Description
+
+Check if a file at the given *path* exists and is accessible to the current user for the given *mode*.
+Valid flags for *mode* are:
+* `F_OK` to check if the file is accessible at all,
+* `R_OK` to check if the file can be read,
+* `W_OK` to check if the file can be written to,
+* `X_OK` to check if the file can be executed as a program.
+
+## Return value
+
+If the file is indeed accessible for the specified *mode*, `access()` returns 0. Otherwise, it returns -1 and sets `errno` to describe the error.