Questions tagged «procfs»

7
解析/ proc /文件是否安全?
我想解析/proc/net/tcp/,但是安全吗? 我应该如何打开文件/proc/并从中读取文件,不要担心其他进程(或操作系统本身)会在同一时间对其进行更改?
152 c++  c  linux  unix  procfs 

1
3>&1隐含4>&3 5>&3等吗?
我希望 echo foo | tee /proc/self/fd/{3..6} 3>&1 因/ proc / self / fd / 4之类的错误而失败:没有此类文件或目录等,但令我惊讶的是,它输出 foo foo foo foo foo 就像3>&1导致以下所有描述符都重定向到stdout一样,除非如果我更改3为其他内容则不起作用,例如 $ echo foo | tee /proc/self/fd/{3..6} 4>&1 tee: /proc/self/fd/3: No such file or directory tee: /proc/self/fd/5: No such file or directory tee: /proc/self/fd/6: No such file or directory foo …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.