Hi, I know this feature is available in linux libc also. So, I have sent a mail to gcc.
I got some good replies.. link is http://gcc.gnu.org/ml/gcc-help/2006-09/msg00068.html
At http://www.logix.cz/michal/devel/faketime/index.xp?show_selected=1&msgid=42 6#feedback_form there are some hints about making the similar thing in solaris. But I did not try them.