From: dashw459@aol.comeatspam Sent: Monday, August 14, 2000 8:40 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: STOP/ID << If you can, you could try to modify this application to set the nodelete bit on the process. >> The cure may be worse than the disease... /****************************************************************/ /* */ /* S T P */ /* */ /* A new high in XXX design. Ingestion makes everything lucid. */ /* XXX employs user mode spin locks to serialize access to */ /* shared resources. Unanticipated process termination */ /* (user ctrl-Y, DCL STOP, EXEC delprc, may leave a resource */ /* permanently locked. These routines attempt to provide part */ /* of a solution by enabling the user to make his process */ /* nondeletable. This works for STOP, SYS$EXIT, SYS$FORCEX and */ /* SYS$DELPRC. It does not work for CTRL-Y or C. Out of band */ /* AST catchers will be required! */ /* */ /* WARNING: */ /* Privileged kernel mode software. These routines can have */ /* terrible side affects. Users may find themselves with */ /* processes that can not be deleted, making reboot necessary. */ /* Aborting an interactive process set no delete can cause */ /* loginout to execute forever consuming huge amnounts of CPU. */ /* */ /* WARNING: */ /* PCB is not locked when modified. If this becomes a problem */ /* will have to take out a lock. */ /* */ /* WARNING: */ /* USE EXTREME CAUTION! Only use these routines if there */ /* are no alternatives. */ /* */ /* Creation Date: 04/15/97 */ /* */ /* Revision History: */ /* */ /****************************************************************/ /* $cc/list stp+alpha$library:sys$lib_c.tlb/libr $link/sysexe 'your program obj',stp */ #include /* YIPPEE TY OH I AYYYE */ #include #include /****************************************************************/ /* */ /* u n s t o p p a b l e */ /* */ /* Private kernel mode routine called by f_stp_unstoppable() */ /* Turn on (WHEE!) callers NO DELETE PCB status bit. */ /****************************************************************/ static int unstoppable() { /* turn PCB status bit for no delete on (set bit) */ #pragma nostandard globalref ctl$gl_pcb; #pragma standard PCB *p = (PCB *) ctl$gl_pcb; p->pcb$l_sts |= PCB$M_NODELET; return(SS$_NORMAL); } /****************************************************************/ /* */ /* s t o p p a b l e */ /* */ /* Private kernel mode routine called by f_stp_stoppable() */ /* Turn off (BOO HISS) callers NO DELETE PCB status bit. */ /* */ /****************************************************************/ static int stoppable() { /* turn PCB status bit for no delete off (clear bit) */ #pragma nostandard globalref ctl$gl_pcb; #pragma standard PCB *p = (PCB *) ctl$gl_pcb; p->pcb$l_sts &= ~PCB$M_NODELET; return(SS$_NORMAL); } /****************************************************************/ /* */ /* f _ s t p _ u n s t o p p a b l e */ /* */ /* Public routine to make callers process non deletable. */ /* Returns: system status, SS$_NORMAL or SS$_NOPRIV */ /* */ /****************************************************************/ int f_stp_unstoppable() { return( sys$cmkrnl( unstoppable, 0)); } /****************************************************************/ /* */ /* f _ s t p _ s t o p p a b l e */ /* */ /* Public routine to make callers process non deletable. */ /* Returns: system status, SS$_NORMAL or SS$_NOPRIV */ /* */ /****************************************************************/ int f_stp_stoppable() { return( sys$cmkrnl( stoppable, 0)); }