Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit
» 

DSPP Home

» HP STK home
Tru64 UNIX STK
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» FAQ
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
» DSPP
Content starts here

critical impact:

statfs, fstatfs - deprecated; use statvfs and fstatvfs (CrCh196)

IO Impacts

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

C/C++ Functionsfstatfs C/C++ Functionsstatfs      

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
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.