What's the logic behind calls like getpid() returning a value of type pid_t instead of an unsigned int? Or int? How does this help?
getpid()
pid_t
unsigned int
int
I'm guessing this has to do with portability? Guaranteeing that pid_t is the same size across different platforms that may have different sizes of ints etc.?
I think it's the opposite: making the program portable across platforms, regardless of whether, e.g., a PID is 16 or 32 bits (or even longer).
2.1m questions
2.1m answers
60 comments
57.0k users