diff --git a/lib/kafs/afssys.c b/lib/kafs/afssys.c index 367592fe0..60cd8cdbe 100644 --- a/lib/kafs/afssys.c +++ b/lib/kafs/afssys.c @@ -10,6 +10,7 @@ RCSID("$Id$"); #ifdef HAVE_SYS_FILIO_H #include #endif +#include #include #include @@ -328,7 +329,9 @@ k_pioctl(char *a_path, #endif errno = ENOSYS; +#ifdef SIGSYS kill(getpid(), SIGSYS); /* You loose! */ +#endif return -1; } @@ -364,12 +367,16 @@ k_setpag(void) #endif errno = ENOSYS; +#ifdef SIGSYS kill(getpid(), SIGSYS); /* You loose! */ +#endif return -1; } static jmp_buf catch_SIGSYS; +#ifdef SIGSYS + static void SIGSYS_handler(int sig) { @@ -378,6 +385,8 @@ SIGSYS_handler(int sig) longjmp(catch_SIGSYS, 1); } +#endif + int k_hasafs(void) { @@ -400,7 +409,9 @@ k_hasafs(void) memset(&parms, 0, sizeof(parms)); saved_errno = errno; +#ifdef SIGSYS saved_func = signal(SIGSYS, SIGSYS_handler); +#endif #ifdef AFS_SYSCALL if (setjmp(catch_SIGSYS) == 0) @@ -454,7 +465,9 @@ k_hasafs(void) #endif done: +#ifdef SIGSYS (void) signal(SIGSYS, saved_func); +#endif errno = saved_errno; return afs_entry_point != NO_ENTRY_POINT; }