Re: Linux printf funny



Vladimir Vassilevsky <antispam_bogus@xxxxxxxxxxx> wrote:
If it is a multithreaded application, this can be the issue with
printf() reentrancy. Many of the stdio.h functions are not reentrant by
default, unless you are linking the appropriate libraries.

...yes you need to pass "-pthread" to GCC which has the effect of defining
_REENTRANT and linking against libpthread.

This is documented as required on some platforms but strangely not for x86 I
don't know if this is a long standing oversight or if it really isn't
needed.

-p
--
"Unix is user friendly, it's just picky about who its friends are."
- Anonymous
--------------------------------------------------------------------
.



Relevant Pages

  • Linux, X, ld, gcc, linking, shared libraries and stuff
    ... if I use GCC rather than LD: ... I then attempted to determine what shared libraries were linked ... So, as I say, I'm pretty sure that this is the problem: LD is linking ... Xlib library...this is a C-based library, so it's designed to be used from ...
    (alt.lang.asm)
  • Re: How to link libxml when compiling?
    ... gcc: -lxml2: linker input file unused because linking not done ... The libraries were not used because linking ...
    (comp.lang.c)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... Or with libraries that you can control to ... Are those libraries reentrant? ... I think you want PyC ... messaging isn't very attractive. ...
    (comp.lang.python)
  • Re: writing a FreeBSD C library
    ... whereas placing mylib.a before the -o switch and then linking with ld ... with gcc in one step. ... The solution was to simply compile and link it like so: ... I'm afraid that this is not the most common usage of libraries in the unix ...
    (freebsd-hackers)
  • Re: Reentrant Programs and Protected Storage
    ... Are there any unauthorized libraries in the concatenation? ... I seem to remember an old rule - if you have a reentrant pgm that is loaded from an authorized library and it is not reentrant, ... The execution scenarios are identical except for ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)