-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unistd/file: provide safe write/read/open/close functions
JIRA: RTOS-874
- Loading branch information
Showing
4 changed files
with
131 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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 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 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,35 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* Internal file operations | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _LIBPHOENIX_INTERNAL_FILE_H_ | ||
#define _LIBPHOENIX_INTERNAL_FILE_H_ | ||
|
||
|
||
#include <sys/types.h> | ||
|
||
|
||
size_t __safe_write(int fd, const void *buff, size_t size); | ||
|
||
|
||
ssize_t __safe_read(int fd, void *buf, size_t size); | ||
|
||
|
||
int __safe_open(const char *path, int oflag, mode_t mode); | ||
|
||
|
||
int __safe_close(int fd); | ||
|
||
|
||
#endif |
This file contains 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