Annotation of coherent/b/lib/libc/XSTDIO/other/fdopen.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Standard I/O Library
                      3:  * get file structure for given file descriptor
                      4:  */
                      5: 
                      6: #include <stdio.h>
                      7: 
                      8: FILE *
                      9: fdopen(fd, type)
                     10: int    fd;
                     11: char   *type;
                     12: {
                     13:        register FILE   **fpp;
                     14:        extern  FILE    *_fopen();
                     15: 
                     16:        if (0<=fd && fd<_NFILE) for (fpp = &_fp[0]; fpp < &_fp[_NFILE]; fpp++)
                     17:                if (*fpp==NULL || !((*fpp)->_ff2&_FINUSE))
                     18:                        return (*fpp = _fopen(NULL, type, *fpp, fd));
                     19:        return (NULL);
                     20: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.