我们正在将 C 应用程序从 Solaris 8 迁移到 Solaris 10。在 Solaris 10 上运行此代码时出现错误。我使用的是 32 位 gcc 编译器。
nFDs = ulimit(UL_GDESLIM, 0);
n=select(nFDs, &set, NULL, NULL, NULL);
错误:
Error : GetKey_(): select(): Invalid argument
我知道为什么会出现此错误,因为nFDs
超过 1024。以下是来自select.h
#ifdef _LP64
#define FD_SETSIZE 65536
#else
#define FD_SETSIZE 1024
您能否给我指点ulimit(UL_GDESLIM, 0)
and的select
工作原理以及我需要修复哪个标头?