Skip to content

Commit dbd0844

Browse files
committed
adding back netbsd
1 parent ef261a8 commit dbd0844

File tree

1 file changed

+26
-0
lines changed
  • library/std/src/os/netbsd

1 file changed

+26
-0
lines changed

library/std/src/os/netbsd/net.rs

+26
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
#![unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
44

5+
use crate::ffi::CStr;
56
use crate::io;
67
use crate::os::unix::net;
78
use crate::sealed::Sealed;
@@ -40,6 +41,15 @@ pub trait UnixSocketExt: Sealed {
4041
/// ```
4142
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
4243
fn set_local_creds(&self, local_creds: bool) -> io::Result<()>;
44+
45+
/// Get a filter name if one had been set previously on the socket.
46+
#[unstable(feature = "acceptfilter", issue = "121891")]
47+
fn acceptfilter(&self) -> io::Result<&CStr>;
48+
49+
/// Set or disable a filter on the socket to filter incoming connections
50+
/// to defer it before accept(2)
51+
#[unstable(feature = "acceptfilter", issue = "121891")]
52+
fn set_acceptfilter(&self, name: &CStr) -> io::Result<()>;
4353
}
4454

4555
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
@@ -51,6 +61,14 @@ impl UnixSocketExt for net::UnixDatagram {
5161
fn set_local_creds(&self, local_creds: bool) -> io::Result<()> {
5262
self.as_inner().set_local_creds(local_creds)
5363
}
64+
65+
fn acceptfilter(&self) -> io::Result<&CStr> {
66+
self.as_inner().acceptfilter()
67+
}
68+
69+
fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
70+
self.as_inner().set_acceptfilter(name)
71+
}
5472
}
5573

5674
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
@@ -62,4 +80,12 @@ impl UnixSocketExt for net::UnixStream {
6280
fn set_local_creds(&self, local_creds: bool) -> io::Result<()> {
6381
self.as_inner().set_local_creds(local_creds)
6482
}
83+
84+
fn acceptfilter(&self) -> io::Result<&CStr> {
85+
self.as_inner().acceptfilter()
86+
}
87+
88+
fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
89+
self.as_inner().set_acceptfilter(name)
90+
}
6591
}

0 commit comments

Comments
 (0)