aboutsummaryrefslogtreecommitdiffstats
path: root/ports/linux/guts/__fxstatat.c
blob: 23dfa738cfdc04fac0334851f4c5a70604439ba0 (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
28
29
30
31
32
33
34
/* 
 * Copyright (c) 2008-2010 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 * static int
 * wrap___fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags) {
 *	int rc = -1;
 */

	struct stat64 buf64;
	/* populate buffer with complete data */
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
	if (dirfd != AT_FDCWD) {
		errno = ENOSYS;
		return -1;
	}
	if (flags & AT_SYMLINK_NOFOLLOW) {
		rc = real___lxstat(ver, path, buf);
	} else {
		rc = real___xstat(ver, path, buf);
	}
#else
	real___fxstatat(ver, dirfd, path, buf, flags);
#endif
	/* obtain fake data */
	rc = wrap___fxstatat64(ver, dirfd, path, &buf64, flags);
	/* overwrite */
	pseudo_stat32_from64(buf, &buf64);

/*	return rc;
 * }
 */