lkml.org 
[lkml]   [2004]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: HOWTO use udev to manage /dev
    On Thu, Feb 19, 2004 at 08:21:25PM +0000, James Simmons wrote:

    > Okay. If I change the major number of serial ttys inside the kernel
    > of course udev would properly handle this. Now the question is would this
    > break userland applications using the serial port?

    Yes, a few of them.
    Ordinarily, userland software uses pathnames in /dev.
    But some software knows too much.

    In dietlibc-0.20 one can read:

    char *ttyname(int fd) {
    ...
    if (S_ISCHR(s.st_mode)) {
    n=minor(s.st_rdev);
    switch (major(s.st_rdev)) {
    case 4:
    ...
    case 2:
    ...
    case 136:
    case 137:
    case 138:
    case 139:
    ...
    }

    This code knows about the actual values of majors.
    There are lots of examples like this.

    For stable use of Linux one must preserve the 16-bit legacy area.

    On the other hand, if the goal is to find and eradicate all such
    ugly uses of explicit device numbers, Linus' idea to make it all
    random will certainly help.
    (But a big grep for st_rdev might be more efficient.)

    Andries
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:01    [W:4.710 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site