[Libsysio-commit] HEAD: libsysio/include sysio.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv23555/include Modified Files: sysio.h Log Message: A roll-up patch from CFS (Eric Mei <er...@cl...>) - intent.diff small changes on intent related behavior. I simply follow the lustre kernel code here. - open() need to pass down param 'flags'. - 'setattr' related syscalls, like chown/chmod/utime/..., don't need intent during path resolution. - sockets.diff your socket driver. - nativefs.diff only add fcntl code into native driver. not sure whether it's complete, but ok for current testing. - trace.diff this patch add SYSIO_ENTER/SYSIO_LEAVE macros. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- sysio.h 29 Oct 2003 00:25:53 -0000 1.14 +++ sysio.h 21 Jan 2004 14:44:53 -0000 1.15 @@ -258,3 +258,42 @@ extern int mount(const char *source, con unsigned long mountflags, const void *data); extern int umount(const char *target); + +/* for debugging */ +#if 1 +#define ASSERT(cond) \ + if (!(cond)) { \ + printf("ASSERTION(" #cond ") failed: " __FILE__ ":" \ + __FUNCTION__ ":%d\n", __LINE__); \ + abort(); \ + } + +#define ERROR(fmt, a...) \ + do { \ + printf("ERROR(" __FILE__ ":%d):" fmt, __LINE__, ##a); \ + while(0) + +#else +#define ERROR(fmt) do{}while(0) +#define ASSERT do{}while(0) +#endif + +/* syscall enter/leave hook functions */ +#if 1 +#define SYSIO_ENTER +#define SYSIO_LEAVE + +#else +extern void _sysio_sysenter(); +extern void _sysio_sysleave(); + +#define SYSIO_ENTER \ + do { \ + _sysio_sysenter(); \ + } while(0) + +#define SYSIO_LEAVE \ + do { \ + _sysio_sysleave(); \ + } while(0) +#endif |