最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to prevent new processes from inheriting an inotify fd? - Stack Overflow

programmeradmin2浏览0评论

On openSUSE Leap 15.6 with XFS I've noticed that all processes get the 3 usual standard fds 0 1 and 2 plus one extra for inotify. For instance for this trivial exe

 #include <unistd.h>

int main()
{
    usleep(100000000L);
}

lsof shows (ignoring libs, cwd and the exe itself)

test    7212 paulf   0u      CHR  136,2      0t0          5 /dev/pts/2
test    7212 paulf   1u      CHR  136,2      0t0          5 /dev/pts/2
test    7212 paulf   2u      CHR  136,2      0t0          5 /dev/pts/2
test    7212 paulf  44r  a_inode   0,14        0       2074 inotify

This interferes with the Valgrind --track-fd regression tests.

Is there any way to turn this off?

发布评论

评论列表(0)

  1. 暂无评论