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

Defined functions

opendir defined in line 11; used 1 times

Defined variables

sccsid defined in line 3; never used
Last modified: 1983-01-06
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 423
Valid CSS Valid XHTML 1.0 Strict