Skip to content

Add AIX operating system support#1704

Merged
Thomasdezeeuw merged 4 commits into
tokio-rs:masterfrom
ecnelises:aix2
Aug 21, 2023
Merged

Add AIX operating system support#1704
Thomasdezeeuw merged 4 commits into
tokio-rs:masterfrom
ecnelises:aix2

Conversation

@ecnelises

Copy link
Copy Markdown
Contributor

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

Comment thread src/sys/unix/waker.rs Outdated
#[cfg(not(target_os = "aix"))]
syscall!(pipe2(fds.as_mut_ptr(), libc::O_NONBLOCK | libc::O_CLOEXEC))?;
#[cfg(target_os = "aix")]
syscall!(pipe(fds.as_mut_ptr()))?;

Copy link
Copy Markdown
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.
@ecnelises ecnelises requested a review from Thomasdezeeuw August 1, 2023 09:53
Comment thread src/sys/unix/waker.rs Outdated
}

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@Thomasdezeeuw

Copy link
Copy Markdown
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.

2 participants