zos: fix non-Release builds

z/OS doesn't support POSIX semaphores. On Release builds the code
paths that reference POSIX semaphore functions (e.g. sem_init())
are optimized away so linking succeeds but on a non-Release build
the references to the unavailable functions result in unresolved
symbol errors.

Stub the unavailable POSIX semaphore functions on z/OS as so the
code can link on non-Release builds.

PR-URL: https://github.com/libuv/libuv/pull/2737
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Richard Lau 2020-03-17 16:38:32 -04:00
parent 1099d298d4
commit a9c58e72a3
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
2 changed files with 30 additions and 0 deletions

View File

@ -556,3 +556,28 @@ size_t strnlen(const char* str, size_t maxlen) {
else
return p - str;
}
int sem_init(UV_PLATFORM_SEM_T* semid, int pshared, unsigned int value) {
UNREACHABLE();
}
int sem_destroy(UV_PLATFORM_SEM_T* semid) {
UNREACHABLE();
}
int sem_post(UV_PLATFORM_SEM_T* semid) {
UNREACHABLE();
}
int sem_trywait(UV_PLATFORM_SEM_T* semid) {
UNREACHABLE();
}
int sem_wait(UV_PLATFORM_SEM_T* semid) {
UNREACHABLE();
}

View File

@ -65,5 +65,10 @@ int scandir(const char* maindir, struct dirent*** namelist,
char *mkdtemp(char* path);
ssize_t os390_readlink(const char* path, char* buf, size_t len);
size_t strnlen(const char* str, size_t maxlen);
int sem_init(UV_PLATFORM_SEM_T* semid, int pshared, unsigned int value);
int sem_destroy(UV_PLATFORM_SEM_T* semid);
int sem_post(UV_PLATFORM_SEM_T* semid);
int sem_trywait(UV_PLATFORM_SEM_T* semid);
int sem_wait(UV_PLATFORM_SEM_T* semid);
#endif /* UV_OS390_SYSCALL_H_ */