|
|
1.1 ! root 1: /* Copyright (c) 1982 Regents of the University of California */ ! 2: ! 3: static char sccsid[] = "@(#)opendir.c 4.2 3/10/82"; ! 4: ! 5: static char SCCSID[] = "@(#)opendir.c 2.1 DKHOST 85/01/15"; ! 6: ! 7: #include <sys/types.h> ! 8: #include <sys/stat.h> ! 9: #include "ndir.h" ! 10: ! 11: /* ! 12: * open a directory. ! 13: */ ! 14: DIR * ! 15: opendir(name) ! 16: char *name; ! 17: { ! 18: register DIR *dirp; ! 19: ! 20: dirp = (DIR *)malloc(sizeof(DIR)); ! 21: dirp->dd_fd = open(name, 0); ! 22: if (dirp->dd_fd == -1) { ! 23: free(dirp); ! 24: return NULL; ! 25: } ! 26: dirp->dd_loc = 0; ! 27: return dirp; ! 28: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.