Disabling the F6 interrupt function - VMS

This is a discussion on Disabling the F6 interrupt function - VMS ; I just found out that a system I maintain is hosed if someone hits F6. It halts the interface, stops ASTs from running, stops freeing locks, halts the system and sets off the watchdog timer. I am trying to figure ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 23

Thread: Disabling the F6 interrupt function

  1. Disabling the F6 interrupt function

    I just found out that a system I maintain is hosed if someone hits
    F6. It halts the interface, stops ASTs from running, stops freeing
    locks, halts the system and sets off the watchdog timer.

    I am trying to figure out how to fix the problem. The interface uses
    SMG.

    I would like to leave line editing functions on if possible, when the
    user is entering line mode commands.

    This interface traps control Y and C but F6 gets by this. I let
    control Y and C exit the system in situations where a unified
    transaction is not in progress.

  2. Re: Disabling the F6 interrupt function

    On Oct 15, 4:18*pm, tadamsmar wrote:
    > I just found out that a system I maintain is hosed if someone hits
    > F6. *It halts the interface, stops ASTs from running, stops freeing
    > locks, halts the system and sets off the watchdog timer.
    >
    > I am trying to figure out how to fix the problem. * The interface uses
    > SMG.
    >
    > I would like to leave line editing functions on if possible, when the
    > user is entering line mode commands.
    >
    > This interface traps control Y and C but F6 gets by this. * I let
    > control Y and C exit the system in situations where a unified
    > transaction is not in progress.


    tadamsmar,

    Since this post does not mention the hardware (terminal or CPU)
    involved, it is difficult to tell you how to resolve this problem.

    That said, F6 is most likely generating a "BREAK" signal. Generally,
    if this is producing a ">>>" prompt, one has the hardware setting
    (such as on a MicroVAX) set to HALT on BREAK.

    - Bob Gezelter, http://www.rlgsc.com

  3. Re: Disabling the F6 interrupt function

    Is this on a workstation, a terminal via Telnet and an emulator, on
    the console?

    In other words, I think a little more information would be useful....


    Sean

    On Oct 15, 1:18*pm, tadamsmar wrote:
    > I just found out that a system I maintain is hosed if someone hits
    > F6. *It halts the interface, stops ASTs from running, stops freeing
    > locks, halts the system and sets off the watchdog timer.
    >
    > I am trying to figure out how to fix the problem. * The interface uses
    > SMG.
    >
    > I would like to leave line editing functions on if possible, when the
    > user is entering line mode commands.
    >
    > This interface traps control Y and C but F6 gets by this. * I let
    > control Y and C exit the system in situations where a unified
    > transaction is not in progress.



  4. Re: Disabling the F6 interrupt function

    All of the below, anything with an F6 key.

    If you have the terminal in "Line Editing" mode, the F6 seems to act
    like Control-Y, only the SMG$SET_OUT_OF_BAND_AST does not trap it when
    you configure it to trap Control-Y.

    You can put a terminal in Line Editing mode with the command:

    SET TERM/LINE

    Anyone who has an app that it trapping out Control-Y to change its
    behavior should probably test hitting the F6 key. We have had our app
    running for almost 20 years, then the day before yesterday I was
    running a brush over the keyboard and locked up the whole system.

    On Oct 15, 6:34*pm, s...@obanion.us wrote:
    > Is this on a workstation, a terminal via Telnet and an emulator, on
    > the console?
    >
    > In other words, I think a little more information would be useful....
    >
    > Sean
    >
    > On Oct 15, 1:18*pm, tadamsmar wrote:
    >
    >
    >
    > > I just found out that a system I maintain is hosed if someone hits
    > > F6. *It halts the interface, stops ASTs from running, stops freeing
    > > locks, halts the system and sets off the watchdog timer.

    >
    > > I am trying to figure out how to fix the problem. * The interface uses
    > > SMG.

    >
    > > I would like to leave line editing functions on if possible, when the
    > > user is entering line mode commands.

    >
    > > This interface traps control Y and C but F6 gets by this. * I let
    > > control Y and C exit the system in situations where a unified
    > > transaction is not in progress.- Hide quoted text -

    >
    > - Show quoted text -



  5. Re: Disabling the F6 interrupt function

    In article , tadamsmar writes:
    > I just found out that a system I maintain is hosed if someone hits
    > F6. It halts the interface, stops ASTs from running, stops freeing
    > locks, halts the system and sets off the watchdog timer.
    >
    > I am trying to figure out how to fix the problem. The interface uses
    > SMG.
    >
    > I would like to leave line editing functions on if possible, when the
    > user is entering line mode commands.
    >
    > This interface traps control Y and C but F6 gets by this. I let
    > control Y and C exit the system in situations where a unified
    > transaction is not in progress.


    What the program gets from F6 probably starts with an escape
    character. I'd look into what SMG is doing with this.


  6. Re: Disabling the F6 interrupt function

    On Oct 16, 8:54*am, koeh...@eisner.nospam.encompasserve.org (Bob
    Koehler) wrote:
    > In article , tadamsmar writes:
    >
    > > I just found out that a system I maintain is hosed if someone hits
    > > F6. *It halts the interface, stops ASTs from running, stops freeing
    > > locks, halts the system and sets off the watchdog timer.

    >
    > > I am trying to figure out how to fix the problem. * The interface uses
    > > SMG.

    >
    > > I would like to leave line editing functions on if possible, when the
    > > user is entering line mode commands.

    >
    > > This interface traps control Y and C but F6 gets by this. * I let
    > > control Y and C exit the system in situations where a unified
    > > transaction is not in progress.

    >
    > * What the program gets from F6 probably starts with an escape
    > * character. *I'd look into what SMG is doing with this.


    I searched the archives here on "F6 Interrupt" and did not see a
    mention of an SMG solution deals only with F6 and has not side-
    effects, and I don't know of one. The only solutions I have found have
    side effects: (1) turn off line editing (2) SET NOCONTROL-Y.

    It is possible to turn line editing on and off with SMG commands or
    system services. I am looking at turning it off at the critical
    times, but of course this solution requires a bit of application
    analysis.

  7. Re: Disabling the F6 interrupt function

    On Oct 16, 9:13*am, tadamsmar wrote:
    > On Oct 16, 8:54*am, koeh...@eisner.nospam.encompasserve.org (Bob
    >
    >
    >
    >
    >
    > Koehler) wrote:
    > > In article , tadamsmar writes:

    >
    > > > I just found out that a system I maintain is hosed if someone hits
    > > > F6. *It halts the interface, stops ASTs from running, stops freeing
    > > > locks, halts the system and sets off the watchdog timer.

    >
    > > > I am trying to figure out how to fix the problem. * The interface uses
    > > > SMG.

    >
    > > > I would like to leave line editing functions on if possible, when the
    > > > user is entering line mode commands.

    >
    > > > This interface traps control Y and C but F6 gets by this. * I let
    > > > control Y and C exit the system in situations where a unified
    > > > transaction is not in progress.

    >
    > > * What the program gets from F6 probably starts with an escape
    > > * character. *I'd look into what SMG is doing with this.

    >
    > I searched the archives here on "F6 Interrupt" and did not see a
    > mention of an SMG solution deals only with F6 and has not side-
    > effects, and I don't know of one. The only solutions I have found have
    > side effects: (1) turn off line editing (2) SET NOCONTROL-Y.
    >
    > It is possible to turn line editing on and off with SMG commands or
    > system services. *I am looking at turning it off at the critical
    > times, but of course this solution requires a bit of application
    > analysis.- Hide quoted text -
    >
    > - Show quoted text -


    Turns out that F6 is being coverted to a CTRL/C. But trapping CTRL/C
    with SMG$SET_OUT_OF_BAND_ASTS does not trap F6 when it is configured
    to trap CTRL/C.

    However, you can trap F6 with SYS$QIOW as illustrated
    here with a handy example program CTRLC.FOR:

    http://h71000.www7.hp.com/doc/82fina...43pro_049.html

    This appears to be promising. I tested the example program and it
    does trap F6 when line editing is enabled for the terminal.



  8. Re: Disabling the F6 interrupt function

    On Oct 17, 3:54*pm, tadamsmar wrote:
    > On Oct 16, 9:13*am, tadamsmar wrote:
    >
    >
    >
    >
    >
    > > On Oct 16, 8:54*am, koeh...@eisner.nospam.encompasserve.org (Bob

    >
    > > Koehler) wrote:
    > > > In article , tadamsmar writes:

    >
    > > > > I just found out that a system I maintain is hosed if someone hits
    > > > > F6. *It halts the interface, stops ASTs from running, stops freeing
    > > > > locks, halts the system and sets off the watchdog timer.

    >
    > > > > I am trying to figure out how to fix the problem. * The interfaceuses
    > > > > SMG.

    >
    > > > > I would like to leave line editing functions on if possible, when the
    > > > > user is entering line mode commands.

    >
    > > > > This interface traps control Y and C but F6 gets by this. * I let
    > > > > control Y and C exit the system in situations where a unified
    > > > > transaction is not in progress.

    >
    > > > * What the program gets from F6 probably starts with an escape
    > > > * character. *I'd look into what SMG is doing with this.

    >
    > > I searched the archives here on "F6 Interrupt" and did not see a
    > > mention of an SMG solution deals only with F6 and has not side-
    > > effects, and I don't know of one. The only solutions I have found have
    > > side effects: (1) turn off line editing (2) SET NOCONTROL-Y.

    >
    > > It is possible to turn line editing on and off with SMG commands or
    > > system services. *I am looking at turning it off at the critical
    > > times, but of course this solution requires a bit of application
    > > analysis.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Turns out that F6 is being coverted to a CTRL/C. *But trapping CTRL/C
    > with SMG$SET_OUT_OF_BAND_ASTS does not trap F6 when it is configured
    > to trap CTRL/C.
    >
    > However, you can trap F6 with SYS$QIOW as illustrated
    > here with a handy example program CTRLC.FOR:
    >
    > http://h71000.www7.hp.com/doc/82fina...43pro_049.html
    >
    > This appears to be promising. *I tested the example program and it
    > does trap F6 when line editing is enabled for the terminal.- Hide quoted text -
    >
    > - Show quoted text -


    This solution is useful but not 100% reliable. Only one AST is
    established and it has to run to re-establish another. If you jam the
    F6 key down then I find that the F6 key eventually wins the race with
    the re-establishment of the AST and causes an interrupt.

  9. Re: Disabling the F6 interrupt function

    On Oct 16, 9:13*am, tadamsmar wrote:
    > On Oct 16, 8:54*am, koeh...@eisner.nospam.encompasserve.org (Bob
    >
    >
    >
    >
    >
    > Koehler) wrote:
    > > In article , tadamsmar writes:

    >
    > > > I just found out that a system I maintain is hosed if someone hits
    > > > F6. *It halts the interface, stops ASTs from running, stops freeing
    > > > locks, halts the system and sets off the watchdog timer.

    >
    > > > I am trying to figure out how to fix the problem. * The interface uses
    > > > SMG.

    >
    > > > I would like to leave line editing functions on if possible, when the
    > > > user is entering line mode commands.

    >
    > > > This interface traps control Y and C but F6 gets by this. * I let
    > > > control Y and C exit the system in situations where a unified
    > > > transaction is not in progress.

    >
    > > * What the program gets from F6 probably starts with an escape
    > > * character. *I'd look into what SMG is doing with this.

    >
    > I searched the archives here on "F6 Interrupt" and did not see a
    > mention of an SMG solution deals only with F6 and has not side-
    > effects, and I don't know of one. The only solutions I have found have
    > side effects: (1) turn off line editing (2) SET NOCONTROL-Y.
    >
    > It is possible to turn line editing on and off with SMG commands or
    > system services. *I am looking at turning it off at the critical
    > times, but of course this solution requires a bit of application
    > analysis.- Hide quoted text -
    >
    > - Show quoted text -


    Opps! I was wrong about something.

    SET NOCONTROL-Y does not work because F6 generates a CTRL/C.

  10. Re: Disabling the F6 interrupt function

    In article <6e8b50bf-00b8-4085-aaf6-0c1d382b39d0@u65g2000hsc.googlegroups.com>, tadamsmar writes:
    >
    > This solution is useful but not 100% reliable. Only one AST is
    > established and it has to run to re-establish another. If you jam the
    > F6 key down then I find that the F6 key eventually wins the race with
    > the re-establishment of the AST and causes an interrupt.


    Can't the AST re-establish itself before exiting?


  11. Re: Disabling the F6 interrupt function

    On Oct 21, 4:58*pm, koeh...@eisner.nospam.encompasserve.org (Bob
    Koehler) wrote:
    > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegroups..com>, tadamsmar writes:
    >
    >
    >
    > > This solution is useful but not 100% reliable. *Only one AST is
    > > established and it has to run to re-establish another. *If you jam the
    > > F6 key down then I find that the F6 key eventually wins the race with
    > > the re-establishment of the AST and causes an interrupt.

    >
    > * *Can't the AST re-establish itself before exiting?


    Yep, and mine does.

    But the program would need to re-establish the AST before any other
    code was executed, like the code that delivers the next F6 key
    interrupt.

    My theory is that next F6 key interrupt gets processed be for the AST
    is re-established. I guess I am assuming that an AST can be
    interrupted by the next F6 Key interrupt. Is that impossible?

    Perhaps the AST can be run at some kind of higher level to ensure it
    is not interrupted. I have not had to deal with this kind of stuff in
    a long time, there are cobwebs on what little I know about it.

  12. Re: Disabling the F6 interrupt function

    On Oct 22, 8:28*am, tadamsmar wrote:
    > On Oct 21, 4:58*pm, koeh...@eisner.nospam.encompasserve.org (Bob
    >
    > Koehler) wrote:
    > > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegroups.com>, tadamsmar writes:

    >
    > > > This solution is useful but not 100% reliable. *Only one AST is
    > > > established and it has to run to re-establish another. *If you jam the
    > > > F6 key down then I find that the F6 key eventually wins the race with
    > > > the re-establishment of the AST and causes an interrupt.

    >
    > > * *Can't the AST re-establish itself before exiting?

    >
    > Yep, and mine does.
    >
    > But the program would need to re-establish the AST before any other
    > code was executed, like the code that delivers the next F6 key
    > interrupt.
    >
    > My theory is that next F6 key interrupt gets processed be for the AST
    > is re-established. * I guess I am assuming that an AST can be
    > interrupted by the next F6 Key interrupt. *Is that impossible?
    >
    > Perhaps the AST can be run at some kind of higher level to ensure it
    > is not interrupted. *I have not had to deal with this kind of stuff in
    > a long time, there are cobwebs on what little I know about it.


    Higher mode, not higher level. Maybe I need to run the AST at a
    higher mode than the default mode?

  13. Re: Disabling the F6 interrupt function

    In article , tadamsmar writes:
    >On Oct 22, 8:28=A0am, tadamsmar wrote:
    >> On Oct 21, 4:58=A0pm, koeh...@eisner.nospam.encompasserve.org (Bob
    >>
    >> Koehler) wrote:
    >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegrou=

    >ps.com>, tadamsmar writes:
    >>
    >> > > This solution is useful but not 100% reliable. =A0Only one AST is
    >> > > established and it has to run to re-establish another. =A0If you jam =

    >the
    >> > > F6 key down then I find that the F6 key eventually wins the race with
    >> > > the re-establishment of the AST and causes an interrupt.

    >>
    >> > =A0 =A0Can't the AST re-establish itself before exiting?

    >>
    >> Yep, and mine does.
    >>
    >> But the program would need to re-establish the AST before any other
    >> code was executed, like the code that delivers the next F6 key
    >> interrupt.
    >>
    >> My theory is that next F6 key interrupt gets processed be for the AST
    >> is re-established. =A0 I guess I am assuming that an AST can be
    >> interrupted by the next F6 Key interrupt. =A0Is that impossible?
    >>
    >> Perhaps the AST can be run at some kind of higher level to ensure it
    >> is not interrupted. =A0I have not had to deal with this kind of stuff in
    >> a long time, there are cobwebs on what little I know about it.

    >
    >Higher mode, not higher level. Maybe I need to run the AST at a
    >higher mode than the default mode?


    Simple...

    .PSECT DATA,WRT,NOEXE,5
    CTRL_C_AST:
    .LONG 3 ; 3 arguments
    .ADDRESS your_ctrl_c_ast_routine ; DCLAST$_ASTADR
    .LONG 0 ; DCLAST$_ASTPRM
    .LONG 0 ; DCLAST$_ACMODE


    .PSECT CODE,NOWRT,EXE,5
    .ENTRY some_name,0

    $CMEXEC_S ROUTIN=SYS$DCLAST,-
    ARGLST=CTRL_C_AST

    RET
    .END


    This will queue the AST for execution in EXECUTIVE mode. You will
    need CMEXEC privilege to test this out. If this works, you'll need
    to implement a user written system service or install your program
    with the CMEXEC privilege to allow this to function for the average
    non-privileged user.

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    .... pejorative statements of opinion are entitled to constitutional protection
    no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)

    Copr. 2008 Brian Schenkenberger. Publication of _this_ usenet article outside
    of usenet _must_ include its contents in its entirety including this copyright
    notice, disclaimer and quotations.

  14. Re: Disabling the F6 interrupt function

    On Oct 22, 9:57*am, VAXman- @SendSpamHere.ORG wrote:
    > In article , tadamsmar writes:
    >
    >
    >
    >
    >
    > >On Oct 22, 8:28=A0am, tadamsmar wrote:
    > >> On Oct 21, 4:58=A0pm, koeh...@eisner.nospam.encompasserve.org (Bob

    >
    > >> Koehler) wrote:
    > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegrou=

    > >ps.com>, tadamsmar writes:

    >
    > >> > > This solution is useful but not 100% reliable. =A0Only one AST is
    > >> > > established and it has to run to re-establish another. =A0If youjam =

    > >the
    > >> > > F6 key down then I find that the F6 key eventually wins the race with
    > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > >> > =A0 =A0Can't the AST re-establish itself before exiting?

    >
    > >> Yep, and mine does.

    >
    > >> But the program would need to re-establish the AST before any other
    > >> code was executed, like the code that delivers the next F6 key
    > >> interrupt.

    >
    > >> My theory is that next F6 key interrupt gets processed be for the AST
    > >> is re-established. =A0 I guess I am assuming that an AST can be
    > >> interrupted by the next F6 Key interrupt. =A0Is that impossible?

    >
    > >> Perhaps the AST can be run at some kind of higher level to ensure it
    > >> is not interrupted. =A0I have not had to deal with this kind of stuff in
    > >> a long time, there are cobwebs on what little I know about it.

    >
    > >Higher mode, not higher level. *Maybe I need to run the AST at a
    > >higher mode than the default mode?

    >
    > Simple...
    >
    > * * * * .PSECT *DATA,WRT,NOEXE,5
    > CTRL_C_AST:
    > * * * * .LONG * 3 * * * * * * * * * * * * * * * ; 3 arguments
    > * * * * .ADDRESS your_ctrl_c_ast_routine * * * *; DCLAST$_ASTADR
    > * * * * .LONG * 0 * * * * * * * * * * * * * * * ; DCLAST$_ASTPRM
    > * * * * .LONG * 0 * * * * * * * * * * * * * * * ; DCLAST$_ACMODE
    >
    > * * * * .PSECT *CODE,NOWRT,EXE,5
    > * * * * .ENTRY *some_name,0
    >
    > * * * * $CMEXEC_S * * * ROUTIN=SYS$DCLAST,-
    > * * * * * * * * * * * * ARGLST=CTRL_C_AST
    >
    > * * * * RET
    > * * * * .END * *
    >
    > This will queue the AST for execution in EXECUTIVE mode. *You will
    > need CMEXEC privilege to test this out. *If this works, you'll need
    > to implement a user written system service or install your program
    > with the CMEXEC privilege to allow this to function for the average
    > non-privileged user.
    >
    > --
    > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM
    >
    > ... pejorative statements of opinion are entitled to constitutional protection
    > no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)
    >
    > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > of usenet _must_ include its contents in its entirety including this copyright
    > notice, disclaimer and quotations.- Hide quoted text -
    >
    > - Show quoted text -


    So, in what context do I execute this function? Looks like it just
    queues the AST. But, I need to specify the AST in the prevously
    referenced SYS$QIO so it will queue when the F6 is pressed.

  15. Re: Disabling the F6 interrupt function

    On Oct 22, 10:42*am, tadamsmar wrote:
    > On Oct 22, 9:57*am, VAXman- *@SendSpamHere.ORG wrote:
    >
    >
    >
    >
    >
    > > In article , tadamsmar writes:

    >
    > > >On Oct 22, 8:28=A0am, tadamsmar wrote:
    > > >> On Oct 21, 4:58=A0pm, koeh...@eisner.nospam.encompasserve.org (Bob

    >
    > > >> Koehler) wrote:
    > > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegrou=
    > > >ps.com>, tadamsmar writes:

    >
    > > >> > > This solution is useful but not 100% reliable. =A0Only one ASTis
    > > >> > > established and it has to run to re-establish another. =A0If you jam =
    > > >the
    > > >> > > F6 key down then I find that the F6 key eventually wins the racewith
    > > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > > >> > =A0 =A0Can't the AST re-establish itself before exiting?

    >
    > > >> Yep, and mine does.

    >
    > > >> But the program would need to re-establish the AST before any other
    > > >> code was executed, like the code that delivers the next F6 key
    > > >> interrupt.

    >
    > > >> My theory is that next F6 key interrupt gets processed be for the AST
    > > >> is re-established. =A0 I guess I am assuming that an AST can be
    > > >> interrupted by the next F6 Key interrupt. =A0Is that impossible?

    >
    > > >> Perhaps the AST can be run at some kind of higher level to ensure it
    > > >> is not interrupted. =A0I have not had to deal with this kind of stuff in
    > > >> a long time, there are cobwebs on what little I know about it.

    >
    > > >Higher mode, not higher level. *Maybe I need to run the AST at a
    > > >higher mode than the default mode?

    >
    > > Simple...

    >
    > > * * * * .PSECT *DATA,WRT,NOEXE,5
    > > CTRL_C_AST:
    > > * * * * .LONG * 3 * * * * * * * * * * ** * * * ; 3 arguments
    > > * * * * .ADDRESS your_ctrl_c_ast_routine * * * *; DCLAST$_ASTADR
    > > * * * * .LONG * 0 * * * * * * * * * * ** * * * ; DCLAST$_ASTPRM
    > > * * * * .LONG * 0 * * * * * * * * * * ** * * * ; DCLAST$_ACMODE

    >
    > > * * * * .PSECT *CODE,NOWRT,EXE,5
    > > * * * * .ENTRY *some_name,0

    >
    > > * * * * $CMEXEC_S * * * ROUTIN=SYS$DCLAST,-
    > > * * * * * * * * * * * * ARGLST=CTRL_C_AST

    >
    > > * * * * RET
    > > * * * * .END * *

    >
    > > This will queue the AST for execution in EXECUTIVE mode. *You will
    > > need CMEXEC privilege to test this out. *If this works, you'll need
    > > to implement a user written system service or install your program
    > > with the CMEXEC privilege to allow this to function for the average
    > > non-privileged user.

    >
    > > --
    > > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM

    >
    > > ... pejorative statements of opinion are entitled to constitutional protection
    > > no matter how extreme, vituperous, or vigorously expressed they may be.(NJSC)

    >
    > > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > > of usenet _must_ include its contents in its entirety including this copyright
    > > notice, disclaimer and quotations.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > So, in what context do I execute this function? *Looks like it just
    > queues the AST. *But, I need to specify the AST in the prevously
    > referenced SYS$QIO so it will queue when the F6 is pressed.- Hide quoted text -
    >
    > - Show quoted text -


    What is "your_ctrl_c_ast_routine"?

    Is it the ast that is suppose to run when ctrl/c is hit? I don't see
    how that would address the issue.

    However if I run the routine that executes the QIO in executive mode,
    and I specify in the QIO call that the
    AST is to be run in executive mode then that should work.

    That is, I need to run this (enanulirp) in executive mode:

    integer*4 function enanulirp ()
    implicit none

    C ONE-LINE DESCRIPTION

    CT Enable null AST for CTRL/C (ENANULIRP)

    C FUNCTION (transformation on inputs to outputs)

    CF The ENANULIRP procedure disables the interrupt
    CF caused by CTRL/C by replacing it with an AST that
    CF does nothing except re-establish the AST.

    C DESIGN CONSIDERATIONS

    CD ENANULIRP is not 100% successful if CTRL/C or the F6 key is
    CD held down, since the next interrupt may arrive before the
    CD AST is re-established.

    CD ENANULIRP disables the CTRL/C that is delivered by the F6 key
    CD when line editing is enabled for the terminal.
    CD SMG$SET_OUT_OF_BAND_ASTS fails to do this.

    CD ENANULIRP does not interfere with SMG$SET_OUT_OF_BAND_ASTS;
    any
    CD CTRL/C defined by SMG$SET_OUT_OF_BAND_ASTS will still run.

    C************************************************* **********************

    C INCLUDE FILES

    INCLUDE '($SYSSRVNAM)' ! System
    services
    INCLUDE '($IODEF)' ! $QIO
    function codes
    include '($psldef)' !PSL symbolic names
    C PARAMETER DECLARATIONS

    C ARGUMENT DECLARATIONS

    C VARIABLE DECLARATIONS

    integer*4 iosb(2) !I/O Status block
    integer*2 chn !Channel
    save chn
    integer*4 sts !Completion status

    C SUBPROGRAM DECLARATIONS

    C EXTERNAL DECLARATIONS

    external nulirpast
    external ss$_normal

    C PROGRAM LOGIC

    CL.le; Initialize the status variable.

    sts = %loc(ss$_normal)

    CL.le; Enable AST so that NULIRPAST is called when Ctrl/C is pressed.

    if (chn .eq. 0) then
    sts = sys$assign ('tt:', chn,,,)
    end if

    if (sts) then
    sts = sys$qiow
    (, ! (3)
    1 %val(chn),
    1 %val(IO$_SETMODE .or. IO$M_CTRLCAST),
    1 iosb,,,
    1 nulirpast,,%val(psl$c_exec),,,)
    end if

    CL.le; Set the return status.

    enanulirp = sts

    return
    end

    And that will cause nulirpast to be called:

    subroutine nulirpast ()
    implicit none

    C INCLUDE FILES

    C PARAMETER DECLARATIONS

    C ARGUMENT DECLARATIONS

    C VARIABLE DECLARATIONS

    integer*4 sts !Completion status

    C SUBPROGRAM DECLARATIONS

    integer*4 enanulirp

    C EXTERNAL DECLARATIONS

    external ss$_normal

    C PROGRAM LOGIC

    CL.le; Initialize the status variable.

    sts = %loc(ss$_normal)

    CL.le; Re-establish the AST

    sts = enanulirp()
    if (.not. sts) then
    call lib$signal(%val(sts))
    end if

    return
    end

  16. Re: Disabling the F6 interrupt function

    On Oct 22, 9:57*am, VAXman- @SendSpamHere.ORG wrote:
    > In article , tadamsmar writes:
    >
    >
    >
    >
    >
    > >On Oct 22, 8:28=A0am, tadamsmar wrote:
    > >> On Oct 21, 4:58=A0pm, koeh...@eisner.nospam.encompasserve.org (Bob

    >
    > >> Koehler) wrote:
    > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googlegrou=

    > >ps.com>, tadamsmar writes:

    >
    > >> > > This solution is useful but not 100% reliable. =A0Only one AST is
    > >> > > established and it has to run to re-establish another. =A0If youjam =

    > >the
    > >> > > F6 key down then I find that the F6 key eventually wins the race with
    > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > >> > =A0 =A0Can't the AST re-establish itself before exiting?

    >
    > >> Yep, and mine does.

    >
    > >> But the program would need to re-establish the AST before any other
    > >> code was executed, like the code that delivers the next F6 key
    > >> interrupt.

    >
    > >> My theory is that next F6 key interrupt gets processed be for the AST
    > >> is re-established. =A0 I guess I am assuming that an AST can be
    > >> interrupted by the next F6 Key interrupt. =A0Is that impossible?

    >
    > >> Perhaps the AST can be run at some kind of higher level to ensure it
    > >> is not interrupted. =A0I have not had to deal with this kind of stuff in
    > >> a long time, there are cobwebs on what little I know about it.

    >
    > >Higher mode, not higher level. *Maybe I need to run the AST at a
    > >higher mode than the default mode?

    >
    > Simple...
    >
    > * * * * .PSECT *DATA,WRT,NOEXE,5
    > CTRL_C_AST:
    > * * * * .LONG * 3 * * * * * * * * * * * * * * * ; 3 arguments
    > * * * * .ADDRESS your_ctrl_c_ast_routine * * * *; DCLAST$_ASTADR
    > * * * * .LONG * 0 * * * * * * * * * * * * * * * ; DCLAST$_ASTPRM
    > * * * * .LONG * 0 * * * * * * * * * * * * * * * ; DCLAST$_ACMODE
    >
    > * * * * .PSECT *CODE,NOWRT,EXE,5
    > * * * * .ENTRY *some_name,0
    >
    > * * * * $CMEXEC_S * * * ROUTIN=SYS$DCLAST,-
    > * * * * * * * * * * * * ARGLST=CTRL_C_AST
    >
    > * * * * RET
    > * * * * .END * *
    >
    > This will queue the AST for execution in EXECUTIVE mode. *You will
    > need CMEXEC privilege to test this out. *If this works, you'll need
    > to implement a user written system service or install your program
    > with the CMEXEC privilege to allow this to function for the average
    > non-privileged user.
    >
    > --
    > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM
    >
    > ... pejorative statements of opinion are entitled to constitutional protection
    > no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)
    >
    > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > of usenet _must_ include its contents in its entirety including this copyright
    > notice, disclaimer and quotations.- Hide quoted text -
    >
    > - Show quoted text -


    Come to think of it, I can run nulirpast once using your code and
    then it will run enanulirp. So that will work.

  17. Re: Disabling the F6 interrupt function

    In article <829f6820-1ba5-4787-86d9-36a149df4d68@d45g2000hsc.googlegroups.com>, tadamsmar writes:
    >On Oct 22, 10:42=A0am, tadamsmar wrote:
    >> On Oct 22, 9:57=A0am, VAXman- =A0@SendSpamHere.ORG wrote:
    >>
    >>
    >>
    >>
    >>
    >> > In article

    >ps.com>, tadamsmar writes:
    >>
    >> > >On Oct 22, 8:28=3DA0am, tadamsmar wrote:
    >> > >> On Oct 21, 4:58=3DA0pm, koeh...@eisner.nospam.encompasserve.org (Bob

    >>
    >> > >> Koehler) wrote:
    >> > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googl=

    >egrou=3D
    >> > >ps.com>, tadamsmar writes:

    >>
    >> > >> > > This solution is useful but not 100% reliable. =3DA0Only one AST=

    > is
    >> > >> > > established and it has to run to re-establish another. =3DA0If y=

    >ou jam =3D
    >> > >the
    >> > >> > > F6 key down then I find that the F6 key eventually wins the race=

    > with
    >> > >> > > the re-establishment of the AST and causes an interrupt.

    >>
    >> > >> > =3DA0 =3DA0Can't the AST re-establish itself before exiting?

    >>
    >> > >> Yep, and mine does.

    >>
    >> > >> But the program would need to re-establish the AST before any other
    >> > >> code was executed, like the code that delivers the next F6 key
    >> > >> interrupt.

    >>
    >> > >> My theory is that next F6 key interrupt gets processed be for the AS=

    >T
    >> > >> is re-established. =3DA0 I guess I am assuming that an AST can be
    >> > >> interrupted by the next F6 Key interrupt. =3DA0Is that impossible?

    >>
    >> > >> Perhaps the AST can be run at some kind of higher level to ensure it
    >> > >> is not interrupted. =3DA0I have not had to deal with this kind of st=

    >uff in
    >> > >> a long time, there are cobwebs on what little I know about it.

    >>
    >> > >Higher mode, not higher level. =A0Maybe I need to run the AST at a
    >> > >higher mode than the default mode?

    >>
    >> > Simple...

    >>
    >> > =A0 =A0 =A0 =A0 .PSECT =A0DATA,WRT,NOEXE,5
    >> > CTRL_C_AST:
    >> > =A0 =A0 =A0 =A0 .LONG =A0 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > =A0 =A0 =A0 =A0 ; 3 arguments
    >> > =A0 =A0 =A0 =A0 .ADDRESS your_ctrl_c_ast_routine =A0 =A0 =A0 =A0; DCLAS=

    >T$_ASTADR
    >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > =A0 =A0 =A0 =A0 ; DCLAST$_ASTPRM
    >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > =A0 =A0 =A0 =A0 ; DCLAST$_ACMODE
    >>
    >> > =A0 =A0 =A0 =A0 .PSECT =A0CODE,NOWRT,EXE,5
    >> > =A0 =A0 =A0 =A0 .ENTRY =A0some_name,0

    >>
    >> > =A0 =A0 =A0 =A0 $CMEXEC_S =A0 =A0 =A0 ROUTIN=3DSYS$DCLAST,-
    >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ARGLST=3DCTRL_C_AST

    >>
    >> > =A0 =A0 =A0 =A0 RET
    >> > =A0 =A0 =A0 =A0 .END =A0 =A0

    >>
    >> > This will queue the AST for execution in EXECUTIVE mode. =A0You will
    >> > need CMEXEC privilege to test this out. =A0If this works, you'll need
    >> > to implement a user written system service or install your program
    >> > with the CMEXEC privilege to allow this to function for the average
    >> > non-privileged user.

    >>
    >> > --
    >> > VAXman- A Bored Certified VMS Kernel Mode Hacker =A0 =A0 =A0VAXman(at)T=

    >MESIS(dot)COM
    >>
    >> > ... pejorative statements of opinion are entitled to constitutional pro=

    >tection
    >> > no matter how extreme, vituperous, or vigorously expressed they may be.=

    > (NJSC)
    >>
    >> > Copr. 2008 Brian Schenkenberger. =A0Publication of _this_ usenet articl=

    >e outside
    >> > of usenet _must_ include its contents in its entirety including this co=

    >pyright
    >> > notice, disclaimer and quotations.- Hide quoted text -

    >>
    >> > - Show quoted text -

    >>
    >> So, in what context do I execute this function? =A0Looks like it just
    >> queues the AST. =A0But, I need to specify the AST in the prevously
    >> referenced SYS$QIO so it will queue when the F6 is pressed.- Hide quoted =

    >text -
    >>
    >> - Show quoted text -

    >
    >What is "your_ctrl_c_ast_routine"?
    >
    >Is it the ast that is suppose to run when ctrl/c is hit? I don't see
    >how that would address the issue.
    >
    >However if I run the routine that executes the QIO in executive mode,
    >and I specify in the QIO call that the
    >AST is to be run in executive mode then that should work.
    >
    >That is, I need to run this (enanulirp) in executive mode:
    >
    > integer*4 function enanulirp ()
    > implicit none
    >
    >C ONE-LINE DESCRIPTION
    >
    >CT Enable null AST for CTRL/C (ENANULIRP)
    >
    >C FUNCTION (transformation on inputs to outputs)
    >
    >CF The ENANULIRP procedure disables the interrupt
    >CF caused by CTRL/C by replacing it with an AST that
    >CF does nothing except re-establish the AST.
    >
    >C DESIGN CONSIDERATIONS
    >
    >CD ENANULIRP is not 100% successful if CTRL/C or the F6 key is
    >CD held down, since the next interrupt may arrive before the
    >CD AST is re-established.
    >
    >CD ENANULIRP disables the CTRL/C that is delivered by the F6 key
    >CD when line editing is enabled for the terminal.
    >CD SMG$SET_OUT_OF_BAND_ASTS fails to do this.
    >
    >CD ENANULIRP does not interfere with SMG$SET_OUT_OF_BAND_ASTS;
    >any
    >CD CTRL/C defined by SMG$SET_OUT_OF_BAND_ASTS will still run.
    >
    >C************************************************* **********************
    >
    >C INCLUDE FILES
    >
    > INCLUDE '($SYSSRVNAM)' ! System
    >services
    > INCLUDE '($IODEF)' ! $QIO
    >function codes
    > include '($psldef)' !PSL symbolic names
    >C PARAMETER DECLARATIONS
    >
    >C ARGUMENT DECLARATIONS
    >
    >C VARIABLE DECLARATIONS
    >
    > integer*4 iosb(2) !I/O Status block
    > integer*2 chn !Channel
    > save chn
    > integer*4 sts !Completion status
    >
    >C SUBPROGRAM DECLARATIONS
    >
    >C EXTERNAL DECLARATIONS
    >
    > external nulirpast
    > external ss$_normal
    >
    >C PROGRAM LOGIC
    >
    >CL.le; Initialize the status variable.
    >
    > sts =3D %loc(ss$_normal)
    >
    >CL.le; Enable AST so that NULIRPAST is called when Ctrl/C is pressed.
    >
    > if (chn .eq. 0) then
    > sts =3D sys$assign ('tt:', chn,,,)
    > end if
    >
    > if (sts) then
    > sts =3D sys$qiow
    >(, ! (3)
    > 1 %val(chn),
    > 1 %val(IO$_SETMODE .or. IO$M_CTRLCAST),
    > 1 iosb,,,
    > 1 nulirpast,,%val(psl$c_exec),,,)
    > end if
    >
    >CL.le; Set the return status.
    >
    > enanulirp =3D sts
    >
    > return
    > end
    >
    >And that will cause nulirpast to be called:
    >
    > subroutine nulirpast ()
    > implicit none
    >
    >C INCLUDE FILES
    >
    >C PARAMETER DECLARATIONS
    >
    >C ARGUMENT DECLARATIONS
    >
    >C VARIABLE DECLARATIONS
    >
    > integer*4 sts !Completion status
    >
    >C SUBPROGRAM DECLARATIONS
    >
    > integer*4 enanulirp
    >
    >C EXTERNAL DECLARATIONS
    >
    > external ss$_normal
    >
    >C PROGRAM LOGIC
    >
    >CL.le; Initialize the status variable.
    >
    > sts =3D %loc(ss$_normal)
    >
    >CL.le; Re-establish the AST
    >
    > sts =3D enanulirp()
    > if (.not. sts) then
    > call lib$signal(%val(sts))
    > end if
    >
    > return
    > end



    OK. You can't pass PSL$C_EXEC as the AST mode and expect it to fire off
    in EXECUTIVE mode if you are calling the $QIO from USER mode. You need
    to invoke the $QIO from EXECUTIVE mode. The CTRL-C AST is a one-timer!
    You need to reenable it in the AST. You can, since your AST will be in
    EXECUTIVE mode, invoke the $QIO there to reenable the AST. I suspected
    that you ALREADY had this AST routine coded in this fashion and suggest-
    ed that you use the $DCLAST to invoke the AST the first time out.

    You also have NOT specified an event flag. Thus, you get the default of
    EFN=0. This can cause all sorts of strange issues for other bits of your
    code waiting on event flags. Include ($EFNDEF) and pass EFN$C_ENF in the
    $QIO (first arg) by %VAL.

    I'd answer sooner if I didn't have to read quoted-pukeable Fortran code.

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    .... pejorative statements of opinion are entitled to constitutional protection
    no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)

    Copr. 2008 Brian Schenkenberger. Publication of _this_ usenet article outside
    of usenet _must_ include its contents in its entirety including this copyright
    notice, disclaimer and quotations.

  18. Re: Disabling the F6 interrupt function

    On Oct 22, 2:03*pm, VAXman- @SendSpamHere.ORG wrote:
    > In article <829f6820-1ba5-4787-86d9-36a149df4...@d45g2000hsc.googlegroups..com>, tadamsmar writes:
    >
    >
    >
    >
    >
    > >On Oct 22, 10:42=A0am, tadamsmar wrote:
    > >> On Oct 22, 9:57=A0am, VAXman- =...@SendSpamHere.ORG wrote:

    >
    > >> > In article
    > >ps.com>, tadamsmar writes:

    >
    > >> > >On Oct 22, 8:28=3DA0am, tadamsmar wrote:
    > >> > >> On Oct 21, 4:58=3DA0pm, koeh...@eisner.nospam.encompasserve.org(Bob

    >
    > >> > >> Koehler) wrote:
    > >> > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googl=

    > >egrou=3D
    > >> > >ps.com>, tadamsmar writes:

    >
    > >> > >> > > This solution is useful but not 100% reliable. =3DA0Only one AST=

    > > is
    > >> > >> > > established and it has to run to re-establish another. =3DA0If y=

    > >ou jam =3D
    > >> > >the
    > >> > >> > > F6 key down then I find that the F6 key eventually wins the race=

    > > with
    > >> > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > >> > >> > =3DA0 =3DA0Can't the AST re-establish itself before exiting?

    >
    > >> > >> Yep, and mine does.

    >
    > >> > >> But the program would need to re-establish the AST before any other
    > >> > >> code was executed, like the code that delivers the next F6 key
    > >> > >> interrupt.

    >
    > >> > >> My theory is that next F6 key interrupt gets processed be for theAS=

    > >T
    > >> > >> is re-established. =3DA0 I guess I am assuming that an AST can be
    > >> > >> interrupted by the next F6 Key interrupt. =3DA0Is that impossible?

    >
    > >> > >> Perhaps the AST can be run at some kind of higher level to ensureit
    > >> > >> is not interrupted. =3DA0I have not had to deal with this kind of st=

    > >uff in
    > >> > >> a long time, there are cobwebs on what little I know about it.

    >
    > >> > >Higher mode, not higher level. =A0Maybe I need to run the AST at a
    > >> > >higher mode than the default mode?

    >
    > >> > Simple...

    >
    > >> > =A0 =A0 =A0 =A0 .PSECT =A0DATA,WRT,NOEXE,5
    > >> > CTRL_C_AST:
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; 3 arguments
    > >> > =A0 =A0 =A0 =A0 .ADDRESS your_ctrl_c_ast_routine =A0 =A0=A0 =A0; DCLAS=

    > >T$_ASTADR
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; DCLAST$_ASTPRM
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; DCLAST$_ACMODE

    >
    > >> > =A0 =A0 =A0 =A0 .PSECT =A0CODE,NOWRT,EXE,5
    > >> > =A0 =A0 =A0 =A0 .ENTRY =A0some_name,0

    >
    > >> > =A0 =A0 =A0 =A0 $CMEXEC_S =A0 =A0 =A0 ROUTIN=3DSYS$DCLAST,-
    > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ARGLST=3DCTRL_C_AST

    >
    > >> > =A0 =A0 =A0 =A0 RET
    > >> > =A0 =A0 =A0 =A0 .END =A0 =A0

    >
    > >> > This will queue the AST for execution in EXECUTIVE mode. =A0You will
    > >> > need CMEXEC privilege to test this out. =A0If this works, you'll need
    > >> > to implement a user written system service or install your program
    > >> > with the CMEXEC privilege to allow this to function for the average
    > >> > non-privileged user.

    >
    > >> > --
    > >> > VAXman- A Bored Certified VMS Kernel Mode Hacker =A0 =A0 =A0VAXman(at)T=

    > >MESIS(dot)COM

    >
    > >> > ... pejorative statements of opinion are entitled to constitutional pro=

    > >tection
    > >> > no matter how extreme, vituperous, or vigorously expressed they may be.=

    > > (NJSC)

    >
    > >> > Copr. 2008 Brian Schenkenberger. =A0Publication of _this_ usenet articl=

    > >e outside
    > >> > of usenet _must_ include its contents in its entirety including thisco=

    > >pyright
    > >> > notice, disclaimer and quotations.- Hide quoted text -

    >
    > >> > - Show quoted text -

    >
    > >> So, in what context do I execute this function? =A0Looks like it just
    > >> queues the AST. =A0But, I need to specify the AST in the prevously
    > >> referenced SYS$QIO so it will queue when the F6 is pressed.- Hide quoted =

    > >text -

    >
    > >> - Show quoted text -

    >
    > >What is "your_ctrl_c_ast_routine"?

    >
    > >Is it the ast that is suppose to run when ctrl/c is hit? *I don't see
    > >how that would address the issue.

    >
    > >However if I run the routine that executes the QIO in executive mode,
    > >and I specify in the QIO call that the
    > >AST is to be run in executive mode then that should work.

    >
    > >That is, I need to run this (enanulirp) in executive mode:

    >
    > > * * * *integer*4 function enanulirp ()
    > > * * * *implicit none

    >
    > >C * * * ONE-LINE DESCRIPTION

    >
    > >CT * * *Enable null AST for CTRL/C (ENANULIRP)

    >
    > >C * * * FUNCTION (transformation on inputs to outputs)

    >
    > >CF * * * The ENANULIRP procedure disables the interrupt
    > >CF * * *caused by CTRL/C by replacing it with an AST that
    > >CF * * *does nothing except re-establish the AST.

    >
    > >C * * * DESIGN CONSIDERATIONS

    >
    > >CD * * *ENANULIRP is not 100% successful if CTRL/C or the F6 key is
    > >CD * * *held down, since the next interrupt may arrive before the
    > >CD * * *AST is re-established.

    >
    > >CD * * *ENANULIRP disables the CTRL/C that is delivered by the F6 key
    > >CD * * *when line editing is enabled for the terminal.
    > >CD * * *SMG$SET_OUT_OF_BAND_ASTS fails to do this.

    >
    > >CD * * *ENANULIRP does not interfere with SMG$SET_OUT_OF_BAND_ASTS;
    > >any
    > >CD * * *CTRL/C defined by SMG$SET_OUT_OF_BAND_ASTS will still run.

    >
    > >C************************************************* **********************

    >
    > >C * * * INCLUDE FILES

    >
    > > * * * *INCLUDE '($SYSSRVNAM)' * * * * * * * * * * * * *! System
    > >services
    > > * * * *INCLUDE '($IODEF)' * * * * * * * * * * * * * * *! $QIO
    > >function codes
    > > * * * *include '($psldef)' * * * * * * * * * * !PSL symbolic names
    > >C * * * PARAMETER DECLARATIONS

    >
    > >C * * * ARGUMENT DECLARATIONS

    >
    > >C * * * VARIABLE DECLARATIONS

    >
    > > * * * *integer*4 * * * iosb(2) * * * * * * * * !I/O Status block
    > > * * * *integer*2 * * * chn * * * * * * * * * * !Channel
    > > * * * *save chn
    > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > >C * * * SUBPROGRAM DECLARATIONS

    >
    > >C * * * EXTERNAL DECLARATIONS

    >
    > > * * * *external * * * *nulirpast
    > > * * * *external * * * *ss$_normal

    >
    > >C * * * PROGRAM LOGIC

    >
    > >CL.le; *Initialize the status variable.

    >
    > > * * * *sts =3D %loc(ss$_normal)

    >
    > >CL.le; *Enable AST so that NULIRPAST is called when Ctrl/C is pressed.

    >
    > > * * * *if (chn .eq. 0) then
    > > * * * * sts =3D sys$assign ('tt:', chn,,,)
    > > * * * *end if

    >
    > > * * * *if (sts) then
    > > * * * * sts =3D sys$qiow
    > >(, * * * * * * * * * * * * * * * * * * * * * * *! * * * *(3)
    > > * * * *1 * * * * * * * * * * * %val(chn),
    > > * * * *1 * * * * * * * * * * * %val(IO$_SETMODE .or. IO$M_CTRLCAST),
    > > * * * *1 * * * * * * * * * * * iosb,,,
    > > * * * *1 * * * * * * * * * * * nulirpast,,%val(psl$c_exec),,,)
    > > * * * *end if

    >
    > >CL.le; *Set the return status.

    >
    > > * * * *enanulirp =3D sts

    >
    > > * * * *return
    > > * * * *end

    >
    > >And that will cause nulirpast to be called:

    >
    > > * * * *subroutine nulirpast ()
    > > * * * *implicit none

    >
    > >C * * * INCLUDE FILES

    >
    > >C * * * PARAMETER DECLARATIONS

    >
    > >C * * * ARGUMENT DECLARATIONS

    >
    > >C * * * VARIABLE DECLARATIONS

    >
    > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > >C * * * SUBPROGRAM DECLARATIONS

    >
    > > * * * *integer*4 enanulirp

    >
    > >C * * * EXTERNAL DECLARATIONS

    >
    > > * * * *external * * * *ss$_normal

    >
    > >C * * * PROGRAM LOGIC

    >
    > >CL.le; *Initialize the status variable.

    >
    > > * * * *sts =3D %loc(ss$_normal)

    >
    > >CL.le; *Re-establish the AST

    >
    > > * * * *sts =3D enanulirp()
    > > * * * *if (.not. sts) then
    > > * * * * *call lib$signal(%val(sts))
    > > * * * *end if

    >
    > > * * * *return
    > > * * * *end

    >
    > OK. *You can't pass PSL$C_EXEC as the AST mode and expect it to fire off
    > in EXECUTIVE mode if you are calling the $QIO from USER mode. *You need
    > to invoke the $QIO from EXECUTIVE mode. *The CTRL-C AST is a one-timer!
    > You need to reenable it in the AST. *You can, since your AST will be in
    > EXECUTIVE mode, invoke the $QIO there to reenable the AST. *I suspected
    > that you ALREADY had this AST routine coded in this fashion and suggest-
    > ed that you use the $DCLAST to invoke the AST the first time out.
    >
    > You also have NOT specified an event flag. *Thus, you get the default of
    > EFN=0. *This can cause all sorts of strange issues for other bits of your
    > code waiting on event flags. *Include ($EFNDEF) and pass EFN$C_ENF in the
    > $QIO (first arg) by %VAL.
    >
    > I'd answer sooner if I didn't have to read quoted-pukeable Fortran code.
    >
    > --
    > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM
    >
    > ... pejorative statements of opinion are entitled to constitutional protection
    > no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)
    >
    > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > of usenet _must_ include its contents in its entirety including this copyright
    > notice, disclaimer and quotations.- Hide quoted text -
    >
    > - Show quoted text -


    That solution does not work, unless I made some kind of mistake. You
    can run the following test program and hold down the F6 key (when in
    Line Editing mode and the interrupts still gets through.

    After initialization, the program always runs in exec mode, but the
    interrupt still gets through if you hold down the F6 key.

    I did not specify exec mode in the qiow call, but I figure the ast
    runs at the mode of the caller of the qiow.

    Here are two test routines that can be compiled and linked into the
    test program:

    (1) SOME_NAME.MAR:


    .PSECT DATA,WRT,NOEXE,5
    CTRL_C_AST:
    .LONG 3 ; 3 arguments
    .ADDRESS ENABLE_AST ; DCLAST$_ASTADR
    .LONG 0 ; DCLAST$_ASTPRM
    .LONG 0 ; DCLAST$_ACMODE


    .PSECT CODE,NOWRT,EXE,5
    .ENTRY some_name,0


    $CMEXEC_S ROUTIN=SYS$DCLAST,-
    ARGLST=CTRL_C_AST


    RET
    .END


    (2) CTRLC.FOR: The example from the VMS documentation modified to call
    SOME_NAME instead of ENABLE_AST. And, I put in the EFN you specified:

    ! Sample program to show enabling of an AST in Fortran
    !
    ! The program uses a Ctrl/C AST to interrupt a work loop in the
    ! main program.
    !
    PROGRAM CTRLC
    IMPLICIT NONE

    LOGICAL CTRLC_FLAG ! Set to TRUE
    when Ctrl/C is pressed
    INTEGER*2 CHANNEL ! Channel for terminal
    COMMON /AST_COM/ CTRLC_FLAG,CHANNEL
    VOLATILE CTRLC_FLAG ! Required because
    variable (1)
    !
    can change at any time
    INTEGER ITERATIONS,I

    ! Do first-time initialization

    CHANNEL = 0
    CTRLC_FLAG = .FALSE.
    !CALL ENABLE_AST
    CALL SOME_NAME

    ! Read iteration count

    100 WRITE (*,'($,A)') ' Enter iteration count (0 to exit): '
    READ (*,*) ITERATIONS
    DO I=1,ITERATIONS
    IF (CTRLC_FLAG) GOTO 200 ! Was Ctrl/C pressed?
    WRITE (*,*) 'Count is ',I
    CALL LIB$WAIT (2.0) ! Pause 2 seconds
    END DO
    IF (ITERATIONS .EQ. 0) GOTO 999
    GOTO 100 ! Loop back

    200 WRITE (*,*) 'Ctrl/C pressed'
    CTRLC_FLAG = .FALSE.
    GOTO 100

    999 END

    ! Subroutine ENABLE_AST

    SUBROUTINE
    ENABLE_AST !
    (2)
    IMPLICIT NONE

    INCLUDE '($EFNDEF)'
    INCLUDE '($SYSSRVNAM)' ! System services
    INCLUDE '($IODEF)' ! $QIO
    function codes

    LOGICAL CTRLC_FLAG
    VOLATILE
    CTRLC_FLAG !
    (1)
    INTEGER*2 CHANNEL
    COMMON /AST_COM/ CTRLC_FLAG,CHANNEL

    EXTERNAL AST_ROUTINE

    INTEGER ASSIGN_STATUS, QIO_STATUS, IOSB(2)

    ! Assign channel if not already assigned

    IF (CHANNEL .EQ. 0) THEN
    ASSIGN_STATUS = SYS$ASSIGN ('TT:', CHANNEL,,,)
    IF (.NOT. ASSIGN_STATUS) CALL LIB$SIGNAL(%VAL(ASSIGN_STATUS))
    END IF

    ! Enable AST so that AST_ROUTINE is called when Ctrl/C is pressed.


    QIO_STATUS = SYS$QIOW (%VAL(EFN
    $C_ENF), ! (3)
    1 %VAL(CHANNEL),
    1 %VAL(IO$_SETMODE .OR. IO$M_CTRLCAST),
    1 IOSB,,,
    1 AST_ROUTINE,,,,,)

    IF (.NOT. QIO_STATUS) CALL LIB$SIGNAL(%VAL(QIO_STATUS))

    RETURN
    END

    ! Subroutine AST_ROUTINE

    SUBROUTINE
    AST_ROUTINE !
    (4)
    IMPLICIT NONE

    LOGICAL CTRLC_FLAG
    VOLATILE
    CTRLC_FLAG !
    (1)
    INTEGER*2 CHANNEL
    COMMON /AST_COM/ CTRLC_FLAG,CHANNEL

    ! Indicate that a CTRL/C has been pressed

    CTRLC_FLAG = .TRUE.

    ! Reenable the AST. This must be done by calling ENABLE_AST rather
    than
    ! doing it here as we would need a recursive reference to
    AST_ROUTINE,
    ! which is disallowed unless /RECURSIVE is used.

    CALL
    ENABLE_AST !
    (5)

    RETURN
    END


  19. Re: Disabling the F6 interrupt function

    On Oct 22, 3:21*pm, tadamsmar wrote:
    > On Oct 22, 2:03*pm, VAXman- *@SendSpamHere.ORG wrote:
    >
    >
    >
    >
    >
    > > In article <829f6820-1ba5-4787-86d9-36a149df4...@d45g2000hsc.googlegroups.com>, tadamsmar writes:

    >
    > > >On Oct 22, 10:42=A0am, tadamsmar wrote:
    > > >> On Oct 22, 9:57=A0am, VAXman- =...@SendSpamHere.ORG wrote:

    >
    > > >> > In article > > >ps.com>, tadamsmar writes:

    >
    > > >> > >On Oct 22, 8:28=3DA0am, tadamsmar wrote:
    > > >> > >> On Oct 21, 4:58=3DA0pm, koeh...@eisner.nospam.encompasserve.org (Bob

    >
    > > >> > >> Koehler) wrote:
    > > >> > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googl=
    > > >egrou=3D
    > > >> > >ps.com>, tadamsmar writes:

    >
    > > >> > >> > > This solution is useful but not 100% reliable. =3DA0Only one AST=
    > > > is
    > > >> > >> > > established and it has to run to re-establish another. =3DA0If y=
    > > >ou jam =3D
    > > >> > >the
    > > >> > >> > > F6 key down then I find that the F6 key eventually wins therace=
    > > > with
    > > >> > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > > >> > >> > =3DA0 =3DA0Can't the AST re-establish itself before exiting?

    >
    > > >> > >> Yep, and mine does.

    >
    > > >> > >> But the program would need to re-establish the AST before any other
    > > >> > >> code was executed, like the code that delivers the next F6 key
    > > >> > >> interrupt.

    >
    > > >> > >> My theory is that next F6 key interrupt gets processed be for the AS=
    > > >T
    > > >> > >> is re-established. =3DA0 I guess I am assuming that an AST can be
    > > >> > >> interrupted by the next F6 Key interrupt. =3DA0Is that impossible?

    >
    > > >> > >> Perhaps the AST can be run at some kind of higher level to ensure it
    > > >> > >> is not interrupted. =3DA0I have not had to deal with this kind of st=
    > > >uff in
    > > >> > >> a long time, there are cobwebs on what little I know about it.

    >
    > > >> > >Higher mode, not higher level. =A0Maybe I need to run the AST at a
    > > >> > >higher mode than the default mode?

    >
    > > >> > Simple...

    >
    > > >> > =A0 =A0 =A0 =A0 .PSECT =A0DATA,WRT,NOEXE,5
    > > >> > CTRL_C_AST:
    > > >> > =A0 =A0 =A0 =A0 .LONG =A0 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
    > > > =A0 =A0 =A0 =A0 ; 3 arguments
    > > >> > =A0 =A0 =A0 =A0 .ADDRESS your_ctrl_c_ast_routine =A0 =A0 =A0 =A0; DCLAS=
    > > >T$_ASTADR
    > > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
    > > > =A0 =A0 =A0 =A0 ; DCLAST$_ASTPRM
    > > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
    > > > =A0 =A0 =A0 =A0 ; DCLAST$_ACMODE

    >
    > > >> > =A0 =A0 =A0 =A0 .PSECT =A0CODE,NOWRT,EXE,5
    > > >> > =A0 =A0 =A0 =A0 .ENTRY =A0some_name,0

    >
    > > >> > =A0 =A0 =A0 =A0 $CMEXEC_S =A0 =A0 =A0 ROUTIN=3DSYS$DCLAST,-
    > > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ARGLST=3DCTRL_C_AST

    >
    > > >> > =A0 =A0 =A0 =A0 RET
    > > >> > =A0 =A0 =A0 =A0 .END =A0 =A0

    >
    > > >> > This will queue the AST for execution in EXECUTIVE mode. =A0You will
    > > >> > need CMEXEC privilege to test this out. =A0If this works, you'llneed
    > > >> > to implement a user written system service or install your program
    > > >> > with the CMEXEC privilege to allow this to function for the average
    > > >> > non-privileged user.

    >
    > > >> > --
    > > >> > VAXman- A Bored Certified VMS Kernel Mode Hacker =A0 =A0 =A0VAXman(at)T=
    > > >MESIS(dot)COM

    >
    > > >> > ... pejorative statements of opinion are entitled to constitutional pro=
    > > >tection
    > > >> > no matter how extreme, vituperous, or vigorously expressed they may be.=
    > > > (NJSC)

    >
    > > >> > Copr. 2008 Brian Schenkenberger. =A0Publication of _this_ usenetarticl=
    > > >e outside
    > > >> > of usenet _must_ include its contents in its entirety including this co=
    > > >pyright
    > > >> > notice, disclaimer and quotations.- Hide quoted text -

    >
    > > >> > - Show quoted text -

    >
    > > >> So, in what context do I execute this function? =A0Looks like it just
    > > >> queues the AST. =A0But, I need to specify the AST in the prevously
    > > >> referenced SYS$QIO so it will queue when the F6 is pressed.- Hide quoted =
    > > >text -

    >
    > > >> - Show quoted text -

    >
    > > >What is "your_ctrl_c_ast_routine"?

    >
    > > >Is it the ast that is suppose to run when ctrl/c is hit? *I don't see
    > > >how that would address the issue.

    >
    > > >However if I run the routine that executes the QIO in executive mode,
    > > >and I specify in the QIO call that the
    > > >AST is to be run in executive mode then that should work.

    >
    > > >That is, I need to run this (enanulirp) in executive mode:

    >
    > > > * * * *integer*4 function enanulirp ()
    > > > * * * *implicit none

    >
    > > >C * * * ONE-LINE DESCRIPTION

    >
    > > >CT * * *Enable null AST for CTRL/C (ENANULIRP)

    >
    > > >C * * * FUNCTION (transformation on inputs to outputs)

    >
    > > >CF * * * The ENANULIRP procedure disables the interrupt
    > > >CF * * *caused by CTRL/C by replacing it with an AST that
    > > >CF * * *does nothing except re-establish the AST.

    >
    > > >C * * * DESIGN CONSIDERATIONS

    >
    > > >CD * * *ENANULIRP is not 100% successful if CTRL/C or the F6 keyis
    > > >CD * * *held down, since the next interrupt may arrive before the
    > > >CD * * *AST is re-established.

    >
    > > >CD * * *ENANULIRP disables the CTRL/C that is delivered by the F6 key
    > > >CD * * *when line editing is enabled for the terminal.
    > > >CD * * *SMG$SET_OUT_OF_BAND_ASTS fails to do this.

    >
    > > >CD * * *ENANULIRP does not interfere with SMG$SET_OUT_OF_BAND_ASTS;
    > > >any
    > > >CD * * *CTRL/C defined by SMG$SET_OUT_OF_BAND_ASTS will still run.

    >
    > > >C************************************************* **********************

    >
    > > >C * * * INCLUDE FILES

    >
    > > > * * * *INCLUDE '($SYSSRVNAM)' * * * * * * * ** * * * *! System
    > > >services
    > > > * * * *INCLUDE '($IODEF)' * * * * * * * * ** * * * * *! $QIO
    > > >function codes
    > > > * * * *include '($psldef)' * * * * * * * * * * !PSL symbolic names
    > > >C * * * PARAMETER DECLARATIONS

    >
    > > >C * * * ARGUMENT DECLARATIONS

    >
    > > >C * * * VARIABLE DECLARATIONS

    >
    > > > * * * *integer*4 * * * iosb(2) * * * * * * * * !I/O Status block
    > > > * * * *integer*2 * * * chn * * * * * * * * * * !Channel
    > > > * * * *save chn
    > > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > > >C * * * SUBPROGRAM DECLARATIONS

    >
    > > >C * * * EXTERNAL DECLARATIONS

    >
    > > > * * * *external * * * *nulirpast
    > > > * * * *external * * * *ss$_normal

    >
    > > >C * * * PROGRAM LOGIC

    >
    > > >CL.le; *Initialize the status variable.

    >
    > > > * * * *sts =3D %loc(ss$_normal)

    >
    > > >CL.le; *Enable AST so that NULIRPAST is called when Ctrl/C is pressed.

    >
    > > > * * * *if (chn .eq. 0) then
    > > > * * * * sts =3D sys$assign ('tt:', chn,,,)
    > > > * * * *end if

    >
    > > > * * * *if (sts) then
    > > > * * * * sts =3D sys$qiow
    > > >(, * * * * * * * * * * * * * * * * ** * * * * *! * * * *(3)
    > > > * * * *1 * * * * * * * * * * * %val(chn),
    > > > * * * *1 * * * * * * * * * * * %val(IO$_SETMODE .or. IO$M_CTRLCAST),
    > > > * * * *1 * * * * * * * * * * * iosb,,,
    > > > * * * *1 * * * * * * * * * * * nulirpast,,%val(psl$c_exec),,,)
    > > > * * * *end if

    >
    > > >CL.le; *Set the return status.

    >
    > > > * * * *enanulirp =3D sts

    >
    > > > * * * *return
    > > > * * * *end

    >
    > > >And that will cause nulirpast to be called:

    >
    > > > * * * *subroutine nulirpast ()
    > > > * * * *implicit none

    >
    > > >C * * * INCLUDE FILES

    >
    > > >C * * * PARAMETER DECLARATIONS

    >
    > > >C * * * ARGUMENT DECLARATIONS

    >
    > > >C * * * VARIABLE DECLARATIONS

    >
    > > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > > >C * * * SUBPROGRAM DECLARATIONS

    >
    > > > * * * *integer*4 enanulirp

    >
    > > >C * * * EXTERNAL DECLARATIONS

    >
    > > > * * * *external * * * *ss$_normal

    >
    > > >C * * * PROGRAM LOGIC

    >
    > > >CL.le; *Initialize the status variable.

    >
    > > > * * * *sts =3D %loc(ss$_normal)

    >
    > > >CL.le; *Re-establish the AST

    >
    > > > * * * *sts =3D enanulirp()
    > > > * * * *if (.not. sts) then
    > > > * * * * *call lib$signal(%val(sts))
    > > > * * * *end if

    >
    > > > * * * *return
    > > > * * * *end

    >
    > > OK. *You can't pass PSL$C_EXEC as the AST mode and expect it to fire off
    > > in EXECUTIVE mode if you are calling the $QIO from USER mode. *You need
    > > to invoke the $QIO from EXECUTIVE mode. *The CTRL-C AST is a one-timer!
    > > You need to reenable it in the AST. *You can, since your AST will be in
    > > EXECUTIVE mode, invoke the $QIO there to reenable the AST. *I suspected
    > > that you ALREADY had this AST routine coded in this fashion and suggest-
    > > ed that you use the $DCLAST to invoke the AST the first time out.

    >
    > > You also have NOT specified an event flag. *Thus, you get the defaultof
    > > EFN=0. *This can cause all sorts of strange issues for other bits of your
    > > code waiting on event flags. *Include ($EFNDEF) and pass EFN$C_ENF inthe
    > > $QIO (first arg) by %VAL.

    >
    > > I'd answer sooner if I didn't have to read quoted-pukeable Fortran code..

    >
    > > --
    > > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM

    >
    > > ... pejorative statements of opinion are entitled to constitutional protection
    > > no matter how extreme, vituperous, or vigorously expressed they may be.(NJSC)

    >
    > > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > > of usenet _must_ include its contents in its entirety including this copyright
    > > notice, disclaimer and quotations.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > That solution does not work, unless I made some kind of mistake. *You
    > can run the following test program and hold down the F6 key (when in
    > Line Editing mode and the interrupts still gets through.
    >


    Actually it probably does work (run the AST in exec mode as you
    intended), but it does not completely defeat Darth F6 Key.

    Looks like turning off Line Editing may be the only way to completely
    avoid these interrupts.

  20. Re: Disabling the F6 interrupt function

    In article <73922e83-f9f3-4749-8eff-0677e1337d8c@m36g2000hse.googlegroups.com>, tadamsmar writes:
    >
    > My theory is that next F6 key interrupt gets processed be for the AST
    > is re-established. I guess I am assuming that an AST can be
    > interrupted by the next F6 Key interrupt. Is that impossible?


    If the AST re-establishes itself, that prevents any main thread code
    from running before the interrupt is passed on to the program.

    But it doesn't prevent the device driver from processing the
    interrupt. Perhaps the AST needs to be set up as an attention AST
    so the driver will know to fire it.

    I've only dealt with this issue in custom drivers that weren't for
    terminals. And, of course, I could code those drivers to always do
    what I wanted.