Re: problem handling POSIX thread on FreeBSD
From: Dan Nelson (dnelson_at_allantgroup.com)
Date: 06/27/05
- Previous message: Dominique SA: "Re: KMEM Problem With OIDENTD"
- In reply to: Pablo Mora: "problem handling POSIX thread on FreeBSD"
- Next in thread: Pablo Mora: "Re: problem handling POSIX thread on FreeBSD"
- Reply: Pablo Mora: "Re: problem handling POSIX thread on FreeBSD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 26 Jun 2005 23:19:58 -0500 To: Pablo Mora <fbsd.hackers@gmail.com>
In the last episode (Jun 26), Pablo Mora said:
> int main() {
> ....
> if(pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0)
> /* handler */
> ....
> }
>
> $ gcc taller.c -pthread
> $ ./a.out
> pthread_attr_setscope: Unknown error: 0
> $
>
> PTHREAD_SCOPE_SYSTEM fail on freebsd ?
The libc_r and libthr threads libraries do not support
PTHREAD_SCOPE_SYSTEM. The standard does not require support for both
PTHREAD_SCOPE_PROCESS and PTHREAD_SCOPE_SYSTEM, so it's better if you
don't treat failure of pthread_attr_setscope() as fatal to the program.
If you're running FreeBSD 4.0, your only choice of threads library is
libc_r.
Also note that the pthread_attr_*() functions are special in that they
do not set the errno variable. They return their error code, so you
need to do something like:
rv = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
if (rv && rv != ENOTSUP)
handle_error();
-- Dan Nelson dnelson@allantgroup.com _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Dominique SA: "Re: KMEM Problem With OIDENTD"
- In reply to: Pablo Mora: "problem handling POSIX thread on FreeBSD"
- Next in thread: Pablo Mora: "Re: problem handling POSIX thread on FreeBSD"
- Reply: Pablo Mora: "Re: problem handling POSIX thread on FreeBSD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|