Revision 7556,
1.3 KB
checked in by cfields, 30 years ago
(diff) |
Include sys/ioccom.h for Solaris.
7.7 checkin; changes by vrt
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 1991 by the Massachusetts Institute of Technology. |
---|
3 | * All Rights Reserved. |
---|
4 | * |
---|
5 | * For re-distribution and warranty information, see <mit-copyright.h> |
---|
6 | * |
---|
7 | * |
---|
8 | * $Id: afs.c,v 1.4 1994-08-14 16:39:43 cfields Exp $ |
---|
9 | */ |
---|
10 | |
---|
11 | #include <sys/types.h> |
---|
12 | #include <sys/ioctl.h> |
---|
13 | |
---|
14 | #include <afs/param.h> |
---|
15 | #include <netinet/in.h> |
---|
16 | #include <afs/venus.h> |
---|
17 | #include <afs/afsint.h> |
---|
18 | |
---|
19 | #ifdef SOLARIS |
---|
20 | #include <sys/ioccom.h> |
---|
21 | #include <sys/fs/ufs_quota.h> |
---|
22 | #else |
---|
23 | #include <ufs/quota.h> |
---|
24 | #endif |
---|
25 | |
---|
26 | #include "xquota.h" |
---|
27 | |
---|
28 | #define MAXNAME 100 |
---|
29 | #define MAXSIZE 2048 |
---|
30 | |
---|
31 | static char space[MAXSIZE]; |
---|
32 | |
---|
33 | /* ARGSUSED */ |
---|
34 | int |
---|
35 | getafsquota(host, path, uid, dqp) |
---|
36 | char *host, *path; |
---|
37 | int uid; |
---|
38 | struct dqblk *dqp; |
---|
39 | { |
---|
40 | int code; |
---|
41 | struct ViceIoctl blob; |
---|
42 | struct VolumeStatus *status; |
---|
43 | char *name; |
---|
44 | |
---|
45 | memset((char *)dqp, 0, sizeof(*dqp)); |
---|
46 | |
---|
47 | blob.out_size = MAXSIZE; |
---|
48 | blob.in_size = 0; |
---|
49 | blob.out = space; |
---|
50 | code = pioctl(path, VIOCGETVOLSTAT, &blob, 1); |
---|
51 | if (code) |
---|
52 | return(QUOTA_ERROR); |
---|
53 | status = (VolumeStatus *)space; |
---|
54 | name = (char *)status + sizeof(*status); |
---|
55 | if (status->MaxQuota == 0) { |
---|
56 | /* no quota */ |
---|
57 | return(QUOTA_OK); |
---|
58 | } |
---|
59 | dqp->dqb_bsoftlimit = status->MaxQuota*2; |
---|
60 | dqp->dqb_bhardlimit = status->MaxQuota*2; |
---|
61 | dqp->dqb_curblocks = status->BlocksInUse*2; |
---|
62 | return(QUOTA_OK); |
---|
63 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.