Weak linkage of cancellation points.
Carlo Wood
carlo@alinoe.com
Wed Jul 14 22:45:00 GMT 2004
On Wed, Jul 14, 2004 at 08:12:51AM -0700, Ulrich Drepper wrote:
> These are no supported interfaces of the libc. If you want to use them
> do this on your own account. Define the functions yourself.
Heh - how? By adding it to libc and recompiling it?
I cannot add an alias for say 'lseek64' and then override
the original (or can I?).
For example, libc declares:
000bb1a0 W lseek64
being the only visible variable. And I want to override it.
Then I need to do something like this?:
// Forward declaration.
off64_t lseek64 (int fd, off64_t offset, int whence);
// Make alias __lseek64
extern __typeof (lseek64) __lseek64 __attribute__ ((alias ("lseek64")));
// Override lseek64
off64_t __attribute__ ((weak)) lseek64 (int fd, off64_t offset, int whence)
{
int oldtype;
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
return_t res = __lseek64 (fd, offset, whence); // Call libc *original*
pthread_setcanceltype(oldtype, NULL);
return res;
}
Will that work? Or what did you mean?
--
Carlo Wood <carlo@alinoe.com>
More information about the Libc-alpha
mailing list