user_task_count#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- zett_agent.sandbox.resources.user_task_count()[source]#
Return how many processes (and, on Linux, threads) this user owns right now.
RLIMIT_NPROCis compared with this number, not with the size of one process tree: a fork fails once the user owns that many in total. Linux counts threads too (it is “more precisely” a limit on threads), and macOS counts processes only.psis asked rather than/procso one code path serves both. None means it could not be counted, and the caller then does not pretend to limit processes.- Return type:
int | None