Bryan O'Donoghue <bryano at europlex.ie> 42 lines of wisdom included:
> Hmm.
>> 1 & 2 ahh, awful.
>> IPC_PRIVATE, good stuff.
>> It looks like if I were to accidentially use the same key for two
> different attempted semget operations (without) the IPC_EXCL bit, that
> the Kernel/runtime would happily give me back the same semaphore id,
> which implies if I did have collision due to using a port number or ftok
> key, I'd be .... irritated[1], to find I didn't have a unique semaphore
> later on.
It's possible that you could use a "magic number" at the start of
the semaphore as well, which would be another good indicator.
If you look in Google for "magic number semaphore", you'll get the
following, in the first few respones:
http://archives.postgresql.org/pgsql-hackers/2000-11/msg01141.php
Regards,
--
Philip Reynolds | RFC Networks Ltd.
philip.reynolds at rfc-networks.ie | +353 (0)1 8832063
http://people.rfc-networks.ie/~phil/ | www.rfc-networks.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!