By this, I mean function-wise. I'm using fileno to convert a FILE\* to a fd and it returns without any error, but when I use pread on that returned value from fileno, it gives me a bad file descriptor error. IE:

```
FILE* fin;
FILE* fout;
int fd, result;
fd = open("path", O_RDWR);
// Do stuff with fin and fout
// fout is the file with all of the stuff I want to copy to the fd
fd = fileno(fout);
result = pread(fd, buf, size, offset); // Bad file descriptor--returns a 9

```

I can't figure out what's causing pread to give me this error and it's driving me nuts.