Add creat(3).
This commit is contained in:
parent
391d844aca
commit
c25e4a1842
|
@ -125,6 +125,7 @@ close.o \
|
|||
$(CPUDIR)/fork.o \
|
||||
$(CPUDIR)/signal.o \
|
||||
$(CPUDIR)/syscall.o \
|
||||
creat.o \
|
||||
dispmsg_issue.o \
|
||||
dlfcn.o \
|
||||
dup2.o \
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
The Sortix C Library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The Sortix C Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
creat.cpp
|
||||
Create a file.
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
extern "C" int creat(const char* path, mode_t mode)
|
||||
{
|
||||
return open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
|
||||
}
|
|
@ -53,12 +53,10 @@ struct flock
|
|||
pid_t l_pid; /* Process ID of the process holding the lock; returned with F_GETLK. */
|
||||
};
|
||||
|
||||
int creat(const char* path, mode_t mode);
|
||||
int fcntl(int fd, int cmd, ...);
|
||||
int open(const char* path, int oflag, ...);
|
||||
int openat(int fd, const char* path, int oflag, ...);
|
||||
#if defined(__SORTIX_SHOW_UNIMPLEMENTED)
|
||||
int creat(const char* path, mode_t mode);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in New Issue