Commit Graph

156194 Commits

Author SHA1 Message Date
John Baldwin
fab216aaa0 Sort function prototypes (since I didn't manage to insert tdksignal()
correctly).
2010-06-29 20:55:12 +00:00
John Baldwin
7a6f3d7890 Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Reported by:	Anit Chakraborty
Reviewed by:	kib, deischen (concept)
MFC after:	1 week
2010-06-29 20:44:19 +00:00
John Baldwin
ad6eec7b9e Tweak the in-kernel API for sending signals to threads:
- Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c.
- Add tdsignal() and tdksignal() routines that mirror psignal() and
  pksignal() except that they accept a thread as an argument instead of
  a process.  They send a signal to a specific thread rather than to an
  individual process.

Reviewed by:	kib
2010-06-29 20:41:52 +00:00
Marcel Moolenaar
cfbcffa248 Fix profiling (part 1):
o   Functions are 4-byte aligned for Book-E.
o   We get compiled with -DPROF and not -DGPROF if profiling
    is enabled.
2010-06-29 19:07:44 +00:00
Matt Jacob
6e4b813833 Don't lock buses around a call to xptperiphlistmatch- the buses will be
locked at appropriate places.

MFC after:	1 week
X-MFC:		208752
2010-06-29 17:10:55 +00:00
Gleb Smirnoff
24536f92c5 After processing the O_SKIPTO opcode our cmd points to the next rule, and
"match" processing at the end of inner loop would look ahead into the next
rule, which is incorrect. Particularly, in the case when the next rule
started with F_NOT opcode it was skipped blindly.

To fix this, exit the inner loop with the continue operator forcibly and
explicitly.

PR:		kern/147798
2010-06-29 16:57:30 +00:00
John Baldwin
5695d99d40 - The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
- Tweak wording in history section for pthread_timedjoin_np().

MFC after:	3 days
2010-06-29 14:32:01 +00:00
Konstantin Belousov
5ed35ba97a Revert r209578:
Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
C++ does not have designator-initializer facility of C99, not using this
in the header makes us friendly to C++ kernel modules, whoever wants
such schism.

Requested by:	mdf
MFC after:	6 days (not really)
2010-06-29 14:31:49 +00:00
Warner Losh
b8f92ce4de Expand system into my_system, and add the necessary tidyness that we
need.  Close the pidfile.  Then close all descriptors >= 3 to avoid
information leakage to children.

This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...

MFC after:	3 days
2010-06-29 03:52:12 +00:00
Doug Barton
d748aee076 If i is going to be used in the loop unconditionally the declaration
has to be unconditional as well.

Conical head covering to:	kib
2010-06-29 01:04:24 +00:00
Konstantin Belousov
13cedde2cb Regenerate 2010-06-28 18:17:21 +00:00
Konstantin Belousov
0d9d996d39 Despite system call deregistration drains the threads executing System V
shm syscalls, and initial check for the number of allocated segments
in the module deinitialization code, the following might happen:
   after the check for active segment, while waiting for threads to
   leave some other syscall, shmget(2) is called. Then, we can end
   up with the shared segment that cannot be detached since sysvshm
   module is unloaded.

Prevent the leak by rechecking and disclaiming a reference to the vm
object owned by sysvshm module, that might have grown during the drain.

Tested by:	pho
Reviewed by:	jhb
MFC after:	1 month
2010-06-28 18:12:42 +00:00
Konstantin Belousov
153ac44cf6 Count number of threads that enter and leave dynamically registered
syscalls. On the dynamic syscall deregistration, wait until all
threads leave the syscall code. This somewhat increases the safety
of the loadable modules unloading.

Reviewed by:	jhb
Tested by:	pho
MFC after:	1 month
2010-06-28 18:06:46 +00:00
Konstantin Belousov
dc2db34f42 Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
MFC after:	1 week
2010-06-28 17:59:45 +00:00
Attilio Rao
b2488fc159 Fix a lock leak in the deadlock resolver in case the ticks counter
wrapped up.

Sponsored by:	Sandvine Incorporated
Submitted by:	pluknet <pluknet at gmail dot com>
Reported by:	Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by:	jhb
MFC after:	3 days
2010-06-28 17:45:00 +00:00
Gavin Atkinson
31fa41024e Various changes to make locate compilable with WARNS=6. Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
actually bumping this to WARNS=6 - I'm still considering the correct
solution to this issue.

