Add pthread_mutexattr_setpshared and pthread_mutexattr_getpshared.
authorDavid Xu <davidxu@dragonflybsd.org>
Mon, 24 Oct 2005 23:58:01 +0000 (23:58 +0000)
committerDavid Xu <davidxu@dragonflybsd.org>
Mon, 24 Oct 2005 23:58:01 +0000 (23:58 +0000)
lib/libthread_xu/thread/thr_mutexattr.c

index 07d5c52..384c2de 100644 (file)
@@ -29,7 +29,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $DragonFly: src/lib/libthread_xu/thread/thr_mutexattr.c,v 1.1 2005/02/01 12:38:27 davidxu Exp $
+ * $DragonFly: src/lib/libthread_xu/thread/thr_mutexattr.c,v 1.2 2005/10/24 23:58:01 davidxu Exp $
  */
 
 /*
@@ -166,3 +166,29 @@ _pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
        }
        return(ret);
 }
+
+int
+_pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
+       int *pshared)
+{
+
+       if (attr == NULL || *attr == NULL)
+               return (EINVAL);
+
+       *pshared = PTHREAD_PROCESS_PRIVATE;
+       return (0);
+}
+
+int
+_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
+{
+
+       if (attr == NULL || *attr == NULL)
+               return (EINVAL);
+
+       /* Only PTHREAD_PROCESS_PRIVATE is supported. */
+       if (pshared != PTHREAD_PROCESS_PRIVATE)
+               return (EINVAL);
+
+       return (0);
+}