1 /*
2 * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
3 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
4 */
5
6 #include <fcntl.h>
7 #include <sys/types.h>
8 #include <cancel.h>
9
10 int
creat(const char * file,mode_t mode)11 creat (const char *file, mode_t mode)
12 {
13 # ifdef __NR_creat
14 return _syscall2(int, __NC(creat), const char*, file, mode_t, mode)
15 # else
16 return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode);
17 # endif
18 }
19
20 CANCELLABLE_SYSCALL(int, creat, (const char *file, mode_t mode), (file, mode))
21
22 lt_libc_hidden(creat)
23