[lxc-devel] [PATCH 0/4] utmp support on bionic

Stéphane Graber stgraber at ubuntu.com
Fri Jan 11 17:29:51 UTC 2013


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

 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





More information about the lxc-devel mailing list