From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Garnett To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] No binary semaphore in C API? Date: Mon, 26 Mar 2001 03:53:00 -0000 Message-id: References: <20010316140116.A1062@visi.com> <3AB67D44.AFB5E10D@redhat.com> X-SW-Source: 2001-03/msg00410.html Jonathan Larmour writes: > Grant Edwards wrote: > > > > So, I wanted to use binary semaphores, but can't find the API. > > The program is using counting semaphores right now, but using a > > binary ones would be a bit more "defensive". > > > > Is there a technical reason that there isn't a C API for binary > > semaphores, or is it something that just hasn't been done yet? > > Certainly no technical reason. Nick may not have done it out of principle. > But right now he's on vacation, so it's best to wait till he returns. > It was never intended that the KAPI be a complete reflection of the kernel implementation. It is meant to be a consistent, self-contained, small API that can be used by C applications. Like the uITRON and POSIX APIs it only exposes a subset. It was considered unnecessary to export binary semaphores, since a counting semaphore initialized to 1 is functionally equivalent. If I had had my way the KAPI would have been even more minimal that it currently is. -- Nick Garnett, eCos Kernel Architect Red Hat, Cambridge, UK