1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: */
6:
7: #if defined(LIBC_SCCS) && !defined(lint)
8: static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86";
9: #endif LIBC_SCCS and not lint
10:
11: #include <sys/param.h>
12: #include <sys/dir.h>
13:
14: /*
15: * open a directory.
16: */
17: DIR *
18: opendir(name)
19: char *name;
20: {
21: register DIR *dirp;
22: register int fd;
23:
24: if ((fd = open(name, 0)) == -1)
25: return NULL;
26: if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
27: close (fd);
28: return NULL;
29: }
30: dirp->dd_fd = fd;
31: dirp->dd_loc = 0;
32: return dirp;
33: }
Defined functions
opendir
defined in line
17; used 88 times
- in /usr/src/bin/chgrp.c line
138
- in /usr/src/bin/chmod.c line
104
- in /usr/src/bin/cp.c line
186
- in /usr/src/bin/csh/sh.exec.c line
298
- in /usr/src/bin/csh/sh.file.c line
379
- in /usr/src/bin/csh/sh.glob.c line
184
- in /usr/src/bin/diff/diffdir.c line
177
- in /usr/src/bin/du.c line
122,
143
- in /usr/src/bin/ls.c line
245
- in /usr/src/bin/make/files.c line
263
- in /usr/src/bin/ps.c line
750
- in /usr/src/bin/rcp.c line
386
- in /usr/src/bin/rm.c line
121,
143
- in /usr/src/bin/sh/expand.c line
72
- in /usr/src/bin/tar.c line
505,
524
- in /usr/src/bin/tp/tp2.c line
259
- in /usr/src/etc/badsect.c line
71
- in /usr/src/etc/catman.c line
127
- in /usr/src/etc/chown.c line
134
- in /usr/src/etc/restore/dirs.c line
108
- in /usr/src/etc/savecore.c line
179
- in /usr/src/games/compat/unixtraps.c line
612
- in /usr/src/lib/libc/gen/getwd.c line
60
- in /usr/src/lib/libc/gen/scandir.c line
34
- in /usr/src/lib/libc/gen/ttyname.c line
35
- in /usr/src/new/dsh/src/getwd.c line
30
- in /usr/src/new/help/help.c line
799
- in /usr/src/new/kermit/ckufio.c line
756,
792
- in /usr/src/new/mh/sbr/m_gmsg.c line
50
- in /usr/src/new/mh/sbr/pwd.c line
69,
81
- in /usr/src/new/mh/uip/bbl.c line
296
- in /usr/src/new/mh/uip/conflict.c line
298
- in /usr/src/new/mh/uip/folder.c line
512
- in /usr/src/new/mh/uip/rmf.c line
163
- in /usr/src/new/mkmf/src/buildlist.c line
214,
220
- in /usr/src/new/nntp/server/scandir.c line
34
- in /usr/src/new/spms/src/bin/pfind/Pfind.c line
122-127(2)
- in /usr/src/new/spms/src/bin/phelp/index.c line
33,
44
- in /usr/src/new/spms/src/lib/libspms/src/getwd.c line
43
- in /usr/src/new/xns/examples/filing/glob.c line
194
- in /usr/src/old/berknet/net.c line
480
- in /usr/src/old/berknet/netdaemon.c line
88
- in /usr/src/old/berknet/netq.c line
85
- in /usr/src/old/berknet/netrm.c line
64
- in /usr/src/old/vpr/vpd.c line
147
- in /usr/src/old/vpr/vpq.c line
87
- in /usr/src/old/vpr/vprm.c line
47
- in /usr/src/ucb/ex/expreserve.c line
118
- in /usr/src/ucb/ex/exrecover.c line
229,
441
- in /usr/src/ucb/ftp/glob.c line
188
- in /usr/src/ucb/lastcomm.c line
212
- in /usr/src/ucb/msgs/msgs.c line
227
- in /usr/src/ucb/rdist/docmd.c line
418
- in /usr/src/ucb/rdist/expand.c line
263
- in /usr/src/ucb/rdist/server.c line
307,
1148,
1229
- in /usr/src/ucb/ruptime.c line
89
- in /usr/src/ucb/rwho.c line
68
- in /usr/src/ucb/sccs.c line
980
- in /usr/src/ucb/sendbug/bugfiler.c line
522-524(2)
- in /usr/src/ucb/whereis.c line
278
- in /usr/src/usr.bin/find/find.c line
653
- in /usr/src/usr.bin/learn/selsub.c line
151
- in /usr/src/usr.bin/learn/start.c line
22
- in /usr/src/usr.bin/uucp/anlwrk.c line
123
- in /usr/src/usr.bin/uucp/gnsys.c line
46
- in /usr/src/usr.bin/uucp/uuclean.c line
86
- in /usr/src/usr.bin/uucp/uuq.c line
198
- in /usr/src/usr.bin/uucp/uusnap.c line
140,
207,
242
- in /usr/src/usr.bin/xsend/xget.c line
118
- in /usr/src/usr.bin/xsend/xsend.c line
49
- in /usr/src/usr.lib/lpr/cmds.c line
661
- in /usr/src/usr.lib/lpr/common.c line
163
- in /usr/src/usr.lib/lpr/recvjob.c line
82
- in /usr/src/usr.lib/sendmail/src/queue.c line
400
Defined variables
sccsid
defined in line
8;
never used