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

Re: more glibc breakage on kfreebsd-amd64 (fix for screen)



On Wed, Mar 15, 2006 at 05:25:41PM +0100, Petr Salinger wrote:
> --- osdef.h.in~ 2006-03-15 16:53:47.000000000 +0100
> +++ osdef.h.in  2006-03-15 16:53:47.000000000 +0100
> @@ -107,6 +107,7 @@
>  extern char *tgoto __P((char *, int, int));
>  
>  #ifdef POSIX
> +#include <string.h>
>  extern int   setsid __P((void));
>  extern int   setpgid __P((int, int));
>  extern int   tcsetpgrp __P((int, int));
> 
> Can you please test it more ?

Ok I'm on it.

> > Ah, that EBADF is the same error we see during startup (on i386 too):
> > 
> > /lib/init/mount-functions.sh: line 108: 0: Bad file descriptor
> > /etc/rcS.d/S10checkroot.sh: line 41: 0: Bad file descriptor
> 
> Yes, and it is very strange - descriptor 0 is stdin.
> It looks like it have been closed or even 
> not passed open by kernel to /sbin/init ...

Unlike Linux, kFreeBSD doesn't open /dev/console or initialise any variable
when running init (or at least this used to be the behaviour in 5.x), but our
sysvinit is compatible with that.

Have you looked at the script though?  This is a really weird hack:

  exec 9<&0 </etc/fstab

9 isn't referenced anywhere else... it's not surprising that if you redirect a
non-existant descriptor to 0, your fd 0 will be messed up.  I wonder how this
can possibly work on gnu/linux.

-- 
Robert Millan



Reply to: