OSDN Git Service

Last portion of libc_hidden_proto removal.
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / open64.c
1 /*
2  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3  *
4  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5  */
6
7 #include <features.h>
8 #include <fcntl.h>
9 #include <stdarg.h>
10
11 #ifdef __UCLIBC_HAS_LFS__
12
13 #ifndef O_LARGEFILE
14 # define O_LARGEFILE    0100000
15 #endif
16
17 extern __typeof(open64) __libc_open64;
18 extern __typeof(open) __libc_open;
19 libc_hidden_proto(__libc_open)
20
21 /* Open FILE with access OFLAG.  If OFLAG includes O_CREAT,
22    a third argument is the file protection.  */
23 libc_hidden_proto(__libc_open64)
24 int __libc_open64 (const char *file, int oflag, ...)
25 {
26     mode_t mode = 0;
27
28     if (oflag & O_CREAT)
29     {
30         va_list arg;
31         va_start (arg, oflag);
32         mode = va_arg (arg, mode_t);
33         va_end (arg);
34     }
35
36     return __libc_open(file, oflag | O_LARGEFILE, mode);
37 }
38 libc_hidden_def(__libc_open64)
39
40 /* libc_hidden_proto(open64) */
41 weak_alias(__libc_open64,open64)
42 libc_hidden_weak(open64)
43 #endif /* __UCLIBC_HAS_LFS__ */