Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: PATCH: maxfilelocks in ulimit output
- X-seq: zsh-workers 18215
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: "'Clint Adams'" <clint@xxxxxxx>, "'Bart Schaefer'" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: RE: PATCH: maxfilelocks in ulimit output
- Date: Mon, 10 Feb 2003 12:08:36 +0300
- Cc: zsh-workers@xxxxxxxxxx
- Importance: Normal
- In-reply-to: <20030209224506.GA25964@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
>
> > Seems that it's treating RLIMIT_AS and RLIMIT_RSS as
> > "identifiers", because they compare equally in the #if.
>
> I'm told that it's impossible to do a preprocessor compare because of
> the enum. So to get this to work we'd need to remove something to
> configure or elsewhere.
Untested idea (not having the relevant system and time :(
AC_DEFUN(zsh_TEST_LIMIT_VALUE,[
echo > get-limit-value.c << EOF
main()
{
#ifdef $1
printf("%d", $1);
#else
printf("%d", -1);
#endif
return 0;
}
EOF
cc -o get-limit-value get-limit-value.c
val=`get-limit-value`
if test "$val" -ge 0; then
AC_DEFINE(ZSH_$1, $val)
fi
]
later on
zsh_TEST_LIMIT_VALUE(RLIMIT_AS)
zsh_TEST_LIMIT_VALUE(RLIMIT_RSS)
...
and in code use ZSH_... instead of original values.
Ugly as sin but it will work.
-andrey
Messages sorted by:
Reverse Date,
Date,
Thread,
Author