You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: isrv.rs
    path of file: ./repos/rustybox/networking
    
    the code of the file until where you have to start completion: use crate::libbb::ptr_to_globals::bb_errno;
use crate::librb::socklen_t;
use libc;
use libc::close;
use libc::ptrdiff_t;
use libc::sockaddr;
use libc::sockaddr_in;
use libc::sockaddr_in6;
use libc::sus
    
pub unsafe extern "C" fn isrv_close_fd(mut state: *mut isrv_state_t, mut fd: libc::c_int) {
  close(fd);
  isrv_dont_want_rd(state, fd);
  if (*state).wr_count != 0 {
    isrv_dont_want_wr(state, fd);
  }
  *(*state).fd2peer.offset(fd as isize) = -1i32 as libc::c_short;
  if fd == (*state).fd_count - 1i32 {
    loop {
      fd -= 1;
      if !(fd >= 0 && *(*state).fd2peer.offset(fd as isize) as libc::c_int == -1i32) {
        break;
      }
    }
    (*state).fd_count = fd + 1i32;
    (*state).fd2peer = crate::libbb::xfuncs_printf::xrealloc(
      (*state).fd2peer as *mut libc::c_void,
      ((*state).fd_count as libc::c_ulong)
        .wrapping_mul(::std::mem::size_of::<libc::c_short>() as libc::c_ulong),
    ) as *mut libc::c_short
  };
}