Linux pid_t defines the data type that is usually used to define the process number during Process Creation: pid_t. We all know that it is an int type,
The following is the process of finding this definition in the Linux C header file: www.2cto.com 1,/usr/include/sys/types. h has the following definitions # include <bits/types. h> ...... # ifndef _ pid_t_defined typedef _ pid_t; # define _ pid_t_defined # endif You Can See That pid_t is actually of the _ pid_t type. 2. in/usr/include/bits/types. h, you can see the definition www.2cto.com # include <bits/typesizes. h> # if _ WORDSIZE = 32 ...... # define _ STD_TYPE _ extension _ typedef # elif _ WORDSIZE = 64 ...... # endif ...... _ STD_TYPE _ PID_T_TYPE _ pid_t;/* Type of process identifications. */we can see that _ pid_t is defined as _ extension _ typedef _ PID_T_TYPE.
3. in the file/usr/include/bits/typesizes. h, you can see this definition (this file does not contain any header files ): # define _ PID_T_TYPE _ S32_TYPE You Can See That _ PID_T_TYPE is defined as _ S32_TYPE.
4. in the file/usr/include/bits/types. in h, we finally found this definition: # define _ S32_TYPE int. Then we finally found the actual definition of pid_t: Actually, it is of the int type.