Bug#555303: kfreebsd-8: problems with *at syscalls

View: New views
4 Messages — Rating Filter:   Alert me  

Parent Message unknown Bug#555303: kfreebsd-8: problems with *at syscalls

by Aurelien Jarno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 09, 2009 at 11:22:13AM +0100, Petr Salinger wrote:

> Package: kfreebsd-8
>
> I tried to rebuild current eglibc under kfreebsd-8,
> there are some problems with *at functions. Under kfreebsd-7
> we use some userspace emulation, under kfreebsd-8 we directly use
> *at syscalls.
>
> The new failed tests are:
>
> io/tst-renameat.out
> io/tst-faccessat.out
> io/tst-symlinkat.out
> io/tst-linkat.out
> io/tst-readlinkat.out
> io/tst-mkdirat.out
> io/tst-mknodat.out
>
> It needs further investigation before we could
> make 8.x kernel the default one.
>

I tracked down the problem to the AT_* #define that are different
between GNU/Linux and GNU/Hurd on one side and GNU/kFreeBSD on the other
side.

I have committed a patch to glibc-bsd to move those definitions to
bits/fcntl.h. The same has to be done on upstream glibc, which impact
quite a lot of files. Before actually doing it, I do wonder if we
shouldn't instead translate the values in our *at functions, which
should also solve the problem of already built binaries using the old
value.

What do you think?

The patch fixes all failures except:
- io/tst-renameat.out: the test verifies error with wrong arguments, and
  the FreeBSD kernel does not check the errors in the same order when
  there are two or more errors, so and error is returned, but not the
  one expected by the tests. I think we can live with that.
- io/tst-mknodat.out: it's not possible to use mknod outside of /dev on
  GNU/kFreeBSD, this is not specific to the *at syscall.

--
Aurelien Jarno                        GPG: 1024D/F1BCDB73
aurelien@...                 http://www.aurel32.net



--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Bug#555303: kfreebsd-8: problems with *at syscalls

by Petr Salinger-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I tracked down the problem to the AT_* #define that are different
> between GNU/Linux and GNU/Hurd on one side and GNU/kFreeBSD on the other
> side.
>
> I have committed a patch to glibc-bsd to move those definitions to
> bits/fcntl.h. The same has to be done on upstream glibc, which impact
> quite a lot of files. Before actually doing it, I do wonder if we
> shouldn't instead translate the values in our *at functions, which
> should also solve the problem of already built binaries using the old
> value.
>
> What do you think?

1) the AT constants might be put into a different new file,
    i.e. <bits/atfile.h> or <bits/atfcntl.h>. This way it would suffice
    just only one new generic file.

2) I am in favor change AT constant to match native FreeBSD.
    The *at functions have been introduced in 2.4 glibc,
    at about 8700 binary pakages have Depends "libc0.1 (>= 2.3",
    these are definitely not affected. We might look into remaining 650
    binary packages and decide which need a binNMU.

> The patch fixes all failures except:
> - io/tst-renameat.out: the test verifies error with wrong arguments, and
>  the FreeBSD kernel does not check the errors in the same order when
>  there are two or more errors, so and error is returned, but not the
>  one expected by the tests. I think we can live with that.
> - io/tst-mknodat.out: it's not possible to use mknod outside of /dev on
>  GNU/kFreeBSD, this is not specific to the *at syscall.

This sounds promising.

Many thanks

  Petr




--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Bug#555303: kfreebsd-8: problems with *at syscalls

by Aurelien Jarno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 13, 2009 at 06:09:32PM +0100, Petr Salinger wrote:

>> I tracked down the problem to the AT_* #define that are different
>> between GNU/Linux and GNU/Hurd on one side and GNU/kFreeBSD on the other
>> side.
>>
>> I have committed a patch to glibc-bsd to move those definitions to
>> bits/fcntl.h. The same has to be done on upstream glibc, which impact
>> quite a lot of files. Before actually doing it, I do wonder if we
>> shouldn't instead translate the values in our *at functions, which
>> should also solve the problem of already built binaries using the old
>> value.
>>
>> What do you think?
>
> 1) the AT constants might be put into a different new file,
>    i.e. <bits/atfile.h> or <bits/atfcntl.h>. This way it would suffice
>    just only one new generic file.
>

Good idea, I am going to implement this solution and push it upstream.
It has the advantage that only the main glibc has to be changed, no need
to also do the changes (in sync) with ports.

--
Aurelien Jarno                        GPG: 1024D/F1BCDB73
aurelien@...                 http://www.aurel32.net



--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Bug#555303: kfreebsd-8: problems with *at syscalls

by Petr Salinger-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> 1) the AT constants might be put into a different new file,
>>    i.e. <bits/atfile.h> or <bits/atfcntl.h>. This way it would suffice
>>    just only one new generic file.
>>
>
> Good idea, I am going to implement this solution and push it upstream.
> It has the advantage that only the main glibc has to be changed, no need
> to also do the changes (in sync) with ports.

Or guard redefinition in main <fcntl.h> by i.e.

--- fcntl.h~
+++ fcntl.h
@@ -56,7 +56,7 @@
  # define SEEK_END      2       /* Seek from end of file.  */
  #endif /* XPG */

-#ifdef __USE_ATFILE
+#if defined(__USE_ATFILE) && !defined(AT_EACCESS)
  # define AT_FDCWD              -100    /* Special value used to indicate
                                            the *at functions should use the
                                            current working directory. */


Petr




--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...