From 7ffb6e99c3662322fd9ffdd4417c2aabd4af95b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 19 Apr 2026 17:29:04 +0200 Subject: [PATCH] tools/nolibc: add creat() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- tools/include/nolibc/fcntl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 */ -- 2.47.3