linux networking question
I have been racking my brain for the last couple of days to find an answer to this question, so here it is:
I am building a networking application (using poll()). I first wanted to figure out how poll worked, so I wrote some test code (very short). It segment faults whenever I run it, and I can't figure out why. I have tried it on several other distros, and flavors of *nix, including my universitys DIGITAL system with no luck.
------Here is my code-----------------------
#include <stdio.h>
#include <poll.h>
#include <stdlib.h>
struct ClientData {
char buffer[8192];
};
int main() {
pollfd ClientFds[1024];
ClientData socketdata[1024];
for (int x=0;x<1024;x++) {
ClientFds[x].fd = -1;
}
return 0;
}
any help would be greatly appreciated.
Knightstar
--------end of code-------
|