Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 04:06 PM
Alex Vinokur
 
Posts: n/a
Default Generating key for shmget() with using ftok()

> uname -smrsv
HP-UX B.11.23 U ia64


Several users need to create segments of shared memory. Duplicate keys
must be avoided.
Does '(valid) usage of ftok()' guaranty that?

It seems that the following actions should be done:
A1) Create some file (and not delete it),
A2) Generate key with using ftok().

The questions:
Q1) Should somebody manage naming and creating such files?
Q2) Are there any (underwater) reefs while using ftok()?


Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-21-2008, 07:40 AM
Alex Vinokur
 
Posts: n/a
Default Re: Generating key for shmget() with using ftok()

On Apr 17, 11:49*am, Alex Vinokur <ale...@users.sourceforge.net>
wrote:
> > uname -smrsv

>
> HP-UX B.11.23 U ia64
>
> Several users need to create segments of shared memory. Duplicate keys
> must be avoided.
> Does '(valid) usage of ftok()' guaranty that?

[sniped]

Once more question.
Can we use a name of some system file as ftok()'s input?
For instance, ftok.exe itself?


Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-02-2008, 05:01 AM
Dennis Handly
 
Posts: n/a
Default Re: Generating key for shmget() with using ftok()

Alex Vinokur wrote:
> Duplicate keys must be avoided.
> Does '(valid) usage of ftok()' guaranty that?


Provided separate (permanent) files and IDs are used.

> Q1) Should somebody manage naming and creating such files?


Yes. Or use the executable if only one, or some common file.

> Q2) Are there any (underwater) reefs while using ftok()?


Like what?

> Can we use a name of some system file as ftok()'s input?
> For instance, ftok.exe itself?


Better to have it controlled by the user application space.
What ftok.exe? ftok(3) is a libc call and that could be patched often.
I suppose you could use /stand/vmunix.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62