Skip to contentSkip to conversation

number of eth0 device

DISCUSSION Karel Kulhavy 5 participants 5 messages Oct 19, 2005

lore
Share & tools
lore
#0 lore raw

Hello

I am looking into Documentation/devices.txt in 2.4.25 and eth0 is not listed there. If I grep "eth", I get only

38 char Myricom PCI Myrinet board
[...]
"This device is used for status query, board control and "user level packet I/O." This board is also accessible as a standard networking "eth" device. "

and then

/dev/pethr0

Is eth0 some kind of special device that doesn't have any number assigned?

CL<

#1 lore raw
Quoted 9 lines · Karel Kulhavy

I am looking into Documentation/devices.txt in 2.4.25 and eth0 is not listed there. If I grep "eth", I get only

38 char Myricom PCI Myrinet board
[...]
"This device is used for status query, board control and "user level packet I/O." This board is also accessible as a standard networking "eth" device. "

Quoted 6 lines

and then

/dev/pethr0

Is eth0 some kind of special device that doesn't have any number assigned?

Yes, there's no such thing as /dev/eth0, network interfaces have their own namespace. Linux uses the defacto standard BSD socket interface for networking, so blame the BSD people for violating the "everything is a file" rule.

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#2 lore raw

Erik Mouw <[email protected]> disait dernièrement que :

Quoted 14 lines · Karel Kulhavy
Quoted 13 lines

I am looking into Documentation/devices.txt in 2.4.25 and eth0 is not listed there. If I grep "eth", I get only

38 char Myricom PCI Myrinet board
[...]
"This device is used for status query, board control and "user level packet I/O." This board is also accessible as a standard networking "eth" device. "

and then

/dev/pethr0

Quoted 7 lines
Quoted 2 lines

Is eth0 some kind of special device that doesn't have any number assigned?

Yes, there's no such thing as /dev/eth0, network interfaces have their own namespace. Linux uses the defacto standard BSD socket interface for networking, so blame the BSD people for violating the "everything is a file" rule.

well, the way NIC's behave kind of forbids this
taken from Linux Device Drivers, 3rd Edition, page 497
"The normal file operations (read, write, and so on) do not make sense when applied to network interfaces, so it is not possible to apply the Unix ''everything is a file'' approach to them"

Signature · 1 line
Mathieu
#3 lore raw
Quoted 24 lines · Mathieu Segaud

Erik Mouw <[email protected]> disait dernièrement que :

Quoted 14 lines · Karel Kulhavy
Quoted 13 lines

I am looking into Documentation/devices.txt in 2.4.25 and eth0 is not listed there. If I grep "eth", I get only

38 char Myricom PCI Myrinet board
[...]
"This device is used for status query, board control and "user level packet I/O." This board is also accessible as a standard networking "eth" device. "

and then

/dev/pethr0

Quoted 7 lines
Quoted 2 lines

Is eth0 some kind of special device that doesn't have any number assigned?

Yes, there's no such thing as /dev/eth0, network interfaces have their own namespace. Linux uses the defacto standard BSD socket interface for networking, so blame the BSD people for violating the "everything is a file" rule.

Quoted 5 lines

well, the way NIC's behave kind of forbids this
taken from Linux Device Drivers, 3rd Edition, page 497
"The normal file operations (read, write, and so on) do not make sense when applied to network interfaces, so it is not possible to apply the Unix ''everything is a file'' approach to them"

I think there're other nodes in /dev on which normal file operations do not make sense either.

Signature · 2 lines
Coywolf
-
#4 lore raw
In reply to Mathieu Segaud
Quoted 6 lines · Mathieu Segaud

well, the way NIC's behave kind of forbids this
taken from Linux Device Drivers, 3rd Edition, page 497
"The normal file operations (read, write, and so on) do not make sense when applied to network interfaces, so it is not possible to apply the Unix ''everything is a file'' approach to them"

Ditto sound cards, which is why ALSA abandoned the OSS "everything is a file" paradigm for sound cards. Read/write etc. don't take into account the inherent realtime constraints in streaming audio to/from a device.

Lee