libc: Add creat()
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
apio 2023-03-19 19:21:36 +01:00
parent 31ef96ebfc
commit bab9600be5
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,9 @@ extern "C"
/* Open a file path and return a file descriptor to it. */
int open(const char* path, int flags, ...);
/* Create a file and return a file descriptor to it. */
int creat(const char* path, mode_t mode);
#ifdef __cplusplus
}
#endif

View File

@ -18,4 +18,9 @@ extern "C"
va_end(ap);
__errno_return(rc, int);
}
int creat(const char* path, mode_t mode)
{
return open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
}