cvs commit: src/sys/kern kern_descrip.c

Ed Schouten ed at
Wed May 28 20:25:19 UTC 2008

ed          2008-05-28 20:25:19 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             kern_descrip.c 
  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
  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

More information about the cvs-src mailing list