home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * GETFH.C
- *
- * (c)Copyright 1990, Matthew Dillon, All Rights Reserved
- */
-
- #include <stdio.h>
- #include <fcntl.h>
- #include <errno.h>
-
- _IOFDS *
- __getfh(fd)
- short fd;
- {
- _IOFDS *d;
-
- if ((unsigned)fd >= _IoFDLimit) {
- errno = EBADF;
- return(NULL);
- }
- d = _IoFD + fd;
- if ((d->fd_Flags & O_ISOPEN) == 0) {
- errno = EBADF;
- return(NULL);
- }
- return(d);
- }
-
-
-