Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
190f9aee
Unverified
Commit
190f9aee
authored
Nov 02, 2017
by
Christian Brauner
Committed by
GitHub
Nov 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1896 from ffontaine/master
Fix compilation on toolchain without prlimit
parents
2ba9ef6c
f48b5fd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
configure.ac
configure.ac
+4
-0
Makefile.am
src/lxc/Makefile.am
+6
-0
conf.c
src/lxc/conf.c
+9
-3
No files found.
configure.ac
View file @
190f9aee
...
@@ -671,6 +671,10 @@ AC_CHECK_FUNCS([prlimit],
...
@@ -671,6 +671,10 @@ AC_CHECK_FUNCS([prlimit],
AM_CONDITIONAL(HAVE_PRLIMIT, true)
AM_CONDITIONAL(HAVE_PRLIMIT, true)
AC_DEFINE(HAVE_PRLIMIT,1,[Have prlimit]),
AC_DEFINE(HAVE_PRLIMIT,1,[Have prlimit]),
AM_CONDITIONAL(HAVE_PRLIMIT, false))
AM_CONDITIONAL(HAVE_PRLIMIT, false))
AC_CHECK_FUNCS([prlimit64],
AM_CONDITIONAL(HAVE_PRLIMIT64, true)
AC_DEFINE(HAVE_PRLIMIT64,1,[Have prlimit64]),
AM_CONDITIONAL(HAVE_PRLIMIT64, false))
# Check for some libraries
# Check for some libraries
AC_SEARCH_LIBS(sem_open, [rt pthread])
AC_SEARCH_LIBS(sem_open, [rt pthread])
...
...
src/lxc/Makefile.am
View file @
190f9aee
...
@@ -45,7 +45,10 @@ noinst_HEADERS += \
...
@@ -45,7 +45,10 @@ noinst_HEADERS += \
../include/ifaddrs.h
\
../include/ifaddrs.h
\
../include/openpty.h
\
../include/openpty.h
\
../include/lxcmntent.h
../include/lxcmntent.h
endif
if
!HAVE_PRLIMIT
if
!HAVE_PRLIMIT
if
HAVE_PRLIMIT64
noinst_HEADERS
+=
../include/prlimit.h
noinst_HEADERS
+=
../include/prlimit.h
endif
endif
endif
endif
...
@@ -143,7 +146,10 @@ liblxc_la_SOURCES += \
...
@@ -143,7 +146,10 @@ liblxc_la_SOURCES += \
../include/ifaddrs.c ../include/ifaddrs.h
\
../include/ifaddrs.c ../include/ifaddrs.h
\
../include/openpty.c ../include/openpty.h
\
../include/openpty.c ../include/openpty.h
\
../include/lxcmntent.c ../include/lxcmntent.h
../include/lxcmntent.c ../include/lxcmntent.h
endif
if
!HAVE_PRLIMIT
if
!HAVE_PRLIMIT
if
HAVE_PRLIMIT64
liblxc_la_SOURCES
+=
../include/prlimit.c ../include/prlimit.h
liblxc_la_SOURCES
+=
../include/prlimit.c ../include/prlimit.h
endif
endif
endif
endif
...
...
src/lxc/conf.c
View file @
190f9aee
...
@@ -97,13 +97,14 @@
...
@@ -97,13 +97,14 @@
#if IS_BIONIC
#if IS_BIONIC
#include <../include/lxcmntent.h>
#include <../include/lxcmntent.h>
#ifndef HAVE_PRLIMIT
#include <../include/prlimit.h>
#endif
#else
#else
#include <mntent.h>
#include <mntent.h>
#endif
#endif
#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64)
#include <../include/prlimit.h>
#endif
lxc_log_define
(
lxc_conf
,
lxc
);
lxc_log_define
(
lxc_conf
,
lxc
);
#if HAVE_LIBCAP
#if HAVE_LIBCAP
...
@@ -2399,10 +2400,15 @@ int setup_resource_limits(struct lxc_list *limits, pid_t pid) {
...
@@ -2399,10 +2400,15 @@ int setup_resource_limits(struct lxc_list *limits, pid_t pid) {
return
-
1
;
return
-
1
;
}
}
#if HAVE_PRLIMIT || HAVE_PRLIMIT64
if
(
prlimit
(
pid
,
resid
,
&
lim
->
limit
,
NULL
)
!=
0
)
{
if
(
prlimit
(
pid
,
resid
,
&
lim
->
limit
,
NULL
)
!=
0
)
{
ERROR
(
"failed to set limit %s: %s"
,
lim
->
resource
,
strerror
(
errno
));
ERROR
(
"failed to set limit %s: %s"
,
lim
->
resource
,
strerror
(
errno
));
return
-
1
;
return
-
1
;
}
}
#else
ERROR
(
"Cannot set limit %s as prlimit is missing"
,
lim
->
resource
);
return
-
1
;
#endif
}
}
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment