gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gluster-devel] glusterfs on NetBSD


From: Emmanuel Dreyfus
Subject: [Gluster-devel] glusterfs on NetBSD
Date: Tue, 24 Aug 2010 15:48:42 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

Hello

I am porting glusterfs to NetBSD. I reached the stage where I can mount,
cd, ls, cat, mkdir, rmdir, mknod, ln ... Obviously there are many bugs
remaining, but I am confident this is going to work.

I have 15 patches for now. I posted some of them previously, but had no 
reply. I would appreciate if a committer could review them.

The most troublesome issue is basename(3) and dirname(3) usage. While
Linux modify the given string and return it, the NetBSD flavor of those 
return static buffers, which is not thread safe. Both behavior are SUSv2
compliant: the functions are not supposed to be thread safe. Since they
are used, there is a portability problem here.

In order to fix that, I can add basename_r() and dirname_r(), and 
do this:
#ifdef __NetBSD__
#define basename(x) basename_r(x)
#define dirname(x) dirname_r(x)
#endif /* __NetBSD__ */

The question is: where in the code is the prefered way for adding
basename_r() and dirname_r()? And in what header should I add the 
defines above?

-- 
Emmanuel Dreyfus
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]