Commit Graph

14487 Commits

Author SHA1 Message Date
jakllsch cfb57741fb Imlementations of fmax, fmaxf, fmin and fminf libm functions for VAX. 2011-01-09 02:32:13 +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
pooka 91aad9bd60 Make rumpclient impervious to LD_PRELOAD syscall hijacking by using
dlsym(RTLD_NEXT) to lookup a host_syscall() function pointer which
is used instead of syscall() to communicate with the kernel server.

WARNING: popular opinion classifies this as "ugly code".  if you
have a weak heart/mind/soul/sole meuniere, read max. 1 line of the
diff per day, preferably with food.
2011-01-07 19:37:51 +00:00
pooka 357983cc1c Make P2K_WIZARDUID require a valid integer instead of defaulting to root. 2011-01-07 16:02:32 +00:00
pooka 0d0a5842f8 Document how to get debug info for the mount. 2011-01-07 15:50:40 +00:00
pooka 27daa694a2 In case of a P2K_DEBUG mount, dump mount point contents when the
process receives SIGINFO.  Additionally, dump vnode status if the
process gets SIGUSR1 (can be quite quite verbose, therefore not
displayed with SIGINFO).
2011-01-07 15:47:14 +00:00
pooka d32ef440df in case unmount fails (it never should), do a full mountpoint dump 2011-01-07 15:30:09 +00:00
pooka cc30c34a93 Remove the componentname-saving code since it was addressing
SAVENAME/HASBUF/SAVESTART and they don't exist anymore (and the
removed code didn't compile on nb5).
2011-01-07 11:15:30 +00:00
pooka 4063bc515b Fix file handles. Problem reported & fix tested by kefren. 2011-01-07 10:18:06 +00:00
njoly 416b82e2e3 Fix macro (DV -> Dv). 2011-01-06 15:22:20 +00:00
blymn 0a965fa7ed Back out change for assume_default_colors as it was not correct. 2011-01-06 11:29:40 +00:00
pooka c45d9404c0 Make rumpclient syscalls safe to call from signal handlers. 2011-01-06 06:57:14 +00:00
christos 221dcf2e47 Since localsub and gmtsub are called recursively to search for the local
time, setting EOVERFLOW at the inmost level will unfortunately persist,
even if later calls to those functions succeed. Move the EOVERFLOW setting
to the top level calls.
2011-01-06 02:41:34 +00:00
pooka f4b63a89c1 Release sender lock before zeroing out "wanted" status during
violent disconnect.  Fixes some race conditions (maybe the one
occasionally showing up on tests/rump/rumpkern/t_stress).

