summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/fstatat.c
blob: 149c1890d3bf29355cdd30f1499cb827af399fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * fstatat() for uClibc
 *
 * Copyright (C) 2009 Analog Devices Inc.
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */

#include <sys/syscall.h>
#include <sys/stat.h>
#include "xstatconv.h"

#ifdef __NR_fstatat64
int fstatat(int fd, const char *file, struct stat *buf, int flag)
{
	int ret;
	struct kernel_stat kbuf;

	ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
	if (ret == 0)
		__xstat_conv(&kbuf, buf);

	return ret;
}
#else
/* should add emulation with fstat() and /proc/self/fd/ ... */
#endif