gpt4 book ai didi

c - task_struct 的struct 中的pwd 和root 有什么区别?

转载 作者:太空宇宙 更新时间:2023-11-04 07:27:49 26 4
gpt4 key购买 nike

Linux-0.12 中的 sched.h:

struct task_struct {
/* these are hardcoded - don't touch */
long state; /* -1 unrunnable, 0 runnable, >0 stopped */
long counter;
long priority;
long signal;
struct sigaction sigaction[32];
long blocked; /* bitmap of masked signals */
/* various fields */
int exit_code;
unsigned long start_code,end_code,end_data,brk,start_stack;
long pid,pgrp,session,leader;
int groups[NGROUPS];
/*
* pointers to parent process, youngest child, younger sibling,
* older sibling, respectively. (p->father can be replaced with
* p->p_pptr->pid)
*/
struct task_struct *p_pptr, *p_cptr, *p_ysptr, *p_osptr;
unsigned short uid,euid,suid;
unsigned short gid,egid,sgid;
unsigned long timeout,alarm;
long utime,stime,cutime,cstime,start_time;
struct rlimit rlim[RLIM_NLIMITS];
unsigned int flags; /* per process flags, defined below */
unsigned short used_math;
/* file system info */
int tty; /* -1 if no tty, so it must be signed */
unsigned short umask;
struct m_inode * pwd;
struct m_inode * root;
struct m_inode * executable;
struct m_inode * library;
unsigned long close_on_exec;
struct file * filp[NR_OPEN];
/* ldt for this task 0 - zero 1 - cs 2 - ds&ss */
struct desc_struct ldt[3];
/* tss for this task */
struct tss_struct tss;
};

struct m_inode * rootstruct m_inode * pwd 有什么区别?
谢谢。

最佳答案

密码是一个目录结构。 dentry 将文件名映射到 inode 编号。 pwd 就是你所在的当前目录。root 是根目录,所以我假设它是根目录/。

http://www.makelinux.net/books/lkd2/ch12lev1sec10

关于c - task_struct 的struct 中的pwd 和root 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16588207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com