include: add getgrgid_r()

parent 87ca8ec4
...@@ -660,6 +660,10 @@ AC_CHECK_FUNCS(pthread_atfork) ...@@ -660,6 +660,10 @@ AC_CHECK_FUNCS(pthread_atfork)
AC_CHECK_FUNCS(statvfs) AC_CHECK_FUNCS(statvfs)
AC_CHECK_LIB(util, openpty) AC_CHECK_LIB(util, openpty)
AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname]) AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
AC_CHECK_FUNCS([getgrgid_r],
AM_CONDITIONAL(HAVE_GETGRGID_R, true)
AC_DEFINE(HAVE_GETGRGID_R,1,[Have getgrgid_r]),
AM_CONDITIONAL(HAVE_GETGRGID_R, false))
AC_CHECK_FUNCS([getline], AC_CHECK_FUNCS([getline],
AM_CONDITIONAL(HAVE_GETLINE, true) AM_CONDITIONAL(HAVE_GETLINE, true)
AC_DEFINE(HAVE_GETLINE,1,[Have getline]), AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
...@@ -672,6 +676,10 @@ AC_CHECK_FUNCS([fgetln], ...@@ -672,6 +676,10 @@ AC_CHECK_FUNCS([fgetln],
AM_CONDITIONAL(HAVE_FGETLN, true) AM_CONDITIONAL(HAVE_FGETLN, true)
AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]), AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
AM_CONDITIONAL(HAVE_FGETLN, false)) AM_CONDITIONAL(HAVE_FGETLN, false))
AC_CHECK_FUNCS([pthread_setcancelstate],
AM_CONDITIONAL(HAVE_PTHREAD_SETCANCELSTATE, true)
AC_DEFINE(HAVE_PTHREAD_SETCANCELSTATE,1,[Have pthread_setcancelstate]),
AM_CONDITIONAL(HAVE_PTHREAD_SETCANCELSTATE, false))
AC_CHECK_FUNCS([strlcpy], AC_CHECK_FUNCS([strlcpy],
AM_CONDITIONAL(HAVE_STRLCPY, true) AM_CONDITIONAL(HAVE_STRLCPY, true)
AC_DEFINE(HAVE_STRLCPY,1,[Have strlcpy]), AC_DEFINE(HAVE_STRLCPY,1,[Have strlcpy]),
......
/* liblxcapi
*
* Copyright © 2018 Christian Brauner <christian.brauner@ubuntu.com>.
* Copyright © 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* This function has been copied from musl.
*/
#ifndef _GETGRGID_R_H
#define _GETGRGID_R_H
#include <stdio.h>
#include <sys/types.h>
#include <grp.h>
extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size,
struct group **res);
#endif /* _GETGRGID_R_H */
...@@ -56,6 +56,10 @@ if !HAVE_GETSUBOPT ...@@ -56,6 +56,10 @@ if !HAVE_GETSUBOPT
noinst_HEADERS += ../include/getsubopt.h noinst_HEADERS += ../include/getsubopt.h
endif endif
if !HAVE_GETGRGID_R
noinst_HEADERS += ../include/getgrgid_r.h
endif
sodir=$(libdir) sodir=$(libdir)
LSM_SOURCES = \ LSM_SOURCES = \
...@@ -148,6 +152,10 @@ if !HAVE_STRLCPY ...@@ -148,6 +152,10 @@ if !HAVE_STRLCPY
liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif endif
if !HAVE_GETGRGID_R
liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h
endif
AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
-DLXCPATH=\"$(LXCPATH)\" \ -DLXCPATH=\"$(LXCPATH)\" \
-DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
...@@ -304,6 +312,10 @@ if !HAVE_STRLCPY ...@@ -304,6 +312,10 @@ if !HAVE_STRLCPY
init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif endif
if !HAVE_GETGRGID_R
liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h
endif
init_lxc_static_LDFLAGS = -all-static init_lxc_static_LDFLAGS = -all-static
init_lxc_static_LDADD = @CAP_LIBS@ init_lxc_static_LDADD = @CAP_LIBS@
init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment