Can';找不到';FD#u集';`select.h中的函数声明`

Can';找不到';FD#u集';`select.h中的函数声明`,c,select,clion,C,Select,Clion,我正在学习unix网络编程。我包括#包括和调用FD\u集功能。当我手动运行gcc时,代码可以成功编译 问题是我的IDEClion无法识别FD\u集,因此它无法帮助我在键入FD\u时自动完成其余代码。因此,我检查了select.h文件,在文件中找不到FD_SET声明 以下是我的Mac电脑上select.h的源代码: #ifndef _SYS_SELECT_H_ #define _SYS_SELECT_H_ #include <sys/appleapiopts.h> #include

我正在学习unix网络编程。我包括
#包括
和调用
FD\u集
功能。当我手动运行
gcc
时,代码可以成功编译

问题是我的IDE
Clion
无法识别
FD\u集
,因此它无法帮助我在键入
FD\u
时自动完成其余代码。因此,我检查了
select.h
文件,在文件中找不到
FD_SET
声明

以下是我的Mac电脑上
select.h
的源代码:

#ifndef _SYS_SELECT_H_
#define _SYS_SELECT_H_

#include <sys/appleapiopts.h>
#include <sys/cdefs.h>
#include <sys/_types.h>

/*
 * [XSI] The <sys/select.h> header shall define the fd_set type as a structure.
 * The timespec structure shall be defined as described in <time.h>
 * The <sys/select.h> header shall define the timeval structure.
 */
#include <sys/_types/_fd_def.h>
#include <sys/_types/_timespec.h>
#include <sys/_types/_timeval.h>

/*
 * The time_t and suseconds_t types shall be defined as described in
 * <sys/types.h>
 * The sigset_t type shall be defined as described in <signal.h>
 */
#include <sys/_types/_time_t.h>
#include <sys/_types/_suseconds_t.h>
#include <sys/_types/_sigset_t.h>

/*
 * [XSI] FD_CLR, FD_ISSET, FD_SET, FD_ZERO may be declared as a function, or
 *   defined as a macro, or both
 * [XSI] FD_SETSIZE shall be defined as a macro
 */

/*
 * Select uses bit masks of file descriptors in longs.  These macros
 * manipulate such bit fields (the filesystem macros use chars).  The
 * extra protection here is to permit application redefinition above
 * the default size.
 */
#include <sys/_types/_fd_setsize.h>
#include <sys/_types/_fd_set.h>
#include <sys/_types/_fd_clr.h>
#include <sys/_types/_fd_isset.h>
#include <sys/_types/_fd_zero.h>

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#include <sys/_types/_fd_copy.h>
#endif  /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */


__BEGIN_DECLS

#ifndef  __MWERKS__
int      pselect(int, fd_set * __restrict, fd_set * __restrict,
    fd_set * __restrict, const struct timespec * __restrict,
    const sigset_t * __restrict)
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
__DARWIN_EXTSN_C(pselect)
#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */
#  if defined(__LP64__) && !__DARWIN_NON_CANCELABLE
__DARWIN_1050(pselect)
#  else /* !__LP64__ || __DARWIN_NON_CANCELABLE */
__DARWIN_ALIAS_C(pselect)
#  endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */
#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */
;
#endif /* __MWERKS__ */

#include <sys/_select.h>        /* select() prototype */

__END_DECLS


#endif /* !_SYS_SELECT_H_ */
\ifndef\u系统选择\u H_
#定义系统选择_
#包括
#包括
#包括
/*
*[XSI]标题应将fd_集合类型定义为结构。
*timespec结构应按照中所述进行定义
*标题应定义timeval结构。
*/
#包括
#包括
#包括
/*
*时间和持续时间类型应按照中所述进行定义
* 
*sigset_t类型的定义如中所述
*/
#包括
#包括
#包括
/*
*[XSI]FD_CLR、FD_ISSET、FD_SET、FD_ZERO可以声明为函数,或者
*定义为宏,或两者都定义
*[XSI]FD_SETSIZE应定义为宏
*/
/*
*Select在long中使用文件描述符的位掩码。这些宏
*操作这样的位字段(文件系统宏使用字符)。这个
*这里的额外保护是允许对上述应用程序进行重新定义
*默认大小。
*/
#包括
#包括
#包括
#包括
#包括
#如果!已定义(_POSIX_C_SOURCE)| |已定义(_DARWIN_C_SOURCE)
#包括
#endif/*(!_POSIX_C_SOURCE | | | | u DARWIN_C_SOURCE)*/
__开始
#ifndef_uuMwerks__
int pselect(int,fd_集*_限制,fd_集*_限制,
fd_集合*_限制,常量结构timespec*_限制,
常数sigset\U t*\U限制)
#如果已定义(_DARWIN_C_SOURCE)|已定义(_DARWIN_UNLIMITED_SELECT)
__达尔文大学(pselect)
#否则/*_达尔文·C·源&_达尔文•无限•选择*/
#如果已定义(uuu LP64_uuu)&&__达尔文不可取消
__达尔文大学1050(普选)
#否则/*__LP64不可取消*/
__达尔文(pselect)
#endif/*\uuuu LP64\uuuu&&__达尔文不可取消*/
#endif/*_DARWIN_C_SOURCE||||u DARWIN_UNLIMITED_SELECT*/
;
#endif/*.\uuuu MWERKS\uu*/
#include/*select()原型*/
__十二月底
#endif/*_系统选择*/

那么,在哪里可以找到
FD\u SET
声明?我应该如何配置我的
clion
,以便它能够识别它?

FD\u集
通常作为宏实现(其他
FD\u*
函数也是如此)。并且没有规定必须直接在播发的头文件中定义它们。正如您在
select.h
的副本中所看到的,它包括许多其他头文件,一些“私有”(如
\ucode>前缀所示),并且宏可以在其中任何一个中定义。您也可以查看是否列出了您的问题。如果没有,请自己创建一个问题并发布一个问题。
FD\u集
通常作为宏实现(其他
FD\u*
“函数也一样”。并且没有规定必须直接在播发的头文件中定义它们。正如您在
select.h
的副本中所看到的,它包括许多其他头文件,一些“私有”(如
\ucode>前缀所示),并且宏可以在其中任何一个中定义。您还可以查看是否列出了您的问题。如果没有,请创建一个问题并自己发布一个问题。