| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
we can end up with some threads with a non-16-byte-aligned stack. This
causes some interesting side effects, including general protection
faults leading to a SIGBUS when doing floating point or varargs. This
should be just a verbose NOP for the other platforms.
Approved by: re (scottl)
|
|
|
|
|
|
| |
wrapped version of write().
Submitted by: dan@langille.org
|
|
|
|
|
|
|
| |
be closed. This fixes a file descriptor leak when closing a kqueue() fd.
Reviewed by: deischen
MFC after: 1 week
|
|
|
|
|
| |
Noticed by: ted@NLnetLabs.nl (Ted Lindgreen)
Approved by: ru
|
|
|
|
| |
the same src/lib/libc_r/test/* tests that the other platforms pass.
|
|
|
|
|
|
|
|
|
| |
stale stdio descriptors flags.
PR: bin/51535
Submitted by: Enache Adrian <enache@rdslink.ro>
Reviewed by: deischen
Approved by: re (scottl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an excessive close() on one of these descriptors would cause
a memory for this descriptor to be allocated in the internal
descriptor table. When this descriptor gets used again, e.g.
through the call to open() or socket(), the descriptor would
be erroneously left in the blocking mode, and the whole
application would get stuck on a blocking operation, e.g.,
in accept(2).
Prevent this bug from happening by disallowing close() against
non-active descriptors (return -1 and set errno to EBADF in
this case).
Reviewed by: deischen
Approved by: re (scottl)
|
|
|
|
|
|
|
|
|
| |
libthr. No changes were made to libpthread by request of deischen,
who will soon commit a real implementation for that library.
PR: standards/50848
Submitted by: Sergey A. Osokin <osa@freebsd.org.ru>
MFC after: 1 week
|
|
|
|
|
|
| |
more complicated things than just setting the lock to 0.
- Implement stubs for this function in libc and the two threading libraries
that are currently in the tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not save (restore) the global pointer (GP) in the jmpbuf in setjmp
(longjmp) because it's not needed in general. GP is considered a
scratch register at callsites and hence is always restored after a
call (when it's possible that the call resolves to a symbol in a
different loadmodule; otherwise GP does not have to be saved and
restored at all), including calls to setjmp/longjmp. There's just
one problem with this now that we use setjmp/longjmp for context
switching: A new context must have GP defined properly for the
thread's entry point. This means that we need to put GP in the
jmpbuf and consequently that we have to restore is in longjmp.
This automaticly requires us to save it as well.
When setjmp/longjmp isn't used for context switching, this can be
reverted again.
|
|
|
|
|
|
|
|
|
|
|
| |
integral type to the size of a pointer type when it's known that the
cast is valid. On ia64 such casts are generally bad news and has led
us (=peter :-) to make such casts fatal. By casting to intptr_t
before casting to a pointer type, this now compiles cleanly in LP64
architectures. Note that the final cast has been changed to void*
(instead of siginfo_t*) to make it explicit that we're not trying to
pass a siginfo_t pointer but rather trying to pass an int when the
prototype says it should be a pointer.
|
| |
|
|
|
|
| |
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
|
|
|
|
|
|
| |
address instead of specified by pthread_attr_t passed to pthread_create().
Suggested by: deischen
|
|
|
|
|
|
| |
overflow when dumping thread info (generated by receipt of SIGINFO).
Reported by: jmallet
|
|
|
|
| |
to be consistent with other pthread_XXX functions
|
|
|
|
|
|
|
|
|
|
|
| |
because we have 2 stacks per thread: the regular downward
memory stack and the irregular upward register stack. This
implementation lets both stacks grow toward each other. An
alternative scheme is to have them grow away from each other.
The alternate scheme has the advantage that both stack grow
toward guard pages. Since libc_r is virtually dead and we
really want the *context stuff for thread switching, we don't
try to be perfect, just functional.
|
| |
|
|
|
|
| |
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
|
|
|
|
|
|
| |
and sendto() cancelation points, as required by POSIX.1-2001.
Reviewed by: deischen
|
|
|
|
|
|
|
|
|
| |
descriptors that have the close-on-exec flag set, as that will have no
effect anyway and might screw something else up if the file descriptor
happens to be shared with another process.
PR: standards/43335
MFC after: 1 week
|
|
|
|
|
|
|
|
|
| |
by filling in the jump table.
Convert uses of pthread routines within libc_r to use the internal
versions (_pthread_foo instead of pthread_foo).
Remove a couple of globals from application namespace.
|
|
|
|
|
|
|
| |
a partial-write is followed by an error.
PR: 43335
MFC after: 3 days
|
|
|
|
|
|
|
| |
a partial-write is followed by an error.
PR: 43335
MFC after: 1 week
|
|
|
|
|
|
|
| |
accidentally call a stub or application provided version of the
same routine.
Submitted by: dfr
|
| |
|
|
|
|
|
|
|
|
|
| |
extenston function. It supposed to provide facility to get already created
thread's attributes. Looks like it's last thing we need to make JDK's Hotspot
building without requirement to have source tree.
Reviewed by: deischen
MFC after: 3 days
|
|
|
|
|
| |
OK'ed by: deischen
MFC after: 3 days
|
|
|
|
| |
Approved by: deischen
|
|
|
|
|
|
|
| |
know what file! (Prevents use of NULL).
MFC after: 1 day
Reviewed by: deischen
|
|
|
|
|
|
|
|
| |
of a file descriptor has NULL entries, so don't dereference the table entries
to get the owners ever -- don't print the owners when processing a thread_dump
request as a result of SIGINFO.
Reviewed by: deischen
|
|
|
|
| |
Approved by: deischen
|
|
|
|
| |
MFC after: 2 weeks
|
|
|
|
|
|
|
|
| |
the FPU state on receiving and returning from a signal.
The FPU save and restore macros are no longer needed, but
remain defined in case we need to use them again (something
else breaks). They'll be removed permanently once new
syscalls are added to handle the new i386 ucontext size.
|
|
|
|
|
|
| |
`sigprocmask', `sigaltstack', and `sigwait' as well as to the
prototypes of the apparantly unimplemented functions `sigtimedwait'
and `sigwaitinfo'. This complies with IEEE Std 1003.1-2001.
|
|
|
|
| |
set.
|
|
|
|
|
|
| |
to/from a ucontext when a thread is interrupted by a signal.
This will be removed when a proper fix is made in the kernel
to save/restore the FP state without breaking the ABI.
|
|
|
|
|
| |
Submitted by: Dan Eischen (deischen@freebsd.org)
Pointy hat for breakage just before going offline: Mini@freebsd.org
|
|
|
|
|
|
|
|
|
|
|
| |
at file flags and replace it with functions that will avoid null
pointer checks.
MFC to be done by archie ;-)
PR: 42100
Reviewed by: archie, robert
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
| |
file descriptor bit if poll() returns POLLERR, POLLHUP, or POLLNVAL.
Othewise, it's possible for select() to return successfully but
with no bits set.
Reviewed by: deischen
MFC after: 3 days
PR: bin/42175
|
|
|
|
|
|
|
|
| |
on behalf of a thread, we should check the POLLERR, POLLHUP, and
POLLNVAL flags as well to wake up the thread in these cases.
Suggested by: deischen
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
initially suspended. This was preventing such threads from getting
resumed.
Reported by: Bill Huey <billh@gnuppy.monkey.org>
|
|
|
|
|
|
| |
the process as well as pending on the current thread.
Reported by: Andrew MacIntyre <andymac@bullseye.apana.org.au>
|
|
|
|
| |
Prompted by: wollman
|
|
|
|
|
|
|
|
|
| |
file descriptors in programs linked with libc_r with flags
other than the default ones. This kept, inter alia, freopen()
from working correctly when reopening standard streams.
reviewed by: deischen
PR: misc/39377
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and pthread_resume_all_np(). These suspend and resume all threads except
the current thread, respectively. The existing functions pthread_single_np()
and pthread_multi_np(), which formerly had no effect, now exhibit the same
behaviour and pthread_suspend_all_np() and pthread_resume_all_np(). These
functions have been added mostly for the native java port.
Don't allow the uthread kernel pipe to use the same descriptors as
stdio. Mostily submitted by Oswald Buddenhagen <ossi@kde.org>.
Correct some minor style nits.
|
|
|
|
|
|
|
|
| |
pthread_page_size.
Fix a bunch line wrapping.
Pointed out by: deischen
|
|
|
|
|
|
|
| |
allow running on other arches when the instructions are supported but
the page size granularity is not.
Glanced at by: peter
|