projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
runas: freebsd do not redefine MAP_STACK
[lttng-tools.git]
/
src
/
common
/
runas.c
diff --git
a/src/common/runas.c
b/src/common/runas.c
index 88ed773152cc7c959b81084fb58a93ee9c3409ae..7dee28abedc6ce1f2d518e32a7d64d5c1a6cd3f4 100644
(file)
--- a/
src/common/runas.c
+++ b/
src/common/runas.c
@@
-38,12
+38,11
@@
#define RUNAS_CHILD_STACK_SIZE 10485760
#define RUNAS_CHILD_STACK_SIZE 10485760
-#ifndef __FreeBSD__
-# ifndef MAP_STACK
-# define MAP_STACK 0
-# endif
-#else /* FreeBSD MAP_STACK always return -ENOMEM */
-# define MAP_STACK 0
+#ifdef __FreeBSD__
+/* FreeBSD MAP_STACK always return -ENOMEM */
+#define LTTNG_MAP_STACK 0
+#else
+#define LTTNG_MAP_STACK MAP_STACK
#endif
#ifndef MAP_GROWSDOWN
#endif
#ifndef MAP_GROWSDOWN
@@
-239,7
+238,7
@@
int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid)
run_as_data.retval_pipe = retval_pipe[1]; /* write end */
child_stack = mmap(NULL, RUNAS_CHILD_STACK_SIZE,
PROT_WRITE | PROT_READ,
run_as_data.retval_pipe = retval_pipe[1]; /* write end */
child_stack = mmap(NULL, RUNAS_CHILD_STACK_SIZE,
PROT_WRITE | PROT_READ,
- MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS | MAP_STACK,
+ MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS |
LTTNG_
MAP_STACK,
-1, 0);
if (child_stack == MAP_FAILED) {
perror("mmap");
-1, 0);
if (child_stack == MAP_FAILED) {
perror("mmap");
This page took
0.024508 seconds
and
5
git commands to generate.