1 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
2 /* All Rights Reserved */
6 * Copyright (c) 1985 Regents of the University of California.
7 * All rights reserved. The Berkeley software License Agreement
8 * specifies the terms and conditions for redistribution.
12 * Copyright (c) 1988-1997, by Sun Microsystems, Inc.
13 * All Rights reserved.
16 #pragma ident "%Z%%M% %I% %E% SMI"
20 #include <sys/types.h>
22 #include <sys/statvfs.h>
27 cnvtvfs64(struct statfs64
*buf
, struct statvfs64
*vbuf
)
30 buf
->f_bsize
= vbuf
->f_frsize
;
31 buf
->f_blocks
= vbuf
->f_blocks
;
32 buf
->f_bfree
= vbuf
->f_bfree
;
33 buf
->f_bavail
= vbuf
->f_bavail
;
34 buf
->f_files
= vbuf
->f_files
;
35 buf
->f_ffree
= vbuf
->f_ffree
;
36 buf
->f_fsid
.val
[0] = vbuf
->f_fsid
;
37 buf
->f_fsid
.val
[1] = 0;
41 statfs64(char *path
, struct statfs64
*buf
)
44 struct statvfs64 vbuf
;
46 if ((long)buf
== -1L) {
51 if ((ret
= statvfs64(path
, &vbuf
)) != -1)
52 cnvtvfs64(buf
, &vbuf
);
57 fstatfs64(int fd
, struct statfs64
*buf
)
60 struct statvfs64 vbuf
;
62 if ((ret
= fstatvfs64(fd
, &vbuf
)) != -1)
63 cnvtvfs64(buf
, &vbuf
);
69 cnvtvfs(struct statfs
*buf
, struct statvfs
*vbuf
)
72 buf
->f_bsize
= vbuf
->f_frsize
;
73 buf
->f_blocks
= vbuf
->f_blocks
;
74 buf
->f_bfree
= vbuf
->f_bfree
;
75 buf
->f_bavail
= vbuf
->f_bavail
;
76 buf
->f_files
= vbuf
->f_files
;
77 buf
->f_ffree
= vbuf
->f_ffree
;
78 buf
->f_fsid
.val
[0] = vbuf
->f_fsid
;
79 buf
->f_fsid
.val
[1] = 0;
83 statfs(char *path
, struct statfs
*buf
)
88 if ((long)buf
== -1L) {
93 if ((ret
= statvfs(path
, &vbuf
)) != -1)
100 fstatfs(int fd
, struct statfs
*buf
)
105 if ((ret
= fstatvfs(fd
, &vbuf
)) != -1)