X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=wrapper%2Ffdtable.h;h=69ff4aa3fc316830c5b6b353e704dde6e6be96cf;hb=c7f2a03aa26ba4e481f63c1824e02018edf475a2;hp=7e74290e94c7ff5b8c1a4f38a1cad05c9e930eaf;hpb=83f9bb7fb160c240d76b22bd049bb9ab57a37f55;p=lttng-modules.git diff --git a/wrapper/fdtable.h b/wrapper/fdtable.h index 7e74290e..69ff4aa3 100644 --- a/wrapper/fdtable.h +++ b/wrapper/fdtable.h @@ -41,4 +41,21 @@ int lttng_iterate_fd(struct files_struct *files, #define lttng_iterate_fd iterate_fd #endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + +static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt) +{ + return close_on_exec(fd, fdt); +} + +#else + +static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt) +{ + return FD_ISSET(fd, fdt->close_on_exec); +} + +#endif + #endif /* _LTTNG_WRAPPER_FDTABLE_H */