bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

implementing bash's magic


From: Marcus Brinkmann
Subject: implementing bash's magic
Date: Fri, 18 Oct 2002 03:16:39 +0200
User-agent: Mutt/1.4i

Hi,

bash treats some filenames in a special way when used for redirections:

     /dev/fd/fd
            If  fd  is  a valid integer, file descriptor fd is dupli-
            cated.
     /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.

/dev/fd/fd, /dev/stdin, /dev/stdout and /dev/stderr are already implemented
for all programs in the Hurd via the magic lookup retry function.  This
works by having the translator return FS_RETRY_MAGIC and as a retry name
"fd/X" where X is the number of the filedescriptor the program should look
up instead of the "real file".

Now, it seems to be rather easy to me to implement the retry magic for tcp
and udp in glibc/hurd/lookup-retry.c as well.  Roland, is this worth punting
to a volunteer or would that be more trouble than just doing it yourself
right quick?  For me it's always the hassle of assigning copyright (should
have assigned future changes as well last time).

The Hurd's magic translator wouldn't even need any changes to make this
work.  We could just add the two entries to MAKEDEV.sh.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]