[gccsdk] [GCCSDK commit] lee - r7304 - in trunk/gcc4/recipe/files/gcc/libunixlib: . unix

alan buckley alan_baa at hotmail.com
Sat May 9 09:44:21 PDT 2020


I don’t think this commit is correct. I checked the definition of select on Linux and it says the time is in microseconds and it should round up to the next clock update frequency. The original isn’t correct either.

I don’t know what the frequency is on RISC OS, but if it’s to a centi-second you will probably end up with something (untested) like:

           now = clock ();
          end = now + timeout->tv_sec * 100 + (timeout->tv_usec + 9999) / 1000000;

If I’m correct does Chris want to try if this fixes the problem he was having and resubmit his patch.

Regards,
Alan


From: riscos-commits-bounces at riscos.info <riscos-commits-bounces at riscos.info> on behalf of svnuser at riscos.info <svnuser at riscos.info>
Sent: Thursday, May 7, 2020 8:44:43 PM
To: riscos-commits at riscos.info <riscos-commits at riscos.info>
Subject: [GCCSDK commit] lee - r7304 - in trunk/gcc4/recipe/files/gcc/libunixlib: . unix

Author: lee
Date: 2020-05-07 12:44:43 -0700 (Thu, 07 May 2020)
New Revision: 7304

Modified:
   trunk/gcc4/recipe/files/gcc/libunixlib/ChangeLog
   trunk/gcc4/recipe/files/gcc/libunixlib/unix/ul_select.c
Log:
Thu May  7 20:35:36 BST  2020  Lee Noar  <lee.noar at sky.com>

        * unix/ul_select.c(select): Fix time calculation so that the tv_usec
        part of the timeout is not ignored.
        Submitted by Chris Johns.


Modified: trunk/gcc4/recipe/files/gcc/libunixlib/ChangeLog
===================================================================
--- trunk/gcc4/recipe/files/gcc/libunixlib/ChangeLog    2020-04-27 19:07:44 UTC (rev 7303)
+++ trunk/gcc4/recipe/files/gcc/libunixlib/ChangeLog    2020-05-07 19:44:43 UTC (rev 7304)
@@ -1,3 +1,9 @@
+Thu May  7 20:35:36 BST  2020  Lee Noar  <lee.noar at sky.com>
+
+       * unix/ul_select.c(select): Fix time calculation so that the tv_usec
+       part of the timeout is not ignored.
+       Submitted by Chris Johns.
+
 Wed Apr  8 18:23:09 BST  2020  Lee Noar  <lee.noar at sky.com>

         * module/sul.s: Bump version number to 1.16.

Modified: trunk/gcc4/recipe/files/gcc/libunixlib/unix/ul_select.c
===================================================================
--- trunk/gcc4/recipe/files/gcc/libunixlib/unix/ul_select.c     2020-04-27 19:07:44 UTC (rev 7303)
+++ trunk/gcc4/recipe/files/gcc/libunixlib/unix/ul_select.c     2020-05-07 19:44:43 UTC (rev 7304)
@@ -180,8 +180,7 @@

           /* OK, so we can't cope with anything more than roughly 248.55 days!  */
           now = clock ();
-          end = now + timeout->tv_sec * 100
-                   + (50000 + timeout->tv_usec) / 1000000;
+         end = now + timeout->tv_sec * 100 + timeout->tv_usec / 10000;
         }
     }



_______________________________________________
riscos-commits mailing list
riscos-commits at riscos.info
http://www.riscos.info/cgi-bin/mailman/listinfo/riscos-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/gcc/attachments/20200509/9fdd3167/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7E21BACBEA7F4B7A8D5F4E8F8CB14D10.png
Type: image/png
Size: 144 bytes
Desc: 7E21BACBEA7F4B7A8D5F4E8F8CB14D10.png
URL: <http://www.riscos.info/pipermail/gcc/attachments/20200509/9fdd3167/attachment.png>


More information about the gcc mailing list