Hacker News new | ask | show | jobs
by arthurcolle 4245 days ago
Sorry for the stupid question but does that mean you can't write C code in Windows that calls fork()?
2 comments

I'm not really an expert but I'm pretty sure you can call fork but you will pay a full cost of a creating a new process, manually copying the memory state to the new process and parent and child have to do a complicated dance to ensure it all happens right. So it works and most of the semantics are the same, but it is god awful slow.
> you can call fork but you will pay a full cost of a creating a new process, manually copying the memory state to the new process and parent and child have to do a complicated dance to ensure it all happens right

That fork() and associated dance happens in cygwin1.dll or the equivalent POSIX compatibility library. Windows has no fork to call.

You are correct, fork() is part of the POSIX specification, Windows does not implement POSIX.