On Tue, May 30, 2023 at 10:09:28AM +0700, Bagas Sanjaya wrote: > On 5/29/23 21:09, Christian Marangi wrote: > > Just to clarify, a device name can't be returned. Not every device have > > a name and such name can be changed. An example is network device where > > you can change the name of the interface. > > > > Using the device prevents all of this problem. > > > > Oh, I guess it was /dev/something. Network devices don't appear in /dev. At least not in Linux. Some other Unix implementations do, i think SunOS used to have an entry in /dev, but i could be remembering wrongly. But within the kernel, you generally don't refer to a device by its /dev/foo name. That is a user space abstraction. In the kernel, each device in the system has a struct device representing it. Andrew