2 * Posix stdio -- fdopen
6 * Open the named file with the given mode, using the given FILE
7 * Legal modes are given below, `additional characters may follow these sequences':
9 * w wb open to write, truncating
10 * a ab open to write positioned at eof, creating if non-existant
11 * r+ r+b rb+ open to read and write, creating if non-existant
12 * w+ w+b wb+ open to read and write, truncating
13 * a+ a+b ab+ open to read and write, positioned at eof, creating if non-existant.
15 FILE *fdopen(const int fd, const char *mode){
18 for(f=_IO_stream;f!=&_IO_stream[FOPEN_MAX];f++)
21 if(f==&_IO_stream[FOPEN_MAX]) {
28 if(f->fd==-1) return NULL;