mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 20:40:28 +00:00
Add posix semaphores support
There's still some bugs to work out on Windows and OpenBSD.
This commit is contained in:
parent
f52f65b2e3
commit
8111462789
36 changed files with 779 additions and 59 deletions
|
@ -133,7 +133,8 @@
|
|||
* @raise ENOENT if `file` doesn't exist when `O_CREAT` isn't in `flags`
|
||||
* @raise ENOENT if `file` points to a string that's empty
|
||||
* @raise ENOMEM if insufficient memory was available
|
||||
* @raise EMFILE if `RLIMIT_NOFILE` has been reached
|
||||
* @raise EMFILE if process `RLIMIT_NOFILE` has been reached
|
||||
* @raise ENFILE if system-wide file limit has been reached
|
||||
* @raise EOPNOTSUPP if `file` names a named socket
|
||||
* @raise EFAULT if `file` points to invalid memory
|
||||
* @raise ETXTBSY if writing is requested on `file` that's being executed
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_SEMAPHORE_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_SEMAPHORE_H_
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define SEM_FAILED ((sem_t *)0)
|
||||
|
||||
typedef struct {
|
||||
volatile int __val[4 * sizeof(long) / sizeof(int)];
|
||||
} sem_t;
|
||||
|
||||
int sem_close(sem_t *);
|
||||
int sem_destroy(sem_t *);
|
||||
int sem_getvalue(sem_t *, int *);
|
||||
int sem_init(sem_t *, int, unsigned);
|
||||
sem_t *sem_open(const char *, int, ...);
|
||||
int sem_post(sem_t *);
|
||||
int sem_timedwait(sem_t *, const struct timespec *);
|
||||
int sem_trywait(sem_t *);
|
||||
int sem_unlink(const char *);
|
||||
int sem_wait(sem_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_SEMAPHORE_H_ */
|
|
@ -24,6 +24,7 @@
|
|||
#include "libc/nt/enum/fileflagandattributes.h"
|
||||
#include "libc/nt/enum/filesharemode.h"
|
||||
#include "libc/nt/enum/io.h"
|
||||
#include "libc/nt/enum/movefileexflags.h"
|
||||
#include "libc/nt/errors.h"
|
||||
#include "libc/nt/files.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue