Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/3d/getdents3d.c
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1989-2012 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* David Korn <[email protected]> *
19
* Eduardo Krell <[email protected]> *
20
* *
21
***********************************************************************/
22
#pragma prototyped
23
24
#include "3d.h"
25
26
#ifdef getdents3d
27
28
ssize_t
29
getdents3d(int fd, void* buf, size_t n)
30
{
31
ssize_t r;
32
33
#if FS
34
register Mount_t* mp;
35
36
if (!fscall(NiL, MSG_getdents, 0, fd, buf, n))
37
return(state.ret);
38
mp = monitored();
39
#endif
40
if ((r = GETDENTS(fd, buf, n)) >= 0)
41
{
42
#if FS
43
if (mp)
44
fscall(mp, MSG_getdents, r, fd, buf, n);
45
for (mp = state.global; mp; mp = mp->global)
46
if (fssys(mp, MSG_getdents))
47
fscall(mp, MSG_getdents, r, fd, buf, n);
48
#endif
49
}
50
return(r);
51
}
52
53
#else
54
55
NoN(getdents)
56
57
#endif
58
59
#ifdef getdents643d
60
61
ssize_t
62
getdents643d(int fd, void* buf, size_t n)
63
{
64
ssize_t r;
65
66
#if FS
67
register Mount_t* mp;
68
69
if (!fscall(NiL, MSG_getdents, 0, fd, buf, n))
70
return(state.ret);
71
mp = monitored();
72
#endif
73
if ((r = GETDENTS64(fd, buf, n)) >= 0)
74
{
75
#if FS
76
if (mp)
77
fscall(mp, MSG_getdents, r, fd, buf, n);
78
for (mp = state.global; mp; mp = mp->global)
79
if (fssys(mp, MSG_getdents))
80
fscall(mp, MSG_getdents, r, fd, buf, n);
81
#endif
82
}
83
return(r);
84
}
85
86
#else
87
88
NoN(getdents64)
89
90
#endif
91
92