made vfs changes

This commit is contained in:
2026-01-18 11:59:45 -05:00
parent 1073362007
commit fd7ee1aa3b
2 changed files with 2 additions and 4 deletions

BIN
Build.tar

Binary file not shown.

View File

@@ -58,14 +58,12 @@ local function allocFD(task)
end end
local function allocFD(task) local function allocFD(task)
-- enforce per-task limit
local count = 0 local count = 0
for _ in pairs(task.fd) do count = count + 1 end for _ in pairs(task.fd) do count = count + 1 end
if count >= kernel.config.maxFilesPerTask then if count >= kernel.config.maxFilesPerTask then
error("EMFILE") -- Too many open files in this task error("EMFILE")
end end
-- find first free FD
local fd = 0 local fd = 0
while task.fd[fd] do fd = fd + 1 end while task.fd[fd] do fd = fd + 1 end
return fd return fd
@@ -74,7 +72,7 @@ end
local total=0 local total=0
local function checkSystemLimit() local function checkSystemLimit()
if total >= kernel.config.maxOpenFiles-16 then if total >= kernel.config.maxOpenFiles-16 then
error("ENFILE") -- Too many open files in the system error("ENFILE")
end end
end end