public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: bill o gallmeister <bog.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jan Engelhardt <jengelh-nopoi9nDyk+ELgA04lAiVw@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: pthread_self.3: arith type or structure
Date: Fri, 06 Nov 2009 13:50:06 -0800	[thread overview]
Message-ID: <4AF49A0E.6080004@gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0911060158001.12689-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>

Jan Engelhardt wrote:

> in man-pages 3.23, one can read in pthread_self.3:
> 
> 
> "POSIX.1 allows an implementation wide freedom in choosing the type
> used to represent a thread ID; for example, representation using
> either an arithmetic type or a structure is permitted."
> 
> http://opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
> however mentions "all of the types are defined as arithmetic types".
> Would you know which of the two documentations (linux-man-pages,
> opengroup's website) is correct?

It depends on which spec the implementation conforms to.  An Opengroup conformant
system would need to provide an arithmetic type, whereas an IEEE 1003.1c-1995
conformant system could get away with a more relaxed specification of pthread_t.

I can speak to the POSIX spec for pthread_t.  The idea was to allow it to be
implemented as any sort of type;  hence the provision of pthread_equal() to
compare two pthread_t variables.

The opengroup spec would seem to have specified this further (the pthreads spec
is from 1995 and the Opengroup spec says 1997).  I am not sure why that would be.
If you're an application programmer,  I would advise you to assume that pthread_t
is not an arithmetic type.  On the other hand, I have yet to see an implementation
where it is not some sort of integer or pointer.

- bog

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-11-06 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06  0:59 pthread_self.3: arith type or structure Jan Engelhardt
     [not found] ` <alpine.LSU.2.00.0911060158001.12689-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2009-11-06 21:50   ` bill o gallmeister [this message]
     [not found]     ` <4AF49A0E.6080004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-11-06 22:05       ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF49A0E.6080004@gmail.com \
    --to=bog.kernel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=jengelh-nopoi9nDyk+ELgA04lAiVw@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox