On Tue, Aug 24, 2010 at 11:35:46PM +0530, Vijay Bellur wrote: > basename_r() and dirname_r() can be added to compat.c in libglusterfs/src. > The above defines can be added to compat.h in the same directory. > Most conditionally compilable code in glusterfs is present in the > compat.[ch] files. I borrowed glibc basename and dirname and added them in compat.c, renamed with _r and guarded by an ifdef __NetBSD__. GF_BSD_HOST_OS should not be used, as FreeBSD's implemntation is thread-safe. It works fine. I also fixed a few additionnal bugs in the code where a pointer returned by dirname is free'ed. Even on Linux this may break, as calling dirname("") will return "." (as mandated by SUSv2) from static storage. I am not sure such a situation arise with glusterfs, though. Who wants my patches? -- Emmanuel Dreyfus manu@xxxxxxxxxx