i want to use ioctl() to get the number of bytes ready to be read
the way I did it is:
mysocket=socket(....); ioctl(mysocket, FIONBIO, &zero);
Have you tried including sys/ioctl.h?
This code works for me:
#include <sys/ioctl.h> #include <stdio.h> int main() { printf("FIONBIO value %d\n", FIONBIO); }
When I execute grep -R FIONBIO /usr/include, it's found here:
grep -R FIONBIO /usr/include
/usr/include/asm-generic/ioctls.h:#define FIONBIO 0x5421