我在 AIX 上运行了以下命令,以找出 AIX 6.1 上进程 200866 打开的文件。
procfiles -nc 200866
并得到以下示例输出:
Current rlimit: 2000 file descriptors
---------------------------------------------------------------------------------------------------------------
FD TYPE MODE DEV/RDEV UID GID OPMOD NAME
---------------------------------------------------------------------------------------------------------------
10 - rw-r--r-- 10, 4 root system R|NH|DY
有人能帮我理解 OPMOD 列中的 NH 和 DY 的含义吗?我在 Google 上搜索了很多,但没有找到任何相关页面。谢谢!
答案1
它们只是文件打开模式标志的缩写,没有标志您也能更完整地看到它们-c
。
我找不到缩写的文档,但标志名称详细说明在open()
文档在您的特定示例中,这将是一个以只读方式打开的文件(R
),其中O_NSHARE
(NH
)和O_DELAY
(DY
)。
这里有一些“生成”它们的 C 代码片段。
open("./1", O_RDONLY|O_DELAY);
open("./2", O_RDONLY|O_NDELAY);
open("./3", O_WRONLY);
open("./4", O_RDWR|O_APPEND);
open("./5", O_RDONLY|O_NSHARE);
open("./6", O_RDONLY|O_RSHARE);
open("./7", O_RDWR|O_CIO);
22282268 : ./a.out
Current rlimit: 32000 file descriptors
---------------------------------------------------------------------------
FD TYPE MODE DEV/RDEV UID GID OPMOD NAME
---------------------------------------------------------------------------
0 c --------- 10, 4(20, 1) xxxxxxxx xxxxxxxx R-W|NC //dev/pts/1
1 c --------- 10, 4(20, 1) xxxxxxxx xxxxxxxx R-W|NC //dev/pts/1
2 c --------- 10, 4(20, 1) xxxxxxxx xxxxxxxx R-W|NC //dev/pts/1
3 - r--r--r-- 10, 8 xxxxxxxx xxxxxxxx R|DY /home/xxxxxxxx/1
4 - r--r--r-- 10, 8 xxxxxxxx xxxxxxxx R|NDY /home/xxxxxxxx/2
5 - -w------- 10, 8 xxxxxxxx xxxxxxxx W /home/xxxxxxxx/3
6 - rw-r--r-- 10, 8 xxxxxxxx xxxxxxxx R-W|A /home/xxxxxxxx/4
7 - r--r--r-- 10, 8 xxxxxxxx xxxxxxxx R|NH /home/xxxxxxxx/5
8 - r--r--r-- 10, 8 xxxxxxxx xxxxxxxx R|RH /home/xxxxxxxx/6
9 - rw-r--r-- 10, 8 xxxxxxxx xxxxxxxx R-W|C /home/xxxxxxxx/7
$ procfiles -n 22282268
22282268 : ./a.out
Current rlimit: 32000 file descriptors
0: S_IFCHR mode:00 dev:10,4 ino:28770 uid:29912237 gid:29912237 rdev:20,1
O_RDWR | O_NOCTTY name://dev/pts/1
1: S_IFCHR mode:00 dev:10,4 ino:28770 uid:29912237 gid:29912237 rdev:20,1
O_RDWR | O_NOCTTY name://dev/pts/1
2: S_IFCHR mode:00 dev:10,4 ino:28770 uid:29912237 gid:29912237 rdev:20,1
O_RDWR | O_NOCTTY name://dev/pts/1
3: S_IFREG mode:0444 dev:10,8 ino:62 uid:29912237 gid:29912237 rdev:0,0
O_RDONLY | O_DELAY size:0 name:/home/xxxxxxxx/1
4: S_IFREG mode:0444 dev:10,8 ino:63 uid:29912237 gid:29912237 rdev:0,0
O_RDONLY | O_NDELAY size:0 name:/home/xxxxxxxx/2
5: S_IFREG mode:0200 dev:10,8 ino:67 uid:29912237 gid:29912237 rdev:0,0
O_WRONLY size:0 name:/home/xxxxxxxx/3
6: S_IFREG mode:0644 dev:10,8 ino:68 uid:29912237 gid:29912237 rdev:0,0
O_RDWR | O_APPEND size:0 name:/home/xxxxxxxx/4
7: S_IFREG mode:0444 dev:10,8 ino:69 uid:29912237 gid:29912237 rdev:0,0
O_RDONLY | O_NSHARE size:0 name:/home/xxxxxxxx/5
8: S_IFREG mode:0444 dev:10,8 ino:70 uid:29912237 gid:29912237 rdev:0,0
O_RDONLY | O_RSHARE size:0 name:/home/xxxxxxxx/6
9: S_IFREG mode:0644 dev:10,8 ino:71 uid:29912237 gid:29912237 rdev:0,0
O_RDWR | O_CIO size:0 name:/home/xxxxxxxx/7