base: stability fixes — acpid EC, inputd, block driver, ipcd UDS, netstack loopback, ptyd, ramfs, randd, scheme-utils blocking

This commit is contained in:
Red Bear OS
2026-07-09 23:54:10 +03:00
parent 9f3f77cb72
commit 417fe4a4fa
11 changed files with 241 additions and 63 deletions
+29
View File
@@ -12,6 +12,8 @@ pub type PacketBuffer = smoltcp::storage::PacketBuffer<'static, ()>;
pub struct LoopbackDevice {
name: Rc<str>,
buffer: PacketBuffer,
enabled: bool,
promiscuous: bool,
}
impl Default for LoopbackDevice {
@@ -23,6 +25,8 @@ impl Default for LoopbackDevice {
LoopbackDevice {
name: "loopback".into(),
buffer,
enabled: true,
promiscuous: false,
}
}
}
@@ -58,4 +62,29 @@ impl LinkDevice for LoopbackDevice {
}
fn set_ip_address(&mut self, _addr: smoltcp::wire::IpCidr) {}
fn is_enabled(&self) -> bool {
self.enabled
}
fn set_enabled(&mut self, enabled: bool) {
self.enabled = enabled;
}
fn is_promiscuous(&self) -> bool {
self.promiscuous
}
fn set_promiscuous(&mut self, enabled: bool) {
self.promiscuous = enabled;
}
fn mtu(&self) -> usize {
1500
}
fn set_mtu(&mut self, _mtu: usize) {
// Loopback's packet buffer is fixed at 1500 bytes at construction;
// reallocation is not supported. The new value is ignored.
}
}
+4 -2
View File
@@ -53,10 +53,12 @@ impl<'a> SchemeSocket for RawSocket<'a> {
}
fn hop_limit(&self) -> u8 {
0
smoltcp::socket::raw::Socket::hop_limit(self)
}
fn set_hop_limit(&mut self, _hop_limit: u8) {}
fn set_hop_limit(&mut self, hop_limit: u8) {
smoltcp::socket::raw::Socket::set_hop_limit(self, hop_limit);
}
fn new_socket(
socket_set: &mut SocketSet,
+7 -5
View File
@@ -922,12 +922,14 @@ where
}
fn fsync(&mut self, fd: usize, _ctx: &CallerCtx) -> SyscallResult<()> {
{
let _file = self.handles.get_mut(fd)?;
}
// Verify the socket exists. The netstack is event-driven (polled by
// userspace via fevent), so there is no kernel-side buffer to flush.
// POSIX fsync(2) on a socket is required to return success when the
// socket is valid; the underlying protocol (TCP) handles acknowledgements
// asynchronously through the normal poll loop.
// Cross-referenced with Linux net/socket.c: sockfs_fsync -> sock_no_fsync.
let _file = self.handles.get(fd)?;
Ok(())
// TODO Implement fsyncing
// self.0.network_fsync()
}
fn fpath(&mut self, fd: usize, buf: &mut [u8], _ctx: &CallerCtx) -> SyscallResult<usize> {