libreplace on Linux was (Re: Changing back to per-thread credentials on Linux (fixing native AIO).)

Jeremy Allison jra at samba.org
Thu Jun 28 08:55:58 MDT 2012


On Thu, Jun 28, 2012 at 09:39:03AM +0200, Jelmer Vernooij wrote:

> Yes, let's not put utility code into libreplace. Originally we had a
> bunch of portability wrappers scattered all over lib/; the goal of
> libreplace was to split out the portability code from the
> Samba-specific utility code and make sure that the rest of the code
> didn't have to worry about portability as much rather than remember to
> call e.g. sys_select().
> 
> From libreplace's README:
> 
> This subsystem ensures that we can always use a certain core set of
> functions and types, that are either provided by the OS or by replacement
> functions / definitions in this subsystem. The aim is to try to stick
> to POSIX functions in here as much as possible. Convenience functions
> that are available on no platform at all belong in other subsystems
> (such as LIBUTIL).
> 
> Things in libreplace are standard POSIX, standard Linux or standard
> BSD (strlcat and strlcpy only) APIs. On modern platforms it should be
> empty.

Well be careful what you wish for :-). Moving it out of
libreplace and renaming the calls will make it a much more
invasive patch, as it will have to touch many more subsystems
(uidwrapper etc.) than it does otherwise.

I originally designed it that way and moved to the libreplace
idea to make the patch smaller.

Anyway, I can move it back to the original design, but this
is a blocker for me for many things I need to get done (and
it needs to go into 3.6.next as well of course to fix the
lost wakeup bug) so I'll make the changes and get it in
once they're done.

Thanks for the reviews.

Jeremy.


More information about the samba-technical mailing list