Tested by:		make universe
2010-06-28 12:04:55 +00:00
Gavin Atkinson
ddcdd26ef6 Make WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
where needed.  Also, fix bad indentation on lines already affected by the
above changes.

Tested with:	make universe
2010-06-28 12:00:20 +00:00
Gavin Atkinson
84f70ae360 Make WARNS=6 safe.
Tested by:	make universe
2010-06-28 08:30:10 +00:00
Pawel Jakub Dawidek
aac0676809 Use spaces, not tabs. 2010-06-28 08:05:30 +00:00
Nathan Whitehorn
153d788f31 Revert r209544. It papers over a binutils bug, and is not even a reliable
fix for it.

The bug occurs when using the --as-needed flag to ld in the presence of
synthetic linker-generated symbols that reference symbols defined in
linked-to shared libraries with versioned symbols. When the only symbols
used from a library fall into this category, ld will drop the DT_NEEDED
entry for it, but retain the versioning information. This bug is best
fixed/hacked around in binutils, not in rtld.

Discussed with:	kan
2010-06-28 01:40:56 +00:00
Gavin Atkinson
16596b221d Make the second example command more closely match the demo output, and as
a side effect more clearly show the change in command lines between the
first and second example invocations.
2010-06-27 23:11:35 +00:00
Warner Losh
445b5e2b79 Properly inherit variables from src/usr.sbin/Makefile.inc for
subdirectories of pc-sysinstall.  Back out explicit setting in
pc-sysinstall/pc-sysinstall/Makefile.
2010-06-27 17:14:04 +00:00
Warner Losh
73d3a33a3f Update pc-sysinstall to output list of FTP mirrors as well as some
installation information.  Export architecture to install.

PR:		148184
Submitted by:	John Hixson
2010-06-27 17:04:03 +00:00
Warner Losh
adf5b4bcd6 Spell iXsystems, Inc properly
Submitted by:	delphij@
2010-06-27 16:46:11 +00:00
Gavin Atkinson
c54da67276 Fix transfer statistics in the "send file" case - The conditional used
to print the stats were using an uninitialised variable. [1]

Fix trasnfer statistics in the "receive file" case - the statistics struct
was being cleared both before and after the initial connect to the remote
server.  As a result, the printed time and calculated bandwidth covers
the time to connect ad well as the time to transfer the file.  This may
not be ideal, but now at least matches the "send file" case.

Found by:	clang static analyser [1]
Reviewed by:	imp
2010-06-27 14:21:08 +00:00
Gavin Atkinson
a1ec94b88d Fix core dump when server fails to respond.
Reviewed by:	imp
2010-06-27 14:11:03 +00:00
Jaakko Heinonen
bc96d3d17a Correct a comment typo. 2010-06-27 12:19:09 +00:00
Rui Paulo
cb3fbd1b92 Fix typo introduced in previous revision. 2010-06-27 10:17:11 +00:00
Colin Percival
bb48785424 Note that internal_underscores should be used in identifier names rather
than camelCase or TitleCase.

According to grep and my checked-out source tree, we're currently at
3733379 internal_underscores, 93024 camelCases, and 80831 TitleCases;
so this commit is merely documenting existing practice.
2010-06-27 02:30:19 +00:00
Nathan Whitehorn
5540acc1ba Ignore versioned dependencies on shared objects to which we do not link.
This fixes an error with files like this created by GNU ld under certain
circumstances.
2010-06-26 22:04:52 +00:00
Pawel Jakub Dawidek
3297cdd096 Correct arguments order. 2010-06-26 21:44:45 +00:00
Pawel Jakub Dawidek
da6ee3126b Just like in case of setgroups(2), for getgroups(2) also advice including
sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS
definitions.
2010-06-26 21:44:05 +00:00
Rui Paulo
fcfe3ad480 Fix the AR_SREV_MERLIN_20_OR_LATER() check.
Submitted by:	Alex Kozlov <spam at rm-rf.kiev.ua>
MFC after:	2 weeks
2010-06-26 20:59:10 +00:00
Michael Tuexen
e1c97831ec * Do not dereference a NULL pointer when calling an SCTP send syscall
not providing a destination address and using ktrace.
* Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
Both bug where reported by Valentin Nechayev.
The first bug results in a kernel panic.
MFC after: 3 days.
2010-06-26 19:26:20 +00:00
Rui Paulo
e2a2599f07 Set svn:executable property so we can run the DTrace test suite. 2010-06-26 18:13:44 +00:00
Rui Paulo
c6b2b6fce6 Add NTFS partition type to GEOM_MBR. 2010-06-26 13:20:40 +00:00
Doug Barton
9dad55defc Taken from actual police videos ... 2010-06-26 07:02:31 +00:00
Warner Losh
cab5ea2e17 We need to install the shell scripts as executables rather than as
data files in the backend* trees.

