c - How can I cancel a blocked read/recvfrom system call on vxworks or linux -


in task i:

...  while (1) {   if (running == false)   break;   ret = read(fd, buf, size); /* or: ret = recvfrom(sock, buf, size, 0, null, null); */   ...  } 

in task ii:

... running = true; /* ioctl(fd, fiocancel, 0); */ close(fd);   /* or: close(sock);*/ 

what should in task ii cancel blocked task i,

in vxworks, there function, ioctl(fd, fiocancel, 0) cancel blocked read or write can not work. because driver can not support "fiocancel".

how write task ii in vxworks , linux? or there other way task?

cancelling read/recvfrom call impossible on linux. cannot write these tasks using same api. on linux can use epoll , o_nonblock create semantics of canceling read/recvfrom.

it impossible using same code both linux , vxworks.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -