//ulimit -n #include #include #include #include int main(int argc, char *argv[]){ int fd; while(1){ fd = open("data.txt", O_RDONLY); if( fd < 0){ perror("ERROR"); return 1; } char c; ssize_t ret = read(fd, &c, 1); if(ret > 0){ printf("%d, %c\n", fd, c); } } close(fd); return 0; }