Why does getpid() return pid_t instead of int?

后端 未结 6 1068
太阳男子
太阳男子 2020-12-23 19:37

What\'s the logic behind calls like getpid() returning a value of type pid_t instead of an unsigned int? Or int? How does

6条回答
  •  失恋的感觉
    2020-12-23 20:14

    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).

提交回复
热议问题