]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
semget(): Check for [EEXIST] error first.
authorjilles <jilles@FreeBSD.org>
Sun, 7 Feb 2016 22:12:39 +0000 (22:12 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 7 Feb 2016 22:12:39 +0000 (22:12 +0000)
commitb2791f185cba92ad0c81fd19ad5ab4d88fd2681c
treed1ff67b50654cbedfcbd100e9ccea7def00ef75f
parent6e7e5621d9b1fb2151c468d82074db9c0e91b6ee
semget(): Check for [EEXIST] error first.

Although POSIX literally permits failing with [EINVAL] if IPC_CREAT and
IPC_EXCL were both passed, the semaphore set already exists and has fewer
semaphores than nsems, this does not allow an application to retry safely:
if the [EINVAL] is actually because of the semmsl limit, an infinite loop
would result.

PR: 206927
sys/kern/sysv_sem.c
tools/regression/sysvsem/semtest.c