blob: 8380ec687318cd2f5e016181c4a624f42f746783 [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 openat __xx_openat
10#include <sys/syscall.h>
11#include <fcntl.h>
12#undef openat
13
14#ifdef __NR_openat
15/* The openat() prototype is varargs based, but we don't care about that
16 * here, so need to provide our own dedicated signature.
17 */
18extern int openat(int fd, const char *file, int oflag, mode_t mode);
19libc_hidden_proto(openat)
20
21_syscall4(int, openat, int, fd, const char *, file, int, oflag, mode_t, mode)
22libc_hidden_def(openat)
23#else
24/* should add emulation with open() and /proc/self/fd/ ... */
25#endif