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

Re: libc6 select problems?

On 2 Jan 1998, Mark W. Eichin wrote:

> Well, at least I've figured out that it isn't a kernel problem.  I
> built xntpd and rsync using libc5-altdev and alt-gcc, and aside from a
> typo (already reported) in the alt sched.h, they both work fine.

	It's a kernel problem.  I'll explain myself:
	There are two syscalls for select:

$ grep select /usr/include/asm/unistd.h
#define __NR_select              93 /* Common                                      */
#define __NR__newselect         230 /* Linux Specific                              */

	`libc5' uses the first one (93), but `libc6' uses the second
(230).  Both of them should work OK, but there's a little bug in the
kernel sources which makes it execute `llseek' instead of `select'
when the second syscall is used.  So, `select(n,...)' is
interpreted by the kernel as `llseek(n,...)'.  `llseek' returns EBADFD
if `n' isn't a valid file descriptor (and this is normally the case
when we use select).  See my previous mail to debian-devel for a
kernel patch.

> I'm not having much luck in figuring out where in glibc-sparc select
> itself is built, though (the Makefiles are a little too magic.)  I'm
> about to just build it and read the logs and see hack on it from that
> direction...

	Yes, it's real ugly... it's defined from
sysdeps/unix/Makefile, looking at file syscalls.list which is in
sysdeps/unix/sysv/linux.  It basically translates the call directly to
a system call.

> Is anyone working on gdb, or strace?  Looks like we're stuck at the
> "printf" level of debugging right now, and that's kind of
> sad... strace needs actual porting (I got as far a build that did a
> fake_exec and ran the program, but didn't see any *real* syscalls),
> gdb uses the bfd it ships with, and that would need to be updated to a
> current sparc-linux-aware libbfd.  It shouldn't be too hard to port,
> but still...

	I'm working on `strace'... there is a working version (in .rpm
format) in ftp.nuclecu.unam.mx:/pub/Linux/Sparc-miguel (well, I cannot
remember exactly the path, but it was something like that).  It
compiles and runs OK as libc5... I'm working on porting it to libc6.

Juan Cespedes

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-sparc-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: