base: apply Red Bear patches on latest upstream/main

251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
This commit is contained in:
Red Bear OS
2026-07-11 11:39:24 +03:00
parent 1b17b3fc24
commit bd595851e2
251 changed files with 24641 additions and 5993 deletions
+10
View File
@@ -47,6 +47,16 @@ impl PortSet {
}
}
/// Increment the reference count for an already-claimed port (SO_REUSEADDR).
/// Always succeeds: the caller has indicated SO_REUSEADDR is set, so
/// multiple sockets are allowed to bind to the same port. The actual
/// collision check (returning EADDRINUSE) is done by `claim_port` first.
/// Returns true on success.
pub fn claim_port_reuse(&mut self, port: u16) -> bool {
self.ports.entry(port).and_modify(|c| *c += 1).or_insert(1);
true
}
pub fn acquire_port(&mut self, port: u16) {
*self.ports.entry(port).or_insert(0) += 1;
}