Hacker News new | past | comments | ask | show | jobs | submit login

> (try setting an IP address with a write() or ioctl())

    ioctl(sock_fd, SIOCSIFADDR, &ifreq_pointer);
is a thing, although it targets a socket on the interface, not the interface itself.

Generally I think there's some cases where they try to push too much through limited interfaces, e.g. ptrace feels like "ok, we have an API already, lets push this unrelated functionality through it too so we don't have to design and add a new one"




> [SIOCSIFADDR] is a thing, although it targets a socket on the interface, not the interface itself.

If we're cheating by using file descriptors instead of files, then you could go all the way and used AF_NETLINK sockets, they allow you even to set routing or firewall. That's kind of not the point.


The whole point of Linus's rant is that the actual Unix mantra is that everything is a file descriptor.


And then we go back to processes, System V-like IPC (shmget()/semget()/msgget()), and network configuration subsystem (routing, firewall, bringing interfaces up or down, and the like; netlink is only a recent development, after 2000).

What was it about the mantra again?


Well, the mantra is of course an aspiration. In practice things are not always done that way, especially in the past. SysV ipc is hopefully a thing of the past though.

(I did upvote you btw)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: