Hello,
I was trying to determine the amount of data available on a socket using the following standard code:
"
ioctl(sock, FIONREAD, &num);
"
The ioctl function does not seem to be implemented as I get the following errors which I do not seem to be able to fix:
"
error: 'FIONREAD' was not declared in this scope
'ioctl' was not declared in this scope
"
I have the following includes:
"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/select.h>
"
Anyone have a solution or pointer to what I`m doing wrong?
ioctl missing?
Standard code? FIONREAD isn't even in POSIX. The PSP isn't POSIX, and definitely isn't UNIX. You'll have to figure out the Sony way of doing that. There might be some sceIoIoctl equivalent, but you'll have to resort to reverse engineering to figure it out.
An easier bet would be to just read all the available data and then you'll know exactly how much there was.
An easier bet would be to just read all the available data and then you'll know exactly how much there was.