Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Fix for QNX Neutrino 6.1.0



Hello!

This patch makes it possible to compile zsh-4.0.2 under QNX Neutrino 
6.1.0.

ChangeLog:
	* Src/Builtins/rlimits.c: Undefine RLIMIT_RSS if it's equal to
	RLIMIT_VMEM to avoid duplicate case value.
	* aczsh.m4 (zsh_LARGE_FILE_SUPPORT): Ignore output of getconf
	if it returns "undefined".

Some comments.

Both RLIMIT_RSS and RLIMIT_VMEM are defined to RLIMIT_AS.  It is possible
to support them both (bash does it), but this would mean that the "switch"  
operator cannot be used.  Also users would be confused that two different
limits are always equal.  Since RLIMIT_AS is closer to RLIMIT_VMEM (IMHO),
it's logical to disable RLIMIT_RSS.

"getconf LFS_CFLAGS" prints "undefined" on stdout and returns 0.  This
doesn't look very good, but it's easier to work it around than to explain
it to QNX developers and have everyone to upgrade (especially since
ugrading an embedded system is not always easy).

If you switch to Autoconf-2.52 (I see no reasons not to switch), you may 
want to use AC_SYS_LARGEFILE instead of zsh_LARGE_FILE_SUPPORT.  The 
former doesn't use getconf.

---------------------------------
--- Src/Builtins/rlimits.c	Thu Dec 16 09:26:36 1999
+++ Src/Builtins/rlimits.c	Fri Oct 12 22:20:33 2001
@@ -44,6 +44,12 @@
 
 # include "rlimits.h"
 
+/* If RLIMIT_VMEM and RLIMIT_RSS are defined and equal, drop support *
+ * for RLIMIT_RSS.  Observed on QNX Neutrino 6.1.0.                 */
+#if defined(RLIMIT_RSS) && defined(RLIMIT_VMEM) && (RLIMIT_RSS == RLIMIT_VMEM)
+#undef RLIMIT_RSS
+#endif
+
 # if defined(RLIM_T_IS_QUAD_T) || defined(RLIM_T_IS_LONG_LONG) || defined(RLIM_T_IS_UNSIGNED)
 static rlim_t
 zstrtorlimt(const char *s, char **t, int base)
--- aczsh.m4	Tue Jun 26 06:08:54 2001
+++ aczsh.m4	Fri Oct 12 21:55:55 2001
@@ -43,7 +43,7 @@
   esac
   (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
   ac_getconf=`getconf $ac_lfsvar`
-  if test -n "$ac_getconf"; then
+  if test -n "$ac_getconf" && test "$ac_getconf" != "undefined"; then
     eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
     ac_getconfs=$ac_getconfs$ac_getconf
     eval ac_test_$ac_shellvar="\$ac_getconf"
---------------------------------

-- 
Regards,
Pavel Roskin



Messages sorted by: Reverse Date, Date, Thread, Author