BPX4TGP (tcgetpgrp) example

The following code gets the foreground process group ID associated with the controlling terminal. For this example to work, STDIN must be associated with the controlling terminal. For the callable service, see tcgetpgrp (BPX1TGP, BPX4TGP) — Get the foreground process group ID. AMODE 31 callers use BPX1TGP (tcgetpgrp) example.
                                              
         CALL  BPX4TGP,              Get the foreground process grp ID +
               (=A(STDIN_FILENO),    Input: File descriptor            +
               RETVAL,               Return value -1, fgrd proc grp ID +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------