blob: 06a5819d7a4c4ab3a9fa5ea52b80b40cbcfcc22e [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*
2 * openat() for uClibc
3 *
4 * Copyright (C) 2009 Analog Devices Inc.
5 *
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
8
9#define openat64 __xx_openat
10#include <sys/syscall.h>
11#include <fcntl.h>
12#undef openat64
13
14#ifdef __UCLIBC_HAS_LFS__
15
16#ifdef __NR_openat
17/* The openat() prototype is varargs based, but we don't care about that
18 * here, so need to provide our own dedicated signature.
19 */
20extern int openat64(int fd, const char *file, int oflag, mode_t mode);
21libc_hidden_proto(openat64)
22
23int openat64(int fd, const char *file, int oflag, mode_t mode)
24{
25 return openat(fd, file, oflag | O_LARGEFILE, mode);
26}
27libc_hidden_def(openat64)
28#else
29/* should add emulation with open() and /proc/self/fd/ ... */
30#endif
31
32#endif