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

PATCH: (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined



Incidentally, 3.0.7 is on the zsh.org FTP site.  I've sent an announcement
to comp.unix.shell and to zsh-announce; but I don't think I'm on the list
of people allowed to post unmoderated to zsh-announce, so it may take a
while for someone at sunsite-dk to notice and send it on through.

On Oct 19, 12:15am, Albert Chin-A-Young wrote:
} Subject: (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined
}
} Below needed for IRIX 6.5.
[...]
} Also, cached_uid is defined in Src/utils.c AND in Src/globals.h.

Sigh.  That's been there since 3.0.6.  Why didn't anyone else complain
during the past ten weeks?

Please use the following patch instead of Albert's.  It handles the limit
properly in builtin.c (and also, incidentally, fixes a missing bit of
handling of the "sockbufsize" limit), and leaves the comment in utils.c
(which applies to the get_username() function, not to the variables).

One hunk of this is also needed in 3.1.6; another patch to follow.

Index: Src/builtin.c
===================================================================
@@ -3765,6 +3765,12 @@
 	    permitted. */
 	    val = ZSTRTORLIMT(s, &s, 10);
 # endif /* RLIMIT_AIO_OPS */
+# ifdef RLIMIT_PTHREAD
+	else if (lim == RLIMIT_PTHREAD)
+	    /* pure numeric resource -- only a straight decimal number is
+	    permitted. */
+	    val = ZSTRTORLIMT(s, &s, 10);
+# endif /* RLIMIT_PTHREAD */
 	else {
 	    /* memory-type resource -- `k' and `M' modifiers are permitted,
 	    meaning (respectively) 2^10 and 2^20. */
@@ -4095,6 +4101,11 @@
 		/* pure numeric resource */
 		printf("%d\n", (int)val);
 # endif /* RLIMIT_AIO_OPS */
+# ifdef RLIMIT_PTHREAD
+	    else if (rt == RLIMIT_PTHREAD)
+		/* pure numeric resource */
+		printf("%d\n", (int)val);
+# endif /* RLIMIT_PTHREAD */
 	    else if (val >= 1024L * 1024L)
 		/* memory resource -- display with `K' or `M' modifier */
 # ifdef RLIM_T_IS_QUAD_T
@@ -4223,6 +4234,20 @@
 	    limit /= 1024;
 	break;
 # endif /* RLIMIT_AIO_MEM */
+# ifdef RLIMIT_SBSIZE
+    case RLIMIT_SBSIZE:
+	if (head)
+	    printf("socket buffer size (kb)    ");
+	if (limit != RLIM_INFINITY)
+	    limit /= 1024;
+	break;
+# endif /* RLIMIT_SBSIZE */
+# ifdef RLIMIT_PTHREAD
+    case RLIMIT_PTHREAD:
+	if (head)
+	    printf("threads per process        ");
+	break;
+# endif /* RLIMIT_PTHREAD */
     }
     /* display the limit */
     if (limit == RLIM_INFINITY)
Index: Src/rlimits.awk
===================================================================
@@ -38,6 +38,7 @@
 	    if (limnam == "AIO_OPS") { msg[limnum] = "aiooperations" }
 	    if (limnam == "AIO_MEM") { msg[limnum] = "aiomemorylocked" }
 	    if (limnam == "SBSIZE")  { msg[limnum] = "sockbufsize" }
+	    if (limnam == "PTHREAD") { msg[limnum] = "maxpthreads" }
         }
     }
 }
Index: Src/utils.c
===================================================================
@@ -397,11 +397,6 @@
  * or NIS/NIS+ database.                                 */
 
 /**/
-uid_t cached_uid;
-/**/
-char *cached_username;
-
-/**/
 char *
 get_username(void)
 {

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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