Re: AC_FUNC_MMAP test fails on AIX for MAP_FIXED: who's at fault?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Yury V. Zaytsev" <yury@xxxxxxxxxx> wrote:

>  ...
>  bash-5.1$ gcc mmap-full.c
>  bash-5.1$ export XPG_SUS_ENV=ON
>  bash-5.1$ ./a.out
>  bash-5.1$ echo $?
>  0
>  bash-5.1$ unset XPG_SUS_ENV
>  bash-5.1$ ./a.out
>  bash-5.1$ echo $?
>  10
>
> ... all controlled by a variable at runtime
> ... nothing one can do at the build time, only runtime control.

Never say never :)

One could, at build time, include code to do something like (untested):

  if (strcmp(getenv("XPG_SUS_ENV", "ON")) != 0)
  {
    setenv("XPG_SUS_ENV", "ON", 1);
  }

(and yes, if AIX has already tested XPG_SUS_ENV before this gets
control, it might also be necessary for the program to re-exec
itself).

> ... for my use case, it's better to just get rid of mmap altogether.

Indeed.




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux