      subroutine csub.accept(sockfd, ret.addr, res)
*
*
*
*
*
*
*
*
*
$catalog local
*
$include ccall.common
*
      equate libname to 'libc.so.6'
      equate fnname  to 'accept'
*
      $include ccall.getfn.include
*
      s1 = cc$nul4 : cc$16 : str(CC$NUL,16)
      s2 = CC$FN.PUSHVAL : int2bin(sockfd,4) : ~
           CC$FN.PUSHOFF : cc$8 :              ~
           CC$FN.PUSHOFF : cc$4 :              ~
           CC$FN.CALLFN  : fn.handle :         ~
           CC$FN.RTN32   : cc$0 :              ~
           CC$FN.EXIT

      s = ccall(s1,s2)

      ret.addr.len = bin2int(s[5,4])
      ret.addr = s[9,ret.addr.len]
      res = bin2int(s[1,4])

      call csub.errno

      return
   end
