BPX1TGS (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 64 callers use BPX4TGS (tcgetsid) example.
                                              
         CALL  BPX1TGS,              Get session process group ID      +
               (=A(STDIN_FILENO),    Input: File descriptor            +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------