Reentrant return linkage

                                              
         XGR   R15,R15               Zero return code                   
         L     R0,@SIZEDAT           Size this program's getmain area   
         LGR   R1,R13                R1 -> this program's getmain area  
         LG    R13,@BACK             R2 -> caller's save area           
         DROP  R13                                                      
         FREEMAIN RU,LV=(0),A=(1)                                       
         LG    R14,8(,R13)           Restore caller's R14               
         LMG   R0,R12,16(R13)        Restore caller's R0-R12            
         BR    R14                   Branch back to caller              
                                              
         SPACE ,  * * * * * * * * * *.* Program constants * * * * * *   
@SIZEDAT DC    A(@ENDSTOR-@STORE)    Size of this getmain storage       
MNTEL    DC    A(MNTE#LENGTH+MNTEH#LENGTH)                              
*                                    Length of MNTEH and 1 MNTE area    
PGPSL    DC    A(PGPS#LENGTH)        Length of PGPS structure           
RMONL    DC    A(RMON#LENGTH)        Length of RMON structure           
SSTFL    DC    A(SSTF#LENGTH)        Length of SSTF structure           
STATL    DC    A(STAT#LENGTH)        Length of STAT structure           
UTSNL    DC    A(UTSN#LENGTH)        Length of UTSN structure           
         SPACE ,                                                        
PRIMARYALET  DC   A(0)               Primary ALET                       
                                              
* * * * * * * * * * * * * * * * * * *.* Program getmain variables * * * 
              DS    0D                                                  
ACPSOCK       DS    F                Accepted socket descriptor         
ADDR_INFO_PTR DS    F                ->Addr_Info Structure              
APPLENV       DS    CL8              Application Environment            
APPLDATALEN   DS    F                Application Data Length            
APPLDATAPTR   DS    A                -> Application Data                
ARGCNT        DS    F                Argument count                     
ARGLLST       DS    3AD              Argument lengths list              
ARGSLST       DS    3AD              Arguments list                     
ATTRIBUTES    DS    F                Attributes                         
ATTADDR       DS    AD               Shared memory attached address     
BUFA          DS    FD               ->buffer                           
BUFB          DS    FD               ->buffer                           
BUFFR         DS    F                                                   
BUFCNTB       DS    F                Count associated with BUFFERB      
BUFFERA       DS    CL1024           Utility buffer A, length 1024      
BUFFERB       DS    CL1024           Utility buffer B, length 1024      
BUFLENA       DS    F                Number of bytes used in buffer A   
BUFLENB       DS    F                Number of bytes used in buffer B   
BUFW          DS    F                Number of words used in BUF        
BYTERECD      DS    F                Bytes Received                     
CANONICAL_LENGTH DS F                Canonical name length              
CELLUUID      DS    CL36             Cell UUID (string form)            
CLASSIFYLEN   DS    F                Classify Area Length               
CLASSIFYAREAPTR DS  A                -> Classify Area                   
CLSLEN        DS    F                Class name length                  
CLS           DS    CL8              Class name                         
COMMAND       DS    F                User defined command               
CONMSGTYPE    DS    F                Console msg type (modify or stop)  
DIRECTDES     DS    F                Directory descriptor               
ECB01         DS    F                Event Control Block # 1            
ECB02         DS    F                Event Control Block # 2            
EGID          DS    F                User ID                            
ENT           DS    CL40             Entity name                        
ENTLEN        DS    F                Entity name length                 
ENTRYPT       DS    FD               Entry Point                        
ENVCNT        DS    F                Number of environment variables    
ENVLENS       DS    FD               Length of environment variables    
ENVPARMS      DS    FD               Environment variables              
EPADDR        DS    AD               Entry point address                
EUID          DS    F                User ID                            
EVENTLIST     DS    A                Event list for thread posting      
EXITRTNA      DS    AD               Exit routine address               
EXITPLA       DS    AD               Exit Parm list address             
FDCNT         DS    F                File descriptor count              
FDLST         DS    F                File descriptor list               
FDLISTPTR     DS    A                -> File Descriptor List            
FILEDESC      DS    F                File descriptor                    
FILEDES2      DS    F                File descriptor                    
FLAGS         DS    F                Utility Flags word                 
FSNAME        DS    CL44             File system name                   
FSTYPE        DS    CL8              File system type                   
GRNAMELN      DS    F                Group name length                  
GROUP         DS    F                Group                              
GROUPCNT      DS    F                Group count                        
GROUPID       DS    F                Group ID (PID of group leader)     
GRPGMNAME     DS    CL8              Group program name                 
HINTS_PTR     DS    FD               ->Addr_Info Structure              
HOST_BUFFER   DS    CL255            Host buffer (up to 255 Characters) 
HOST_BUFFER_LENGTH DS F              Host buffer length                 
IDENT         DS    CL8              Identity of new thread security    
INARG         DS    F                Input argument                     
INARGLIST     DS    A                Input arglist                      
INARGLISTPTR  DS    AD               Input arglist ptr                  
INCR          DS    F                Increment value for nice           
INTMASK       DS    XL8              Signal mask                        
INITADDR  DS   FD                    Address __map_init parm list       
INITPARM  DS   0C                    __map_init parm list               
          ORG  *+_MMG_INIT_PARM_LEN                                     
INITRTNA      DS    AD               ->Initialization routine           
INTRSTATE     DS    A                Interrupt state                    
INTRTYPE      DS    A                Interrupt type                     
ITIMA         DS    AD               ->BPXYITIM structure               
KEY           DS    F                Interprocess Communication KEY     
LIBPTHLN      DS    F                Library Path Length (BPX4LOD)      
LIBPATH       DS    CL100            Library Path (BPX4LOD)             
LOCKADDR      DS    AD               ->Lockword                         
LOCKTOKENADDR DS    AD               ->LockToken                        
LOCKATTRADDR  DS    AD               ->LockAttr                         
LOCKWORD      DS    F                Lockword (BPX4SLK)                 
LSOCKADR      DS    F                Local socket structure             
LTOKEN        DS    CL8              Local token                        
MAP_ADDRESS   DS    AD               ->mapped area                      
MAP_LENGTH    DS    FD               length of mapped area              
MASTER_FD     DS    F                Master file descriptor             
MSG_ID        DS    F                IPC Message Queue ID               
MSGATTRLEN    DS    F                Length of BPX4CCA                  
MSGATTR       DS    CL100            Storage for BPX4CCA                
MODSTRINGPTR  DS    F                Address of user msg buffer         
MODIFYSTGLEN  DS    F                Length of user msg buffer          
NANOSECONDS   DS    F                Count of nanoseconds               
NCATCHER      DS    A                New catcher                        
NEWFLAGS      DS    F                New flags                          
NEWHANDL      DS    FD               New Handler                        
NEWLEN        DS    XL8              Length file                        
NEWMASK       DS    XL8              New mask for signals               
NEWMASKA      DS    A                ->New mask                         
NEWPASS       DS    CL8              Password                           
NEWPASSLEN    DS    F                Password length                    
NEWTIMES      DS    DL2              New access/modification time       
NODE_NAME     DS    CL255            Node Name (up to 255 Characters)   
NODE_NAME_LENGTH DS F                Node Name Length                   
NUMB_SEMS     DS    F                IPC Number of semaphores in set    
NUMB_SEM_OPS  DS    F                IPC Number of semaphore ops        
OCATCHER      DS    A                Old catcher                        
OFFSET        DS    CL8              File offset                        
OLDHANDL      DS    FD               Old handler                        
OLDFLAGS      DS    F                Old flags                          
OLDMASK       DS    CL8              Old signal mask                    
OLDMASKA      DS    A                ->Old mask                         
OLDPASS       DS    CL8              Password                           
OLDPASSLEN    DS    F                Password length                    
OPTIONS       DS    F                Options                            
PARALLELEU    DS    F                Parallel Eu                        
PASSWORD      DS    CL8              Password                           
PGMNAME       DS    CL8              Program name                       
PGMNAMEL      DS    F                Length PGMNAME                     
PLIST         DS    13A              Max number of parms                
PRINUUID      DS    CL36             Principal UUID (string form)       
PRIORITY      DS    F                Priority value                     
PROCID        DS    F                Process ID                         
PROCTOK       DS    F                Relative process number            
PT_NEWA       DS    AD               Address of PT_NEW                  
PT_OLD        DS    CL66             Pthread tag - old                  
PT_OLDA       DS    AD               Address of PT_OLD                  
PT_OLDL       DS    F                Length of tag in PT_NEW            
READFD        DS    F                File descriptor - input file       
REFPT         DS    F                File reference point               
RESOURCE      DS    F                Resource                           
RESULTS_PTR   DS    FD               ->Addr_Info Structure              
RETCODE       DS    F                Return code (ERRNO)                
RETURNEDADDRESS DS  AD               Returned address in doubleword     
RETVAL        DS    F                Return value (0, -1 or other)      
RETVAL64      DS    FD               64-bit return value                
RGID          DS    F                User ID                            
RSOCKADR      DS    F                Remote socket structure            
RUID          DS    F                User ID                            
RUSAGEA       DS    AD               ->Rusage                           
RSNCODE       DS    F                Reason code (ERRNOJR)              
SECONDS       DS    F                Time in seconds                    
SEGADDR       DS    AD               IPC Shared Memory segment Addr     
SELLIST       DS    F                List to use for select calls       
SEM_ID        DS    F                IPC Semaphore set ID               
SEM_NUMBER    DS    F                IPC Semaphore number               
SERVICE_BUFFER DS   CL32             Service Buffer ( to 32 Characters) 
SERVICE_BUFFER_LENGTH DS F           Service buffer length              
SERVICE_NAME  DS    CL32             Service Name (up to 32 Characters) 
SERVICE_NAME_LENGTH DS F             Service Name Length                
SHM_ID        DS    F                IPC Shared Memory segment ID       
SIGNAL        DS    A                Signal                             
SIGNALREG     DS    AD               Signal registration, user data     
SIGNALOPTIONS DS    A                Signal options                     
SIGPID        DS    F                Signal processs id for BPX4PAF     
SIGRET        DS    CL8              Signal return mask                 
SIRTNA        DS    AD               Signal interrupt routine           
SMF_TYPE      DS    F                SMF record type                    
SMF_SUBTYPE   DS    F                SMF record subtype                 
SOCKADDR_LENGTH DS  F                Lenght of SockAddr                 
SOCKETS       DS    0XL8             Socket vector for socket call      
SOCKDESC      DS    F                Socket descriptor                  
SOCKDES2      DS    F                Second Socket descriptor           
SRVCADDR      DS    FD               Address __map_service parm list    
SRVCPARM      DS    0C               __map_service parm list            
              ORG   *+3*_MMG_SERVICE_PARM_LEN Room for three entries    
STATFLD       DS    AD               Status field                       
STATUS        DS    F                Status                             
STATUSA       DS    A                ->STATUS                           
SUBSYSTYPE    DS    CL4              Subsystem Type                     
SUBSYSNAME    DS    CL8              Subsystem Name                     
TARPID        DS    F                Target processs id for BPX4PAF     
              ORG   BUFFERB          remap utility buffer B             
TBLSOURCE     DS    XL256            Source conversion table            
TBLTARGET     DS    XL256            Target conversion table            
              ORG                                                       
TERMMASK      DS    XL8              Signal termination mask            
THID          DS    XL8              Thread ID                          
TOKEN         DS    F                Relative IPC member or Misc Token  
TRXCLASS      DS    CL8              Transaction Class                  
USERID        DS    F                User ID                            
USERDATA      DS    FD               User Data                          
USERNAME      DS    CL8              User name                          
USERNLEN      DS    F                Length USERNAME                    
HOST_NAME     DS    CL8              HOST name                          
HOST_NAMELEN  DS    F                Length HOST_NAME                   
HOST_ADDR     DS    CL8              HOST IP address                    
HOST_ADDRLEN  DS    F                Length HOST_ADDR                   
HOSTENT_PTR   DS    FD               Length HOST_ADDR                   
USERWORD      DS    FD               User data                          
WAITMASK      DS    F                Mast for signal waits              
WHO           DS    F                Who for rusage                     
WRITEFD       DS    F                File descriptor - output file      
LFUIOPTR      DS    FD               Pointer to FUIO structure          
              SPACE ,                                                   
@ENDSTOR      EQU   *                End of getmain storage             
              IVTBUFL                                                   
         SPACE 3  * * * * * * * * * *.* Register equates  * * * * * * * 
              SPACE ,                                                   
R0            EQU   0                                                   
R1            EQU   1                Parameter list pointer             
R2            EQU   2                                                   
R3            EQU   3                                                   
R4            EQU   4                                                   
R5            EQU   5                                                   
R6            EQU   6                                                   
R7            EQU   7                                                   
R8            EQU   8                                                   
R9            EQU   9                                                   
R10           EQU   10               Second getmain storage register    
R11           EQU   11               Second program base register       
R12           EQU   12               Program base register              
R13           EQU   13               Savearea and getmain storage base  
R14           EQU   14               Return address                     
R15           EQU   15               Branch location                    
         SPACE 3  * * * * * * * * * *.* External * * * * * * * * * * *  
              SPACE ,                                                   
              EXTRN EXITRTN                                             
              EXTRN SIRTN                                               
                END