RE: Job control (Ctrl-Z and forground) with inf.4gl on unix
Posted in 1998
---------- From: Kaare Krakhella[SMTP:krakhell@online.no] Sent: Wednesday, January 28, 1998 3:20 AM To: Leffler, Jonathan; Matthews, Paul Subject: Job control (Ctrl-Z and forground) with inf.4gl on unix We have a customer that started to use job control with an informix 4gl application. The problem is that this does not work on all unix systems, espesially not on their new aix. We have contacted Informix Scandinavia and they say that it should not work at all. Our customer is not satishfied with that. It seems to me that setting signals SIGTSTP and SIGCONT to SIG_DFL will solve the problem partly. If we switch SIGTSTP between SIG_IGN and SIG_DFL it might work even better. Then ve would restet the tty-settings whitch seems to be done with a 'display "', and give the user a message in the situations where SIGTSTP is ignored. We would rather not call 4gl from c as we support 4gl V4. Thanks for any tips. JL: Which version 4 of I4GL? From about 4.14 onwards, I4GL should support job control. JL: I'd not want to guarantee that it works on every platform, but it should. If you are using JL: 4.10 or 4.11, then it won't work properly. If you are using 4.12 or 4.13, it's time to upgrade JL: and I don't recall exactly when the job control fixes went into the product. As you indicate, JL: the hard part is ensuring that the terminal settings are handled properly; the fixed versions JL do that automatically. There isn't any inherent reason why calling I4GL from C won't work JL: with the 4.x product. You would have to be careful to ensure that you wrote the main() JL: analogous to the code produced by the compilation of: MAIN DEFER INTERRUPT DEFER QUIT CALL main_program() EXIT PROGRAM 0 END MAIN JL: Your current MAIN would be repackaged as FUNCTION main_program(), minus the JL: DEFER statements (which are only allowed in MAIN. You'd also arrange to set up your JL: SIGTSTP and SIGCONT signal handlers, and the setup code would probably save the tty JL: state and the handlers would resave and restore the tty state appropriately. It's more messy JL: than difficult - except when you're writing 100% portable code. Yours, Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>