what the double-fork? 0 ▲ erock's devlog 1 hour ago · 5 min read1010 words · Tech · hide · 0 comments • I built zmx as a multi-faceted learning exercise. I wanted to learn more about zig, posix, daemons, ptys, libghostty, and terminals. Creating a program that fits into my core dev toolchain was merely a side-effect. While researching about how to create a daemon, buried in the implementation of abduco, I discovered the double-fork. • abduco.c • Hidden behind the double-fork technique is a cascade of terms and concepts that are fundamental to how linux manages processes. This post is me coming to the surface and intended to be a reminder when I read zmx and say "what the double-fork?" what is a daemon? • A daemon belongs to a session that has no controlling terminal. In linux terms, it does not have a controlling terminal. For example, when backgrounding a process using ctrl-z+bg or {cmd} &, the session still has a controlling terminal which means it can control those background processes. This is not ideal for a daemon. how does fork work in a program? • When using fork(2) in a… No comments yet. Log in to reply on the Fediverse. Comments will appear here.