I've finished the 2.3 patch for Irix job limits. It's a bit longer than a couple of lines. The bulk of the patch changes the configuration files to enable the job limits support on Irix. The meat of the change is in session.c where the new job containter is created at the same point as the other Irix specific actions. - Dennis --- config.h.in Sun Nov 5 21:25:18 2000 +++ config.h.in Wed Nov 8 10:25:53 2000 @@ -92,6 +92,9 @@ /* Define if you want IRIX audit trails */ #undef WITH_IRIX_AUDIT +/* Define if you want IRIX kernel job initiation */ +#undef WITH_IRIX_JOBS + /* Location of random number pool */ #undef RANDOM_POOL end --- configure.in Sun Nov 5 03:08:45 2000 +++ configure.in Wed Nov 8 10:26:57 2000 @@ -111,6 +111,7 @@ AC_DEFINE(WITH_IRIX_ARRAY) AC_DEFINE(WITH_IRIX_PROJECT) AC_DEFINE(WITH_IRIX_AUDIT) + AC_DEFINE(WITH_IRIX_JOBS) no_libsocket=1 no_libnsl=1 AC_DEFINE(BROKEN_INET_NTOA) end --- configure Sun Nov 5 21:25:18 2000 +++ configure Wed Nov 8 10:28:11 2000 @@ -1459,6 +1459,10 @@ #define WITH_IRIX_AUDIT 1 EOF + cat >> confdefs.h <<\EOF +#define WITH_IRIX_JOBS 1 +EOF + no_libsocket=1 no_libnsl=1 cat >> confdefs.h <<\EOF end --- acconfig.h Wed Oct 18 08:11:44 2000 +++ acconfig.h Wed Nov 8 10:28:56 2000 @@ -83,6 +83,9 @@ /* Define if you want IRIX audit trails */ #undef WITH_IRIX_AUDIT +/* Define if you want IRIX kernel jobs */ +#undef WITH_IRIX_JOBS + /* Location of random number pool */ #undef RANDOM_POOL end --- session.c Fri Oct 27 22:19:58 2000 +++ session.c Wed Nov 8 13:20:03 2000 @@ -55,6 +55,9 @@ #ifdef WITH_IRIX_PROJECT #include <proj.h> #endif /* WITH_IRIX_PROJECT */ +#ifdef WITH_IRIX_JOBS +#include <sys/resource.h> +#endif #if defined(HAVE_USERSEC_H) #include <usersec.h> @@ -1014,6 +1017,14 @@ #ifdef WITH_IRIX_PROJECT prid_t projid; #endif /* WITH_IRIX_PROJECT */ +#ifdef WITH_IRIX_JOBS + jid_t jid = 0; +#else +#ifdef WITH_IRIX_ARRAY + int jid = 0; +#endif /* WITH_IRIX_ARRAY */ +#endif /* WITH_IRIX_JOBS */ + /* login(1) is only called if we execute the login shell */ if (options.use_login && command != NULL) @@ -1086,11 +1097,21 @@ exit(1); } endgrent(); +# ifdef WITH_IRIX_JOBS + jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); + if (jid == -1) { + fatal("Failed to create job container: %.100s", + strerror(errno)); + } +# endif /* WITH_IRIX_JOBS */ + # ifdef WITH_IRIX_ARRAY /* initialize array session */ - if (newarraysess() != 0) - fatal("Failed to set up new array session: %.100s", - strerror(errno)); + if (jid == 0) { + if (newarraysess() != 0) + fatal("Failed to set up new array session: %.100s", + strerror(errno)); + } # endif /* WITH_IRIX_ARRAY */ # ifdef WITH_IRIX_PROJECT /* initialize irix project info */ end