1: static char sccsid[] = "@(#)opendir.c 4.4 11/12/82";
   2: 
   3: #include <sys/param.h>
   4: #include <dir.h>
   5: 
   6: /*
   7:  * open a directory.
   8:  */
   9: DIR *
  10: opendir(name)
  11:     char *name;
  12: {
  13:     register DIR *dirp;
  14:     register int fd;
  15: 
  16:     if ((fd = open(name, 0)) == -1)
  17:         return NULL;
  18:     if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
  19:         close (fd);
  20:         return NULL;
  21:     }
  22:     dirp->dd_fd = fd;
  23:     dirp->dd_loc = 0;
  24:     return dirp;
  25: }

Defined functions

opendir defined in line 9; used 1 times

Defined variables

sccsid defined in line 1; never used
Last modified: 1986-04-21
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 794
Valid CSS Valid XHTML 1.0 Strict