diff options
| author | Scott Gasch <[email protected]> | 2026-08-22 15:27:59 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-08-22 15:27:59 -0700 |
| commit | dc0c9dbf405095a6483705b153f4c85c64499d4e (patch) | |
| tree | d83b20c0095726055327cb2879c0a53a591ff4de /src/unix.c | |
| parent | a99cc7a0289e4106f6bb1954660a3df5c53d470b (diff) | |
Bug fixes.
Diffstat (limited to 'src/unix.c')
| -rw-r--r-- | src/unix.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -424,10 +424,11 @@ Return value: **/ { - __asm__("rdtsc;" - : - : - : "%eax", "%edx"); + ULONG uLow, uHigh; + + __asm__ volatile("rdtsc" + : "=a" (uLow), "=d" (uHigh)); + return(((UINT64)uHigh << 32) | (UINT64)uLow); } @@ -1068,25 +1069,30 @@ SystemCreateSemaphore(ULONG uValue) return(u); } -FLAG +FLAG SystemDeleteSemaphore(ULONG u) { union semun { int val; struct semid_ds *buf; unsigned short *array; } value; + FLAG fRet = TRUE; + memset(&value, 0, sizeof(value)); LOCK_SYSTEM; - if ((u < MAX_SEM) && (g_rgSemaphores[u] >= 0)) + if ((u < MAX_SEM) && (g_rgSemaphores[u] >= 0)) { - if (semctl(g_rgSemaphores[u], 0, IPC_RMID, value) < 0) + if (semctl(g_rgSemaphores[u], 0, IPC_RMID, value) < 0) { - return(FALSE); + fRet = FALSE; + } + else + { + g_rgSemaphores[u] = -1; } - g_rgSemaphores[u] = -1; } UNLOCK_SYSTEM; - return(TRUE); + return(fRet); } void |
