readlink() patch

DJ Delorie
Tue Sep 5 09:10:00 GMT 2000

Has anyone actually *tried* readlink() on linux?  I did.

If the result is too long, it is silently truncated to fit the buffer,
and no error is returned.

main(int argc, char **argv)
  int i;
  char buf[20];
  memset (buf, 0, sizeof(buf));
  i = readlink (argv[1], buf, 1);
  printf ("ret %d `%s'\n", i, buf);
  perror ("errno");

More information about the Cygwin-patches mailing list