!fnjobinfo.bsi [100] - misc job info functions
!------------------------------------------------------------------------
!EDIT HISTORY
!Version 1.0:-
! [100] 14-Nov-24 / jdm / created
!------------------------------------------------------------------------
!REQUIREMENTS
!
!NOTES
!
!KEYWORDS: background job 
!------------------------------------------------------------------------
!FUNCTIONS:
! Fn'Job'Is'Background() - check if job in background
!------------------------------------------------------------------------

++include'once ashinc:types.def

!---------------------------------------------------------------------
!Function:
!   Check if current job is in background
!Params:
!   none
!Returns:
!   .TRUE if in background, else .FALSE
!Globals:
!Notes:
!   Currently only works for Linux as it is based on checking of the
!   condev name prefix has changed to "tsk:" (this will happen 
!   automatically for background jobs or jobs that lose their
!   terminal connection.)
!---------------------------------------------------------------------
Function Fn'Job'Is'Background() as BOOLEAN

    map1 locals
        map2 usrnam$,s,20
        map2 machine$,s,20
        
    xcall GETUSN, usrnam$, machine$
    if machine$[1,4] = "tsk:" then
        .fn = .TRUE 
    endif
    
EndFunction
