functions to be used by the dynamic linker. This can be called by
threads packages at start-up time. I will add the call to libc_r
soon.
Also add a default locking method that is used up until dllockinit()
is called. The default method works by blocking SIGVTALRM, SIGPROF,
and SIGALRM in critical sections. It is based on the observation
that most user-space threads packages implement thread preemption
with one of these signals (usually SIGVTALRM).
The dynamic linker has never been reentrant, but it became less
reentrant in revision 1.34 of "src/libexec/rtld-elf/rtld.c".
Starting with that revision, multiple threads each doing lazy
binding could interfere with each other. The usual symptom was
that a symbol was falsely reported as undefined at start-up time.
It was rare but not unseen. This commit fixes it.
1003.1c-1995.
Undefine _POSIX_THREAD_SAFE_FUNCTIONS, since we do not implement all of the
necessary interfaces. At least getgrgid_r(), getrnam_r(), getpwuid_r(),
getpwnam_r(), getc_unlocked(), getchar_unlocked(), putc_unlocked(),
and putchar_unlocked() are missing. Due to a likely typo in 1003.1c-1995,
we are not technically allowed to define _POSIX_THREADS without defining
_POSIX_THREAD_SAFE_FUNCTIONS, but either way we're non-compliant, so I'm
leaving _POSIX_THREADS defined.
PR: bin/8281
readdir_r is not POSIX according to POSIX_SOURCE, bruce says:
> readdir_r() is in the _POSIX_SOURCE section, but is not a POSIX.1-1990
> function. It's POSIX.1-1996 so it should be under a different feature
> test which we don't support yet.
make sure errno is saved so that its contents are cleared unless
necessary.
Submitted by: bde
eischen (Daniel Eischen) added wrappers to protect against cancled
threads orphaning internal resources.
the cancelability code is still a bit fuzzy but works for test
programs of my own, OpenBSD's and some examples from ORA's books.
add readdir_r to both libc and libc_r
add some 'const' attributes to function parameters
Reviewed by: eischen, jasone
Been in production for 3 years now. Gives Instant Frame relay to if_sr
and if_ar drivers, and PPPOE support soon. See:
ftp://ftp.whistle.com/pub/archie/netgraph/index.html
for on-line manual pages.
Reviewed by: Doug Rabson (dfr@freebsd.org)
Obtained from: Whistle CVS tree
-----------------------------
Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c
The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.
There are version bumps for the following libraries:
libdialog
libreadline
libc
libc_r
libedit
libftpio
libss
These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.
NOTE: libncurses already had an version bump and has not been
given one now.
NOTE: doscmd is a real casualty and has been disconnected for
the moment. Reconnection will eventually happen after
doscmd has been fixed. I'm aware that being the last one
to touch it, I'm automaticly promoted to being maintainer.
According to good taste this means that I will receive a
badge which either will be glued or mechanically stapled,
drilled or otherwise violently forced onto me :-)
NOTE: pcvt/vttest cannot be compiled with -traditional. The
change cause sys/types to be included along the way which
contains the const and volatile modifiers. I don't consider
this a solution, but more a workaround.
the default SHARED=copies, otherwise the kernel source tree gets modified
if /usr/include/machine is a symlink to the source tree (which is not the
case by default). Nothing in our src tree uses <machine/soundcard.h>.
Pointed out by: bde
would expect. (Allow user data to be associated with an EditLine context).
As this changes no existing interfaces and doesn't alter any structs
visable to the user I've been told that its not necessary to bump
the version of the library.
not currently supported. Also corrected the declaration for
pthread_testcancel which incorrectly returned int when POSIX and
SUSv2 both say it should be void.
Submitted by: Ralf S. Engelschall <rse@engelschall.com>
Reviewed by: John Birrell <jb@freebsd.org>
function. It was an ill-considered feature. It didn't solve the
problem I wanted it to solve. And it added Yet Another Version
Number that would have to be maintained at every release point.
I'm nuking it now before anybody grows too fond of it.
Include <machine/ansi.h> so that this file is self-sufficient again.
Rev.1.6 doesn't do this as claimed unless <nlist.h> has nonstandard
pollution.
Cleaned up includes.
implementation requires two things:
1.) The priority queues must be protected during insertion
and removal of threads. Since the kernel scheduler
must modify the priority queues, a spinlock for
protection cannot be used. The functions
_thread_kern_sched_defer() and _thread_kern_sched_undefer()
were added to {un}defer kernel scheduler activation.
2.) A thread (active) priority change can be performed only
when the thread is removed from the priority queue. The
implementation uses a threads active priority when
inserting it into the queue.
A by-product is that thread switches are much faster. A
separate queue is used for waiting and/or blocked threads,
and it is searched at most 2 times in the kernel scheduler
when there are active threads. It should be possible to
reduce this to once by combining polling of threads waiting
on I/O with the loop that looks for timed out threads and
the minimum timeout value.
o Functions to defer kernel scheduler activation were added. These
are _thread_kern_sched_defer() and _thread_kern_sched_undefer()
and may be called recursively. These routines do not block the
scheduling signal, but latch its occurrence. The signal handler
will not call the kernel scheduler when the running thread has
deferred scheduling, but it will be called when running thread
undefers scheduling.
o Added support for _POSIX_THREAD_PRIORITY_SCHEDULING. All the
POSIX routines required by this should now be implemented.
One note, SCHED_OTHER, SCHED_FIFO, and SCHED_RR are required
to be defined by including pthread.h. These defines are currently
in sched.h. I modified pthread.h to include sched.h but don't
know if this is the proper thing to do.
o Added support for priority protection and inheritence mutexes.
This allows definition of _POSIX_THREAD_PRIO_PROTECT and
_POSIX_THREAD_PRIO_INHERIT.
o Added additional error checks required by POSIX for mutexes and
condition variables.
o Provided a wrapper for sigpending which is marked as a hidden
syscall.
o Added a non-portable function as a debugging aid to allow an
application to monitor thread context switches. An application
can install a routine that gets called everytime a thread
(explicitly created by the application) gets context switched.
The routine gets passed the pthread IDs of the threads that are
being switched in and out. I found this useful, but we can
get rid of it if you want.
Submitted by: Dan Eischen <eischen@vigrid.com>
to be written to /etc.
The only essential change is in paths.h, so any third-party software
written correctly will pick it up in the next rebuild.
Reviewed by: the committers list (actually an old version)
of getopt (as in, multiple input lines :). This is documented in the
man page and is used in the code, but unistd.h and stand.h do not
declare it. Incidentally, it prevents me fixing a bug in loader's
code... :-)
PR: misc/9373
Submitted by: "Daniel C. Sobral" <dcs@newsguy.com>
#include <ieeefp.h>
to access these functions instead of the i386 specific
#include <machine/floatingpoint.h>
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
- created internal names for fixed-size integral types, like __int32_t. They
will be used to make several headers self-sufficient.
- <stdlib.h> don't include <machine/types.h> anymore.
- created <sys/inttypes.h>, which can be used as <inttypes.h>.
- declaration of uoff_t and ufs_daddr_t moved to <sys/types.h>.
Reviewed by: bde
<kvm.h> is self-sufficient again.
Moved typedefs and forward struct declarations out of __BEGIN_DECLS/
__END_DECLS.
Don't comment out the prototype for kvm_uread(). This was a 4 year
old kludge for previous breakage of self-sufficiency. The prototypwe
was broken instead.
Fixed bitrot (const poisoning) in the type of kvm_uread().
Fixed order of the declaration of kvm_uread().
and their argument lists for the err(3) family of functions. Note,
I intentionally used __printflike instead of __printf0like for
warnx. Although a NULL format string is legal for that function, it
doesn't make any sense.
breaks cross-builds. Just depend on ${.CURDIR}/../sys/conf/newvers.sh
existing.
Don't override the (correct) defaults for the depend, lint or tags target.
In LDIRS: fixed order-rot. Don't comment out dead networking directories;
remove them.
with the SunRPC code to allow the use of hardware DES on certain Sun
hardware that supported it (if you installed the appropriate kit). We
don't have them and they apparently break the ioctl table
generation for kdump.
Pointed out by: bde
===================================
HARP | Host ATM Research Platform
===================================
HARP 3
What is this stuff?
-------------------
The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
the Host ATM Research Platform (HARP) software, which allows IP hosts to
communicate over ATM networks using standard protocols. It is intended to
be a high-quality platform for IP/ATM research.
HARP provides a way for IP hosts to connect to ATM networks. It supports
standard methods of communication using IP over ATM. A host's standard IP
software sends and receives datagrams via a HARP ATM interface. HARP provides
functionality similar to (and typically replaces) vendor-provided ATM device
driver software.
HARP includes full source code, making it possible for researchers to
experiment with different approaches to running IP over ATM. HARP is
self-contained; it requires no other licenses or commercial software packages.
HARP implements support for the IETF Classical IP model for using IP over ATM
networks, including:
o IETF ATMARP address resolution client
o IETF ATMARP address resolution server
o IETF SCSP/ATMARP server
o UNI 3.1 and 3.0 signalling protocols
o Fore Systems's SPANS signalling protocol
What's supported
----------------
The following are supported by HARP 3:
o ATM Host Interfaces
- FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
- FORE Systems, Inc. PCA-200E ATM PCI Adapters
- Efficient Networks, Inc. ENI-155p ATM PCI Adapters
o ATM Signalling Protocols
- The ATM Forum UNI 3.1 signalling protocol
- The ATM Forum UNI 3.0 signalling protocol
- The ATM Forum ILMI address registration
- FORE Systems's proprietary SPANS signalling protocol
- Permanent Virtual Channels (PVCs)
o IETF "Classical IP and ARP over ATM" model
- RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
- RFC 1577, "Classical IP and ARP over ATM"
- RFC 1626, "Default IP MTU for use over ATM AAL5"
- RFC 1755, "ATM Signaling Support for IP over ATM"
- RFC 2225, "Classical IP and ARP over ATM"
- RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
- Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
"A Distributed ATMARP Service Using SCSP"
o ATM Sockets interface
- The file atm-sockets.txt contains further information
What's not supported
--------------------
The following major features of the above list are not currently supported:
o UNI point-to-multipoint support
o Driver support for Traffic Control/Quality of Service
o SPANS multicast and MPP support
o SPANS signalling using Efficient adapters
This software was developed under the sponsorship of the Defense Advanced
Research Projects Agency (DARPA).
Reviewed (lightly) by: phk
Submitted by: Network Computing Services, Inc.
when it returns NULL to indicate failure, it will also free the memory
that was passed to it, if that was non-null.
This does not change the semantics of realloc.
A second commit will be done to commit the conversion of those places in
the code that can safely use this to avoid memory leaks when confronted
with low memory situations.
Beaten-to-death-but-finally-approved-in: -current
- Fix some style errors I made back in 1995.
- Add a new flavor of the err(3) family, which takes an explicit
errno argument rather than implicitly examining errno. This
will make it easier to use these functions in conjunction with
modern library interfaces that return an errno value explicitly.
standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an
indication of the user's preferred object file format. This
consolidates some code that was starting to be duplicated in more
and more places.
Use the new function in ldconfig.
Note: I don't think that gcc should use getobjformat(), even though
it could. The compiler should limit itself to functions that are
widespread, to ease porting and cross-compilation.
externed in netdb.h - where all of its #define values
live. If anything requires h_errno here (nothing in
/usr/src seems to) it's almost definitely broken.
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family. err() isn't quite printf-like since its format arg can
legitimately be NULL. syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.
as threatened in the 4-5 year old comment. Most of the change is
in <machine/ansi.h>; this commit just removes cruft for the strict
ANSI case. 64-bit types couldn't actually be defined using
__attribute__(()) in gcc-2.4, since attribute names in the
implementation namespace only became available in gcc-2.7. I've
probably just broken gcc-2.6 support by using the gcc-2.7 names
unconditionally.
<resolv.h>. This breaks user ppp at least, and goodness knows how
many ports. :-(
This a bit of a hack, but is probably simpler than duplicating the
typedefs and protecting them from each other.
Also, remove some temporary XXX notes that I forgot to remove before.
since it has far wider impact than hostname lookups (including passwords).
Note that this has more ugly symbol hiding and binary compatability hacks
that can go away the second we bump majors.
Obtained from: Mostly from diff against ISC bind-8.1.2 sources
instead of long long and unsigned long long. Really they should be
quad_t and u_quad_t, but that would require sys/types.h and this
header only includes machine/types.h. The difference here is that
int64_t and u_int64_t on alpha are long and unsigned long, not
long long etc. This is required to pass gcc's type checking where
long != long long even though they are the same size of alpha.
about spaces and tabs.
The externs in the static inline functions remain 'cause (a) they're
required; and (b) I can't find any gcc -W* cases where they generate
warnings.
test for __isthreaded before calling the lock/unlock functions to
try to save some performance. The _THREAD_SAFE case should become the
default, but since it tests for a global variable in libc, people won't
be able to build -current on pre-3.0 systems unless the default leaves
it out. Such is life.
_KPOSIX_PRIORITY_SCHEDULING options to work. Changes:
Change all "posix4" to "p1003_1b". Misnamed files are left
as "posix4" until I'm told if I can simply delete them and add
new ones;
Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux;
Add man pages for _POSIX_PRIORITY_SCHEDULING system calls;
Add options to LINT;
Minor fixes to P1003_1B code during testing.
Changes to support building with _POSIX_SOURCE set to 199309L:
1. Add sys/_posix.h to handle those preprocessor defs that POSIX
says have effects when defined before including any header files;
2. Change POSIX4_VISIBLE back to _POSIX4_VISIBLE
3. Add _POSIX4_VISIBLE_HISTORICALLY for pre-existing BSD features now
defined in POSIX. These show up when:
_POSIX_SOURCE and _POSIX_C_SOURCE are not set or
_POSIX_C_SOURCE is set >= 199309L
and vanish when:
_POSIX_SOURCE is set or _POSIX_C_SOURCE is < 199309L.
4. Explain these in man 9 posix4;
5. Include _posix.h and conditionalize on new feature test.
is generated. It must be installed in both /usr/include/rpc/ and
/usr/include/rpcsvc/ for historical reasons. The generated version
was once missing ANSI prototypes because the wrong flags were passed
to rpcgen, but that is fixed now. The committed version had `#pragma
indent' which gratuitously broke K&R support. Apart from this, all
versions before and after this commit are identical.
Move sigjmp_buf and jmp_buf structure definitions to machine/setjmp.h
so that i386 can continue to use int as the basic register type and
alpha can use long. Bruce was concerned about possible differing
alignment. I've left the definition of _JBLEN in machine/setjmp.h
even though Bruce's example used the number directly. I don't know if
any other code relies on _JBLEN, so I left it to avoid potential
breakage.
Note: this may cause some problems in a few cases. With very old versions
of rpcgen, if you defined a procedure called foo, then rpcen would create
client stubs for function foo_1() and server stubs _also_ with function
foo_1(). This only worked because of the lack of ANSI prototypes: the
client side stub takes different arguments than the server side stub.
(The client side takes a CLIENT * handle, while the server side wants
an svc_req *.)
To fix this conflict, rpcgen in ANSI mode generates foo_1() for the client
and foo_1_svc() for the server. RPC server code that depends on the old
behavior might break because of this. (Fixing it is just a matter of
adding the _svc suffix onto the server procedure names.)
isn't gratuitously broken. This also prevents ANSI compilers from
recognizing the pragma as a request to run /usr/games/hack...
FreeBSD Ids should be in comments or rcsids, not in `#pragma ident's
(which are equivalent to comments when compiled by gcc), and the
only FreeBSD change in this file seems to be adding the Id.
definitions for architectures that we don't have libc MD source for.
Change 'int' to 'long' in sigjmp_buf and jmp_buf structures so
that they are suitable for the register size on both i386 and alpha.
Although FreeBSD defines these structures differently to NetBSD,
the element size is now the same.
If Bruce doesn't like this [8-)], we'll need to add a typedef to
each <machine/setjmp.h> and use that in <setjmp.h>.
RFC 1350 isn't very explicit about this, but the use of signed
integers doesn't seem to make sense.
Should be in 2.2.5, but is probably too late to be verified completely.
PR: bin/4502
Submitted by: Dirk Nehrling <nerle@pdv.de> via Lars Koeller
sys/poll.h). Just provide a link, it's close enough. :-) In an ideal
world the prototype for poll() would be in <poll.h> but some code seems
to expect it in <sys/poll.h>, so we can't win there.
modify the original `no modifications' copyright message, and i've
included his mail into the source file.
The common localization functions between strptime(3) and strftime(3)
have been broken out into timelocal.[ch].
implement (better) falback code inside srandomdev() itself.
Change return type from int to void (binary compatibility surprisely
achieved). Userland code will be changed soon.