BPX4TGS (tcgetsid) example

The following code retrieves the process group ID of the session for which the terminal specified by file descriptor is the controlling terminal. For the callable service, see tcgetsid (BPX1TGS, BPX4TGS) — Get a process group ID for the session leader for the controlling terminal. AMODE 31 callers use BPX1TGS (tcgetsid) example.
                                              
         CALL  BPX4TGS,              Get session process group ID      +
               (=A(STDIN_FILENO),    Input: File descriptor            +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------