Files
cgroups-rs/src/systemd/pids.rs
Xuewei Niu 4a68c762e1 systemd: Add support for managing cgroups through systemd
`SystemdCgroup` takes a `parent`, which is the name of a slice, and a
`unit`, which is the name of a slice or a scope unit, and provides methods
to start, kill the unit, as well as set properties for the unit.

The mods, `cpu`, `memory`, `cpuset`, and `pids`, are designed to generate
properties quickly. It hides the difference between cgroups v1 and v2, and
does simple checks for the systemd version and arguments.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2025-07-18 15:17:12 +08:00

12 lines
240 B
Rust

// Copyright (c) 2025 Ant Group
//
// SPDX-License-Identifier: Apache-2.0 or MIT
//
use crate::systemd::error::Result;
use crate::systemd::TASKS_MAX;
pub fn max(max: i64) -> Result<(&'static str, u64)> {
Ok((TASKS_MAX, max as u64))
}