aboutsummaryrefslogtreecommitdiffstats
path: root/ports/darwin/guts/fstat.c
blob: 12e223357aba1ea1a65204e4762aaf1bbf918c8a (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
/*
 * Copyright (c) 2011 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 * int fstat(int fd, struct stat *buf)
 *	int rc = -1;
 */
	pseudo_msg_t *msg;

	rc = real_fstat(fd, buf);

	if (rc == -1) {
		return rc;
	}

	/* query database
	 * note that symlink canonicalizing is now automatic, so we
	 * don't need to check for a symlink on this end
	 */
	msg = pseudo_client_op(OP_FSTAT, 0, fd, -1, 0, buf);
	if (msg && msg->result == RESULT_SUCCEED) {
		pseudo_stat_msg(buf, msg);
	}

/*	return rc;
 * }
 */