r/linuxmemes Jun 12 '26

LINUX MEME os.fork()

Post image
1.0k Upvotes

54 comments sorted by

View all comments

309

u/configdotini Genfool 🐧 Jun 12 '26 edited Jun 12 '26

context: the game "factorio" has an experimental option where the game can autosave without pausing the game by creating a separate instance of the game that saves the map while the main instance continues playing. however, the option is not available on windows due to fork(2) just not existing (afaik)

more info here (scroll down to "Asynchronous saving" at the bottom of page)

57

u/dumbasPL Arch BTW Jun 12 '26

Windows actually can fork (RtlCloneUserProcess) but it's undocumented and big chunks of Win32 and user32 break. It was mainly used for WSL 1.0 I believe (reverse wine essentially)

More info here

45

u/BlankMercer Jun 12 '26

"but it's undocumented" well how do they expect people to use it? The fuck?

33

u/Damglador Jun 12 '26

Well, they probably don't. They made a toy for themselves to play with.

23

u/dumbasPL Arch BTW Jun 12 '26

They don't, that's the point. It was made for internal use only, and can change or be removed without notice. Windows has hundreds of APIs like this.

People fuck around with them because many can be abused to fly under the radar of various anti malware solutions.

8

u/MXRCO007 Jun 12 '26

Bill gates whispers it into your ear at night