diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-08 04:50:57 +0100 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-08 04:50:57 +0100 |
commit | 784e234c19fc474af3ac3b7f96fa2dcc9f6443be (patch) | |
tree | 73ee0f45ac2714865bd2cc4d6b59d1d2a8d643d5 /openbsd-compat | |
parent | - (bal) Add in check for rpc/types.h since it is needed on (diff) | |
download | openssh-784e234c19fc474af3ac3b7f96fa2dcc9f6443be.tar.xz openssh-784e234c19fc474af3ac3b7f96fa2dcc9f6443be.zip |
- (bal) Test for IRIX JOBS support at runtime. Patch provided
by David Kaelbling <drk@sgi.com>
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/port-irix.c | 27 |
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 @@ #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 @@ irix_setusercontext(struct passwd *pw) #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 */ |