mirror of
https://github.com/zsh-users/zsh
synced 2024-11-02 20:47:49 +00:00
Toby Peterson: 21083: RLIMIT_AS and RLIMIT_RSS are the same in Mac OX X
ut_name needs to be ut_user in struct utmpx
This commit is contained in:
parent
82c9c7a423
commit
8776b52d7d
4 changed files with 41 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
2005-04-04 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* Toby Peterson: 21083: On Mac OS X 10.4, the AS and RSS rlimits
|
||||
are the same. Also utmpx doesn't have ut_name. In fact, it
|
||||
doesn't seem to have it on any system.
|
||||
|
||||
* Dan Nelson: 21082: Src/exec.c, Test/A01grammar.ztst: fix zsh -c
|
||||
exit status on parse error.
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ printulimit(char *nam, int lim, int hard, int head)
|
|||
# endif /* HAVE_RLIMIT_MEMLOCK */
|
||||
/* If RLIMIT_VMEM and RLIMIT_RSS are defined and equal, avoid *
|
||||
* duplicate case statement. Observed on QNX Neutrino 6.1.0. */
|
||||
# if defined(HAVE_RLIMIT_RSS) && !defined(RLIMIT_VMEM_IS_RSS)
|
||||
# if defined(HAVE_RLIMIT_RSS) && !defined(RLIMIT_VMEM_IS_RSS) && !defined(RLIMIT_RSS_IS_AS)
|
||||
case RLIMIT_RSS:
|
||||
if (head)
|
||||
printf("-m: resident set size (kbytes) ");
|
||||
|
@ -834,7 +834,7 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
|
|||
case RLIMIT_VMEM:
|
||||
# endif /* HAVE_RLIMIT_VMEM */
|
||||
/* ditto RLIMIT_VMEM and RLIMIT_AS */
|
||||
# if defined(HAVE_RLIMIT_AS) && !defined(RLIMIT_VMEM_IS_AS)
|
||||
# if defined(HAVE_RLIMIT_AS) && !defined(RLIMIT_VMEM_IS_AS) && !defined(RLIMIT_RSS_IS_AS)
|
||||
case RLIMIT_AS:
|
||||
# endif /* HAVE_RLIMIT_AS */
|
||||
# ifdef HAVE_RLIMIT_AIO_MEM
|
||||
|
|
|
@ -87,6 +87,14 @@
|
|||
|
||||
#if !defined(WATCH_STRUCT_UTMP) && defined(HAVE_STRUCT_UTMPX) && defined(REAL_UTMPX_FILE)
|
||||
# define WATCH_STRUCT_UTMP struct utmpx
|
||||
/*
|
||||
* In utmpx, the ut_name field is replaced by ut_user.
|
||||
* Howver, on some systems ut_name may already be defined this
|
||||
* way for the purposes of utmp.
|
||||
*/
|
||||
# ifndef ut_name
|
||||
# define ut_name ut_user
|
||||
# endif
|
||||
# ifdef HAVE_STRUCT_UTMPX_UT_XTIME
|
||||
# undef ut_time
|
||||
# define ut_time ut_xtime
|
||||
|
|
27
configure.ac
27
configure.ac
|
@ -1502,6 +1502,33 @@ if test $zsh_cv_rlimit_vmem_is_as = yes; then
|
|||
fi
|
||||
|
||||
|
||||
AH_TEMPLATE([RLIMIT_RSS_IS_AS],
|
||||
[Define to 1 if RLIMIT_RSS and RLIMIT_AS both exist and are equal.])
|
||||
AC_CACHE_CHECK(if RLIMIT_RSS and RLIMIT_AS are the same,
|
||||
zsh_cv_rlimit_rss_is_as,
|
||||
[AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/resource.h>
|
||||
int main()
|
||||
{
|
||||
int ret = 1;
|
||||
#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS)
|
||||
if (RLIMIT_AS == RLIMIT_RSS) ret = 0;
|
||||
#endif
|
||||
return ret;
|
||||
}],
|
||||
zsh_cv_rlimit_rss_is_as=yes,
|
||||
zsh_cv_rlimit_rss_is_as=no,
|
||||
zsh_cv_rlimit_rss_is_as=no)])
|
||||
|
||||
if test $zsh_cv_rlimit_rss_is_as = yes; then
|
||||
AC_DEFINE(RLIMIT_RSS_IS_AS)
|
||||
fi
|
||||
|
||||
|
||||
dnl --------------------------------------------
|
||||
dnl Check for members of struct rusage
|
||||
dnl --------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue