aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts/closedir.c
blob: 32c008f1b343618a99d0802ed93febfe5d58d240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Copyright (c) 2012 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 * static int
 * wrap_closedir(DIR *dirp) {
 *	int rc = -1;
 */
	if (!dirp) {
		errno = EFAULT;
		return -1;
	}

	int fd = dirfd(dirp);
	pseudo_client_op(OP_CLOSE, 0, fd, -1, 0, 0);
	rc = real_closedir(dirp);

/*	return rc;
 * }
 */