      subroutine csub.bind(sockfd, my.addr, res)
*
*
*
*
*
*
*
*
*
$catalog local
*
$include ccall.common
*
      equate libname to 'libc.so.6'
      equate fnname  to 'bind'
*
      $include ccall.getfn.include
*
      s1 = cc$nul4 : my.addr

      v1 = int2bin(sockfd,4)
      v2 = int2bin(len(my.addr),4)

      s2 = CC$FN.PUSHVAL : v1 :        ~
           CC$FN.PUSHOFF : cc$4 :      ~
           CC$FN.PUSHVAL : v2 :        ~
           CC$FN.CALLFN  : fn.handle : ~
           CC$FN.RTN32   : cc$0 :      ~
           CC$FN.EXIT

      s = ccall(s1,s2)

      res = bin2int(s[1,4])

      call csub.errno

      return
   end
