Issues porting 'moc'

Unxmaal

Administrator
Feb 8, 2019
98
60
18
Here's the error:

Code:
io_curl.c: In function 'curl_read_internal':
io_curl.c:381:12: error: 'struct timeval' has no member named 'tv_nsec'; did you mean 'tv_sec'?
  381 |    timeout.tv_nsec = (milliseconds % 1000L) * 1000000L;
      |            ^~~~~~~
      |            tv_sec
make[2]: *** [Makefile:777: io_curl.o] Error 1
Here's part of the patch, just for this file:

Code:
diff -Naur trunk.orig/io_curl.c trunk/io_curl.c
--- trunk.orig/io_curl.c        2018-12-27 06:58:23.000000000 +0000
+++ trunk/io_curl.c     2020-02-05 20:21:24.148952435 +0000
@@ -23,6 +23,10 @@
 #include <errno.h>
 #include <assert.h>
 #include <stdint.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/timespec.h>
+#include <sys/ktime.h>

 #define DEBUG

@@ -33,6 +37,7 @@
 #include "options.h"
 #include "lists.h"

+
 static char user_agent[] = PACKAGE_NAME"/"PACKAGE_VERSION;

 void io_curl_init ()
@@ -346,7 +351,11 @@
                        fd_set read_fds, write_fds, exc_fds;
                        int max_fd, ret;
                        long milliseconds;
+                       #if defined(__sgi)
+                       struct timeval timeout;
+                       #else
                        struct timespec timeout;
+                       #endif

                        logit ("Doing pselect()...");

@@ -371,8 +380,12 @@
                        timeout.tv_sec = milliseconds / 1000;
                        timeout.tv_nsec = (milliseconds % 1000L) * 1000000L;

+                       #if defined(__sgi)
+                       ret = select (max_fd +1, &read_fds, &write_fds, &exc_fds, &timeout);
+                       #else
                        ret = pselect (max_fd + 1, &read_fds, &write_fds, &exc_fds,
                                      &timeout, NULL);
+                       #endif

                        if (ret < 0 && errno == EINTR) {
                                logit ("Interrupted");

As you can see, in my flailing around I've tried including a few extra things from sys, but they didn't help. I can see timeval defined in sys/time.h, but it doesn't have tv_nsec, only tv_usec.

Or more likely, I'm totally lost.
 

Elf

Storybook / Retired, ex-staff
Feb 4, 2019
792
252
63
Mountain West (US)
It may be that IRIX just doesn't support nanoseconds in that data structure but does support microseconds.

Try just setting:
Code:
timeout.tv_usec = (milliseconds % 1000L) * 1000L;
(A microsecond is 1000 nanoseconds)
 

Unxmaal

Administrator
Feb 8, 2019
98
60
18
I got past this part by disabling curl.

Sadly, moc doesn't have support for any IRIX audio (that I could tell.).
 

Elf

Storybook / Retired, ex-staff
Feb 4, 2019
792
252
63
Mountain West (US)
@Unxmaal I would be curious about IRIX's audio system, I actually don't know much about it at all. Is it just a /dev/dsp type arrangement or is there some framework?
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu