on linux-kernel there was once a posting for an app, that could trap any system call and make the kernel return different results. think like strace, but allows to reprogram system calls.
i'm sorry, i don't know where the program was, but maybe you like to search and look at this approach. andreas