[lxc-devel] [PATCH 0/4] utmp support on bionic
Serge Hallyn
serge.hallyn at canonical.com
Fri Jan 11 18:07:42 UTC 2013
Quoting Stéphane Graber (stgraber at ubuntu.com):
> Alright, so those are the changes required to get utmp watch on bionic/android.
>
> bionic doesn't have a utmpx.h implementation and only has utmp.h.
> This caused a bit of a problem because the utmp support in LXC is called
> utmp.c/utmp.h so it was causing a conflict with the libc header name.
>
> So the first significant change is to rename the code in lxc to lxcutmp.c.
>
> I then essentially aliases all the utmpx functions to their utmp equivalent,
> with two exceptions, endutxent where the equivalent function endutent sadly
> isn't exported by bionic...
>
> And utmpname that for some odd reason isn't returning the standard return
> values. In eglibc, you get 0 on success and -1 on error. In bionic you get 1 on
> success and -1 on error, so I basically substract 1 to the return value when
> running on bionic.
>
> Stéphane Graber (4):
> Fix header name in lxcmntent.h
> Add check for sys/timerfd.h
> Rename utmp.c/utmp.h to lxcutmp.c/lxcutmp.h
> Build lxcutmp.c without timerfd.h or utmpx.h
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
for the set. Lately there's been quite a bit if ugly #ifdefery added
which I may start objecting to, but this set restricts that to the
utmp files so that's ok.
>
> configure.ac | 2 +-
> src/include/lxcmntent.h | 4 +-
> src/lxc/Makefile.am | 2 +-
> src/lxc/lxcutmp.c | 481 ++++++++++++++++++++++++++++++++++++++++++++++++
> src/lxc/lxcutmp.h | 30 +++
> src/lxc/start.c | 2 +-
> src/lxc/utmp.c | 421 ------------------------------------------
> src/lxc/utmp.h | 37 ----
> 8 files changed, 516 insertions(+), 463 deletions(-)
> create mode 100644 src/lxc/lxcutmp.c
> create mode 100644 src/lxc/lxcutmp.h
> delete mode 100644 src/lxc/utmp.c
> delete mode 100644 src/lxc/utmp.h
>
> --
> 1.8.0
>
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
> much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list