函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\utsname.c Create Date:2022-07-27 12:20:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Clone a new ns copying an original utsname, setting refcount to 1*@old_ns: namespace to clone* Return ERR_PTR(-ENOMEM) on error (failure to allocate), new ns otherwise

函数原型:static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, struct uts_namespace *old_ns)

返回类型:struct uts_namespace

参数:

类型参数名称
struct user_namespace *user_ns
struct uts_namespace *old_ns
52  err等于负ENOSPC
53  ucounts等于inc_uts_namespaces(user_ns)
54  如果非ucounts则转到:fail
57  err等于负ENOMEM
58  ns等于create_uts_ns()
59  如果非ns则转到:fail_dec
62  err等于ns_alloc_inum( & ns)
63  如果err则转到:fail_free
66  ucounts等于ucounts
67  ops等于utsns_operations
69  lock for reading
70  内存复制( & name, & name, name的长度)
71  user_ns等于get_user_ns(user_ns)
72  lease a read lock
73  返回:ns
75  fail_free :
76  kmem_cache_free(uts_ns_cache, ns)
77  fail_dec :
78  dec_uts_namespaces(ucounts)
79  fail :
80  返回:错误号
调用者
名称描述
copy_utsnameCopy task tsk's utsname namespace, or clone it if flags* specifies CLONE_NEWUTS. In latter case, changes to the* utsname of this process won't be seen by parent, and vice* versa.