pid_t Type in Linux It is used to define process in environment programming ID, The header file needs to be introduced <sys/types.h>, First look at the header file
/usr/include/sys/types.h About pid_t Definition of .
#ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif
so pid_t Equivalent to __pid_t, Keep looking __pid_t Definition of .

Header file <sys/types.h> The header file is included in <bits/types.h>, Depending on the name, it is related to the definition of the type , We're in the header file <bits/types.h> We found it in
__pid_t Is defined as follows :
#if __WORDSIZE == 32 #define __STD_TYPE __extension__ typedef #elif __WORDSIZE
== 64 # define __STD_TYPE typedef #else # error #endif __STD_TYPE __PID_T_TYPE
__pid_t; /* Type of process identifications. */
That is to say, if we compile a program that is 32 Bit , that __pid_t Is defined as follows :
__extension__ typedef __PID_T_TYPE __pid_t;
If we compile a program that is 64 Bit , that __pid_t Is defined as follows :
typedef __PID_T_TYPE __pid_t;
among __extension__ The role of :GCC To standard C The language has been extended , But when you use these extensions , The compiler will warn you , use __extension__
Keywords will tell GCC Don't warn .

__pid_t Is equivalent to __PID_T_TYPE, We keep looking __PID_T_TYPE Definition of , In header file <bits/typesizes.h> We found that
__PID_T_TYPE Is defined as follows :
#define __PID_T_TYPE __S32_TYPE
thus , We found it pid_t Is equivalent to __S32_TYPE. that __S32_TYPE What type is it ? We go back to the header file <bits/types.h> The following definitions were found :
#define __S32_TYPE int
thus , We come to the following conclusion :
pid_t be equal to int.

Technology
©2019-2020 Toolsou All rights reserved,
What are the protection measures for website security ? Talking about uni-app Page value transfer problem Remember once EventBus Project issues caused by memory leaks I've been drinking soft water for three years ? What is the use of soft water and water softener Time conversion front desk will 2020-07-17T03:07:02.000+0000 Into 2020-07-17 11:07:02 Chuan Shen Count the number of letters (java Language implementation ) Time format 2020-01-13T16:00:00.000Z Medium T and Z What do they mean , How to deal with it msf Generate Trojan horse attack android mobile phone The world's first free open source ERP Odoo Ubuntu The best development environment What's the difference in server prices ?