Another bug, in dup3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al:

A second problem we noticed from the gnulib test is that this
assertion fails with the latest upstream kernel:

      /* Assigning to self is invalid.  */
      errno = 0;
      ASSERT (dup3 (fd, fd, o_flags) == -1);   <--- fails
      ASSERT (errno == EINVAL);

dup3 is not currently specified by POSIX, so technically it is fine
for dup3 on Linux to do anything it likes.

*However* the proposal for dup3 in POSIX:

  http://austingroupbugs.net/view.php?id=411

says:

  "The dup3( ) function shall be equivalent to the dup2( ) function if
  the flag argument is 0, except that it shall be an error if fildes
  is equal to fildes2."

So it's probably a good idea for Linux not to regress here.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux