Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jun 2008 10:46:34 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        src-committers@freebsd.org
Cc:        cvs-src@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/sys semaphore.h
Message-ID:  <200806261046.34932.jhb@freebsd.org>
In-Reply-To: <200806261351.m5QDpjda006584@repoman.freebsd.org>
References:  <200806261351.m5QDpjda006584@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 26 June 2008 09:51:25 am John Baldwin wrote:
> jhb         2008-06-26 13:51:25 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/sys              semaphore.h 
>   Log:
>   SVN rev 180032 on 2008-06-26 13:51:25Z by jhb
>   
>   Change SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
>   to INT_MAX.  Otherwise, a process could create a semaphore (or increase
>   its value via ksem_post()) beyond INT_MAX and sem_getvalue() would return
>   a negative value.  sem_getvalue() is only supposed to return a negative
>   value if that is the number of waiters for that semaphore.
>   
>   MFC after:      2 weeks

Forgot to mention that other OS's I checked (glibc, Windows) use signed max 
constants (INT_MAX, LONG_MAX) rather than the unsigned constant.  Probably 
for the same reason.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806261046.34932.jhb>