Merge branch 'epollet-test' into 'master'
Add failed epollet test See merge request redox-os/relibc!997
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use core::{arch::asm, num::NonZeroU64, ptr};
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use core::arch::asm;
|
||||
|
||||
use super::{Pal, types::*};
|
||||
use crate::{
|
||||
@@ -19,6 +20,7 @@ use crate::{
|
||||
ld_so::tcb::OsSpecific,
|
||||
out::Out,
|
||||
};
|
||||
use core::{num::NonZeroU64, ptr};
|
||||
// use header::sys_times::tms;
|
||||
use crate::{
|
||||
error::{Errno, Result},
|
||||
|
||||
@@ -11,6 +11,7 @@ FAILING_TESTS=tls \
|
||||
mkfifo \
|
||||
sigchld \
|
||||
stdlib/ptsname \
|
||||
sys_epoll/epollet \
|
||||
sys_mman/fmap \
|
||||
signals/pthread_kill-child \
|
||||
unistd/isatty \
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
ctl ADD: 0
|
||||
wait for HUP, edge-triggered: 1
|
||||
wait for HUP again: 0
|
||||
ctl MOD: 0
|
||||
wait for HUP: 1
|
||||
@@ -0,0 +1,5 @@
|
||||
ctl ADD: 0
|
||||
wait for HUP, edge-triggered: 1
|
||||
wait for HUP again: 0
|
||||
ctl MOD: 0
|
||||
wait for HUP: 1
|
||||
@@ -0,0 +1,46 @@
|
||||
// test code found on dbus, currently hangs on redox
|
||||
|
||||
#include <sys/epoll.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define _DBUS_ZERO(object) (memset (&(object), '\0', sizeof ((object))))
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
struct epoll_event input;
|
||||
struct epoll_event output;
|
||||
int epfd = epoll_create1 (EPOLL_CLOEXEC);
|
||||
|
||||
int pipefds[2];
|
||||
pipe(pipefds);
|
||||
close(pipefds[1]);
|
||||
int fd = pipefds[0];
|
||||
|
||||
int ret;
|
||||
|
||||
_DBUS_ZERO (input);
|
||||
|
||||
input.events = EPOLLHUP | EPOLLET;
|
||||
ret = epoll_ctl (epfd, EPOLL_CTL_ADD, fd, &input);
|
||||
printf ("ctl ADD: %d\n", ret);
|
||||
|
||||
ret = epoll_wait (epfd, &output, 1, -1);
|
||||
printf ("wait for HUP, edge-triggered: %d\n", ret);
|
||||
|
||||
ret = epoll_wait (epfd, &output, 1, 100);
|
||||
printf ("wait for HUP again: %d\n", ret);
|
||||
|
||||
input.events = EPOLLHUP;
|
||||
ret = epoll_ctl (epfd, EPOLL_CTL_MOD, fd, &input);
|
||||
printf ("ctl MOD: %d\n", ret);
|
||||
|
||||
ret = epoll_wait (epfd, &output, 1, -1);
|
||||
printf ("wait for HUP: %d\n", ret);
|
||||
|
||||
close(fd);
|
||||
close(epfd);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user