Fix two broken macros.


git-svn-id: svn://svn.freebsd.org/base/head@249222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The CELL fields can be various integer types depending on the platform
(ARM uses 'int' and 'unsigned'; i386 uses 'long' and 'unsigned long'),
so we need explicit casts to long and unsigned long here to ensure
that the result matches the printf %ld and %lx specifiers.


git-svn-id: svn://svn.freebsd.org/base/head@249223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove extra semicolons from CAM_SIM_[UN]LOCK() macros.


git-svn-id: svn://svn.freebsd.org/base/head@249224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix regression issue after r248910.

PR:		arm/177685
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>


git-svn-id: svn://svn.freebsd.org/base/head@249232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
mqueue,ksem,shm: Fix race condition with setting UF_EXCLOSE.

POSIX mqueue, compatibility ksem and POSIX shm create a file descriptor that
has close-on-exec set. However, they do this incorrectly, leaving a window
where a thread may fork and exec while the flag has not been set yet. The
race is easily reproduced on a multicore system with one thread doing
shm_open and close and another thread doing posix_spawnp and waitpid.

Set UF_EXCLOSE via falloc()'s flags argument instead. This also simplifies
the code.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@249233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add some missing newlines and static declarations.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@249234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Add const to nodesavestr().


git-svn-id: svn://svn.freebsd.org/base/head@249235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use 4-byte padding for core dump notes on both 32 and 64bit archs.

Although native word padding (i.e. 8-byte on 64bit arch) looks to be
in agreement with standards, other parts of our code and other OSes
use 4-byte alignment.

This is not expected to change alignment for currently generated core
dump notes, as the notes look to consist of structures with sizes
multiple of 8 on 64-bit archs. But there are plans to add additional
notes, where 4-byte vs 8-byte alignment makes difference.

Discussed with:	kib
Reviewed by:	kib
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@249238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fill p_flags and p_align fields of the core dump note segement.

Reviewed by:	kib
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@249239 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use pget(9) to reduce code duplication.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@249240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix synopsis for sbuf_len.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@249241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'