当前位置: 技术问答>linux和unix
关于select函数,哪位高手帮我看看下面这个系统调用的程序那里有问题,帮我修改一下,谢谢。
来源: 互联网 发布时间:2016-10-29
本文导语: [root@localhost mplex]# make gcc -o mplex mplex.c mplex.c:39:26: error: macro "FD_ISSET" requires 2 arguments, but only 1 given mplex.c: In function ‘main’: mplex.c:39: error: ‘FD_ISSET’ undeclared (first use in this function) mplex.c:39: error: (Ea...
[root@localhost mplex]# make
gcc -o mplex mplex.c
mplex.c:39:26: error: macro "FD_ISSET" requires 2 arguments, but only 1 given
mplex.c: In function ‘main’:
mplex.c:39: error: ‘FD_ISSET’ undeclared (first use in this function)
mplex.c:39: error: (Each undeclared identifier is reported only once
mplex.c:39: error: for each function it appears in.)
mplex.c:39: error: expected expression before ‘||’ token
mplex.c:39: error: expected statement before ‘)’ token
#include
#include
#include
#include
#define BUFSZ 80
void err_quit(char *msg);
int main()
{
int fds[2];
char buf[BUFSZ];
int i,rc,maxfd;
fd_set watchset; //read this set of file descriptors;
fd_set inset; // copy of watchset for select to update
//open the pipes
if((fds[0] = open("pipe1",O_RDONLY | O_NONBLOCK))
gcc -o mplex mplex.c
mplex.c:39:26: error: macro "FD_ISSET" requires 2 arguments, but only 1 given
mplex.c: In function ‘main’:
mplex.c:39: error: ‘FD_ISSET’ undeclared (first use in this function)
mplex.c:39: error: (Each undeclared identifier is reported only once
mplex.c:39: error: for each function it appears in.)
mplex.c:39: error: expected expression before ‘||’ token
mplex.c:39: error: expected statement before ‘)’ token
#include
#include
#include
#include
#define BUFSZ 80
void err_quit(char *msg);
int main()
{
int fds[2];
char buf[BUFSZ];
int i,rc,maxfd;
fd_set watchset; //read this set of file descriptors;
fd_set inset; // copy of watchset for select to update
//open the pipes
if((fds[0] = open("pipe1",O_RDONLY | O_NONBLOCK))
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!