How to properly end a C program using stdio with F3

Patrik Schindler <[email protected]> Wed, 29 Jan 2020 19:37:33 +0100
Newsgroups gmane.comp.lang.as400.c
Message-ID <[email protected]>
Hello,

I have ported a self-written C program to my AS/400 (yes, AS/400, 9401-150, running V4R5). The program is looping over recvfrom() to receive data from an UDP socket. If data is received, the program outputs parsed data via printf() to stdout for debugging purposes. In practice, the number of packets received is less than five per second. Runs fine, does stuff like expected. So far so good.

I can't end this program with F3 in the "fake terminal". The keyboard gets locked (like the AS/400 does when it's busy) and thus doesn't accept any keys. Even pressing reset and immediately F3 yields no program ending: The keyboard gets locked again.

I read the two Unix porting guides:
- UNIX C Applications Porting to AS/400 Companion Guide.pdf
- UNIX C Applications Porting to AS/400.pdf

But I haven't found any mentioning how to handle a similar situation. I also browsed through the ILE C/C++ Programmer's Guide.pdf, with also no helpful findings.

May I kindly ask for advice? Thanks!

:wq! PoC

PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc

-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/c400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/c400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com