|
|
1.1 ! root 1: /* ! 2: * libc/stdio/fdopen.c ! 3: * Standard I/O Library ! 4: * Get file structure for given file descriptor. ! 5: */ ! 6: ! 7: #include <stdio.h> ! 8: ! 9: FILE * ! 10: fdopen(fd, type) ! 11: int fd; ! 12: char *type; ! 13: { ! 14: register FILE **fpp; ! 15: extern FILE *_fopen(); ! 16: ! 17: if (0<=fd && fd<_NFILE) for (fpp = &_fp[0]; fpp < &_fp[_NFILE]; fpp++) ! 18: if (*fpp==NULL || !((*fpp)->_ff2&_FINUSE)) ! 19: return (*fpp = _fopen(NULL, type, *fpp, fd)); ! 20: return (NULL); ! 21: } ! 22: ! 23: /* end of libc/stdio/fdopen.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.