当前位置: 技术问答>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))