Commit Graph

17 Commits

Author SHA1 Message Date
pooka dda8526653 fix lp64 snafu (hopefully)
from pgoyette
2011-01-18 23:43:21 +00:00
pooka 35dfb75868 comment out DBG and NOGCCERROR, use proper LIBDPLIBS form 2011-01-18 19:53:23 +00:00
pooka f6eee6f557 * attempt to match libc non-compat names (XXX: needs work)
* make shutdown() a dual-stack call
* flip the default to use host for PF_UNIX, since that's generally
  the desired case (because of X)
2011-01-18 19:41:02 +00:00
pooka 2c78c39d6a pollts:
Since fds[] does not go to both kernels, set revents to 0 when
splitting the vector.  Now any stale revents passed by the caller
do not get counted as results for the kernel which did not "win"
the poll.

This fixes a situation where a firefox transfer would occasionally
stall.  Now firefox works full speed with a rump networking stack.
2011-01-18 16:00:04 +00:00
pooka 81ca4f22d1 use -D_REENTRANT (should currently have no effect, but better safe
than sorry if someone adds uses of stdio macros)
2011-01-18 15:00:22 +00:00
pooka 613ebae808 Don't count sparse elements in the poll vector for host fds. 2011-01-18 14:51:14 +00:00
pooka ac1dfbf509 Fix conversion: there are 1000*1000 nanoseconds in a millisecond, not 1000. 2011-01-18 14:45:30 +00:00
pooka 07d03119a0 Fix dup2 mask so that dup2'ing a rump kernel fd to 1 does not cause
stderr to be treated as a rump kernel fd as well.  Makes e.g.
bozohttpd work better with stderr logging.

Also, add aborty stubs for kqueue.
(implementing kqueue is even trickier than implementing select/poll
since we need to keep state for two kqueue fd's)
2011-01-18 11:04:10 +00:00
pooka d8244e0b17 Use host_close() instead of close() where we know it to be the
right interface.
2011-01-17 16:30:09 +00:00
pooka 6054dbc060 Adapt to rump syscall changes. The correct rump compat syscall is
now automatically picked based on the ABI of the target the library
is compiled for.

(the host libc symbolname to override still needs a little attention
based on the system version)
2011-01-17 16:27:54 +00:00
pooka 81131c3a38 Networked X11 clients have the annoying property that they need to
contact the X server.  Since most of the useful cases these days
are local, add a toggle which forwards PF_LOCAL sockets to the host
and all other protocol families to the rump kernel.

This makes an unmodified firefox work with a rump TCP/IP stack.
I'm sure someone will find applications for being able to run
multiple web browser profiles on one OS with each browser having
a different IP address in the same subnet ...
2011-01-09 19:56:33 +00:00
pooka 2ec0087d6f Don't depend on malloc(0) returning non-NULL. 2011-01-09 14:15:06 +00:00
pooka bfa098ff96 dprintf to stderr. stop doing it if stderr_fileno gets dup2()'d 2011-01-09 10:28:46 +00:00
pooka 8ee1967622 Support dual kernel select() by emulating it with pollts(). It
would have been much easier if up to and including 5.0 we wouldn't
silently cap the nfds argument to poll(!!!).

Makes things like socket(1) work out-of-the-box, and pretty much
every other decidedly prehistoric select() user.
(netcat is a slight exception since it sets FD_SETSIZE, a.k.a.
interface-of-the-year, to 16)
2011-01-08 21:30:24 +00:00
pooka 270275f700 support pollts and rewrite poll in terms of pollts 2011-01-08 18:11:46 +00:00
pooka 1cc3ec9f1f Support fork() and dup2().
This is sufficient to make an unmodified httpd(8) be able to serve
pages via a rump networking stack.
2011-01-08 14:19:27 +00:00
pooka e9d1107acf Begin work on a syscall hijacking library which can be LD_PRELOADed
to convince non-rumped applications to communicate with a rump
kernel instead of the host kernel.  The precision of what goes
where is not exactly surgical, but for example when wanting to
debug a web server's TCP/IP stack interaction, it might be enough.
When all you have is a hand grenade, all problems look like a ....
hmm?

There's still plenty to figure out.  For example, I'm not sure what
the user interface will be like.  Now it just attempts to hijack
network communication.  It also needs to sync with symbol renaming
in libc, and maybe autogenerate the non-schizophrenic wrappers
where the communication is heading to exactly one destination, lest
I'll be a mummmy by the time I finish writing them all.  As a fun
example of a non-non-schizophrenic one, consider poll().

Work in progress, but I managed to get two non-rumped netcats
talking to each other or fetching the index from a non-rumped
thttpd.  telnet works in one direction (i can read the data from
netcat, but anything i send back is not printed).  bozohttpd uses
dup2() which i haven't bothered to address yet, etcetc.

(not hooking this up the build for now)
2011-01-07 19:52:43 +00:00