fs/proc/thread_self.c

Source file repositories/reference/linux-study-clean/fs/proc/thread_self.c

File Facts

System
Linux kernel
Corpus path
fs/proc/thread_self.c
Extension
.c
Size
1650 bytes
Lines
66
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

if (inode) {
			inode->i_ino = thread_self_inum;
			simple_inode_init_ts(inode);
			inode->i_mode = S_IFLNK | S_IRWXUGO;
			inode->i_uid = GLOBAL_ROOT_UID;
			inode->i_gid = GLOBAL_ROOT_GID;
			inode->i_op = &proc_thread_self_inode_operations;
			d_make_persistent(thread_self, inode);
			ret = 0;
		}
		dput(thread_self);
	}

	if (ret)
		pr_err("proc_fill_super: can't allocate /proc/thread-self\n");
	return ret;
}

void __init proc_thread_self_init(void)
{
	proc_alloc_inum(&thread_self_inum);
}

Annotation

Implementation Notes