git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git 565ebbf79f61873042c22a7126d002c104e056f4 broken on OpenBSD

From
Jan Harkes <jaharkes@cs.cmu.edu>
Date
Oct 26, 2005, 16:15 UTC
Message-ID
<20051026161552.GA11483@delft.aura.cs.cmu.edu>
In-Reply-To
<86irvkfg80.fsf@blue.stonehenge.com>
On Wed, Oct 26, 2005 at 08:30:39AM -0700, Randal L. Schwartz wrote:
Show 14 quoted lines
> >> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Johannes> What does your man page for link() say? If it is not 
> Johannes> supported, what value will be in errno?
> >> 
> >> EOPNOTSUPP
> 
> Interesting... google for "ENOTSUPP EOPNOTSUPP".  Apparently
> hits like this:
> 
> <http://sources.redhat.com/ml/bug-glibc/2002-08/msg00013.html>
> 
> shows that on some platforms, they may have both.  This is not as
> easy as it looks.  Maybe define an extra || condition to handle either
> or both?

It looks like glibc assumes that the kernel doesn't have ENOTSUP and defines it as EOPNOTSUPP in <bits/errno.h>. So even if the kernel does return different values, any glibc linked application probably wouldn't be able to test for the ENOTSUP error.

Checking the SuSv2 manpage for link(2), it doesn't mention either of
these error codes. But does mention EPERM as a valid error when the
filesystem doesn't support hardlinks.
    http://www.opengroup.org/onlinepubs/007908799/xsh/link.html
My local manual page for link(2) agrees with that definition,
	EPERM  oldpath is a directory.
	EPERM  The  filesystem  containing oldpath and newpath does not support
	       the creation of hard links.

I also took a look at the Linux 2.4/2.6 kernel sources, and msdos, fat and vfat all do not set a function for 'dir->i_op->link'. In that case, vfs_link() will return EPERM.

So I don't know where ENOTSUP/EOPNOTSUPP would be coming from. From the few places I looked, I don't think the original patch can be right. Not sure yet if I want to change Coda's return value to EPERM as well, the thing is that we do support hardlinks, just not between different directories, but I guess EXDEV isn't really accurate either.

Jan
Previous: Randal L. SchwartzNext: Johannes Schindelin
Message 7 of 17 in “git 565ebbf79f61873042c22a7126d002c104e056f4 broken on OpenBSD”
  1. Randal L. SchwartzOct 26, 2005
  2. Randal L. SchwartzOct 26, 2005
  3. Johannes SchindelinOct 26, 2005
  4. Randal L. SchwartzOct 26, 2005
  5. Johannes SchindelinOct 26, 2005
  6. Randal L. SchwartzOct 26, 2005
  7. Jan HarkesOct 26, 2005
  8. Johannes SchindelinOct 26, 2005
  9. Jan HarkesOct 26, 2005
  10. Johannes SchindelinOct 26, 2005
  11. Linus TorvaldsOct 26, 2005
  12. Linus TorvaldsOct 26, 2005
  13. Johannes SchindelinOct 26, 2005
  14. Horst von BrandOct 26, 2005
  15. Randal L. SchwartzOct 26, 2005
  16. Junio C HamanoOct 26, 2005
  17. Randal L. SchwartzOct 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.