<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479763#M477752</link>
    <description>&lt;P&gt;&amp;gt;1. Where may file be: on NFS, something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well more precisely, somewhere where it can be unmounted and mounted.&amp;nbsp; With the automounter, this is transparent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;2. But we actually came across this problem: ftok() returned other key for the same non-recreated file between reboots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On HP-UX and not NFS or umount/mount?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2012 07:33:42 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2012-01-11T07:33:42Z</dc:date>
    <item>
      <title>[ftok()-related] Can 'st.st_dev of the same file' be changed between reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441073#M477711</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;st.st_dev of the same file (that wasn't deleted) can&amp;nbsp;be changed between&lt;BR /&gt;reboots on Linux.&lt;/P&gt;&lt;P&gt;See &lt;A href="http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/018671b4d364409f" target="_blank"&gt;http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/018671b4d364409f&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As a result, the ftok() function on Linux may generate different keys for&lt;BR /&gt;the same file (that wasn't deleted) between reboots.&lt;BR /&gt;It seems to be a bug in design of ftok() on Linux.&lt;BR /&gt;&lt;BR /&gt;Does such a problem exist with ftok() on HP-UX?&lt;BR /&gt;&lt;BR /&gt;Alex&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 05:54:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441073#M477711</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-08T05:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441299#M477712</link>
      <description>&lt;P&gt;(Please edit your post with the "post Options &amp;gt; Edit Reply" to remove the bogus wlmailhtml: hyperlink that nobody but you? can access.&amp;nbsp; Using the URL in the text does work but we want lazy people to see it too.&amp;nbsp; :-)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Does such a problem exist with ftok() on HP-UX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, even worse, it can be changed without reboots.&lt;/P&gt;&lt;P&gt;It currently exists in the linker if you compile with -ipo or +O4.&lt;/P&gt;&lt;P&gt;The problem exists in the automounter.&amp;nbsp; If it unmounts the filesystem, you are hosed and st_dev seems to be incremented.&amp;nbsp; Unmounting was mentioned by Barry in your URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One solution is to keep the file open so it can't be unmounted.&amp;nbsp; Or mmap(2) the file.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 20:43:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441299#M477712</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-08T20:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed between reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441407#M477713</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. My original post was edited (the link was deleted).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The following situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;create file with name "Name1"&lt;/P&gt;&lt;P&gt;// That file will not be deleted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reboot-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key1 = ftok("Name1", 'A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key2 = ftok ("Name1", 'A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reboot-2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key3 = ftok("Name1", 'A');&lt;/P&gt;&lt;P&gt;-----------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key3 may differ from key1. It is clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It turnsout that key2 can differ from key1.&amp;nbsp; It is &lt;STRONG&gt;very u&lt;/STRONG&gt;&lt;SPAN class="hps"&gt;&lt;STRONG&gt;pleasant situation&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;We can't keep the file "Name1" open and we can't mmap the file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I didn't understand witt -ipo or +O4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 05:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441407#M477713</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-08T05:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441489#M477714</link>
      <description>&lt;P&gt;&amp;gt;1. My original post was edited (the link was deleted).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You didn't need to delete it, just make it easy to click on. :-)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;It turns out that key2 can differ from key2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;key2 differ from key1?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&amp;gt;We can't keep the file "Name1" open and we can't mmap the file.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;My case was st_dev changing without reboots on a NFS filesystem.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&amp;gt;I didn't understand with -ipo or +O4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;These are compile options that cause the link step to take a long time.&amp;nbsp; So long that the automounter unmounts the filesystem.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 20:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441489#M477714</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-08T20:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed between reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441493#M477715</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;&amp;gt;1. My original post was edited (the link was deleted).&lt;BR /&gt;&amp;gt; (You didn't need to delete it, just make it easy to click on. :-)&lt;BR /&gt;I don't know why the link doesn't work. From my site it works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;It turns out that key2 can differ from key2.&lt;BR /&gt;&amp;gt; key2 differ from key1?&lt;/P&gt;&lt;P&gt;Of course. My typo, sorry.&lt;BR /&gt;So, can key2 differ from key1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;We can't keep the file "Name1" open and we can't mmap the file.&lt;BR /&gt;&amp;gt; My case was st_dev changing without reboots on a NFS filesystem.&lt;BR /&gt;Yes, changing st_dev caused changing key returned by ftok(). We want to avoid that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------&lt;BR /&gt;&amp;gt;&amp;gt;I didn't understand with -ipo or +O4.&lt;BR /&gt;&amp;gt; These are compile options that cause the link step to take a long time.&amp;nbsp; So long that the automounter unmounts the filesystem.&lt;/P&gt;&lt;P&gt;What should be compiled? It seems that &amp;nbsp;I don't understand that issue.&lt;BR /&gt;------------------------------&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 18:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441493#M477715</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-07T18:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441525#M477716</link>
      <description>&lt;P&gt;&amp;gt;I don't know why the link doesn't work. From my site it works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What was displayed worked, "http:".&amp;nbsp; But if you clicked on the link, "wlmailhtml:" didn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Of course. My typo.&amp;nbsp;&amp;nbsp; So, can key2 differ from key1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You can go back and edit it.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I explained how.&amp;nbsp; If over NFS and the file gets unmounted, you get a different st_dev.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;changing st_dev caused changing key returned by ftok(). We want to avoid that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't look like you can unless you keep it open.&amp;nbsp; It seems they need to beef up the WARNINGS section.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;What should be compiled? It seems that&amp;nbsp; I don't understand that issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was saying there are several applications that also depend on stat(2) and st_dev.&lt;/P&gt;&lt;P&gt;1) Linker to check dependent shlibs, fails if it takes a long time.&lt;/P&gt;&lt;P&gt;2) dld.so to check if already loaded.&amp;nbsp; This works, since files are mmap(2).&lt;/P&gt;&lt;P&gt;3) aCC compiler driver.&amp;nbsp; This works since stdout/stderr is still open.&amp;nbsp; And wouldn't matter anyway.&amp;nbsp; ;-)&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 20:44:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441525#M477716</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-08T20:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed between reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441619#M477717</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;I don't know why the link doesn't work. From my site it works&lt;BR /&gt;&amp;gt;What was displayed worked, "http:".&amp;nbsp; But if you clicked on the link, "wlmailhtml:" didn't.&lt;/P&gt;&lt;P&gt;I edited my original message once again.&lt;BR /&gt;Added:&lt;BR /&gt;See &lt;A href="http://groups.google.com/group/comp.unix.programme?r/browse_frm/thread/018671b4d364409f" target="_blank"&gt;http://groups.google.com/group/comp.unix.programme?r/browse_frm/thread/018671b4d364409f&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Of course. My typo.&amp;nbsp;&amp;nbsp; So, can key2 differ from key1?&lt;BR /&gt;&amp;gt;(You can go back and edit it.)&lt;BR /&gt;Thanks. Edited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Yes, I explained how.&amp;nbsp; If over NFS and the file gets unmounted, you get a different st_dev.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;changing st_dev caused changing key returned by ftok(). We want to avoid that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;It doesn't look like you can unless you keep it open.&amp;nbsp; It seems they need to beef up the WARNINGS section.&lt;BR /&gt;They must beef up the WARNINGS section. But actually it doesn't help.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Currently it seems to there be a bug in design of ftok().&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;key = ftok("Name1", 'A').&lt;BR /&gt;File "Name1" is existing an accessible and never deleted.&lt;/P&gt;&lt;P&gt;Of course, an user expects to get the same key in all calls of ftok(), at least, between reboots.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;HP-UX hpx418 B.11.23 U ia64 1139467043 unlimited-user license&lt;/P&gt;&lt;P&gt;&amp;gt; man ftok&lt;/P&gt;&lt;P&gt;&amp;nbsp;ftok(3C)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftok(3C)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;NAME&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftok() - create interprocess communication identifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;SYNOPSIS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #include &amp;lt;sys/ipc.h&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key_t ftok(const char *path, int id);&lt;/P&gt;&lt;P&gt;&amp;nbsp;DESCRIPTION&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All interprocess communication facilities require the user to supply a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key to be used by the msgget(), semget(), and shmget() system calls to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obtain interprocess communication identifiers (see msgget(2),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semget(2), and shmget(2)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftok() returns a key based on path and id that is usable in subsequent&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgget(), semget(), and shmget() system calls.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The parameters for the ftok() function are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; must be the path name of an existing file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; that is accessible to the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is a character that uniquely identifies a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; project.&amp;nbsp; This means that only the low order&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8-bits of id are significant.&amp;nbsp; Note that&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftok() returns the same key for linked files&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when called with the same id and that it&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returns different keys when called with the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; same file name but different ids.&lt;/P&gt;&lt;P&gt;&amp;nbsp;RETURN VALUE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftok() returns (key_t)-1 if path does not exist or if it is not&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; accessible to the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;EXAMPLES&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The following call to ftok() returns a key associated with the file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myfile and id A:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; key_t mykey;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; mykey = ftok ("myfile", 'A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;WARNINGS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the file whose path is passed to ftok() is removed when keys still&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; refer to the file, future calls to ftok() with the same path and id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; will return an error.&amp;nbsp; If the same file is recreated, ftok() is likely&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to return a different key than it did the original time it was called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;SEE ALSO&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intro(2), msgget(2), semget(2), shmget(2), thread_safety(5).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hewlett-Packard Company&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 1 -&amp;nbsp;&amp;nbsp; HP-UX 11i Version 2: August 2003&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;That man is very "smart":&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1. No info about (the same or not the same) key returned by ftok() with file that wasn't deleted.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;2. No info about reboots&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;3. No info about mounting/unmounting.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;What should be compiled? It seems that&amp;nbsp; I don't understand that issue.&lt;/P&gt;&lt;P&gt;&amp;gt;I was saying there are several applications that also depend on stat(2) and st_dev.&lt;/P&gt;&lt;P&gt;&amp;gt;1) Linker to check dependent shlibs, fails if it takes a long time.&lt;/P&gt;&lt;P&gt;&amp;gt;2) dld.so to check if already loaded.&amp;nbsp; This works, since files are mmap(2).&lt;/P&gt;&lt;P&gt;&amp;gt;3) aCC compiler driver.&amp;nbsp; This works since stdout/stderr is still open.&amp;nbsp; And wouldn't matter anyway.&amp;nbsp; ;-)&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I didn't understand how we can use it.&lt;/P&gt;&lt;P&gt;We have situation like this.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; key = ftok("Name1", 'A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id = shmget (key, ..., ...);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // If Shm segment with key is not existing we create, it.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Otherwise we must work with existing Shm segment&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // So, if while run-1 we get key1, while run-2 we get key2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and key2 != key1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then&lt;/P&gt;&lt;P&gt;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) data from Shm segment key1 will be lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) we never can get key1 via ftok()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; shmat(...);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; shmdt();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Let myexe is executable of that main()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now, we work as it follows:&lt;/P&gt;&lt;P&gt;====================================&lt;BR /&gt;create file "Name1"&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;reboot-1&lt;/P&gt;&lt;P&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;reboot-2&lt;/P&gt;&lt;P&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;myexe&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;reboot-3&lt;/P&gt;&lt;P&gt;====================================&lt;/P&gt;&lt;P&gt;OK, keys in intervals (reboot-1, reboot-2) and (reboot-2, reboot-3) may be different. No problem.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How can we use linker options and aCC compiler driver to guarantee the same key within each interval in our situation?&lt;BR /&gt;We have myexe + libraries already created.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dennis, thank you very much.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 08:17:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441619#M477717</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-08T08:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441763#M477718</link>
      <description>&lt;P&gt;&amp;gt;I edited my original message once again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;They must beef up the WARNINGS section. But actually it doesn't help.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;gt;Currently it seems to there be a bug in design of ftok().&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is nothing they can do about it unless key_t is larger.&amp;nbsp; Or an index in some ftok(3) table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;gt;2. No info about reboots&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A computer is not suppose to go down and that isn't defined by any standard.&amp;nbsp; And if does go down, you will have to get your shared memory again, anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;gt;3. No info about mounting/unmounting.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's something that should be defined, since mount/umount are defined in the standard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I didn't understand how we can use it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure that the file is on a filesystem that isn't or can't be unmounted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;How can we use linker and compiler driver to guarantee the same key within each interval in our situation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was pointing out other applications that may have the same problem you do.&amp;nbsp; And how to possibly workaround the problem.&amp;nbsp; The linker is a real world case that I've ran into many times before and finally we got a RCA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;keys in intervals (reboot-1, reboot-2) and (reboot-2, reboot-3) may be different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Better to not even mention reboots.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;We have myexe + libraries already created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That may be your solution.&amp;nbsp; Pick myexe as the name of your file.&amp;nbsp; That can't be unmounted.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 20:43:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441763#M477718</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-08T20:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441937#M477719</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt; They must beef up the WARNINGS section. But actually it doesn't help.&lt;BR /&gt;&amp;gt;&amp;gt; Currently it seems to there be a bug in design of ftok().&lt;BR /&gt;&amp;gt; There is nothing they can do about it unless key_t is larger.&amp;nbsp; Or an index in some ftok(3) table.&lt;BR /&gt;Yes.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 2. No info about reboots&lt;BR /&gt;&amp;gt; A computer is not suppose to go down and that isn't defined by any standard.&amp;nbsp; And if does go down, you will have to get your shared memory again, anyway.&lt;BR /&gt;Of course. Different keys after different reboots is not a problem because shared memory is volatile memory.&lt;BR /&gt;About "that isn't defined by any standard". However, people are working in real circumstances (with down), and it would be useful to note this.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 3. No info about mounting/unmounting.&lt;BR /&gt;&amp;gt; That's something that should be defined, since mount/umount are defined in the standard.&lt;BR /&gt;&lt;STRONG&gt;It is very important. Thanks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;gt;&amp;gt; I didn't understand how we can use it.&lt;BR /&gt;&amp;gt; Make sure that the file is on a filesystem that isn't or can't be unmounted.&lt;BR /&gt;That the program works with many of our customers. We have no control over this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;That may be your solution.&amp;nbsp; Pick myexe as the name of your file.&amp;nbsp; That can't be unmounted.&lt;/P&gt;&lt;P&gt;Where to pick?&amp;nbsp;Via any program that "works" with myexe .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dennis, thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2012 05:09:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5441937#M477719</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-09T05:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5442905#M477734</link>
      <description>&lt;P&gt;&amp;gt;Where to pick? Via any program that "works" with myexe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the myexe executable itself.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2012 20:58:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5442905#M477734</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-09T20:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5454623#M477738</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;gt;&amp;gt; Where to pick? Via any program that "works" with myexe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; Use the myexe executable itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our situation is more complicated. We need several ftok-files,&amp;nbsp;their names depend on some input parameters from database.&lt;/P&gt;&lt;P&gt;OK, we will think of that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dennis, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Jan 2012 08:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5454623#M477738</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-10T08:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5454669#M477739</link>
      <description>&lt;P&gt;&amp;gt;We need several ftok-files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the same file and up to 256 values of "id".&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2012 08:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5454669#M477739</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-10T08:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5457135#M477742</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;gt;&amp;gt; We need several ftok-files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; You can use the same file and up to 256 values of "id".&lt;/P&gt;&lt;P&gt;&amp;nbsp;Our "id's" are actually some strings (that are selected from database).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is another problem: file "myexe" may be updated (i.e. re-created)&amp;nbsp;from time to time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We will investigate another solution (possible using also existing ftok()-function).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Jan 2012 10:19:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5457135#M477742</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-10T10:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5470111#M477744</link>
      <description>&lt;P&gt;&amp;gt;another problem: file "myexe" may be updated (i.e. re-created) from time to time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there multiple executables that access the shared memory segment?&amp;nbsp; Or you want it to stick around after you update myexe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume you realize that if you file isn't on NFS, you don't have to worry?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2012 17:35:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5470111#M477744</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-10T17:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479693#M477751</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;another problem: file "myexe" may be updated (i.e. re-created) from time to time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Are there multiple executables that access the shared memory segment?&amp;nbsp; Or you want it to stick around after you update myexe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, we don't have multiple executables that access the shared memory segment. The only executable creates (or attaches) different shared memory segments, Names of ftok-files are built on basis some info from data base.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I assume you realize that if you file isn't on NFS, you don't have to worry?&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;1. It seems that I don't understand this issue. Where may file be: on NFS, something else?&lt;/P&gt;&lt;P&gt;2. But we actually came across this problem: ftok() returned other key for the same non-recreated file between reboots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 06:11:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479693#M477751</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-11T06:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479763#M477752</link>
      <description>&lt;P&gt;&amp;gt;1. Where may file be: on NFS, something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well more precisely, somewhere where it can be unmounted and mounted.&amp;nbsp; With the automounter, this is transparent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;2. But we actually came across this problem: ftok() returned other key for the same non-recreated file between reboots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On HP-UX and not NFS or umount/mount?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 07:33:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479763#M477752</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-11T07:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479803#M477753</link>
      <description>&lt;P&gt;&lt;BR /&gt;&amp;gt;&amp;gt;1. Where may file be: on NFS, something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Well more precisely, somewhere where it can be unmounted and mounted.&amp;nbsp; With the automounter, this is &amp;gt;transparent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not familiar with that issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;2. But we actually came across this problem: ftok() returned other key for the same non-recreated file between reboots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;On HP-UX and not NFS or umount/mount?&lt;/P&gt;&lt;P&gt;Dennis, sorry. My mistake.&lt;/P&gt;&lt;P&gt;We came across that on Linux. After that I started to&amp;nbsp;check the ftok()-problem on other platforms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 08:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5479803#M477753</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-11T08:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5480701#M477761</link>
      <description>&lt;P&gt;&amp;gt;We came across that on Linux.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know this only happens transparently with NFS and automounter.&amp;nbsp; Or some sysadmin manually unmounting and mounting filesystems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were there any other cases for Linux?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 19:40:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5480701#M477761</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-11T19:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5481527#M477767</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/22676"&gt;@Dennis Handly&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;&amp;gt;We came across that on Linux.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know this only happens transparently with NFS and automounter.&amp;nbsp; Or some sysadmin manually unmounting and mounting filesystems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were there any other cases for Linux?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;About other cases for Linux - I don't know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came accross that&amp;nbsp;accidently, because&amp;nbsp;it happened on Linux-machine that I have nothing to do with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How was the problkem detected?&lt;/P&gt;&lt;P&gt;While each reading the ftok file I write to that file&amp;nbsp;&amp;nbsp; some relevant info, including generated Key (see attachment&amp;nbsp; &lt;STRONG&gt;TC_SHMTOK1_avinokur_TTT2_TTT1.docx&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;In addition, on request we can get brief info&amp;nbsp;about ftok-file (see attachment &lt;STRONG&gt;FtokFilesInfo.docx&lt;/STRONG&gt;), that includes all generated Keys for ftok-files.&lt;/P&gt;&lt;P&gt;I was asked about something for that machine and accidently detected that&amp;nbsp;some row in &amp;nbsp;&lt;STRONG&gt;FtokFilesInfo.docx&lt;/STRONG&gt; contained 3 keys (not the only key, as it&amp;nbsp;was expected).&lt;/P&gt;&lt;P&gt;It seems, that two keys were from the same reboot interval (so, here we have problematic situation).&lt;/P&gt;&lt;P&gt;Third key was from other reboot interval&amp;nbsp; (so, it may be OK).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think, we should check generated keys within the same reboot interval (not only write to ftok-file).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2012 06:15:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5481527#M477767</guid>
      <dc:creator>Alex_Vinokur</dc:creator>
      <dc:date>2012-01-12T06:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: [ftok()-related] Can 'st.st_dev of the same file' be changed without reboots on HP-UX?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5481579#M477769</link>
      <description>&lt;P&gt;&amp;gt;How was the problem detected?&lt;/P&gt;&lt;P&gt;&amp;gt;While each reading the ftok file I write to that file&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; /devjuser1/jp/ccjp/avinokur/tmp/shm_keys_holder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did someone remove the file since it was in "tmp"?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2012 06:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftok-related-can-st-st-dev-of-the-same-file-be-changed-between/m-p/5481579#M477769</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-01-12T06:43:28Z</dc:date>
    </item>
  </channel>
</rss>

