mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
tools/nolibc: add creat()
creat() is a simple wrapper around open(). Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260419-nolibc-open-mode-v1-2-8dc5a960daa7@weissschuh.net
This commit is contained in:
@@ -66,4 +66,14 @@ int open(const char *path, int flags, ...)
|
||||
return __sysret(_sys_open(path, flags, mode));
|
||||
}
|
||||
|
||||
/*
|
||||
* int creat(const char *path, mode_t mode);
|
||||
*/
|
||||
|
||||
static __attribute__((unused))
|
||||
int creat(const char *path, mode_t mode)
|
||||
{
|
||||
return open(path, O_CREAT | O_WRONLY | O_TRUNC, mode);
|
||||
}
|
||||
|
||||
#endif /* _NOLIBC_FCNTL_H */
|
||||
|
||||
Reference in New Issue
Block a user