Commit Graph

194710 Commits

Author SHA1 Message Date
uebayasi 5d2c6eda11 Dereferencing struct proc * and struct lwp *, include them 2010-11-15 06:05:27 +00:00
uebayasi 2d479f916f Dereferencing struct lwp * needs sys/lwp.h. 2010-11-15 06:01:07 +00:00
uebayasi 15158cd1c7 This doesn't use uvm(9) API. 2010-11-15 05:59:57 +00:00
uebayasi 1d247bb84c wakeup needs sys/proc.h. 2010-11-15 05:58:18 +00:00
uebayasi e379b4b16c tsleep needs sys/proc.h. 2010-11-15 05:57:07 +00:00
uebayasi ce4b9e0990 Socket ioctl definitions need sys/sockio.h. 2010-11-15 05:56:29 +00:00
uebayasi 0666f65e61 curlwp needs sys/lwp.h. 2010-11-15 05:52:41 +00:00
tron 103af04b49 Don't use internal libc function __findenv(). 2010-11-14 22:25:23 +00:00
tron 1fbd900608 Don't use internal libc function __findenv(). 2010-11-14 22:09:16 +00:00
tron 2f85740ecc 1.) Rename internal function __findvar() to __findenvvar().
2.) Add a wrapper function __findenv() which implements the previous
    *internal* interface. It turns out that ld.elf_so(1) and pthread(3)
    both use it.

Stripping e.g. "LD_LIBRARY_PATH" from the environment while running
setuid binaries works again now.
2010-11-14 22:04:36 +00:00
schnoebe 041d7f637f bin/44088
Change the initialization state of gtagsmode to 0, (unset).

This brings about least astonishment for users, permittings tags
functionality to work as expected.
2010-11-14 20:53:54 +00:00
tron 268c79e4cc Set errno to ENOENT if we reject the environment variable name in
getenv_r() instead of leaving it unchanged.
2010-11-14 20:37:02 +00:00
christos af7c6886fd revert previous. breaks other stuff. 2010-11-14 19:49:16 +00:00
christos 082c42cb76 - Fix a couple of bugs to make the following two echo statements print the
same output as they should:

    line='#define bindir "/usr/bin" /* comment */'
    echo "${line%%/\**}"
    echo ${line%%/\**}

1. ISDBLQUOTE() was not working properly for non VSNORMAL expansions because
   varnest was incremented before the variable was completely parsed. Add
   an insub adjustment to keep track of that.
2. When we have a quoted backslash, we need to escape twice, because one
   level of escaping will be stripped later. (XXX: Do that when insub == 1
   only?)

- Make macros statements
2010-11-14 19:43:38 +00:00
christos 232829f42f don't core-dump if we cannot open the trace file. 2010-11-14 19:36:07 +00:00
tron 91e8290e88 Add a new regression test "t_threaded" which tests using getenv_r(3),
putenv(3), setenv(3) and unsetenv(3) concurrently.
2010-11-14 19:19:24 +00:00
tron 18217b5088 Update tests for *env(3):
- Introduce randomness into "t_setenv" to avoid freeing environment
  variables exactly in the order they have been allocated.
  Also call unsetenv(3) twice to make sure it behaves well if the
  environment variable doesn't exist.
- "t_getenv" is no longer a known failure after getenv(3) and getenv_r(3)
  have been fixed.
2010-11-14 18:15:08 +00:00
tron fbf4aa1699 Improve and simplify implementation of *env(3) functions:
- Use RB tree to keep track of memory allocated via setenv(3) as
  suggested by Enami Tsugutomo in private e-mail.
  This simplifies the code a lot as we no longer need to keep the size
  of "environ" in sync with an array of allocated environment variables.
  It also makes it possible to free environment variables in unsetenv(3)
  if something has changed the order of the "environ" array.
- Fix a bug in getenv(3) and getenv_r(3) which would return bogus
  results e.g. for " getenv("A=B") " if an environment variable "A"
  with value "B=C" exists.
- Clean up the internal functions:
  - Don't expose the read/write lock for the environment to other parts
    of "libc". Provide locking functions instead.
  - Use "bool" to report success or failure.
  - Use "ssize_t" or "size_t" instead of "int" for indexes.
  - Provide internal functions with simpler interfaces e.g. don't
    combine return values and reference arguments.
  - Don't copy "environ" into an allocated block unless we really need
    to grow it.

Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by
Joerg Sonnenberger and me. These changes also fix problems in
zsh 4.3.* and pam_ssh according to Joerg.
2010-11-14 18:11:42 +00:00
uebayasi dff67e454b Include dependencies directly. 2010-11-14 15:47:20 +00:00
uebayasi 01fb76730e Include sys/ioccom.h directly because it's used. 2010-11-14 15:36:47 +00:00
christos 0c40d420be recognize isysroot 2010-11-14 15:18:24 +00:00
uebayasi 2bc2c4def2 ... and another. 2010-11-14 15:18:07 +00:00
uebayasi 12d4db54c0 Fix build caused by a last minute change. 2010-11-14 15:16:53 +00:00
uebayasi 26dd1e598f Be a little more friendly to dynamic physical segment registration.
Maintain an array of pointer to struct vm_physseg, instead of struct
array.  So that VM subsystem can take its pointer safely.  Pointer
to this struct will replace raw paddr_t usage in the future.

