]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r295385: semget(): Check for [EEXIST] error first.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 9 Apr 2016 13:32:42 +0000 (13:32 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 9 Apr 2016 13:32:42 +0000 (13:32 +0000)
commita84c51f26258270ff7c0a1176f948c52ccaca8f5
treebf032f976c283c35de30d920650828c88cf09e0e
parent67471be88878f094912fb719d6cbf3f0e1846dda
MFC r295385: 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

git-svn-id: svn://svn.freebsd.org/base/stable/10@297747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/sysv_sem.c
tools/regression/sysvsem/semtest.c