Clean-up: run format-cpp on the tree
[lttng-tools.git] / src / common / compat / dirent.hpp
CommitLineData
5a2451c9
MJ
1/*
2 * Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
3 *
ab5be9fa 4 * SPDX-License-Identifier: MIT
5a2451c9 5 *
5a2451c9
MJ
6 */
7
8#ifndef _COMPAT_DIRENT_H
9#define _COMPAT_DIRENT_H
10
11#include <dirent.h>
12
13#ifdef HAVE_DIRFD
28f23191
JG
14static inline int lttng_dirfd(DIR *dir)
15{
5a2451c9
MJ
16 return dirfd(dir);
17}
18#else
28f23191
JG
19#ifndef __XOPEN_OR_POSIX
20static inline int lttng_dirfd(DIR *dir)
21{
5a2451c9
MJ
22 return dir->dd_fd;
23}
28f23191
JG
24#else
25static inline int lttng_dirfd(DIR *dir)
26{
5a2451c9
MJ
27 return dir->d_fd;
28}
28f23191 29#endif
5a2451c9
MJ
30#endif
31
32#endif /* _COMPAT_DIRENT_H */
This page took 0.057446 seconds and 4 git commands to generate.