Re: shadowing libc



> A macro does the job as well in most cases.

ISO C and POSIX want most of their specified functions to be available as
functions. (putc, setjmp, ... are exceptions.) And furthermore as functions
of "external linkage" (ISO C 99 7.1.2.(6)). This means we have to write

       #define strftime our_strftime

in a header file and

       size_t
       our_strftime(char *s, size_t max, const char *format, const struct tm *tm)
       {
         return gl_strftime (s, max, format, tm, _gl_thread_locale ());
       }

in a .c file.

> But what I've been
> thinking about was shadowing at run-time, i.e. LD_PRELOAD.  With
> all the problems that such an approach has, at least it is an
> step towards uniformity.

LD_PRELOAD works only on glibc systems, on Solaris, and - under a different
name - on Tru64. Not on the many other platforms that GNOME runs on.

Bruno




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]