zsh-workers
 help / color / mirror / code / Atom feed
From: Borzenkov Andrey <Andrey.Borzenkov@siemens.com>
To: "'Clint Adams'" <clint@zsh.org>,
	"'Bart Schaefer'" <schaefer@brasslantern.com>
Cc: zsh-workers@sunsite.dk
Subject: RE: PATCH: maxfilelocks in ulimit output
Date: Mon, 10 Feb 2003 12:08:36 +0300	[thread overview]
Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B63B@mowd019a.mow.siemens.ru> (raw)
In-Reply-To: <20030209224506.GA25964@scowler.net>


> 
> > 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


  reply	other threads:[~2003-02-10  9:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09  1:06 Clint Adams
2003-02-09  1:41 ` Clint Adams
2003-02-09  2:25   ` Bart Schaefer
2003-02-09 17:29     ` Clint Adams
2003-02-09 22:45       ` Clint Adams
2003-02-10  9:08         ` Borzenkov Andrey [this message]
2003-02-10  9:31           ` Zefram
2003-02-10 10:47             ` Peter Stephenson
2003-02-12  4:03             ` Clint Adams
2003-02-12 11:09               ` Peter Stephenson
2003-02-16  4:52                 ` Clint Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6134254DE87BD411908B00A0C99B044F03A0B63B@mowd019a.mow.siemens.ru \
    --to=andrey.borzenkov@siemens.com \
    --cc=clint@zsh.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).