[RFC PATCH v5 0/9] libcamera: process: Remove `ProcessManager` singleton

Barnabás Pőcze barnabas.pocze at ideasonboard.com
Thu Apr 24 13:40:54 CEST 2025


The main goal is to remove the need for the ProcessManager singleton. That
is achieved by using pidfd + clone3(), which raises the minimum
kernel version to 5.4. There are also additional misc. changes.

changes in v5:
  * send the actually intended version...

changes in v4:
  * address review comments

v4: https://patchwork.libcamera.org/cover/23242/
v3: https://patchwork.libcamera.org/cover/23013/
v2: https://patchwork.libcamera.org/patch/22609/
v1: https://patchwork.libcamera.org/patch/22522/

Barnabás Pőcze (9):
  libcamera: process: Disable copy/move
  libcamera: process: Misc. cleanup around `execv()`
  libcamera: process: Use `pid_` member to decide if running
  libcamera: process: Return error if already running
  libcamera: process: Ensure that file descriptors are nonnegative
  libcamera: process: Use span instead of vector
  libcamera: process: Move `closeAllFdsExcept()`
  libcamera: process: Use `close_range()` when available
  libcamera: process: Remove `ProcessManager` singleton

 include/libcamera/internal/camera_manager.h |   1 -
 include/libcamera/internal/process.h        |  45 +--
 meson.build                                 |   6 +-
 src/libcamera/ipc_pipe_unixsocket.cpp       |   9 +-
 src/libcamera/process.cpp                   | 312 +++++++-------------
 test/ipc/unixsocket_ipc.cpp                 |   2 -
 test/log/log_process.cpp                    |   2 -
 test/process/process_test.cpp               |   7 +-
 8 files changed, 124 insertions(+), 260 deletions(-)

--
2.49.0


More information about the libcamera-devel mailing list