Submitted by:	John Hixon
2010-06-25 22:35:19 +00:00
Rui Paulo
bbe4a97d41 Import the acpi_aibs(4) driver written by Constantine A. Murenin.
It has more features than acpi_aiboost(4) and it will eventually replace
acpi_aiboost(4).

Submitted by:	Constantine A. Murenin <cnst at FreeBSD.org>
Reviewed by:	freebsd-acpi, imp
MFC after:	1 month
2010-06-25 15:32:46 +00:00
Jayachandran C.
60ddfa2837 use PTR_WORD for __curbrk and minbrk instead of .word, the new version
wil support all ABIs.

Approved by:	rrs (mentor)
2010-06-25 05:36:36 +00:00
Jayachandran C.
d12582eb67 Add an alignment of 8 for sections in the n32 ABI. The default alignment
of of 4 causes _end to be word aligned, which will be returned by sbrk.

malloc(3), when compiled for n32, expects sbrk to return an 8-byte aligned
value.

Approved by:	rrs (mentor)
2010-06-25 05:07:42 +00:00
Warner Losh
4f4b032c2b Fix a stray PC-BSDism, on FreeBSD, we install these things into /usr/share 2010-06-24 22:47:50 +00:00
Warner Losh
b75ba9b10d Makefile overlooked in r2095137 2010-06-24 22:33:03 +00:00
Warner Losh
71d06a52a6 Remove the license files that svn made me remove at the last second, doh! 2010-06-24 22:29:36 +00:00
Warner Losh
4bbc5bd8e0 Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. This
shell script is the back end logic necessary for an installer.  It
contains both query routines to allow a front-end installer to present
reasonable choices to the user and also action routines which allow
the front end installer to put a FreeBSD distribution onto a disk.  It
supports installing onto the usual suspects, as well as advanced
features like Mirroring, ZFS, Encryprion and GPT labels.

While this is only the back-end of the installer, it can do unattended
scripted installations.  In PC-BSD's world view, all installations are
scripted and all the front-end does is write the script.  As such, it
is useful in its own right.

This has been extensively tested over the past several releases of
PC-BSD.  However, differences between that environment and FreeBSD
suggest there will be a period of shake-out while those differences
are discovered and corrected.

A text-based front-end is in the works.  For the GUI-based front-end,
you can use the PC-BSD distribution.

Kris' BSDcan paper on pc-sysinstall is linked off his talk on the
BSDcan site:
	http://www.bsdcan.org/2010/schedule/events/173.en.html

The man page is written by Josh Paetzel, and I wrote the Makefiles for
the FreeBSD integration.  Kris wrote the rest.

This represents version r7010 in the PC-BSD repo.
http://svn.pcbsd.org/pcbsd/current/pc-sysinstall

Submitted by:	kris@
Sponsored by:	iX Systems
2010-06-24 22:21:47 +00:00
George V. Neville-Neil
5ea4d522bb Make sure that all the exposed counters and variables are actually
being updated.

Pointed out by:	jfv
2010-06-24 21:17:58 +00:00
Warner Losh
d587260195 Merge from tbemd:
use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the
CSU is based on MACHINE_CPUARCH

Reviewed by:	arch@ (twice)
2010-06-24 17:53:25 +00:00
Warner Losh
4a5faa676e Merge from tbemd:
change the name of the object tree from ${TARGET} to
${TARGET}.${TARGET_ARCH} so we can do both big and little endian
builds in the same tree.

Reviewed by:	arch@ (twice)
2010-06-24 16:32:20 +00:00
Warner Losh
9998d0c0f0 Merge from TBEMD:
Rather than having arch specific code in Makefile.inc1, generalize so
that we can control the settings of different options on a per
architecutre basis.

Reviewed by:	arch@ (twice)
2010-06-24 16:28:52 +00:00
Jayachandran C.
4fddb8ed6f Add linker script and configuration file for n32 kernel.
Approved by:	rrs (mentor)
2010-06-24 10:14:31 +00:00