Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2008 20:25:19 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern kern_descrip.c
Message-ID:  <200805282025.m4SKPJgY097901@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
ed          2008-05-28 20:25:19 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_descrip.c 
  Log:
  Remove redundant checks from fcntl()'s F_DUPFD.
  
  Right now we perform some of the checks inside the fcntl()'s F_DUPFD
  operation twice. We first validate the `fd' argument. When finished,
  we validate the `arg' argument. These checks are also performed inside
  do_dup().
  
  The reason we need to do this, is because fcntl() should return different
  errno's when the `arg' argument is out of bounds (EINVAL instead of
  EBADF). To prevent the redundant locking of the PROC_LOCK and
  FILEDESC_SLOCK, patch do_dup() to support the error semantics required
  by fcntl().
  
  Approved by:    philip (mentor)
  
  Revision  Changes    Path
  1.334     +16 -31    src/sys/kern/kern_descrip.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805282025.m4SKPJgY097901>