Open Bug 1192500 Opened 6 years ago Updated 4 years ago

ssl/sslmutex.c uses sem_init/sem_destroy that are unsupported on iOS

Categories

(NSS :: Libraries, defect, P3)

3.19
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: sdefresne, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36

Steps to reproduce:

When building ssl/sslmutex.c targeting iOS with -Wdeprecated-declarations, the compiler reports that sem_init and sem_destroy are deprecated. In fact those interface are not implemented on iOS, they just return an error.


Actual results:

../../net/third_party/nss/ssl/sslmutex.c:522:14: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
        rv = sem_init(&pMutex->u.sem, shared, 1);
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/sys/semaphore.h:55:5: note: 'sem_init' has been explicitly marked deprecated here
int sem_init(sem_t *, int, unsigned int) __deprecated;
    ^
../../net/third_party/nss/ssl/sslmutex.c:544:7: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]
        rv = sem_destroy(&pMutex->u.sem);
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/sys/semaphore.h:53:5: note: 'sem_destroy' has been explicitly marked deprecated here
int sem_destroy(sem_t *) __deprecated;



Expected results:

No warning should be reported by the compiler. Possible replacements are GCD semaphores or named semaphore (sem_open/sem_close).

http://stackoverflow.com/a/27847103/5353
Duplicate of this bug: 1193525
http://stackoverflow.com/questions/1413785/sem-init-on-os-x includes this gem:

> Wow. <semaphore.h> declares sem_init so that it compiles properly on OS X, but it returns -1 with errno set to ENOSYS (function not implemented).

Clearly, no one is actually using these on OS X.  Maybe we should just remove support for shared semaphores in libssl on OS X.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.