LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] OT : Semaphore Key creation

[ILUG] OT : Semaphore Key creation

Philip Reynolds philip.reynolds at rfc-networks.ie
Thu Mar 11 13:27:16 GMT 2004


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


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell