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

Fix Haiku #7042

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ jobs:
strategy:
matrix:
target:
- name: x86_64-unknown-haiku
- name: armv7-sony-vita-newlibeabihf
exclude_features: "process,signal,rt-process-signal,full"
steps:
Expand Down
4 changes: 4 additions & 0 deletions tokio/src/net/tcp/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
Expand All @@ -477,6 +478,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
))))
)]
pub fn tos(&self) -> io::Result<u32> {
Expand All @@ -496,6 +498,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
Expand All @@ -504,6 +507,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
))))
)]
pub fn set_tos(&self, tos: u32) -> io::Result<()> {
Expand Down
4 changes: 4 additions & 0 deletions tokio/src/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
Expand All @@ -1872,6 +1873,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
))))
)]
pub fn tos(&self) -> io::Result<u32> {
Expand All @@ -1891,6 +1893,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
Expand All @@ -1899,6 +1902,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
))))
)]
pub fn set_tos(&self, tos: u32) -> io::Result<()> {
Expand Down
13 changes: 10 additions & 3 deletions tokio/src/net/unix/ucred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ impl UCred {
target_os = "linux",
target_os = "redox",
target_os = "android",
target_os = "openbsd"
target_os = "openbsd",
target_os = "haiku"
))]
pub(crate) use self::impl_linux::get_peer_cred;

Expand Down Expand Up @@ -67,7 +68,8 @@ pub(crate) use self::impl_noproc::get_peer_cred;
target_os = "linux",
target_os = "redox",
target_os = "android",
target_os = "openbsd"
target_os = "openbsd",
target_os = "haiku"
))]
pub(crate) mod impl_linux {
use crate::net::unix::{self, UnixStream};
Expand All @@ -77,7 +79,12 @@ pub(crate) mod impl_linux {

#[cfg(target_os = "openbsd")]
use libc::sockpeercred as ucred;
#[cfg(any(target_os = "linux", target_os = "redox", target_os = "android"))]
#[cfg(any(
target_os = "linux",
target_os = "redox",
target_os = "android",
target_os = "haiku"
))]
use libc::ucred;

pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
Expand Down
9 changes: 9 additions & 0 deletions tokio/src/signal/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ impl SignalKind {
Self(libc::SIGINT)
}

#[cfg(target_os = "haiku")]
/// Represents the `SIGPOLL` signal.
///
/// On POSIX systems this signal is sent when I/O operations are possible
/// on some file descriptor. By default, this signal is ignored.
pub const fn io() -> Self {
Self(libc::SIGPOLL)
}
#[cfg(not(target_os = "haiku"))]
/// Represents the `SIGIO` signal.
///
/// On Unix systems this signal is sent when I/O operations are possible
Expand Down
Loading