critical impact:
statfs, fstatfs - deprecated; use statvfs and fstatvfs (CrCh196)
Problem description
The statfs and fstatfs functions are being deprecated on HP-UX.
The statfs and fstatfs functions are only supported for 32-bit applications on HP-UX. These functions are available for 64-bit applications on HP-UX, but can only support file systems up to 2GB in size. Identifiers
 fstatfs |
 statfs |
|
|
|
Old behavior
#include <sys/mount.h>
.
.
.
char *path;
int fd;
struct statfs buffer;
statfs(path, &buffer);
fstatfs(fd, &buffer);
.
.
. See also
Solution description
Modify your source code.
Replace all calls to statfs and fstatfs with the standard statvfs and fstatvfs functions, respectively. This is especially true when porting a 64-bit application. You must also add
sys/types.h and sys/statvfs.h header files to your application. In addition, change the data type for storing the file system status information from statfs to statvfs (defined on HP-UX in /usr/include/sys/statvfs.h).
If you want to continue using statfs and fstatfs, change the header file from sys/mount.h to sys/vfs.h. Note: statfs and fstatfs are marked as deprecated on HP-UX.
New behavior
#include <sys/types.h>
#include <sys/statvfs.h>
.
.
.
char *path;
int fd;
struct statvfs buffer;
statvfs(path, &buffer);
fstatvfs(fd, &buffer);
.
.
. See also
Problem summary
| classifications |
source types |
OS release |
severity |
type |
| IO |
C, C++ |
any HP-UX 11i version |
critical |
changed |
|