misc: get haiku working

This commit is contained in:
Fancy2209
2024-12-30 03:36:40 -06:00
committed by GitHub
parent 970d880ceb
commit 9d42b977df
5 changed files with 28 additions and 3 deletions
+1
View File
@@ -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:
+4
View File
@@ -469,6 +469,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
@@ -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> {
@@ -496,6 +498,7 @@ impl TcpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
@@ -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<()> {
+4
View File
@@ -1864,6 +1864,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
@@ -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> {
@@ -1891,6 +1893,7 @@ impl UdpSocket {
target_os = "redox",
target_os = "solaris",
target_os = "illumos",
target_os = "haiku"
)))]
#[cfg_attr(
docsrs,
@@ -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<()> {
+10 -3
View File
@@ -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;
@@ -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};
@@ -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> {
+9
View File
@@ -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