diff options
| author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-09 16:47:01 +0000 |
|---|---|---|
| committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-09 16:47:01 +0000 |
| commit | 62a21af8006ab04282fdc354c5b4dc765f56d058 (patch) | |
| tree | 568761d58289238aa14cced3f0010809d4d28c00 /libc/sysdeps/linux/common/open.c | |
| parent | ef250238dc1572caf859c2b64652f9cdfb0d9e42 (diff) | |
| download | uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.bz2 uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.xz | |
BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/sysdeps/linux/common/open.c')
| -rw-r--r-- | libc/sysdeps/linux/common/open.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index 822ac4f63..b4bef3c63 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -7,7 +7,7 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#include "syscalls.h" +#include <sys/syscall.h> #include <stdlib.h> #include <stdarg.h> #include <fcntl.h> @@ -15,26 +15,25 @@ #include <sys/param.h> extern __typeof(open) __libc_open; -libc_hidden_proto(__libc_open) +extern __typeof(creat) __libc_creat; #define __NR___syscall_open __NR_open static inline _syscall3(int, __syscall_open, const char *, file, int, flags, __kernel_mode_t, mode); -int __libc_open(const char *file, int flags, ...) +libc_hidden_proto(__libc_open) +int __libc_open(const char *file, int oflag, ...) { - /* gcc may warn about mode being uninitialized. - * Just ignore that, since gcc is wrong. */ - mode_t mode; + mode_t mode = 0; - if (flags & O_CREAT) { - va_list ap; - - va_start(ap, flags); - mode = va_arg(ap, mode_t); - va_end(ap); + if (oflag & O_CREAT) { + va_list arg; + va_start (arg, oflag); + mode = va_arg (arg, mode_t); + va_end (arg); } - return __syscall_open(file, flags, mode); + + return __syscall_open(file, oflag, mode); } libc_hidden_def(__libc_open) @@ -42,7 +41,8 @@ libc_hidden_proto(open) weak_alias(__libc_open,open) libc_hidden_weak(open) -int creat(const char *file, mode_t mode) +int __libc_creat(const char *file, mode_t mode) { return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); } +weak_alias(__libc_creat,creat) |
