Close-on-Exec in Device Services: Stop Helper Processes from Keeping Ports Open
Set close-on-exec when a descriptor is created, duplicated or received, unless it belongs to an explicit helper-inheritance contract. Adding FD_CLOEXEC later with fcntl leaves a multithreaded fork/exec window. A helper can retain a device port, socket or pipe after the parent closes its copy, preventing the release the service expected. This guide follows Linux man-pages…