summaryrefslogtreecommitdiffstats
path: root/lib/libc/compat-43/creat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/compat-43/creat.c')
-rw-r--r--lib/libc/compat-43/creat.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c
index fc3be06..5ee4531 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/compat-43/creat.c
@@ -36,11 +36,23 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <fcntl.h>
#include "un-namespace.h"
+#include "libc_private.h"
+__weak_reference(__libc_creat, __creat);
+__weak_reference(__libc_creat, _creat);
+
+#pragma weak creat
int
-__creat(const char *path, mode_t mode)
+creat(const char *path, mode_t mode)
{
- return(_open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
+
+ return (((int (*)(const char *, mode_t))
+ __libc_interposing[INTERPOS_creat])(path, mode));
+}
+
+int
+__libc_creat(const char *path, mode_t mode)
+{
+
+ return(__sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
}
-__weak_reference(__creat, creat);
-__weak_reference(__creat, _creat);
OpenPOWER on IntegriCloud