File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -318,17 +318,15 @@ pub fn name(pid: i32) -> Result<String, String> {
318318/// use libproc::libproc::proc_pid::{listpidinfo, pidinfo};
319319/// use libproc::libproc::task_info::{TaskAllInfo};
320320/// use libproc::libproc::file_info::{ListFDs, ProcFDType};
321+ /// use std::process;
321322///
322- /// fn listpidinfo_test() {
323- /// use std::process;
324- /// let pid = process::id() as i32;
323+ /// let pid = process::id() as i32;
325324///
326- /// if let Ok(info) = pidinfo::<TaskAllInfo>(pid, 0) {
327- /// if let Ok(fds) = listpidinfo::<ListFDs>(pid, info.pbsd.pbi_nfiles as usize) {
328- /// for fd in &fds {
329- /// let fd_type = ProcFDType::from(fd.proc_fdtype);
330- /// println!("File Descriptor: {}, Type: {:?}", fd.proc_fd, fd_type);
331- /// }
325+ /// if let Ok(info) = pidinfo::<TaskAllInfo>(pid, 0) {
326+ /// if let Ok(fds) = listpidinfo::<ListFDs>(pid, info.pbsd.pbi_nfiles as usize) {
327+ /// for fd in &fds {
328+ /// let fd_type = ProcFDType::from(fd.proc_fdtype);
329+ /// println!("File Descriptor: {}, Type: {:?}", fd.proc_fd, fd_type);
332330/// }
333331/// }
334332/// }
You can’t perform that action at this time.
0 commit comments