This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

Re: How to read environment variable in Glibc code


 Thanks a lot for your valuable input. I want to control printf from
environment variable.
 If I set Environment variable 1 it enable print to screen if i put
Environment variable to 0 it disable to screen.

Actual I have already prebuild software, I want to control its o/p
using glibc and Environment variable.


 Thanks.

> 2012/1/9 Ángel González <keisial@gmail.com>
>>
>> On 09/01/12 14:50, Carlos O'Donell wrote:
>>>
>>> The libc-help mailing list is the *correct* mailing list for this
>>> discussion, I'm removing the other mailing lists.
>>>
>>> The easiest way to achieve what you want is to provide your own
>>> version of printf in your program.
>>>
>>> This custom version of printf can be implemented in any way you want
>>> but works only for your program.
>>>
>>> If you want to stop output to stdio for precompiled programs then you
>>> need to rebuild libc with the appropriate change to printf.c.
>>>
>>> What problem are you having?
>>
>> He may be having issues to call the real printf after he alias it with his version.
>>
>> The non-standard RTLD_NEXT is very handy for that (man 3 dlsym).
>>
>


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