About the kse signal process
Daniel Eischen
eischen at vigrid.com
Mon Jun 30 20:02:47 PDT 2003
On Mon, 30 Jun 2003, xiong jinshan wrote:
>
> --- Daniel Eischen <eischen at vigrid.com> wrote:
> > On Mon, 30 Jun 2003, xiong jinshan wrote:
> > > It received the SIGSEGV before the main() when I
> > > linked with libc_r;(.
> >
> > I think you have something screwed up somewhere.
> > How did you compile and link it?
>
> Yes, it maybe my fault.
>
> If I link libc_r with static, it works correctly.
> If I link it with dynamic, segv occurs.
> If I not linked c_r, th_func() couldn't received the
> alarm.
>
> Why must it be linked with static mode? Does it mean
> the native c library in release 5.1 not reentrant?
It doesn't have to be statically linked. Are you
explicitly using -lc? (don't!) In 5.x, you link
threaded programs (if linking against libc_r) with:
gcc -o app app.c -lc_r
Or, using the deprecated -pthread option:
gcc -o app -pthread app.c
As I said, it works here for me on -current. It doesn't
look like anything has changed in libc_r since 5.1.
--
Dan Eischen
More information about the freebsd-threads
mailing list