Linux function: unshare
When a new process is created with the clone() system call, a set of flags is provided which tells the kernel which resources, if any, should be shared between that process and its parent. Potentially shareable resources include virtual memory, open files, signal handlers, and more. New processes also share, by default, the filesystem namespace seen by their parent (and, usually, by the system as a whole).
In the current Linux kernel, the sharing decisions made at clone() time last for the lifetime of the processes involved. There is not usually a reason to change resource sharing, but recent discussions on supporting private mounts (with the filesystems in user space patch, or otherwise) have suggested that it would actually be useful for a process to be able to "unshare" resources after its creation. In particular, if a process could detach itself from the global filesystem namespace and create its own, it would be possible to set up that new namespace with whatever private mounts that process needs. If this functionality were used within a PAM module, it would be relatively easy for administrators to set up per-user views of the filesystem, complete with private mounts.
To that end, Jenak Desai has posted a patch adding a new unshare() system call. The interface is simple enough:
long unshare(unsigned long flags);
The flags argument can be CLONE_NEWNS (to create a new filesystem namespace), CLONE_VM (to establish a private virtual address space) or CLONE_SIGHAND (to unshare signal handlers). If all goes well, when the call returns, the designated resource(s) will now be private to the calling process; otherwise the situation is unchanged.
This patch has not yet made it to the linux-kernel mailing list, and may see some changes before it is considered for inclusion.
Linux function: unshare的更多相关文章
- linux function
#!/bin/bash function sayHello() { #这里的{ 和它前面的)之间可以没有空格 echo "Hello $1" } sayHello 'Neeky'
- karottc A Simple linux-virus Analysis、Linux Kernel <= 2.6.37 - Local Privilege Escalation、CVE-2010-4258、CVE-2010-3849、CVE-2010-3850
catalog . 程序功能概述 . 感染文件 . 前置知识 . 获取ROOT权限: Linux Kernel <= - Local Privilege Escalation 1. 程序功能概述 ...
- Linux 驱动开发
linux驱动开发总结(一) 基础性总结 1, linux驱动一般分为3大类: * 字符设备 * 块设备 * 网络设备 2, 开发环境构建: * 交叉工具链构建 * NFS和tftp服务器安装 3, ...
- 使用js和jq去掉左右空格方法
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <script src ...
- oracle批量导出AWR报告
工作需求:项目中需要把生产库中所有的AWR报告dump出来,然后导入到方便测试的数据库中.在测试库中的AWR报告需要根据dbid和实例名逐个导出,如果遇到很多再加上RAC系统,会很麻烦.在网上找了一些 ...
- SelectDirectory使用方法以及EnableTaskWindows
SelectDirectory使用方法 格式 Delphi syntax: On Windows: function SelectDirectory(const Caption: string; co ...
- php 简单通用的日志记录方法
使用file_put_contents 方法来实现简单便捷的日志记录功能 方法1: // use \r\n for new line on windows, just \n on linux func ...
- shell 函数用法
近期在学习shell编程方面的知识,写的不怎么好,请大家多多指点,下面给大家分享一下shell函数的用法. 我们为什么要用shell函数? 简单的说,函数的作用就是把程序多次调用相同的代码部分定义成一 ...
- 一些方便系统诊断的bash函数
原文地址:一些方便系统诊断的bash函数 一些方便系统诊断的bash函数:http://hongjiang.info/common-bash-functions/ 这段脚本包含100多个bash函数, ...
随机推荐
- Atcoder CADDi 2018 Solution
C - Product and GCD Solved. 题意: 给出$n个数$的乘积,求$这n个数$的最大的可能是GCD 思路: 分解质因子,那么$每个质因子的贡献就是其质因子个数/ n的乘积$ #i ...
- Linux基础入门(实验楼实验)
实验一 Linux系统简介 Linux和windows.Mac OS一样是一种操作系统.最早流行起来的操作系统是UNIX,但由于其过度商业化,价格昂贵,因此在校园里人们大多选择MINIX.1991年, ...
- Windows10系统远程桌面连接出现卡顿如何解决
最新的windows10系统下,用户只要开启远程桌面连接,就能够轻松地操控其他电脑.但是,最近部分用户在win10中启用远程连接时,发现电脑窗口变得非常缓慢卡顿,这是怎么回事呢?其实,该问题与系统的设 ...
- linux下查看当前登陆的用户数目
在shell下输入以下语句即可获取: who | awk '{print $1}' | sort | uniq | wc -l
- Educational Codeforces Round 17 C. Two strings 打表二分
C. Two strings time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...
- python 列表元素统计出现的次数并输出字典
import collections my_list = [,,,,,,,,,,,,] print("Original List : ",my_list) ctr = collec ...
- Mediator(中介者)
意图: 用一个中介对象来封装一系列的对象交互.中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互. 适用性: 一组对象以定义良好但是复杂的方式进行通信.产生的相互依 ...
- QWebEngine_C++_交互
参考网址:http://blog.csdn.net/liuyez123/article/details/50509788 ZC: 该文章里面的: “ <ahref="javascrip ...
- c# 如何调用python脚本
1.net4.5: http://www.jb51.net/article/84418.htm 2.net4.0: https://www.cnblogs.com/shiyingzheng/p/605 ...
- 使用80percent开发rails程序:gem的了解。(kaminari)
学习目的: 对一些主要的gem进行学习了解基本功能: 作者的一些答复:(链接) 关于安全配置: 对于配置文件, 安全仅有一点: 不要提交任何敏感信息到服务端. 所以 rails-template 是添 ...