| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=269684
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=269683
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=253600
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit. Merge it:
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:
In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.
No mergeinfo changes with this commit as r241475 already updated the
mergeinfo.
Notes:
svn path=/stable/8/; revision=248821
|
| |
|
|
| |
Notes:
svn path=/stable/8/; revision=247500
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a sample program that shows how a custom comparison function and
qsort(3) can work together to sort an array of integers.
PR: docs/176197
Submitted by: Fernando, fapesteguia at opensistemas.com
Christoph Mallon, christoph.mallon at gmx.de
Approved by: gjb (mentor), remko (mentor)
Notes:
svn path=/stable/8/; revision=247276
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:
In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.
Approved by: cperciva (implicit)
Notes:
svn path=/stable/8/; revision=241475
|
| |
|
|
|
|
|
|
|
| |
General mdoc(7) and typo fixes.
PR: 167734
Notes:
svn path=/stable/8/; revision=235576
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.
Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.
Call back into libthr from __cxa_finalize using weak
__pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.
The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.
MFC r211894:
Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.
Requested and tested by: Peter Jeremy <peter rulingia com>
Notes:
svn path=/stable/8/; revision=235198
|
| |
|
|
|
|
|
|
|
| |
r228885:
- Add missing opening and closing brackets in getopt_long.3 and
getsubopt.3 to make the examples reflect reality more closely.
Notes:
svn path=/stable/8/; revision=229330
|
| |
|
|
|
|
|
|
|
|
|
| |
Because POSIX does not allow EINTR to be returned from sigwait(),
add a wrapper for it in libc and rework the code in libthr, the
system call still can return EINTR, we keep this feature.
Discussed with: davidxu
Notes:
svn path=/stable/8/; revision=225896
|
| |
|
|
|
|
|
|
| |
Fix some style(9) issues.
Do not use strlcpy() where simple assignment is enough.
Notes:
svn path=/stable/8/; revision=217441
|
| |
|
|
|
|
|
|
|
|
|
| |
Sync with OpenBSD rev. 1.13:
strtonum does not require limits.h
Obtained from: OpenBSD
Discussed with: ru@
Notes:
svn path=/stable/8/; revision=214379
|
| |
|
|
|
|
|
|
|
|
|
| |
Add cross-references to lrand48(3) and arc4random(3) from rand(3)
and random(3).
MFC r213477:
Missed space.
Notes:
svn path=/stable/8/; revision=213773
|
| |
|
|
|
|
|
|
|
|
| |
- order prologue by Dd/Dt/Os
- fix prologue
- remove empty lines and other garbage
- uppercase document title
Notes:
svn path=/stable/8/; revision=211872
|
| |
|
|
|
|
|
| |
Style.
Notes:
svn path=/stable/8/; revision=211840
|
| |
|
|
|
|
|
|
|
|
|
| |
In reallocf(3), free the memory only when size != 0. Otherwise, when the
System V compatibility option (malloc "V" flag) is in effect a zero sized
reallocf() could cause a double free.
PR: bin/141753
Notes:
svn path=/stable/8/; revision=210745
|
| |
|
|
|
|
|
|
| |
The previous revision actually removed the bug being hinted at, so
go ahead and remove the hint.
Notes:
svn path=/stable/8/; revision=209698
|
| |
|
|
|
|
|
| |
C language does not has references, it provides pointers.
Notes:
svn path=/stable/8/; revision=207654
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Slightly modernize realpath(3).
SUSv4 requires that implementation returns EINVAL if supplied path is NULL,
and ENOENT if path is empty string [1].
Bring prototype in conformance with SUSv4, adding restrict keywords.
Allow the resolved path buffer pointer be NULL, in which case realpath(3)
allocates storage with malloc().
MFC r206898:
Free() is not allowed to modify errno, remove safety brackets around it.
Add small optimization, do not copy a string to the buffer that is
to be freed immediately after.
MFC r206997:
Move realpath(3) prototype to a POSIX section.
MFC r206998:
Add standards section, improve wording, taking into account the handling
of NULL and changed type in declaration.
Notes:
svn path=/stable/8/; revision=207599
|
| |
|
|
|
|
|
|
|
|
|
| |
Add missing return, in a rare case where we can't allocate memory in
deallocate.
Submitted by: Ryan Stone (rysto32 at gmail dot com)
Approved by: jasone
Notes:
svn path=/stable/8/; revision=203701
|
| |
|
|
|
|
|
| |
Make malloc(3) superpage aware.
Notes:
svn path=/stable/8/; revision=198815
|
| |
|
|
|
|
|
|
|
|
| |
Handle zero size for posix_memalign. Return NULL or unique address
according to the 'V' option.
Approved by: re (kensmith)
Notes:
svn path=/stable/8/; revision=197127
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for stable branches:
- shift to MALLOC_PRODUCTION
- turn off automatic crash dumps
- Remove kernel debuggers, INVARIANTS*[1], WITNESS* from
GENERIC kernel config files[2]
[1] INVARIANTS* left on for ia64 by request marcel
[2] sun4v was left as-is
Reviewed by: marcel, kib
Approved by: re (implicit)
Notes:
svn path=/stable/8/; revision=197065
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our implementation of granpt(3) could be valid in the future.
When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert
Watson and I agreed the best way to implement this, would be to let
posix_openpt() create a pseudo-terminal with proper permissions in place
and let grantpt() and unlockpt() be no-ops.
This isn't valid behaviour when looking at the spec. Because I thought
it was an elegant solution, I filed a bug report at the Austin Group
about this. In their last teleconference, they agreed on this subject.
This means that future revisions of POSIX may allow grantpt() and
unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation
has such a device) and posix_openpt() already do the right thing.
I'd rather put this in the manpage, because simply mentioning we don't
comply to any standard makes it look worse than it is. Right now we
don't, but at least we took care of it.
Approved by: re (kib)
Notes:
svn path=/stable/8/; revision=196614
|
| |
|
|
|
|
|
| |
Submitted by: Christoph Mallon
Notes:
svn path=/head/; revision=194703
|
| |
|
|
| |
Notes:
svn path=/head/; revision=191789
|
| |
|
|
| |
Notes:
svn path=/head/; revision=189207
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A more elegant way of obtaining a name of a character device by its file
descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid
file descriptor implies a file descriptor is visible in /dev, it will
always resolve a valid device name.
I'm adding a more friendly wrapper for this ioctl, called fdevname(). It
is a lot easier to use than devname() and also has better error
handling. When a device name cannot be resolved, it will just return
NULL instead of a generated device name that makes no sense.
Discussed with: kib
Notes:
svn path=/head/; revision=188497
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
stating that in FreeBSD the atol() and atoll() functions affect
errno in the same way as strtol() and stroll().
PR: docs/126487
Submitted by: edwin
Reviewed by: trhodes, gabor
MFC after: 1 week
Notes:
svn path=/head/; revision=188305
|
| |
|
|
|
|
|
| |
Reported by: kib
Notes:
svn path=/head/; revision=185514
|
| |
|
|
|
|
|
|
|
| |
spinning is avoided due to running on a single-CPU system.
Reported by: stefanf
Notes:
svn path=/head/; revision=185483
|
| |
|
|
|
|
|
| |
Reported by: davidxu
Notes:
svn path=/head/; revision=185468
|
| |
|
|
|
|
|
|
|
|
| |
potential extreme contention in the kernel for multi-threaded applications
on SMP systems.
Reported by: kris
Notes:
svn path=/head/; revision=184602
|
| |
|
|
|
|
|
|
|
|
| |
Allow to define MALLOC_PRODUCTION with a make variable instead of polluting
the global CFLAGS.
Reviewed by: jasone
Notes:
svn path=/head/; revision=183969
|
| |
|
|
|
|
|
|
|
| |
page size and using sysconf(3).
Suggested by: marcel
Notes:
svn path=/head/; revision=182906
|
| |
|
|
| |
Notes:
svn path=/head/; revision=182809
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This caching allows for completely lock-free allocation/deallocation in the
steady state, at the expense of likely increased memory use and
fragmentation.
Reduce the default number of arenas to 2*ncpus, since thread-specific
caching typically reduces arena contention.
Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced,
cacheline-spaced, and subpage-spaced size classes. The advantages are:
fewer size classes, reduced false cacheline sharing, and reduced internal
fragmentation for allocations that are slightly over 512, 1024, etc.
Increase RUN_MAX_SMALL, in order to limit fragmentation for the
subpage-spaced size classes.
Add a size-->bin lookup table for small sizes to simplify translating sizes
to size classes. Include a hard-coded constant table that is used unless
custom size class spacing is specified at run time.
Add the ability to disable tiny size classes at compile time via
MALLOC_TINY.
Notes:
svn path=/head/; revision=182225
|
| |
|
|
|
|
|
|
|
| |
The routines in grantpt.c have been moved to ptsname.c in the MPSAFE TTY
layer, because grantpt() is now effectively a no-op. I forgot to remove
the corresponding source file from libc.
Notes:
svn path=/head/; revision=181915
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.
If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan
Notes:
svn path=/head/; revision=181905
|
| |
|
|
|
|
|
|
|
| |
preemption while busy-waiting.
Submitted by: Mike Schuster <schuster@adobe.com>
Notes:
svn path=/head/; revision=181733
|
| |
|
|
|
|
|
|
|
| |
detect whether the integer division table is large enough to handle the
divisor. Before this change, the last two table elements were never used,
thus causing the slow path to be used for those divisors.
Notes:
svn path=/head/; revision=181732
|
| |
|
|
|
|
|
|
| |
Found by: LLVM/Clang Static Checker
Approved by: jasone
Notes:
svn path=/head/; revision=181438
|
| |
|
|
|
|
|
|
|
|
|
|
| |
environ[0] to be more obvious that environ is not NULL before environ[0]
is tested. Although I believe the previous code worked, this change
improves code maintainability.
Reviewed by: ache
MFC after: 3 days
Notes:
svn path=/head/; revision=181266
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the first value (environ[0]) to NULL. This is in addition to the
current detection of environ being replaced, which includes being set to
NULL. Without this fix, the environment is not truly wiped, but appears
to be by getenv() until an *env() call is made to alter the enviroment.
This change is necessary to support those applications that use this
method for clearing environ such as Dovecot and Postfix. Applications
such as Sendmail and the base system's env replace environ (already
detected). While neither of these methods are defined by SUSv3, it is
best to support them due to historic reasons and in lieu of a clean,
defined method.
Add extra units tests for clearing environ using four different methods:
1. Set environ to NULL pointer.
2. Set environ[0] to NULL pointer.
3. Set environ to calloc()'d NULL-terminated array.
4. Set environ to static NULL-terminated array.
Noticed by: Timo Sirainen
MFC after: 3 days
Notes:
svn path=/head/; revision=181150
|
| |
|
|
|
|
|
|
|
|
| |
the chunk map instead of red-black trees where possible. Remove the
red-black trees and node objects that are obsoleted by this change. The
net result is a ~1-2% memory savings, and a substantial allocation speed
improvement.
Notes:
svn path=/head/; revision=180599
|
| |
|
|
|
|
|
|
|
|
|
|
| |
statement. Add the one from the current NetBSD version.
- Also bump a date to reflect my content changes I have done in previous
revision
Approved by: imp
MFC after: 3 days
Notes:
svn path=/head/; revision=180329
|
| |
|
|
|
|
|
|
|
| |
PR: docs/75995
Submitted by: Tarc <tarc@po.cs.msu.su>
MFC after: 3 days
Notes:
svn path=/head/; revision=180325
|
| |
|
|
|
|
|
|
|
| |
- remove contractions
MFC after: 3 days
Notes:
svn path=/head/; revision=180323
|
| |
|
|
|
|
|
|
| |
PR: docs/122818
MFC after: 3 days
Notes:
svn path=/head/; revision=180024
|