Linux pid_t Definition

Source: Internet
Author: User


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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.