thanks to schmonz for some discussion
2011-01-05 22:57:01 +00:00
pooka fd993ea3d0 Support fork() for rumpclient users. 2011-01-05 17:14:50 +00:00
pooka de27b28026 Fix fd leak also in non-NetBSD code path. 2011-01-05 09:43:00 +00:00
wiz aff1729a2c Fix fdleak in error case. Found by cppcheck. 2011-01-05 00:09:43 +00:00
wiz e97508602c Fix fdleak in #ifdef DEBUG. Found by cppcheck. 2011-01-05 00:03:52 +00:00
martin 27868e15e9 Special-case the (unlikely in practice) call with len = 2 - previously
the code would not have swapped anything. Problem pointed out by
sparc64 automatic test run.
2011-01-04 17:14:07 +00:00
pooka d67d4f135c document rump_pub_lwproc_rfork() 2011-01-02 13:03:29 +00:00
pooka 3daddc031c rump_lwproc_newproc -> rump_lwproc_rfork 2011-01-02 13:01:45 +00:00
dholland b845056678 Add an INRELOOKUP namei flag. Sigh. (We don't need more namei flags.)
However, because of a protocol deficiency puffs relies on being able
to keep track of VOP_LOOKUP calls by inspecting their contents, and
this at least allows it to use something vaguely principled instead of
making wild guesses based on whether SAVESTART is set.

Update libp2k to use INRELOOKUP instead of SAVESTART.
2011-01-02 05:04:58 +00:00
pooka 2aa9fbc0b2 Allow rump kernel to call dlsym(RTLD_DEFAULT). 2010-12-30 15:47:30 +00:00
christos 61a5737280 off by one 2010-12-28 16:19:25 +00:00
jnemeth fd52cff654 vsnprintf_ss does NOT handle floating point formats 2010-12-26 12:39:54 +00:00
blymn bcc3426f98 Little bit more debug information. 2010-12-25 10:08:20 +00:00
blymn 58f5b3b32b Ignore request to change the values of colour pair 0
Explicitly set foreground and/or background colours when -1 is passed
to assume_default_colors()
2010-12-25 10:05:08 +00:00
blymn 0ddf818977 Allow attributes to be applied to the default line drawing characters
by just passing attributes as arguments to the wborder call.
2010-12-25 09:59:52 +00:00
christos 6ef213c85c restore lost overlow check fix. 2010-12-24 15:47:39 +00:00
skrll f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
christos 5448347830 make this thread-safe. We could use localtime_tz and make it even better,
but not now.
2010-12-24 03:37:37 +00:00
christos 736ce759b3 use pthread__stacksize since size has not been initialized yet. 2010-12-22 22:41:45 +00:00
christos 5cea6e6df8 only mprotect base if we moved it. 2010-12-22 22:19:46 +00:00
wiz 207ab8d006 Add punctuation. 2010-12-22 17:06:03 +00:00
christos 92a95e7ba4 document vsnprintf_ss 2010-12-22 16:59:10 +00:00
wiz c03e55e8e9 Remove trailing whitespace. 2010-12-22 09:12:28 +00:00
christos a504543f04 fix incorrect overflow check from Nicholas Joly 2010-12-21 18:13:02 +00:00
christos 537ea48995 - document limitations
- add extra number name parsing
2010-12-21 00:15:10 +00:00
christos 2e63e08217 - fix off by one in comparison with 69 (it should be 70)
- add aliases for 1 (one), 2 (two), etc.
- allow parsing of HH:MM:SS.sss as the man page mentions, and ignore sss
2010-12-21 00:14:10 +00:00
wiz 817bb39979 Remove trailing whitespace; sort errors; spell "variadic" like
Wikipedia or GNU libc.
2010-12-19 22:19:27 +00:00
christos 4d653f4318 Make the ioctl prototype reflect reality and explain why. Also mention that
the generic file descriptor manipulation ioctls are superceded by the
equivalent fcntl one.
2010-12-19 16:54:10 +00:00
jruoho 5c9efd7bb1 Xref __builtin_return_address(3). 2010-12-19 09:33:52 +00:00
jruoho a20c806d96 Small modifications to wording, tidy up SEE ALSO. 2010-12-19 08:28:40 +00:00
jruoho 6f013d76df Fix SYNOPSIS, add CAVEATS. 2010-12-19 08:21:36 +00:00
christos 66f16a1fa6 I've had this patch in my tree for a while and since it only improves
the situation, I decided to commit it. There is an inherent problem
with ASLR and the way the pthread library is using the thread stack.

Our pthread library chooses that stack for each thread strategically
so that it can locate the location of the pthread struct for each
thread by masking the stack pointer and looking just below the red
zone it creates. Unfortunately with ASLR you get many random values
for the initial stack, and there are situations where the masked
stack base ends up below the base of the stack. (this happens on
x86 when the stack base happens to be 0x???02000 for example and
your mask is stackmask is 0xffe00000). To fix this, we detect the
pathological cases (this happens only in the main thread), allocate
more stack, and mprotect it appropriately. Then we stash the main
base and the main struct, so that when we look for the pthread
struct in pthread__id, we can special case the main thread.

Another way to work around the problem is unlimiting stacksize,
but the proper way is to use TLS to find the thread structure and
not to play games with the thread stacks.
2010-12-18 15:54:27 +00:00
njoly 53ac8d2f21 Fix typo in cross-refernce. 2010-12-17 23:57:07 +00:00
christos 3a693ad8ca PR/44248: Antti Kantee: Fix multi-threaded localtime hang. 2010-12-17 23:11:57 +00:00
njoly 9f266c104e Fix cross-reference, dir(5) -> dirent(3). 2010-12-17 19:20:42 +00:00
wiz db9d3e0efd Sort ERRORS. Fix a typo. Readd macro usage lost in previous.
Remove trailing whitespace.
2010-12-17 01:30:50 +00:00
wiz a5f2300ef5 Sort SEE ALSO, add a serial comma. 2010-12-17 01:30:14 +00:00
wiz 72b0a97144 Use more markup. 2010-12-17 01:29:45 +00:00
joerg c4120e324e Replace use of errlist with a single concatenated version and an offset
array. This requires less storage and avoids one runtime relocation per
errno value.
2010-12-16 22:52:32 +00:00
christos d6bc393ba9 it is getname not time. 2010-12-16 22:18:37 +00:00
christos 84df4ad5ec add the 3 missing man pages. 2010-12-16 21:53:56 +00:00
christos 5a87b22ec6 Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
This work was presented to the tzcode folks and it was generally
accepted, but there seems to be a lot of inertia.
2010-12-16 18:36:47 +00:00
jruoho 595da22eed Reference __builtin_object_size(3) and attribute(3) with each other. 2010-12-16 17:50:39 +00:00
wiz 3d3c5d42cb Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
2010-12-16 17:42:25 +00:00
wiz 9d8035939e Add missing word. 2010-12-16 17:17:07 +00:00
pooka 393eecc12a Have the client and server perform some sort of handshake first.
It's pretty much a placeholder for now.  One plan for the future
is to require some sort of authentication for superuser clients.
The code will need a little massage then, though, to prevent DoS
attacks.
2010-12-16 17:05:44 +00:00
pooka 02d25938f6 Describe the rump_sp facility a bit. 2010-12-16 15:29:28 +00:00
pooka f55f15b84d xfer rump_etfs 2010-12-16 12:39:39 +00:00
pooka 3c4a27f7cd Print a banner a connecting client. The banner contains rump sp
protocol version, os name, os revision and machine.
2010-12-16 12:38:20 +00:00
jruoho 9f95187844 .Fn, offset indent, complete reference. 2010-12-16 12:08:16 +00:00
jruoho fe6e1d361b Fix the references and -offset indent. 2010-12-16 11:57:20 +00:00
jruoho c1a91d0bee Use .Fn. 2010-12-16 11:49:35 +00:00
wiz d714991586 Use full month name in dates. 2010-12-16 10:08:27 +00:00
plunky aaac48679d bump date for previous 2010-12-16 08:45:32 +00:00
plunky a1c148fc46 remove unnecessary step in example code
(sdp_service_attribute() did that already)
while here, start new paragraph for next example
2010-12-16 08:44:23 +00:00
jruoho 91e230c6b8 Fix xref; module(4) -> module(7). 2010-12-14 16:23:59 +00:00
jruoho 5c1bce6b00 Reference strsuftoll(3) and orders(7) with each other. 2010-12-14 13:00:34 +00:00
joerg 674a655551 Prefix ctype bitmask macros with _CTYPE 2010-12-14 02:28:57 +00:00
pooka 0c0346ae48 Don't __weak_alias non-existent symbols. Apparently the alpha
compiler doesn't like it.
2010-12-13 23:10:12 +00:00
pooka 5f35396ed8 last of the RUMP_ACTION syscall swappers 2010-12-13 21:07:54 +00:00
pooka 2f36209c20 Mirror sysctlgetmibinfo RUMP_ACTION change. 2010-12-13 14:17:11 +00:00
jruoho 05a9f55544 Xref module(4). 2010-12-13 10:07:46 +00:00
pooka 33c6814d7a document abortop. part of PR kern/44208 2010-12-13 09:06:51 +00:00
joerg 230ccda64c Don't bother with SCCS or the other RCSID conditionals. 2010-12-12 22:34:44 +00:00
christos b3ddcb3ea2 errlist.c is automatically generated now. 2010-12-12 20:22:48 +00:00
christos 5eeef29dbe remove comment 2010-12-12 20:16:09 +00:00
christos 91083d6e86 Automatically generate the error list. 2010-12-12 20:08:27 +00:00
christos 245a0c0325 remove old libpcap. 2010-12-12 18:52:41 +00:00
christos 49f71b9cd5 PR/42549: Izumi Tsutsui: parsedate does not work after 2038.
Fix multiple issues:
- Remove bogus 2038 check and add overflow checks in the appropriate places.
- Correct incomplete leap year calculation that broke things after 2100.
- Check localtime return values
- Change int calculations to time_t to avoid oveflow.
- Consistently check/return -1 and remove bogus comment about not being
  able to return -1.

Now:
$ date -d 20991201
Tue Dec  1 00:00:00 EST 2099
$ date -d 40991201
Tue Dec  1 00:00:00 EST 4099
$ date -d 10000000991201
Tue Dec  1 00:00:00 EST 1000000099
TIME=0:04.48 CPU=117.8% (5.288u 0.000s) SWAPS=0 (0+95)pf (0i+0o) (0Kc+0Kd)
$ date -d 100000000991201
date: Cannot parse `100000000991201'
TIME=0:53.48 CPU=99.2% (53.086u 0.000s) SWAPS=0 (0+96)pf (0i+0o) (0Kc+0Kd)
Exit 1
2010-12-12 18:39:57 +00:00
pooka 34c8240044 Unlink unix socket as part of server exit.
(whatever happened to the code that was supposed to do it automatically
when the binding process exits?)
2010-12-12 17:58:28 +00:00
pooka c59435eea2 add rumpuser_sp_fini, which surpringly is the opposite of rumpuser_sp_init 2010-12-12 17:10:36 +00:00
pooka 939300d48c outdated comment 2010-12-12 13:48:55 +00:00
plunky 90c70dd232 rearrange libraries to reduce the number of .WAITs (14 -> 6)
during that, fix some outdated comments & list dependents
2010-12-12 12:09:51 +00:00
tsutsui be1c859466 We can't assume syscall retains t0, unless it's documented as ABI. 2010-12-12 09:03:06 +00:00
tsutsui f3f411dad2 brk(2) should update __curbrk, not __minbrk or garbage. 2010-12-12 09:00:37 +00:00
joerg 6ccee47911 Revert last as gcc(1) checks for -r to disable passing down --relax e.g.
on Sparc.
2010-12-10 20:06:17 +00:00
abs eb439bf1a7 Add noieee versions for lround(), lroundf(), lrint(), lrintf(),
llrint() and llrintf().  Code copied from round(), roundf() and
rint() and modified for return values.  Its possible this may not
do the right things in edge cases, but if so its likely to have
the same issues as the existing round(), roundf() and rint().

All this used by vax (only), and should allow xnest to complete
build.
2010-12-09 22:52:59 +00:00
joerg cb6cc2679c Wrap sys_errlist constants in a macro to make it easier to extract
the strings reliably with sed/awk.
2010-12-09 21:27:31 +00:00
njoly a2a0aef6cd s/curses_fileo/curses_fileio/ in xrefs. 2010-12-09 13:26:27 +00:00
njoly b0b35bdc77 Add missing space in fread xref. 2010-12-09 11:21:49 +00:00
njoly 5db815a78e Convert a few macros to Vt (variable type). 2010-12-09 09:22:31 +00:00
christos 75a9445418 use %option noinput 2010-12-08 03:19:19 +00:00
joerg 72183148bb Explicitly pass down -r as linker option. 2010-12-08 02:07:25 +00:00
joerg 3b7d8067b3 Don't redeclare __isthreaded. 2010-12-08 02:07:03 +00:00