<?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: select() does not behave correctly for sufficiently large timeout values +DD64 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5387545#M639741</link>
    <description>&lt;P&gt;&amp;gt;I may not have tested it with +DD64, I'll try again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right, it fails there for me with EINVAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to contact the Response Center to see if there is a patch for it.&lt;/P&gt;&lt;P&gt;A quick check indicates the kernel only checks the tv_usec field but I'm looking at the latest sources.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2011 03:57:05 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-11-11T03:57:05Z</dc:date>
    <item>
      <title>select() does not behave correctly for sufficiently large timeout values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5385347#M639737</link>
      <description>&lt;P&gt;According to POSIX...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Implementations may place limitations on the maximum timeout interval supported. On all implementations, the maximum timeout interval supported will be at least 31 days. If the&amp;nbsp;&lt;EM&gt;timeout&lt;/EM&gt;&amp;nbsp;argument specifies a timeout interval greater than the implementation-dependent maximum value, the maximum value will be used as the actual timeout value. Implementations may also place limitations on the granularity of timeout intervals. If the requested timeout interval requires a finer granularity than the implementation supports, the actual timeout interval will be rounded up to the next supported value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In testing our libraries, I discovered that when using sufficiently large timeout values, calls to select() return -1 and set errno to EINVAL. For an implementation that follows the spec, I would expect the call to select() to either timeout before the requested time (the implementation limit was less than the requested timeout and the attribute was never selected), or the call should succeed if the requested attributes were selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following testcase and output illustrate the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[vitek@hokie] 201 % cat t.cpp
#include &amp;lt;assert.h&amp;gt;     // for assert()
#include &amp;lt;string.h&amp;gt;     // for memset() used in FD_ZERO on acc-6.25
#include &amp;lt;limits.h&amp;gt;     // for LONG_MAX
#include &amp;lt;unistd.h&amp;gt;     // for STDOUT_FILENO

#include &amp;lt;sys/select.h&amp;gt; // for select()

int main ()
{
  fd_set fds;
  FD_ZERO(&amp;amp;fds);
  FD_SET(STDOUT_FILENO, &amp;amp;fds);

  timeval tv;
  tv.tv_sec = LONG_MAX;
  tv.tv_usec = 0;

  // wait until we can read or write stdout
  assert (-1 != select (FD_SETSIZE, &amp;amp;fds, &amp;amp;fds, 0, &amp;amp;tv));

  return 0;
}

[vitek@hokie] 202 % aCC +DD32 t.cpp &amp;amp;&amp;amp; ./a.out
[vitek@hokie] 203 % aCC +DD64 t.cpp &amp;amp;&amp;amp; ./a.out
Assertion failed: -1 != select (FD_SETSIZE, &amp;amp;fds, &amp;amp;fds, 0, &amp;amp;tv), file t.cpp, line 19
ABORT instruction (core dumped)
[vitek@hokie] 204 %&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2011 00:10:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5385347#M639737</guid>
      <dc:creator>Travis Vitek</dc:creator>
      <dc:date>2011-11-09T00:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: select() does not behave correctly for sufficiently large timeout values +DD64</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5385515#M639738</link>
      <description>&lt;P&gt;&amp;gt;According to POSIX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which version?&amp;nbsp; Only 11.31 supports 2003.&lt;/P&gt;&lt;P&gt;Your test case works fine on 11.31 after inserting "struct" before timeval.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2011 03:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5385515#M639738</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-11-11T03:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: select() does not behave correctly for sufficiently large timeout values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5386233#M639739</link>
      <description>&lt;P&gt;Dennis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fairly certain it was in 1003.1-2003, but the requirement is found in the select() manual page on the HP box I'm testing on.&amp;nbsp;There is a chance that there is a patch we don't have installed that may fix this, but I have doubts. Here is some information that may or may not be pertinent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[vitek@hokie] 68 % ldd ./a.out

./a.out:
        libstd_v2.so.1 =&amp;gt;       /usr/lib/hpux64/libstd_v2.so.1
        libCsup.so.1 =&amp;gt; /usr/lib/hpux64/libCsup.so.1
        libm.so.1 =&amp;gt;    /usr/lib/hpux64/libm.so.1
        libunwind.so.1 =&amp;gt;       /usr/lib/hpux64/libunwind.so.1
        libc.so.1 =&amp;gt;    /usr/lib/hpux64/libc.so.1
        libdl.so.1 =&amp;gt;   /usr/lib/hpux64/libdl.so.1
        libuca.so.1 =&amp;gt;  /usr/lib/hpux64/libuca.so.1
[vitek@hokie] 69 % ls -l /usr/lib/hpux64/libc.so.1
-r-xr-xr-x   1 bin        bin        4898536 Apr  8  2009 /usr/lib/hpux64/libc.so.1
[vitek@hokie] 70 % aCC -V
aCC: HP C/aC++ B3910B A.06.25.01 [May 17 2010]
[vitek@hokie] 71 % uname -smnrvl
HP-UX hokie B.11.31 U ia64 unlimited-user license
[vitek@hokie] 72 %&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unsure why you'd need to insert the `struct' keyword unless you were compiling with a C compiler. Have you tried compiling with a C++ compiler and the 64-bit compile option as I did above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Travis&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>Wed, 09 Nov 2011 22:21:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5386233#M639739</guid>
      <dc:creator>Travis Vitek</dc:creator>
      <dc:date>2011-11-09T22:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: select() does not behave correctly for sufficiently large timeout values +DD64</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5386587#M639740</link>
      <description>&lt;P&gt;&amp;gt;is a chance that there is a patch we don't have installed that may fix this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oops, I may not have tested it with +DD64, I'll try again.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I'm unsure why you'd need to insert the `struct' keyword unless you were compiling with a C compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right.&amp;nbsp; If you are testing libc, you should have a test case that works with both C and C++.&lt;/P&gt;&lt;P&gt;In general, if you have a pure C interface, it's probably good idea to insert the optional "struct" keyword.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2011 03:49:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5386587#M639740</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-11-11T03:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: select() does not behave correctly for sufficiently large timeout values +DD64</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5387545#M639741</link>
      <description>&lt;P&gt;&amp;gt;I may not have tested it with +DD64, I'll try again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right, it fails there for me with EINVAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to contact the Response Center to see if there is a patch for it.&lt;/P&gt;&lt;P&gt;A quick check indicates the kernel only checks the tv_usec field but I'm looking at the latest sources.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2011 03:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-does-not-behave-correctly-for-sufficiently-large-timeout/m-p/5387545#M639741</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-11-11T03:57:05Z</dc:date>
    </item>
  </channel>
</rss>

