rholo restart stalls with "bad magic number"

Greg Ward wrote:

Done. I also updated the calls to lseek() to use the officially
blessed macros. If these aren't defined for some reason under Windows,
we should add the following lines to platform.h:

#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif

Looks good.
I found that lseek() is indeed defined in <io.h> as I suspected.
Although I couldn't find the above macros in the same file, they
must be defined somewhere close by, because the code compiled on
Windows right away.

-schorsch

···

--
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/

Dear folks,

FYI: rholo (HEAD version as of today, 19.10.03) on Linux (tested on slackware and Debian 'sarge') screws writing holodeck files.
It works if holofile.c and rholo.c include

        #include <sys/types.h>
        #include <unistd.h>

as suggested by the lseek man page

note 2 (mostly for developpers): POSIX lseeks seem to favor macros for the lseek 'whence' parameter: lseek man page says:

       When converting old code, substitute values for whence with the following macros:
         old new
        0 SEEK_SET
        1 SEEK_CUR
        2 SEEK_END
        L_SET SEEK_SET
        L_INCR SEEK_CUR
        L_XTND SEEK_END

at least that keeps me going for now

I'm posting this to the general list to keep potential users updated, the cross-post to the dev list is indended for follow ups.

-Peter

PS: yet another good reason for a test suite

rholo.c (15.2 KB)

···

--
  pab-opto, Freiburg, Germany, www.pab-opto.de