The pid of a process is defined as
pid_t pid;
whereas, pid_t is an opaque data type. If the process’s id number can be represented by an int, why should not we declare it as an int family rather then hiding its data type from its users?
The pid of a process is defined as pid_t pid; whereas, pid_t is an
Share
That’s not really an opaque type, but an alias to an integer type. For example, in my system, I find the following in different header files:
Hence, you’re right in that
pid_tis just anint. However, I’d say there are a couple of reasons to do this:long int), you just need to change thetypedef, recompile and everything should work fine. In fact, I believe this already happens for different architectures.