From 0507674a13a02a46c789b6e314deffb73302e135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 4 Nov 2025 20:56:15 +0000 Subject: [PATCH] Document the new cleanup function using a Doxygen-style comment --- src/libstore/unix/build/darwin-derivation-builder.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libstore/unix/build/darwin-derivation-builder.cc b/src/libstore/unix/build/darwin-derivation-builder.cc index 701da9513..613ec6d54 100644 --- a/src/libstore/unix/build/darwin-derivation-builder.cc +++ b/src/libstore/unix/build/darwin-derivation-builder.cc @@ -227,6 +227,15 @@ struct DarwinDerivationBuilder : DerivationBuilderImpl NULL, drv.builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data()); } + /** + * Cleans up all System V IPC objects owned by the specified user. + * + * On Darwin, IPC objects (shared memory segments, message queues, and semaphore) + * can persist after the build user's processes are killed, since there are no IPC namespaces + * like on Linux. This can exhaust kernel IPC limits over time. + * + * Uses sysctl to enumerate and remove all IPC objects owned by the given UID. + */ void cleanupSysVIPCForUser(uid_t uid) { struct IpcsCommand ic;