News for hackers. Stuff that matters.
Re:Linux Kernel Module Programming Guide by yjftsjthsd-h on Monday August 23, 2021 @09:18PM (#28284084)
I've been wanting to write modules to bring more of Plan 9 to Linux by exposing character devices in /dev for TCP (and probably other things, but that's the big one).
Re:Linux Kernel Module Programming Guide by kbenson on Monday August 23, 2021 @09:27PM (#28284140)
One of the reasons this probably hasn't already happened is because bash specially handles those so they work already. From the man page for bash:

       Bash handles several filenames specially when they are used in redirections, as described in the following table:

              /dev/fd/fd
                     If fd is a valid integer, file descriptor fd is duplicated.
              /dev/stdin
                     File descriptor 0 is duplicated.
              /dev/stdout
                     File descriptor 1 is duplicated.
              /dev/stderr
                     File descriptor 2 is duplicated.
              /dev/tcp/host/port
                     If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open
                     a TCP connection to the corresponding socket.
              /dev/udp/host/port
                     If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open
                     a UDP connection to the corresponding socket.
Edit: Not to imply it's not a good idea. I think it is, so much so that the only reason it wasn't done long ago is because often a "good enough for most people" solution can sap the need for a different solution which has other benefits.
Re:Linux Kernel Module Programming Guide by yjftsjthsd-h on Monday August 23, 2021 @09:30PM (#28284165)
I'm aware, but I want that functionality outside of BASH.