[lkml]   [2000]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Re: test11-pre5
    Date (Dan Aloni) writes:
    > Is there a special reason why dev->name is not a pointer?

    One of the changes in 2.3 was to change dev->name from a pointer to the
    char array. A little bit painful (in terms of the number of changes,
    rather than the complexity).

    The reason for this is that dev->name needs to be writeable, each instance
    of dev->name must not be shared, and there needs to be at least IFNAMSIZ
    bytes allocated.

    The problem that first triggered the change was that gcc was sharing
    all instances of "eth%d", so there was a problem with multiple adaptors
    referenced from the same source file.

    It just happens that the kernel does not implement read-only strings
    (as userspace does), but it could do in the future. This would cause
    problem if dev->name is a pointer.

    Finally, looking through the many net drivers, many failed to reserve
    IFNAMSIZ (currently 16) bytes. Some allocated 8, some 9, some 17.

    `O O' |
    // ^ \\ |
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:45    [W:0.019 / U:115.800 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site