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

Re: r1073 - trunk/glibc-2.3-head/sysdeps/kfreebsd

Robert Millan a écrit :
On Sat, Jan 21, 2006 at 12:11:52AM +0100, Aurelien Jarno wrote:

This is the comment in the FreeBSD kernel, file sys/kern/kern_xxx.c

* This is the FreeBSD-1.1 compatable uname(2) interface.  These
* days it is done in libc as a wrapper around a bunch of sysctl's.
* This must maintain the old 1.1 binary ABI.

Then if you look at the code corresponding to the syscall, you will see that the syscall correspond to a call to the corresponding sysctl, but

       name[0] = CTL_KERN;
       name[1] = KERN_OSTYPE;
       len = sizeof (uap->name->sysname);
       error = userland_sysctl(td, name, 2, uap->name->sysname, &len,
               1, 0, 0, 0);
       if (error)
               goto done2;
       subyte( uap->name->sysname + sizeof(uap->name->sysname) - 1, 0);


So, in short the current implementation in our glibc is the correct one.

Weird.   How about disabling SYS_uname macro, then?

I don't see why we should disable it here. This syscall does its job correclty, ie it returns the requested data, but in a format different from our userland structure (32 bytes field instead of 256 bytes).

There is a lot of unused syscalls in sys/syscalls.h. Maybe we could decide not to export this file, but I don't think it is a good idea to remove some syscalls just because they are not suitable for the corresponding glibc functions.


  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

Reply to: