fix: align POSIX stdio and argument handling, clarify Intel iwlwifi licensing
This commit is contained in:
+11
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user