From 77adf4cd648dce41f89469dd185deec6b6b53a0b Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Wed, 18 Feb 2009 17:36:07 +0530 Subject: Added all files --- doc/porting_guide.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 doc/porting_guide.txt (limited to 'doc/porting_guide.txt') diff --git a/doc/porting_guide.txt b/doc/porting_guide.txt new file mode 100644 index 000000000..905bb4228 --- /dev/null +++ b/doc/porting_guide.txt @@ -0,0 +1,45 @@ + GlusterFS Porting Guide + ----------------------- + +* General setup + +The configure script will detect the target platform for the build. +All platform-specific CFLAGS, macro definitions should be done +in configure.ac + +Platform-specific code can be written like this: + +#ifdef GF_DARWIN_HOST_OS + /* some code specific to Darwin */ +#endif + +* Coding guidelines + +In general, avoid glibc extensions. For example, nested functions don't work +on Mac OS X. It is best to stick to C99. + +When using library calls and system calls, pay attention to the +portability notes. As far as possible stick to POSIX-specified behavior. +Do not use anything expressly permitted by the specification. For example, +some fields in structures may be present only on certain platforms. Avoid +use of such things. + +Do not pass values of constants such as F_*, O_*, errno values, etc. across +platforms. + +Please refer compat-errno.h for more details about errno handling inside +glusterfs for cross platform. + +* Specific issues + +- The argp library is available only on Linux through glibc, but for other + platforms glusterfs has already included argp-standalone library which will + statically linked during the glusterfs build. + +- Extended attribute calls (setxattr, listxattr, etc.) have differing prototypes + on different platforms. See compat.h for macro definitions to resolve this, also + read out the specific extended attribute documentation for your platforms. + +------------------------------------------ +Last revised: Thu Feb 28 13:58:07 IST 2008 +------------------------------------------ -- cgit