From: Mathieu Desnoyers Date: Thu, 23 Feb 2012 15:33:56 +0000 (-0500) Subject: runas: freebsd do not redefine MAP_STACK X-Git-Tag: v2.0.0-rc3~32 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0756d5575beab9eabb6d6e3faa321fe7246ad1a7;p=lttng-tools.git runas: freebsd do not redefine MAP_STACK Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/runas.c b/src/common/runas.c index 88ed77315..7dee28abe 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -38,12 +38,11 @@ #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 @@ -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, - 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");