]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/common/open64.c
Inital import
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / 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 /* Open FILE with access OFLAG.  If OFLAG includes O_CREAT,
18    a third argument is the file protection.  */
19 int open64 (const char *file, int oflag, ...)
20 {
21     mode_t mode = 0;
22
23     if (oflag & O_CREAT)
24     {
25         va_list arg;
26         va_start (arg, oflag);
27         mode = va_arg (arg, mode_t);
28         va_end (arg);
29     }
30
31     return open(file, oflag | O_LARGEFILE, mode);
32 }
33 #ifndef __LINUXTHREADS_OLD__
34 libc_hidden_def(open64)
35 #else
36 libc_hidden_weak(open64)
37 strong_alias(open64,__libc_open64)
38 #endif
39
40 #endif /* __UCLIBC_HAS_LFS__ */