summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/dirfd.c
blob: 48e955450f571ef96f6815b18edf0cbd91659f5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <dirent.h>
#include <errno.h>
#include "dirstream.h"

int attribute_hidden __dirfd(DIR * dir)
{
	if (!dir || dir->dd_fd == -1) {
		__set_errno(EBADF);
		return -1;
	}

	return dir->dd_fd;
}
strong_alias(__dirfd,dirfd)