blob: 649dd4ad858f38c566496b4b432f1cf7d6b1d33d [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3 *
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5 */
6
7#include <dirent.h>
8#include <errno.h>
9#include "dirstream.h"
10
11
12int dirfd(DIR * dir)
13{
14 if (!dir || dir->dd_fd == -1) {
15 __set_errno(EBADF);
16 return -1;
17 }
18
19 return dir->dd_fd;
20}
21libc_hidden_def(dirfd)