Dynamic removal is not supported yet.

Only MD data structure changes, no kernel bump needed.

Tested on i386, amd64, powerpc/ibm40x, arm11.
2010-11-14 15:06:34 +00:00
bouyer 4621c0ed04 Boot vs AP processors don't make sense for physical CPUs, these are
handled by the hypervisor and all CPUs are running when the dom0 is started.
In addition, we don't have a reliable way to determine the boot CPU as
- we may not be running on the boot CPU
- we don't have access to the lapic id
So simplify by ignoring the information and assign phycpu_info_primary to the
first attached CPU.
2010-11-14 13:43:04 +00:00
mlelstv f9c11ac3ae rlphy fails to work without autonegotiation.
Reason is that ifm_data does not store BMCR data but a media index
that gets poked into the BMCR register.

Setting the BMCR and ANAR registers is correctly handled by the
generic function mii_phy_setmedia.
2010-11-14 13:40:36 +00:00
bouyer fd46720a12 Explain why we hardwire lapic_cpu_number() to 0 on Xen. 2010-11-14 13:40:31 +00:00
uebayasi 5d7952a5d1 Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap.  vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
2010-11-14 13:33:20 +00:00
kiyohara de5ebce146 Add myself. 2010-11-14 11:19:49 +00:00
uebayasi b76221069a This actually uses only PAGE_SIZE, remove uvm/uvm_extern.h again. 2010-11-14 06:30:59 +00:00
uebayasi 7caa83525a According to nxr.netbsd.org nothing uses CTL_NAMES now. 2010-11-14 05:34:56 +00:00
uebayasi af8968bc24 Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace. 2010-11-14 05:31:59 +00:00
uebayasi 1674b65491 Oops. Fix thinko. 2010-11-14 04:31:02 +00:00
uebayasi c9ff0b160b Platforms that dynamically set PAGE_{SIZE,MASK,SHIFT}, those values are
saved in struct uvmexp.  Expose only the relevant part for symbol users,
so that they don't need to include the whole uvm(9) API.
2010-11-14 04:25:16 +00:00
uebayasi 4bbd14ce50 Yet another hidden uvmexp user. 2010-11-14 04:01:50 +00:00
uebayasi d877842fbf Direct/indirect uses of sys/device.h and prop/proplib.h. 2010-11-14 03:57:17 +00:00
uebayasi 19b39d64b4 Include uvm/uvm_extern.h to access uvmexp. gtmpsc.c doesn't need
uvm(9) API at all.
2010-11-14 03:49:52 +00:00
uebayasi bf824a0e5c This uses autoconf(9) API, include sys/device.h. 2010-11-14 03:36:52 +00:00
uebayasi 401165c038 prop/proplib.h is indirectly used here, include it.
XXX What is the conclusion about direct vs. indirect #include from headers?
2010-11-14 03:32:44 +00:00
uebayasi b9437ce56d Directly include sys/pmf.h because this uses it. 2010-11-14 03:22:01 +00:00
uebayasi 7aed473aa6 Include sys/pmf.h for pmf(9) API. 2010-11-14 03:17:50 +00:00
uebayasi 1be6f4ae31 Don't rely on global APIs from internal. 2010-11-14 03:16:03 +00:00
roy e4ee997db8 Document RTM_CHGADDR and the newer RTM_IFINFO messages. 2010-11-14 00:38:56 +00:00
tron 603058a76c Add a test for getenv(3) which fails at the moment because it doesn't
handle "=" in variable names properly.

I'll send out a diff for review soon which fixes this.
2010-11-13 21:08:36 +00:00
plunky 9dc6fb5c3d quell some lint warnings 2010-11-13 19:43:56 +00:00
christos f214ecbad3 forgot to commit this one for two months!
add vdprintf.
2010-11-13 19:41:32 +00:00
christos e614555f42 add want_agent to the commented line of pam_ssh 2010-11-13 19:19:40 +00:00
tron 926ab269df Improve testing of environment handling:
1.) Always check the return value of setenv(3) and unsetenv(3).
2.) Test that calling setenv(..., ..., 0) doesn't overwrite environment
    variables.
3.) Add a new test which mixes putenv(3) and setenv(3).
2010-11-13 18:52:55 +00:00
uebayasi 9b35e244a4 Some missing sys/device.h dependencies. 2010-11-13 15:35:49 +00:00
pgoyette 1e2c5ac2c2 Add pseudo-device dmoverio(4) to ALL 2010-11-13 14:38:44 +00:00