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:
Thomas Weißschuh
2026-04-19 17:29:04 +02:00
parent 0cb18b5b27
commit 7ffb6e99c3

View File

@@ -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 */