Shared libraries error
shrikar archak
shrikar.archak at yahoo.co.in
Sun Jan 21 14:27:43 UTC 2007
Hi all,
I am trying to have a version of open system call which is something like this
here When i want to induce error it should not call the open instead should return error
in our case controlled by OPEN_INDEX other wise the usual open system call should be called.
int open(const char * path, int flags, mode_t mode) {
action a;
int old_errno;
int rv;
if (fig_error(OPEN_INDEX, &a)) {
log(INJECTED, "open(%s %d %d) Induced error - going to return %d, errno = %d\n", path, flags, mode, a.ret, a.err);
errno = a.err;
return (int) a.ret;
} else {
rv = (int) __libc_open(path, flags, mode);
old_errno = errno;
log(ALL, "open(%s %d %d) library returning %d, errno = %d\n", path, flags, mode, rv, errno); errno = old_errno;
return rv;
}
}
once i preload this library i get this error
This snippet taken from fault injection in GLibc.
shrikar at shrikar-desktop:~/fig/src$ ls
ls: symbol lookup error: /home/shrikar/fig/src/libfig.so: undefined symbol: __libc_open
i have compiled the shared library with -shared -ldl option
Thanks
Shrikar
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070121/30a356c8/attachment.html>
More information about the ubuntu-users
mailing list