some todos

This commit is contained in:
ClementTsang
2025-08-31 01:25:54 -04:00
parent bb741cf6b4
commit f5833c5bfb
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -170,6 +170,7 @@ fn get_amdgpu_pid_fds(pid: u32, device_path: &[String]) -> Option<Vec<u32>> {
let valid_fds: Vec<u32> = fd_list
.filter_map(|fd_link| {
let dir_entry = fd_link.map(|fd_link| fd_link.path()).ok()?;
// TODO: Could we reuse the buffer in some way?
let link = rustix::fs::readlink(&dir_entry, vec![]).ok()?;
// e.g. "/dev/dri/renderD128" or "/dev/dri/card0"
@@ -250,6 +250,7 @@ impl Process {
.next_back()
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
.or_else(|| {
// TODO: Could we reuse the buffer in some way?
rustix::fs::readlinkat(rustix::fs::CWD, pid_path.as_path(), vec![])
.ok()
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())