Multiprocess#

#include "rcsw/multiprocess/procm.h"

Process management helpers for POSIX systems. Not available in bare-metal builds.

  • procm_socket_lock() restricts the calling process to the CPUs of one socket. Linux only: it reads the CPU topology from sysfs.

  • procm_fork_exec() forks and execv()s a command (no PATH search), optionally changing the child’s working directory, silencing its stdout, and connecting a pipe to its stdin.

Error Handling#

procm_socket_lock() returns ERROR on failure; see Error Handling. procm_fork_exec() returns the child’s process ID to the parent, or -1 if fork() failed. A child that can’t set up or exec writes a message to stderr and exits with EXIT_FAILURE.