This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: linuxthreads question


1003.1-1996 lists EINVAL and ENOTSUP (as "if detected" errors) for
pthread_attr_setschedpolicy.  ENOTSUP means "the implementation does not
support this feature of the standard" (in this case I read the "feature" as
being the particular policy flavor specified).  So it does not seem
appropriate for something that the (or a) process in the same system 
might be able to do under different circumstances (such as different
authorization).  

I agree it is pointless for libc to perform "security checks" on things
that the program can do by entering the kernel system call some other way.

Moreover, the standard does not require the pthread_attr_set* functions to
detect such errors at all.  (The only error that must be returned "if it
occurs" rather than "if it is detected" is ENOSYS if the system does not
support pthread_attr_* whatsoever.)  For example, it is permissible under
the standard for all pthread_attr_set* functions to be macros/inlines that
always do a direct assignment (attr)->member = value.

Conversely, pthread_create is required to fail with EINVAL if the
attributes specified are invalid.

I see no benefit in the pthread_attr_* functions doing any more than simple
structure access.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]