kernel/fs/handle.c
/*
 * Returns a handle to the free handle list and increments the free_handle_cnt.
 */
Returns a handle to the free handle list and increments the free_handle_cnt.
Returns a handle to the free handle list and increments the free_handle_cnt .
int FreeHandle(int fd) {
  struct Process *current;
  struct Filp *filp;
  current = GetCurrentProcess();
  if (fd < 0 || fd >= NPROC_FD) {
    return -EINVAL;
  }
  filp = GetFilp(fd);
  FreeFilp(filp);
  current->fd_table[fd] = NULL;
  return 0;
}
int FreeHandle ( int fd ) { struct Process * current ; struct Filp * filp ; current = GetCurrentProcess ( ) ; if ( fd < 0 || fd >= NPROC_FD ) { return - EINVAL ; } filp = GetFilp ( fd ) ; FreeFilp ( filp ) ; current -> fd_table [ fd ] = NULL ; return 0 ; }
Returns a handle to the free handle list and increments the free_handle_cnt.
Returns a handle to the free handle list and increments the free_handle_cnt .