[Libsysio-commit] b_lustre: libsysio/include sysio.h
Brought to you by:
lward
From: Mei <me...@us...> - 2003-06-29 10:15:34
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv5026/include Modified Files: Tag: b_lustre sysio.h Log Message: make lustre could hook functions on when enter/leave system calls. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -w -b -B -p -r1.7 -r1.7.4.1 --- sysio.h 26 Mar 2003 00:06:04 -0000 1.7 +++ sysio.h 29 Jun 2003 10:15:32 -0000 1.7.4.1 @@ -183,3 +183,25 @@ extern int mount(const char *source, con unsigned long mountflags, const void *data); extern int umount(const char *target); + +/* This allow lustre's function hook into libsysio */ +extern int __sysio_in_syscall; +typedef void __sysio_hook_func(void); +extern __sysio_hook_func *__sysio_hook_sys_enter; +extern __sysio_hook_func *__sysio_hook_sys_leave; + +#define SYSIO_ENTER \ + do { \ + if (__sysio_hook_sys_enter) \ + __sysio_hook_sys_enter(); \ + if (__sysio_in_syscall++) \ + abort(); \ + } while(0) + +#define SYSIO_LEAVE \ + do { \ + if (--__sysio_in_syscall != 0) \ + abort(); \ + if (__sysio_hook_sys_leave) \ + __sysio_hook_sys_leave(); \ + } while(0) |