-
-
Save tcreech/b178ec9d34abac22a0b6 to your computer and use it in GitHub Desktop.
OpenAFS on FreeBSD: AFS fd never ready for reading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/select.h> | |
#include <fcntl.h> | |
/* Accepts exactly one argument: the name of a file which we will open(2) and | |
* select(2) on for reading. */ | |
int main(int argc, char **argv){ | |
int fd; | |
fd_set fs; | |
int sel; | |
if(argc != 2) | |
return 1; | |
fd = open(argv[1], O_RDONLY); | |
if(fd == -1) | |
return 2; | |
FD_ZERO(&fs); | |
FD_SET(fd, &fs); | |
select(fd+1, &fs, 0, 0, 0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment