summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-irix.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-03-08 03:50:57 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-03-08 03:50:57 +0000
commit784e234c19fc474af3ac3b7f96fa2dcc9f6443be (patch)
tree73ee0f45ac2714865bd2cc4d6b59d1d2a8d643d5 /openbsd-compat/port-irix.c
parent7577fd83c16ef3415b61ca1bea1b14e1ab8e4228 (diff)
- (bal) Test for IRIX JOBS support at runtime. Patch provided
by David Kaelbling <drk@sgi.com>
Diffstat (limited to 'openbsd-compat/port-irix.c')
-rw-r--r--openbsd-compat/port-irix.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c
index a63ec429a..bd03366f5 100644
--- a/openbsd-compat/port-irix.c
+++ b/openbsd-compat/port-irix.c
@@ -3,13 +3,20 @@
3#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) 3#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
4 4
5#ifdef WITH_IRIX_PROJECT 5#ifdef WITH_IRIX_PROJECT
6#include <proj.h> 6# include <proj.h>
7#endif /* WITH_IRIX_PROJECT */ 7#endif /* WITH_IRIX_PROJECT */
8#ifdef WITH_IRIX_JOBS 8#ifdef WITH_IRIX_JOBS
9#include <sys/resource.h> 9# include <sys/resource.h>
10#endif 10# include <optional_sym.h>
11# if !defined(JLIMIT_CPU)
12/* Simulate job limit support so we can still test for it at runtime. */
13typedef __int64_t jid_t;
14extern jid_t jlimit_startjob(char *, uid_t, char *);
15# pragma optional jlimit_startjob
16# endif
17#endif /* WITH_IRIX_JOBS */
11#ifdef WITH_IRIX_AUDIT 18#ifdef WITH_IRIX_AUDIT
12#include <sat.h> 19# include <sat.h>
13#endif /* WITH_IRIX_AUDIT */ 20#endif /* WITH_IRIX_AUDIT */
14 21
15void 22void
@@ -27,10 +34,16 @@ irix_setusercontext(struct passwd *pw)
27#endif /* WITH_IRIX_JOBS */ 34#endif /* WITH_IRIX_JOBS */
28 35
29#ifdef WITH_IRIX_JOBS 36#ifdef WITH_IRIX_JOBS
30 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); 37 if (_MIPS_SYMBOL_PRESENT(jlimit_startjob)) {
31 if (jid == -1) 38 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
32 fatal("Failed to create job container: %.100s", 39 if (jid == -1) {
40 if (errno == ENOPKG)
41 jid = 0;
42 else
43 fatal("Failed to create job container: %.100s",
33 strerror(errno)); 44 strerror(errno));
45 }
46 }
34#endif /* WITH_IRIX_JOBS */ 47#endif /* WITH_IRIX_JOBS */
35#ifdef WITH_IRIX_ARRAY 48#ifdef WITH_IRIX_ARRAY
36 /* initialize array session */ 49 /* initialize array session */