#include <common/utils.h>
#include <common/align.h>
#include <common/time.h>
-#include <sys/eventfd.h>
#include <sys/stat.h>
#include <time.h>
#include <signal.h>
#include <common/hashtable/utils.h>
#include <common/kernel-ctl/kernel-ctl.h>
#include <common/credentials.h>
-#include <sys/eventfd.h>
#include <sys/stat.h>
#include <time.h>
#include <signal.h>
#include <common/align.h>
#include <common/time.h>
#include <common/hashtable/utils.h>
-#include <sys/eventfd.h>
#include <sys/stat.h>
#include <time.h>
#include <signal.h>
*
*/
+#include <unistd.h>
+
+#include <common/compat/fcntl.h>
#include <common/payload.h>
#include <common/payload-view.h>
#include <tap/tap.h>
-#include <sys/eventfd.h>
static const int TEST_COUNT = 5;
diag("Validating fd push/pop order");
for (i = 0; i < 3; i++) {
- int fd = eventfd(0, 0);
+ int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
struct fd_handle *handle;
assert(fd >= 0);
diag("Validating fd pop imbalance");
for (i = 0; i < 10; i++) {
struct fd_handle *handle;
- int fd = eventfd(0, 0);
+ int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
assert(fd >= 0);
static void test_fd_pop_fd_root_views(void)
{
int ret, i;
- const int fd = eventfd(0, 0);
- struct fd_handle *handle = fd_handle_create(fd);
+ int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
+ struct fd_handle *handle;
struct lttng_payload payload;
const char * const test_description = "Same file descriptor returned when popping from different top-level views";
- lttng_payload_init(&payload);
+ assert(fd >= 0);
+ handle = fd_handle_create(fd);
assert(handle);
+ lttng_payload_init(&payload);
+
diag("Validating root view fd pop behaviour");
ret = lttng_payload_push_fd_handle(&payload, handle);
if (ret) {
*
*/
+#include <common/compat/fcntl.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/payload.h>
#include <common/payload-view.h>
#include <common/utils.h>
#include <common/defaults.h>
#include <tap/tap.h>
-#include <sys/eventfd.h>
#include <stdbool.h>
#include <common/error.h>
#include <lttng/constant.h>
for (i = 0; i < fd_count; i++) {
struct fd_handle *handle;
- const int fd = eventfd(0, 0);
+ int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
if (fd < 0) {
- PERROR("Failed to create event fd while creating test payload");
+ PERROR("Failed to create fd while creating test payload");
goto error;
}
handle = fd_handle_create(fd);
if (!handle) {
if (close(fd)) {
- PERROR("Failed to close event fd while preparing test payload");
+ PERROR("Failed to close fd while preparing test payload");
goto error;
}
}
goto error;
}
- fd = eventfd(0, 0);
+ fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
if (fd < 0) {
- PERROR("Failed to create event fd while creating test payload");
+ PERROR("Failed to create fd while creating test payload");
goto error;
}
handle = fd_handle_create(fd);
if (!handle) {
if (close(fd)) {
- PERROR("Failed to close event fd while preparing test payload");
+ PERROR("Failed to close fd while preparing test payload");
goto error;
}
}
goto error;
}
- fd = eventfd(0, 0);
+ fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
if (fd < 0) {
- PERROR("Failed to create event fd while creating test payload");
+ PERROR("Failed to create fd while creating test payload");
goto error;
}
handle = fd_handle_create(fd);
if (!handle) {
if (close(fd)) {
- PERROR("Failed to close event fd while preparing test payload");
+ PERROR("Failed to close fd while preparing test payload");
goto error;
}
}