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:

pthread_delay_np - not supported; temporarily available (CrUn37)

ME Impacts TH Impacts

Problem description

The pthread_delay_np function exists on Tru64 UNIX, but not on HP-UX. This function will be available on a temporary basis in the Tru64 UNIX Migration Environment for HP-UX.

The pthread_delay_np function is a nonportable equivalent to the POSIX standard function nanosleep. Both accept a time interval using a standard POSIX struct timespec structure, which defines the interval in seconds and nanoseconds, and suspend the calling thread for at least as long as the specified interval. The major functional difference is that pthread_delay_np is based on a timed condition variable wait: it computes an absolute target time by adding the interval to the current system time, and waits until that target time arrives, disregarding any signals delivered to the thread. Changes to the system time will affect the actual interval waited. The nanosleep function waits for the specified interval regardless of system time changes; however, if a signal is delivered to the thread, and dismissed normally, nanosleep will return to the caller and can optionally return the remaining interval.

The Migration Environment contains Tru64 UNIX APIs, development tools, and commands and utilities to assist customers in migrating their applications from Tru64 UNIX to HP-UX.


C/C++ Functionspthread_delay_np    

Old behavior

The following is an example of the pthread_delay_np function:

struct timespec interval;
interval.tv_sec = 5;
interval.tv_nsec = 0;
pthread_delay_np (&interval);

See also

Solution description

The pthread_delay_np routine is in the Tru64 UNIX Migration Environment.

Applications will be able to use this function from the Tru64 UNIX Migration Environment for HP-UX. Please note that the Migration Environment is temporary. For a long-term solution, recode your application to use the standard nanosleep function. Be advised of the semantic differences regarding wait interval and signal behavior; but these will not be important to most applications.

New behavior

The following is an example of the nanosleep function:

struct timespec interval, remain;
interval.tv_sec = 5;
interval.tv_nsec = 0;
nanosleep (&interval, &remain);

See also

Problem summary

classifications source types OS release severity type
ME, TH C, C++ any HP-UX 11i version critical unavailable
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.