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


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

critical impact:

getdiskbyname - incompatible return type (CrCh70)

IO Impacts

Problem description

The Tru64 UNIX and HP-UX return types for getdiskbyname are incompatible. On Tru64 UNIX, the function prototype is as follows:

struct disktab *getdiskbyname(const char *name);

On HP-UX, the function prototype is as follows:

struct disklabel *getdiskbyname (char *name);

The getdiskbyname routine gets the disk description using a disk name. On Tru64 UNIX, the <sys/disklabel.h> header file defines the return types for this routine as follows:

struct disklabel {
    u_int       d_magic ;
    short       d_type ;
    short       d_subtype ;
    char        d_typename[16] ;
    union       d_un ;
    u_int       d_secsize ;
    u_int       d_nsectors ;
    u_int       d_ntracks ;
    u_int       d_ncylinders ;
    u_int       d_secpercyl ;
    u_int       d_secperunit ;
    u_short     d_sparespertrack ;
    u_short     d_sparespercyl ;
    u_int       d_acylinders ;
    u_short     d_rpm ;
    u_short     d_interleave ;
    u_short     d_trackskew ;
    u_short     d_cylskew ;
    u_int       d_headswitch ;
    u_int       d_trkseek ;
    u_int       d_flags ;
    u_int       d_drivedata[5] ;
    u_int       d_spare[5] ;
    u_int       d_magic2 ;
    u_short     d_checksum ;
    u_short     d_npartitions ;
    u_int       d_bbsize ;
    u_int       d_sbsize ;
    struct partition d_partitions[8] ;
} ;

On HP-UX, the <disktab.h> header file defines the return types for this routine as follows:

struct disktab {
    char *      d_name ;
    char *      d_type ;
    int         d_secsize ;
    int         d_ntracks ;
    int         d_nsectors ;
    int         d_ncylinders ;
    int         d_rpm ;
    struct partition d_partitions[] ;} ;


C/C++ Structuresdisktab C/C++ Functionsgetdiskbyname  

See also

Solution description

Review the applicable manpages and code to determine if your code has any dependencies on the return types.

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.