What's the relationship between pid and pid_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, All

From linux kernel (2.6.30.4), I found two data structures, as follow:

typedef __kernel_pid_t        pid_t;

struct pid
{
    atomic_t count;
    unsigned int level;
    /* lists of tasks that use this pid */
    struct hlist_head tasks[PIDTYPE_MAX];
    struct rcu_head rcu;
    struct upid numbers[1];
};

According to my understanding, the pid_t is the frequent item we know, such as in getpid() function, ps command and also.

Then, what's the pid structure used for? and what's the relationship between pid structure and pid_t?

Why the kernel required to involved pid this structure?

Hope you could give me some explanation or some  links.

Thank you very much~
--
Best Regards!
Aiolia Lea

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux