OSSP CVS Repository

ossp - Check-in [423]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 423
Date: 2001-Mar-24 16:46:32 (local)
2001-Mar-24 15:46:32 (UTC)
User:rse
Branch:
Comment: *** empty log message ***
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.541 -> 1.542     9 inserted, 0 deleted
ossp-pkg/pth/pthread.c      1.54 -> 1.55     25 inserted, 9 deleted
ossp-pkg/pth/pthread.h.in      1.57 -> 1.58     11 inserted, 9 deleted

ossp-pkg/pth/ChangeLog 1.541 -> 1.542

--- ChangeLog    2001/03/24 14:51:03     1.541
+++ ChangeLog    2001/03/24 15:46:32     1.542
@@ -21,6 +21,15 @@
     
   Changes between 1.4a3 and 1.4a4 (29-Jul-2000 to 24-Mar-2001)
 
+   *) Adjusted all pthread_attr_getXXXX() functions to use a "const
+      pthread_attr_t *" as the first argument instead of "pthread_attr_t
+      *" to fully-conform to POSIX/SUSv2.
+      [Ralf S. Engelschall, Bill Apt <babt@us.ibm.com>]
+
+   *) Added ENOSYS-stubs for pthread_attr_{set,get}guardsize()
+      to the Pthread API to be more complete with POSIX/SUSv2 specs. 
+      [Ralf S. Engelschall, Bill Apt <babt@us.ibm.com>]
+
    *) Added still missing soft system call mapping to Pth and Pthread
       APIs for functions recv(2), send(2), recvfrom(2) and sendto(2).
       [Ralf S. Engelschall, Bill Apt <babt@us.ibm.com>]


ossp-pkg/pth/pthread.c 1.54 -> 1.55

--- pthread.c    2001/03/24 14:51:05     1.54
+++ pthread.c    2001/03/24 15:46:32     1.55
@@ -107,7 +107,7 @@
     return_errno(ENOSYS, ENOSYS);
 }
 
-int pthread_attr_getinheritsched(pthread_attr_t *attr, int *inheritsched)
+int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched)
 {
     if (attr == NULL || inheritsched == NULL)
         return_errno(EINVAL, EINVAL);
@@ -123,7 +123,7 @@
     return_errno(ENOSYS, ENOSYS);
 }
 
-int pthread_attr_getschedparam(pthread_attr_t *attr, struct sched_param *schedparam)
+int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *schedparam)
 {
     if (attr == NULL || schedparam == NULL)
         return_errno(EINVAL, EINVAL);
@@ -139,7 +139,7 @@
     return_errno(ENOSYS, ENOSYS);
 }
 
-int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *schedpolicy)
+int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *schedpolicy)
 {
     if (attr == NULL || schedpolicy == NULL)
         return_errno(EINVAL, EINVAL);
@@ -155,7 +155,7 @@
     return_errno(ENOSYS, ENOSYS);
 }
 
-int pthread_attr_getscope(pthread_attr_t *attr, int *scope)
+int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
 {
     if (attr == NULL || scope == NULL)
         return_errno(EINVAL, EINVAL);
@@ -172,7 +172,7 @@
     return OK;
 }
 
-int pthread_attr_getstacksize(pthread_attr_t *attr, size_t *stacksize)
+int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
 {
     if (attr == NULL || stacksize == NULL)
         return_errno(EINVAL, EINVAL);
@@ -190,7 +190,7 @@
     return OK;
 }
 
-int pthread_attr_getstackaddr(pthread_attr_t *attr, void **stackaddr)
+int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
 {
     if (attr == NULL || stackaddr == NULL)
         return_errno(EINVAL, EINVAL);
@@ -216,7 +216,7 @@
     return OK;
 }
 
-int pthread_attr_getdetachstate(pthread_attr_t *attr, int *detachstate)
+int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
 {
     int s;
 
@@ -231,6 +231,22 @@
     return OK;
 }
 
+int pthread_attr_setguardsize(pthread_attr_t *attr, int stacksize)
+{
+    if (attr == NULL || stacksize < 0)
+        return_errno(EINVAL, EINVAL);
+    /* not supported */
+    return_errno(ENOSYS, ENOSYS);
+}
+
+int pthread_attr_getguardsize(const pthread_attr_t *attr, int *stacksize)
+{
+    if (attr == NULL || stacksize == NULL)
+        return_errno(EINVAL, EINVAL);
+    /* not supported */
+    return_errno(ENOSYS, ENOSYS);
+}
+
 int pthread_attr_setname_np(pthread_attr_t *attr, char *name)
 {
     if (attr == NULL || name == NULL)
@@ -240,7 +256,7 @@
     return OK;
 }
 
-int pthread_attr_getname_np(pthread_attr_t *attr, char **name)
+int pthread_attr_getname_np(const pthread_attr_t *attr, char **name)
 {
     if (attr == NULL || name == NULL)
         return_errno(EINVAL, EINVAL);
@@ -258,7 +274,7 @@
     return OK;
 }
 
-int pthread_attr_getprio_np(pthread_attr_t *attr, int *prio)
+int pthread_attr_getprio_np(const pthread_attr_t *attr, int *prio)
 {
     if (attr == NULL || prio == NULL)
         return_errno(EINVAL, EINVAL);


ossp-pkg/pth/pthread.h.in 1.57 -> 1.58

--- pthread.h.in 2001/03/24 14:51:05     1.57
+++ pthread.h.in 2001/03/24 15:46:32     1.58
@@ -306,23 +306,25 @@
 extern int       pthread_attr_init(pthread_attr_t *);
 extern int       pthread_attr_destroy(pthread_attr_t *);
 extern int       pthread_attr_setinheritsched(pthread_attr_t *, int);
-extern int       pthread_attr_getinheritsched(pthread_attr_t *, int *);
+extern int       pthread_attr_getinheritsched(const pthread_attr_t *, int *);
 extern int       pthread_attr_setschedparam(pthread_attr_t *, struct sched_param *);
-extern int       pthread_attr_getschedparam(pthread_attr_t *, struct sched_param *);
+extern int       pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *);
 extern int       pthread_attr_setschedpolicy(pthread_attr_t *, int);
-extern int       pthread_attr_getschedpolicy(pthread_attr_t *, int *);
+extern int       pthread_attr_getschedpolicy(const pthread_attr_t *, int *);
 extern int       pthread_attr_setscope(pthread_attr_t *, int);
-extern int       pthread_attr_getscope(pthread_attr_t *, int *);
+extern int       pthread_attr_getscope(const pthread_attr_t *, int *);
 extern int       pthread_attr_setstacksize(pthread_attr_t *, size_t);
-extern int       pthread_attr_getstacksize(pthread_attr_t *, size_t *);
+extern int       pthread_attr_getstacksize(const pthread_attr_t *, size_t *);
 extern int       pthread_attr_setstackaddr(pthread_attr_t *, void *);
-extern int       pthread_attr_getstackaddr(pthread_attr_t *, void **);
+extern int       pthread_attr_getstackaddr(const pthread_attr_t *, void **);
 extern int       pthread_attr_setdetachstate(pthread_attr_t *, int);
-extern int       pthread_attr_getdetachstate(pthread_attr_t *, int *);
+extern int       pthread_attr_getdetachstate(const pthread_attr_t *, int *);
+extern int       pthread_attr_setguardsize(pthread_attr_t *, int);
+extern int       pthread_attr_getguardsize(const pthread_attr_t *, int *);
 extern int       pthread_attr_setname_np(pthread_attr_t *, char *);
-extern int       pthread_attr_getname_np(pthread_attr_t *, char **);
+extern int       pthread_attr_getname_np(const pthread_attr_t *, char **);
 extern int       pthread_attr_setprio_np(pthread_attr_t *, int);
-extern int       pthread_attr_getprio_np(pthread_attr_t *, int *);
+extern int       pthread_attr_getprio_np(const pthread_attr_t *, int *);
 
 /* thread routines */
 extern int       pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *);

CVSTrac 2.0.1