-
Notifications
You must be signed in to change notification settings - Fork 7.4k
posix: Clean up various headers #16626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0873eee
posix: Move sys/stat.h to minimal libc
pfalcon ce8b3b0
posix: struct timespec: Move definition to sys/_timespec.h
pfalcon aa6f218
posix: time.h: Add workaround for outdated newlib used by Xtensa
pfalcon fa79039
posix: mqueue.h: Move O_CREAT and friends to fcntl.h
pfalcon 66a0f0d
posix: unistd.h: open() doesn't belong here
pfalcon 69b2bf8
libc: minimal: time.h: Don't (re)define struct timespec.
pfalcon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2019 Linaro Limited | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMESPEC_H_ | ||
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMESPEC_H_ | ||
|
||
#include <sys/types.h> | ||
|
||
struct timespec { | ||
time_t tv_sec; | ||
long tv_nsec; | ||
}; | ||
|
||
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMESPEC_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,49 @@ | ||
/* | ||
* Copyright (c) 2018 Linaro Limited | ||
* Copyright (c) 2018 Intel Corporation | ||
pfalcon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_STAT_H_ | ||
#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_STAT_H_ | ||
|
||
/* Dummy sys/stat.h to fulfill the requirements of certain libraries. | ||
*/ | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define S_IRWXU 00700 | ||
#define S_IRUSR 00400 | ||
#define S_IWUSR 00200 | ||
#define S_IXUSR 00100 | ||
|
||
#define S_IRWXG 00070 | ||
#define S_IRGRP 00040 | ||
#define S_IWGRP 00020 | ||
#define S_IXGRP 00010 | ||
|
||
#define S_IRWXO 00007 | ||
#define S_IROTH 00004 | ||
#define S_IWOTH 00002 | ||
#define S_IXOTH 00001 | ||
|
||
/* File open modes */ | ||
#define O_ACCMODE 0003 | ||
#define O_RDONLY 00 | ||
#define O_WRONLY 01 | ||
#define O_RDWR 02 | ||
|
||
#define SEEK_SET 0 /* Seek from beginning of file. */ | ||
#define SEEK_CUR 1 /* Seek from current position. */ | ||
#define SEEK_END 2 /* Seek from end of file. */ | ||
|
||
struct stat { | ||
unsigned long st_size; | ||
unsigned long st_blksize; | ||
unsigned long st_blocks; | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_STAT_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
*/ | ||
|
||
#include <string.h> | ||
#include <fcntl.h> | ||
#include <posix/unistd.h> | ||
#include "test_fs.h" | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.