path: root/doc/porting_guide.txt
diff options
authorVikas Gorur <>2009-02-18 17:36:07 +0530
committerVikas Gorur <>2009-02-18 17:36:07 +0530
commit77adf4cd648dce41f89469dd185deec6b6b53a0b (patch)
tree02e155a5753b398ee572b45793f889b538efab6b /doc/porting_guide.txt
parentf3b2e6580e5663292ee113c741343c8a43ee133f (diff)
Added all files
Diffstat (limited to 'doc/porting_guide.txt')
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/porting_guide.txt b/doc/porting_guide.txt
new file mode 100644
index 0000000..905bb42
--- /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
+Platform-specific code can be written like this:
+ /* some code specific to Darwin */
+* 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
+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