/* * 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
*/ staticstruct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, struct uts_namespace *old_ns)
{ struct uts_namespace *ns; struct ucounts *ucounts; int err;
err = -ENOSPC;
ucounts = inc_uts_namespaces(user_ns); if (!ucounts) goto fail;
err = -ENOMEM;
ns = create_uts_ns(); if (!ns) goto fail_dec;
err = ns_alloc_inum(&ns->ns); if (err) goto fail_free;
/* * Copy 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.
*/ struct uts_namespace *copy_utsname(unsignedlong flags, struct user_namespace *user_ns, struct uts_namespace *old_ns)
{ struct uts_namespace *new_ns;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.