mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02: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:
parent
0cb18b5b27
commit
7ffb6e99c3
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user