Irix joblimits failure (was: Re: New snapshot)
David Kaelbling
drk at sgi.com
Fri Mar 8 08:02:15 EST 2002
IRIX has a compatibility mechanism that lets you test for optional symbols (like jlimit_start) at run-time. I think these patches will let all all IRIX 6.5 systems build images that will test for job limit support dynamically:
--- ./configure.ac Wed Feb 27 01:12:35 2002
+++ ../openssh-3.1p1/./configure.ac Thu Mar 7 15:50:21 2002
@@ -115,7 +115,7 @@
AC_DEFINE(WITH_IRIX_ARRAY)
AC_DEFINE(WITH_IRIX_PROJECT)
AC_DEFINE(WITH_IRIX_AUDIT)
- AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
+ AC_DEFINE(WITH_IRIX_JOBS)
AC_DEFINE(BROKEN_INET_NTOA)
;;
*-*-linux*)
--- ./openbsd-compat/port-irix.c Tue Feb 19 15:02:49 2002
+++ ../openssh-3.1p1/./openbsd-compat/port-irix.c Thu Mar 7 15:35:21 2002
@@ -3,13 +3,20 @@
#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
#ifdef WITH_IRIX_PROJECT
-#include <proj.h>
+# include <proj.h>
#endif /* WITH_IRIX_PROJECT */
#ifdef WITH_IRIX_JOBS
-#include <sys/resource.h>
-#endif
+# include <sys/resource.h>
+# include <optional_sym.h>
+# if !defined(JLIMIT_CPU)
+/* Simulate job limit support so we can still test for it at runtime. */
+typedef __int64_t jid_t;
+extern jid_t jlimit_startjob(char *, uid_t, char *);
+# pragma optional jlimit_startjob
+# endif
+#endif /* WITH_IRIX_JOBS */
#ifdef WITH_IRIX_AUDIT
-#include <sat.h>
+# include <sat.h>
#endif /* WITH_IRIX_AUDIT */
void
@@ -27,10 +34,16 @@
#endif /* WITH_IRIX_JOBS */
#ifdef WITH_IRIX_JOBS
- jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
- if (jid == -1)
- fatal("Failed to create job container: %.100s",
+ if (_MIPS_SYMBOL_PRESENT(jlimit_startjob)) {
+ jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
+ if (jid == -1) {
+ if (errno == ENOPKG)
+ jid = 0;
+ else
+ fatal("Failed to create job container: %.100s",
strerror(errno));
+ }
+ }
#endif /* WITH_IRIX_JOBS */
#ifdef WITH_IRIX_ARRAY
/* initialize array session */
(Hopefully that didn't get line-wrapped. If it did I can try again.)
The JLIMIT_CPU test is to try and recognize when we are compiling on a system without the job limit headers.
Thanks,
David
--
David KAELBLING <drk at sgi.com> Silicon Graphics Computer Systems
1 Cabot Rd, suite 250; Hudson, MA 01749 781.839.2157, fax ...2357
More information about the openssh-unix-dev
mailing list