|
|
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: #include <sys/types.h> ! 6: #include <sys/stat.h> ! 7: #include <ndir.h> ! 8: ! 9: /* ! 10: * open a directory. ! 11: */ ! 12: DIR * ! 13: opendir(name) ! 14: char *name; ! 15: { ! 16: register DIR *dirp; ! 17: ! 18: dirp = (DIR *)malloc(sizeof(DIR)); ! 19: dirp->dd_fd = open(name, 0); ! 20: if (dirp->dd_fd == -1) { ! 21: free(dirp); ! 22: return NULL; ! 23: } ! 24: dirp->dd_loc = 0; ! 25: return dirp; ! 26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.