5

I've written some code (to run under Linux) that uses pthread robust mutexes for deadlock recovery.

Under Centos 5 the mutex attr name is PTHREAD_MUTEX_ROBUST_NP. However under Fedora 16 the _NP suffix has been removed.

The Posix standard does not include the suffix. What does the suffix mean, when was it removed, and what is the proper way to get code to compile that uses either naming of the feature.

EDIT: So it appears that in latter pthreads the suffix was removed. However, defining _GNU_SOURCE redefines the '_np' versions so the source can compile under either.

krbvroc1
  • 51
  • 4

1 Answers1

3

As suggested already by cnicutar the _NP stands for non-portable and is appended by implementations that want to add functionality that is not (or not yet) in the standard. The standard will only consider including functions that are implemented in at least one major implementation and prove to be useful and not trivially achievable using existing standard functions.

Fedora generally uses more recent versions of libraries than RHEL (or CentOS) and probably removed the _np now that robust mutexes and the associated API have been accepted into the standard.

jafw
  • 31
  • 1