Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AIX operating system support #1704

Merged
merged 4 commits into from Aug 21, 2023
Merged

Conversation

ecnelises
Copy link
Contributor

AIX does not have epoll or kqueue functionality, so it relies on force_poll_poll feature.

syscall!(pipe2(fds.as_mut_ptr(), libc::O_NONBLOCK | libc::O_CLOEXEC))?;
#[cfg(target_os = "aix")]
syscall!(pipe(fds.as_mut_ptr()))?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to set the libc::O_NONBLOCK | libc::O_CLOEXEC otherwise this will not work.

AIX does not have pipe2 system call. Use pipe with fcntl instead.
@@ -265,6 +265,32 @@ mod pipe {
}
}
}

#[cfg(target_os = "aix")]
fn pipe2() -> io::Result<(RawFd, RawFd)> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is essentially the same code as in src/sys/unix/pipe.rs, maybe we should reuse that code.

@ecnelises
Copy link
Contributor Author

cargo check --target x86_64-unknown-illumos --no-default-features --features os-poll fails because no os-ext feature specified, and crate::unix::pipe::new relies on os-ext. Should we guard mod pipe with os-ext?

@Thomasdezeeuw
Copy link
Collaborator

@ecnelises I've opened ecnelises#1 to solve that.

This also adds a new function sys::unix::pipe::new_raw that creates a
pipe, returning the raw fds. This is used by the Waker implementation
and of course sys::unix::pipe::new (which is exposed as
mio::unix::pipe::new).
@Thomasdezeeuw Thomasdezeeuw merged commit 9f21ce1 into tokio-rs:master Aug 21, 2023
20 checks passed
@Thomasdezeeuw
Copy link
Collaborator

Thanks @ecnelises

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants