feat: unify system status codes

This commit is contained in:
daniel committed 2026-09-30 09:43:18 +02:00
1 parent 93894b8fe5
commit 8a3ffb2be1
46 files changed
+1499 -489

No files matched your search

+4 -4
View File
@@ -115,15 +115,15 @@ namespace montauk::abi {
// Decrements refcount; actually unmaps when refcount reaches 0.
inline int Sys_UnloadLib(uint64_t handle) {
int slot = GetCurrentSlot();
if (slot < 0) return -1;
if (slot < 0) return GenericFailure;
int libSlot = (int)handle - 1;
if (libSlot < 0 || libSlot >= MaxLibsPerProcess) return -1;
if (libSlot < 0 || libSlot >= MaxLibsPerProcess) return InvalidArgument;
g_libLocks[slot].Acquire();
if (!g_libTable[slot][libSlot].inUse) {
g_libLocks[slot].Release();
return -1;
return InvalidArgument;
}
g_libTable[slot][libSlot].refcount--;
@@ -144,7 +144,7 @@ namespace montauk::abi {
}
g_libLocks[slot].Release();
return 0;
return Success;
}
// Resolve a symbol in a loaded library.