Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual c++ doesn't have sys/wait.h

I have downloaded the timezone database library and am trying to compile it under windows to a DLL. When I do this, I get messages like:

1>c:\javatools\tzinfo\src\private.h(97): fatal error C1083: Cannot open include file: 'sys/wait.h': No such file or directory

and, of course, sys/wait.h is not ANSI C, which is the issue. I seem to recall windows have some near file names to this. Can I get an assist here?

Thanks.

like image 306
Thom Avatar asked Oct 20 '11 19:10

Thom


2 Answers

fork(), wait() and waitpid() are defined by the POSIX standard, and Windows is not POSIX-compliant.

In order to have POSIX compliance under Windows, you should compile under Cygwin.

The analogous WinAPI functions are CreateProcess and GetProcessExitCode.

like image 182
Blagovest Buyukliev Avatar answered Nov 06 '22 14:11

Blagovest Buyukliev


If you're looking for the wait() equivalent of MSVS, look no further than WaitForSingleObject().

like image 3
Luchian Grigore Avatar answered Nov 06 '22 15:11

Luchian Grigore