summaryrefslogtreecommitdiff
path: root/src/libstddjb/dir_fd.c
blob: 403853ff90ed33a93ea3cec025a94bca4b5571ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ISC license. */

#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
#include <skalibs/direntry.h>

#ifdef SKALIBS_HASDIRFD

int dir_fd (DIR *dir)
{
  return dirfd(dir) ;
}

#else

 /* Pokes at the internals of DIR - no choice here */

int dir_fd (DIR *dir)
{
  return dir->dd_fd ;
}

#endif