Fix: invalid discarded events on start/stop without event production
[lttng-tools.git] / src / common / compat / dirent.h
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
14static inline
15int lttng_dirfd(DIR *dir) {
16 return dirfd(dir);
17}
18#else
19# ifndef __XOPEN_OR_POSIX
20static inline
21int lttng_dirfd(DIR *dir) {
22 return dir->dd_fd;
23}
24# else
25static inline
26int lttng_dirfd(DIR *dir) {
27 return dir->d_fd;
28}
29# endif
30#endif
31
32#endif /* _COMPAT_DIRENT_H */
This page took 0.036345 seconds and 4 git commands to generate.