      function ccall.getmem(ptr, len)
*
*
*
*
*
*
*
*
*
$catalog local
*
$include ccall.common
*
      equate libname to 'libc.so.6'
      equate fnname  to 'memcpy'

      $include ccall.getfn.include

      s1 = str(CC$NUL,len)
      s2 = CC$FN.PUSHOFF : cc$0 :           ~
           CC$FN.PUSHVAL : ptr :            ~
           CC$FN.PUSHVAL : int2bin(len,4) : ~
           CC$FN.CALLFN  : fn.handle :      ~
           CC$FN.EXIT
      res = ccall(s1,s2)

      return(res)
   end
