From: Thomas Weißschuh Date: Sun, 19 Apr 2026 15:29:04 +0000 (+0200) Subject: tools/nolibc: add creat() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ffb6e99c3662322fd9ffdd4417c2aabd4af95b9;p=thirdparty%2Fkernel%2Flinux.git tools/nolibc: add creat() creat() is a simple wrapper around open(). Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://patch.msgid.link/20260419-nolibc-open-mode-v1-2-8dc5a960daa7@weissschuh.net --- diff --git a/tools/include/nolibc/fcntl.h b/tools/include/nolibc/fcntl.h index ed2f5553c65a0..56650a36f8569 100644 --- a/tools/include/nolibc/fcntl.h +++ b/tools/include/nolibc/fcntl.h @@ -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 */