summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-10-04 10:02:42 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-10-04 11:02:42 +0200
commit79d8b9ae755c7d4727fdb6a22d250854ca1ae450 (patch)
tree3061e99bb62cca4642840d625ac1af76b1cb2569 /Libraries/LibC
parent4288cfa65aaad41473e26cbcc64bae4a36f77592 (diff)
downloadserenity-79d8b9ae755c7d4727fdb6a22d250854ca1ae450.zip
LibC: unistd.h should provide SEEK_SET etc. if stdio.h is not included (#629)
Seems POSIX is odd and unistd also defines SEEK_SET if stdio.h This simply follows the pattern several other C libraries take of setting these macros to the same values in stdio if that header is not included.
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/unistd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h
index da0d472d2b..6a879684e4 100644
--- a/Libraries/LibC/unistd.h
+++ b/Libraries/LibC/unistd.h
@@ -1,3 +1,10 @@
+/* standard symbolic constants and types
+ *
+ * values from POSIX standard unix specification
+ *
+ * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html
+ */
+
#pragma once
#include <errno.h>
@@ -12,6 +19,14 @@ __BEGIN_DECLS
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
+/* lseek whence values */
+#ifndef _STDIO_H /* also defined in stdio.h */
+#define SEEK_SET 0 /* from beginning of file. */
+#define SEEK_CUR 1 /* from current position in file. */
+#define SEEK_END 2 /* from the end of the file. */
+#endif
+
+
extern char** environ;
int get_process_name(char* buffer, int buffer_size);