Re: devfs v136, ZIP disks and glibc-2.1.2

Andreas Jaeger (
07 Nov 1999 16:48:00 +0100

>>>>> German Jose Gomez Garcia writes:

> And more things:

> The new glibc-2.1.2 uses some kind of "horrible hack" to
> check if /dev/pts is mounted (in order to getpt() to use the
> UNIX98 ttys) it checks both for the presence of /dev/pts but also
> for its magic, the next code is extracted from

We have to check for the magic because you can have a directory
/dev/pts but not devpts compiled into your kernel. Therefore we need
a way to know exactly if devpts is available.

> glibc-2.1.2/sysdeps/unix/sysv/linux/getpt.c

> --------------------------------------------------------------------
> #define DEVPTS_SUPER_MAGIC 0x1cd1
This comes from linux/fs/devpts/devpts_i.h.
> ....

> /* Check that the /dev/pts filesystem is mounted. */
> if (devpts_mounted
> || (__statfs (_PATH_DEVPTS, &fsbuf) == 0
> && fsbuf.f_type == DEVPTS_SUPER_MAGIC))
> {
> /* Everything is OK. */
> devpts_mounted = 1;
> return fd;
> }
> --------------------------------------------------------------------

> as you can see Drepper check for that DEVPTS_SUPER_MAGIC, I have no idea
> where it comes from (maybe some POSIX knowledge here would be useful).
Every filesystem has a magic number associated with it. statfs gets
this numbers.

> But using devfs the /dev/pts dir has no such f_type (it have 0x1373)
> I have no checked without devfs but it seems that your patch doesn't
> touch anything having to do with such magic number (or at least
> 'grepping' for it in your patch returns nothing :-), I have currently patched
> my glibc version but I don't know if the correct thing is to send a
> patch to Drepper or change something in the kernel, any POSIX guru here
> who knows if that DEVPTS_SUPER_MAGIC is "official" ?
It's official - see above.

If devfs handles this differently and needs a patch, please tell us
what needs to be done - or change devfs accordingly. Since devfs is
not part of the kernel and none of the glibc developers seems to use
and nobody else complained so far, this hasn't been fixed.


 Andreas Jaeger   
  SuSE Labs	

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at