|
From: | Wei Shen |
Subject: | Re: Google Summer of Code participation |
Date: | Sun, 16 Mar 2008 00:47:23 +0800 |
I made a try to implement a basic mechanism of socket servers (pfinet and pflocal) overriding, as described below. Comments are solicited.
1) Add two new environment variables: SERVERS_SOCKET_LOCAL for the pf_local socket server and SERVERS_SOCKET_INET for the pf_inet server. The value of each variable should be set to a colon-separated list, and each element of the list is a file path that specifies a overriding server.2) Hack _hurd_socket_server in "hurd/hurdsock.c" of Glibc to check for the two environment variables.
For example, when looking up the socket server of pf_inet domain, _hurd_socket_server first checks SERVERS_SOCKET_INET. If SERVERS_SOCKET_INET is not set or is set to null, then just queries and returns the port of the default pf_inet server as usual; or else, repeatedly tries querying each overriding server in the overriding list defined by SERVERS_SOCKET_INET, until the first existing overriding server is found (or none is found).
The modified hurd/hurdsock.c is attached to this mail. I have tested it with Glibc-2.5.
hurdsock.c
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |