fix: align POSIX stdio and argument handling, clarify Intel iwlwifi licensing

This commit is contained in:
2026-08-09 10:42:09 +02:00
parent a06ef0192d
commit 771c3a5a98
15 changed files with 197 additions and 19 deletions
+1 -1
View File
@@ -12,4 +12,4 @@
#pragma once
#define MONTAUK_BUILD_NUMBER 92
#define MONTAUK_BUILD_NUMBER 94
+3 -1
View File
@@ -5,7 +5,9 @@
* Register offsets, firmware command IDs and wire-format structures follow
* Intel's dual BSD/GPLv2-licensed iwlwifi API headers, as consolidated in
* OpenBSD's if_iwxreg.h (ISC/BSD). Only the subset used by this driver is
* kept. See 0:/os/licenses/NOTICES.txt for the full attribution.
* kept. MontaukOS relies on the BSD license option; see
* montaukos.org/THIRD-PARTY-NOTICES.txt and 0:/os/licenses/NOTICES.txt for
* the full attribution and license terms.
*
* Copyright (c) 2026 Daniel Hammer
* Portions Copyright (c) 2017 Intel Deutschland GmbH
+11 -2
View File
@@ -714,8 +714,17 @@ namespace Ipc {
g_handleTableLocks[slot].Acquire();
uint64_t& bm0 = g_handleBitmaps[slot][0];
uint64_t& bm1 = g_handleBitmaps[slot][1];
// Find first zero bit in bitmap (free slot)
uint64_t bits0 = ~bm0;
// Find first zero bit in bitmap (free slot).
//
// Handles 0, 1 and 2 are never allocated: to POSIX code those numbers
// ARE stdin/stdout/stderr, and the libc routes read()/write() on them
// to the terminal (SYS_GETCHAR/SYS_PUTCHAR) rather than to this table.
// Handing them out as file handles makes the two meanings collide --
// a program's third open() would own "stderr", and every write(2, ...)
// it made would land in that file instead of on screen. Reserving them
// here rather than at process setup keeps the rule in one place and
// immune to a stale bitmap.
uint64_t bits0 = ~bm0 & ~0x7ULL;
uint64_t bits1 = ~bm1;
if (bits0) {
int i = __builtin_ctzll(bits0);