mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:57:35 +00:00
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.
This commit is contained in:
parent
4288cfa65a
commit
79d8b9ae75
1 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue