LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Replacement for <unistd.h>, <sys/wait.h> and <signal.h> in Windows ? (https://www.linuxquestions.org/questions/programming-9/replacement-for-unistd-h-sys-wait-h-and-signal-h-in-windows-734049/)

Kunsheng 06-18-2009 09:02 PM

Replacement for <unistd.h>, <sys/wait.h> and <signal.h> in Windows ?
 
Hello everyone,

I am converting a Linux app to Windows with Visual Studio 2005 ( Win32 console app).

Basically I need counterparts of fork(), signalset functions under Windows. <csignal> is a said to be a replacement for <signal.h> according to MSDN (I haven't confirmed it yet).

Does anyone have some idea on replacement of <sys/wait.h> and <unistd.h> ?

Do they have a completed alternative header files or need to be specific on functions ?


Thanks,

-Kun

paulsm4 06-18-2009 09:12 PM

Which headers you need depends largely on which functions you're using. It's conceivable, for example, that all you might need is "<windows.h>".

MSDN is a joy to use: just highlight a function in the Visual Studio IDE, hit <F1> ... and it's usually pretty good about bringing up the man page, telling you what header and/or library you need, and discussing any compatibility issues.

If the function in question doesn't show up on MSDN (i.e. if that particular API isn't supported under Windows), then Google is your next stop. You're virtually certain to find a Windows equivalent!

'Hope that helps .. PSM

sundialsvcs 06-19-2009 07:18 AM

I'd suggest spending some "google time" looking over your various options. There are many ways to do cross-platform code and/or cross-platform conversions, so if you find yourself "thinking from scratch," it's time to pull-back and look around: your efforts would be redundant.
Quote:

Actum Ne Agas: "Do Not Do A Thing Already Done."
Look over the code and try to enumerate the Linux/Unix facilities that are being used in the code, how they are being used (particularly if threading and/or synchronization is involved), and so on ... all before you embark upon changing anything at all. Then, do your research.


All times are GMT -5. The time now is 08:46 PM.