zsh-workers
 help / color / mirror / code / Atom feed
* (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined
@ 1999-10-19  5:15 Albert Chin-A-Young
  1999-10-19  6:10 ` PATCH: " Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Chin-A-Young @ 1999-10-19  5:15 UTC (permalink / raw)
  To: zsh-workers

Below needed for IRIX 6.5. I would update Doc/zsh/builtins.yo
but it doesn't seem to be shipped with the distribution. From
setrlimit(2):

     RLIMIT_PTHREAD   The maximum number of threads (pthreads(5)) that a
                      process may create.  Functions that attempt to create
                      new threads beyond this limit will fail with the error
                      EAGAIN.

Also, cached_uid is defined in Src/utils.c AND in Src/globals.h. This
is bad because utils.pro, generated from Src/utils.c, contains the
definition and the IRIX linker gives multiply defined symbol errors
for cached_uid. The second patch fixes this.

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- Src/rlimits.awk.orig	Mon Oct 18 23:19:19 1999
+++ Src/rlimits.awk	Mon Oct 18 23:19:32 1999
@@ -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] = "pthreads" }
         }
     }
 }
--- Src/utils.c.orig	Mon Oct 18 23:56:10 1999
+++ Src/utils.c	Tue Oct 19 00:08:56 1999
@@ -392,15 +392,6 @@
     }
 }
 
-/* Returns the current username.  It caches the username *
- * and uid to try to avoid requerying the password files *
- * or NIS/NIS+ database.                                 */
-
-/**/
-uid_t cached_uid;
-/**/
-char *cached_username;
-
 /**/
 char *
 get_username(void)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* PATCH: (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined
  1999-10-19  5:15 (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined Albert Chin-A-Young
@ 1999-10-19  6:10 ` Bart Schaefer
  1999-10-20 23:04   ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1999-10-19  6:10 UTC (permalink / raw)
  To: Albert Chin-A-Young, zsh-workers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined
  1999-10-19  6:10 ` PATCH: " Bart Schaefer
@ 1999-10-20 23:04   ` Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 1999-10-20 23:04 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer wrote:
>                                                 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.

I've just approved this.  I'm not sure who's on the moderation list,
other than me and Peter.  Presumably karthy; ISTR there being just three
of us.  You should probably be added.  (Sod's law: you posted it at the
start of my two-day bout of illness, from which I'm just recovering.
I would have approved it on Tuesday if I'd made it in to work.)

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-10-20 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-19  5:15 (3.0.7) compilation under IRIX 6.5, cached_uid multiply defined Albert Chin-A-Young
1999-10-19  6:10 ` PATCH: " Bart Schaefer
1999-10-20 23:04   ` Zefram

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