I think i might have found a minor bug in “int
pthread_mutexattr_setpshared(pthread_mutexattr_t* attr, int pshared)” in
The documentation (QNX as well as POSIX) says that the function returns
EINVAL if “The new value specified in pshared isn’t PTHREAD_PROCESS_SHARED
However I find that any value I pass for “pshared” is accepted (EOK). Some
testing shows me that odd values equate to PTHREAD_PROCESS_SHARED and even
values are taken as PTHREAD_PROCESS_PRIVATE.
Test code below:
main (int argc, char **argv)
/* argv is the value we want to pass to ‘pshared’.
iPShared = atoi(argv); */
printf("\nAttempting to set ‘pshared’ to %d\n", iPShared);
printf(“Return Value = %s\n”,
(EOK == pthread_mutexattr_setpshared(&tAttr,
? “EOK” : “SOME ERROR”);
printf(“Retrieved value of ‘pshared’ = %d\n\n”, iPShared);