> (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.
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).
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.
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"