Dear Andrew, Handles in windows are void pointers. 32 bit void pointers in Windows 32 and 64 bit void pointers in Windows 64 (obviously). However in WIN64 only the less significant 32 bits of a handle are used for compatibility and interoperability reasons. So having typedef int pid_t; or typedef HANDLE pid_t; it is not quite the same.
Frankly what puzzles me is the huge code difference between the Aolserver and Naviserver versions of this file (thread.c), and in general of all the nsthread module. I also have the feeling that the the Aolserver version is less OS dependent and more portable. Well yes, Naviserver has been ported on Windows but with MinGW and quite likely only in Win32. I suspect that many other problems will show up in Windows 64 and I sincerely hope you are concentrating your efforts on this platform (Windows 64). Hope this helps and thank you for your work, Maurizio -----Original Message----- From: Andrew Piskorski [mailto:a...@piskorski.com] Sent: 18 September 2014 01:26 To: naviserver-devel@lists.sourceforge.net Subject: [naviserver-devel] pid_t missing on Windows On Windows with the VC 2012 compiler I get this error, which seems to then break a lot of other important stuff downstream: thread.c(55) : error C2061: syntax error : identifier 'pid_t' Is pid_t defined anywhere for Windows? AFAICT it is not. Adding this in an appropriate spot in nsthread.h makes the error go away: #ifndef pid_t typedef int pid_t; #endif But I don't know whether that's actually a correct fix for the various places that use pid_t. Interestingly, in nsd/exec.c Ns_WaitForProcess uses pid_t ONLY on Unix, and has a completely different implementation for Windows, which uses a HANDLE type instead of pid_t. And winthread.c definitely uses HANDLE. So it looks like use of the Unix-only pid_t crept into a few of the nominally cross-platform files over time. But what's the correct fix? -- Andrew Piskorski <a...@piskorski.com> ---------------------------------------------------------------------------- -- Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel