簡體   English   中英

為什么 kill function 手冊頁顯示兩個 header sys/types.h 和 signal.h

[英]why does the kill function man page shows two header sys/types.h and signal.h

man 2 kill - C 中 kill function 的手冊頁在 SYNOPSIS 中顯示了兩個 header 文件 -

  1. #include <sys/types.h>
  2. #include <信號.h>

當我在我的 c 程序中使用 kill function 時, only including the signal.h file就可以完美編譯。
包含synopsis中提到的所有#include 重要嗎?
上面 kill 中sys/types.h的目的是什么?

您可以包含sys/types.h以使用pid_t並且它是可選的。 但是signal.h允許您使用kill (和其他函數)、信號常量等。所以#include <signal.h>必須使用kill

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM