高手赐教!!急!!tornado2.0
小弟不知道select()怎么用!在tornado2.0下的程序!
#include "vxWorks.h"
#include "selectLib.h"
#include "fcntl.h"
#include "stdlib.h"
#include "stdio.h"
#include "ioLib.h"
#include "pipeDrv.h"
#include "selectLib.h"
#define MAX_DATA 1024
#define MAX_MESSAGE 50
#define EVERMESSAGELONGTH 10
#define FIRST "first"
#define SECOND "second"
int task1();
int task2();
int i;
int firstID;
char buffer[MAX_DATA];
int width;
struct fd_set readFds;
struct fd_set writeFds;
int fds1;
int pipe()
{
pipeDrv ();
if((pipeDevCreate("first",MAX_MESSAGE,EVERMESSAGELONGTH)==ERROR))
{
printf("the pipe is failed\n");
}
else
{
printf("the pipe have been created successfully\n");
}
if (select (10, &readFds,&writeFds, NULL, 120) == ERROR)
{
printf("the select is wrong\n");
}
else
{
firstID=taskSpawn("firsttask",90,0x000,2000,task1,0,0,0,0,0,0,0,0,0,0);
fds1=fds1+5;
printf("the fds1 is changed,now it is:\n");
printf("%d",fds1);
}
}
int task1()
{
if((fds1= open ("first", O_RDWR,0644))==ERROR)
{
printf("the file is opened FAILED\n");
}
else
{
printf("the file is opened sucessful\n");
printf("the original fds1,it is:\n");
printf("%d",fds1);
}
FD_ZERO (&readFds);
FD_SET (fds1,&readFds);
read (fds1, buffer, 10);
}
/*int task2()
{
}*/