diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h
index 4ab846b24..e55d11fa3 100644
--- a/include/libcamera/internal/process.h
+++ b/include/libcamera/internal/process.h
@@ -45,7 +45,6 @@ public:
 private:
 	LIBCAMERA_DISABLE_COPY_AND_MOVE(Process)
 
-	void closeAllFdsExcept(std::vector<int> v);
 	int isolate();
 	void died(int wstatus);
 
diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
index 5193386ce..4b87c5591 100644
--- a/src/libcamera/process.cpp
+++ b/src/libcamera/process.cpp
@@ -63,6 +63,33 @@ void sigact(int signal, siginfo_t *info, void *ucontext)
 	}
 }
 
+void closeAllFdsExcept(std::vector<int> v)
+{
+	sort(v.begin(), v.end());
+
+	ASSERT(v.empty() || v.front() >= 0);
+
+	DIR *dir = opendir("/proc/self/fd");
+	if (!dir)
+		return;
+
+	int dfd = dirfd(dir);
+
+	struct dirent *ent;
+	while ((ent = readdir(dir)) != nullptr) {
+		char *endp;
+		int fd = strtoul(ent->d_name, &endp, 10);
+		if (*endp)
+			continue;
+
+		if (fd >= 0 && fd != dfd &&
+		    !std::binary_search(v.begin(), v.end(), fd))
+			close(fd);
+	}
+
+	closedir(dir);
+}
+
 } /* namespace */
 
 void ProcessManager::sighandler()
@@ -296,33 +323,6 @@ int Process::start(const std::string &path,
 	}
 }
 
-void Process::closeAllFdsExcept(std::vector<int> v)
-{
-	sort(v.begin(), v.end());
-
-	ASSERT(v.empty() || v.front() >= 0);
-
-	DIR *dir = opendir("/proc/self/fd");
-	if (!dir)
-		return;
-
-	int dfd = dirfd(dir);
-
-	struct dirent *ent;
-	while ((ent = readdir(dir)) != nullptr) {
-		char *endp;
-		int fd = strtoul(ent->d_name, &endp, 10);
-		if (*endp)
-			continue;
-
-		if (fd >= 0 && fd != dfd &&
-		    !std::binary_search(v.begin(), v.end(), fd))
-			close(fd);
-	}
-
-	closedir(dir);
-}
-
 int Process::isolate()
 {
 	int ret = unshare(CLONE_NEWUSER | CLONE_NEWNET);
