Function report |
Source Code:kernel\fork.c |
Create Date:2022-07-28 08:59:01 |
Last Modify:2020-03-17 11:04:53 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:share allows a process to 'unshare' part of the process* context which was originally shared using clone. copy_** functions used by do_fork() cannot be used here directly* because they modify an inactive task_struct that is being* constructed
Proto:int ksys_unshare(unsigned long unshare_flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned long | unshare_flags |
2898 | struct files_struct * fd, * new_fd = NULL |
2900 | struct nsproxy * new_nsproxy = NULL |
2901 | do_sysvsem = 0 |
2908 | If unshare_flags & New user namespace Then unshare_flags |= Same thread group | set if fs info shared between processes |
2913 | If unshare_flags & set if VM shared between processes Then unshare_flags |= set if signal handlers and blocked signals shared |
2918 | If unshare_flags & set if signal handlers and blocked signals shared Then unshare_flags |= Same thread group |
2923 | If unshare_flags & New mount namespace group Then unshare_flags |= set if fs info shared between processes |
2927 | If err Then Go to bad_unshare_out |
2934 | If unshare_flags & (New ipc namespace | share system V SEM_UNDO semantics ) Then do_sysvsem = 1 |
2937 | If err Then Go to bad_unshare_out |
2940 | If err Then Go to bad_unshare_cleanup_fs |
2942 | err = unshare_userns(unshare_flags, & new_cred) |
2943 | If err Then Go to bad_unshare_cleanup_fd |
2945 | err = unshare_nsproxy_namespaces(unshare_flags, & new_nsproxy, new_cred, new_fs) |
2947 | If err Then Go to bad_unshare_cleanup_cred |
2950 | If new_fs || new_fd || do_sysvsem || new_cred || new_nsproxy Then |
2951 | If do_sysvsem Then |
2955 | exit_sem(current process) |
2957 | If unshare_flags & New ipc namespace Then |
2959 | exit_shm(current process) |
2960 | shm_init_task(current process) |
2963 | If new_nsproxy Then switch_task_namespaces(current process, new_nsproxy) |
2968 | If new_fs Then |
2976 | spin_unlock( & lock) |
2979 | If new_fd Then |
2985 | task_unlock(current process) |
2987 | If new_cred Then |
2996 | bad_unshare_cleanup_cred : |
2999 | bad_unshare_cleanup_fd : |
3000 | If new_fd Then put_files_struct(new_fd) |
3003 | bad_unshare_cleanup_fs : |
3004 | If new_fs Then free_fs_struct(new_fs) |
3007 | bad_unshare_out : |
3008 | Return err |
Name | Describe |
---|---|
SYSCALL_DEFINE1 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |