This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: linux-generic dup2 behaviour


On 9/14/2011 12:06 PM, Linas Vepstas wrote:
> The m4 test cases aren't all that stunning; for me, 3 of 108 failed,
> and this patch should fix 2 of these.  The third was test-readlink which
> is expecting
> readlink("", buf, sizeof buf);
> to set ENOENT, and instead it sets EINVAL
>
> I was willing to ascribe this to poor test case design, but now that
> we're on topic... any suggestions?

That's puzzling.  The in-kernel version just does readlinkat(AT_FDCWD,
path, buf, bufsiz), which is all the "generic" glibc code does, in
userspace.  I would expect them to return the same errnos, and in fact a
quick test on Tile does get ENOENT:

#include <unistd.h>
#include <stdio.h>
#include <errno.h>

int main(void)
{
  char buf[1000];
  errno = 0;
  int rc = readlink("", buf, sizeof buf);
  printf("%d/%d\n", rc, errno);
  return 0;
}


-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]