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:

wait4 - parameter differences (CrCh180)

KN Impacts SIG Impacts

Problem description

The status parameter for the wait4 function is different on Tru64 UNIX and HP-UX.

The wait4 function waits for a child process to stop or terminate.

On Tru64 UNIX, wait4 has the following function prototype:

pid_t wait4 (pid_t wpid, union wait *status, int options, struct rusage *rusage);

On HP-UX, wait4 has the following function prototype:

pid_t wait4 (pid_t wpid, int *status, int options, struct rusage *rusage);

Note that on Tru64 UNIX, status is declared as union wait *; on HP-UX, status is declared as an int *.


C/C++ Functionswait4            

Old behavior

Example 1

union wait status;
result = wait4(pid, &status, options, rusage);

Example 2

union wait status;
if (WIFEXITED(status -> w_status)) ...

See also

Solution description

Change your code.

If your application uses wait4, change the union wait variable to an int.

In addition, for each of the following macros (called after wait4 in accordance with the Tru64 UNIX documentation), change the type of the parameter passed to the macro from the w_status member of the wait union to an to an integer:


The wait4 function will be documented in a future release of HP-UX. Monitor the HP-UX release notes for information on its availability.

New behavior

Example 1

int status;
result = wait4(pid, &status, options, rusage);

Example 2

int status;
if (WIFEXITED(status)) ...

Problem summary

classifications source types OS release severity type
KN, SIG 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.