Question

I want to exercise some UNIX commands using C language. When I include <unistd.h> header file and when I use fork() method it gives me a compile time error: "can not include unistd.h". I check on he Internet and the fork() method is available in <unistd.h> header file only. Please help me on this.

  • Is now <unistd.h> is replaced with any other header file?
  • Even if I use "process.h", that does not have a definition for fork().
  • How I can use fork() method?

I have DOSBox v0.74 on my system (Windows 7, 64-bit).

Was it helpful?

Solution

The DOSBox web site says it is an emulation of DOS for Unix machines, not an emulator of Unix for Windows (DOS) machines. You need Cygwin or MinGW or something similar if you want to emulate Unix on Windows.

OTHER TIPS

There is no easy way of emulating fork() on win32 or dos.

You always can declare anything yourself: pid_t fork(void); However, if your system don't have unistd.h, it isn't POSIX compliant (or you haven't installed headers at all).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top