发新话题
打印

命名空间是什么概念

命名空间是什么概念

  little提问:在进程clone()中,copy_process()拷贝或共享打开的文件,文件系统信息,信号处理函数,进程地址空间,命名空间。请问一个命名空间是什么概念,怎么理解?
storm earth fire hear my call you are too late my brother will not die in vain 叛逆善良

TOP

陈老师回复:名字空间的数据结构:
struct namespace {
9         atomic_t                count;
10         struct vfsmount *       root;
11         struct list_head        list;
12         struct rw_semaphore     sem;
13 };
可以看出,其中主要数据结构为vfsmount,而vfsmount为已安装的文件系统
康华回复:命名空间的概念在C++,Jave编程语言里很常见,是指变量函数等的名称有效范围,同一命名空间中的变量不可重名。 至于Linux中copy_process()提到的进程命名空间意义同样。
storm earth fire hear my call you are too late my brother will not die in vain 叛逆善良

TOP

发新话题