1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 23:35:36 -08:00
Commit Graph

1009 Commits

Author SHA1 Message Date
pelikan
4f42d1192c international currency locale rules as per POSIX.1-2008
required for libc++

ok guenther afresh1
2014-07-14 07:22:06 +00:00
deraadt
b68230f567 enter libressl for make includes 2014-07-14 01:01:27 +00:00
guenther
7c5b55ffaa Tackle the endian.h mess. Make it so that:
* you can #include <sys/endian.h> instead of <machine/endian.h>,
   and ditto <endian.h>  (fixes code that pulls in <sys/endian.h> first)

 * those will always export the symbols that POSIX specified for
   <endian.h>, including the new {be,le}{16,32,64}toh() set.  c.f.
	http://austingroupbugs.net/view.php?id=162

   if __BSD_VISIBLE then you also get the symbols that our <machine/endian.h>
   currently exports (ntohs, NTOHS, dlg's bemtoh*, etc)

 * when doing POSIX compiles (not __BSD_VISIBLE), then <netinet/in.h> and
   <arpa/inet.h> will *stop* exporting the extra symbols like BYTE_ORDER
   and betoh*

ok deraadt@
2014-07-12 16:25:08 +00:00
guenther
014e36e3da Welcome to 1989: assume the compiler support const 2014-07-12 02:51:52 +00:00
guenther
9bfcd1767c Per C99, wchar.h has to forward declare struct tm 2014-07-12 02:48:33 +00:00
tedu
9e593bd9b7 stop installing netbt headers 2014-07-11 21:50:28 +00:00
halex
150f0d6bfa make dump support DUIDs for command line arguments and /etc/dumpdates (using
the new shiny -U switch)

dumpdates part originating from, and discussed with, Maximilian Fillinger

seems reasonable to krw@, "get it in" deraadt@
2014-07-11 16:01:40 +00:00
beck
e5388d055a Clean up after arc4random u_int32_t uint32_t change
ok jsing@
2014-07-09 16:57:49 +00:00
tedu
5f651b4a12 update _POSIX2_FORT_RUN, so that sysconf(_SC_2_FORT_RUN) remains correct.
because you care. reminded by matthew.
2014-07-08 21:35:39 +00:00
deraadt
bbb6b66290 Change return value of getentropy() to int 0 for success. Maximum
buffersize is enforced strictly, this supplies sufficient entropy
payload to act as seed material.  Discourage general use of this
API, but lock down this function name as the go-to for userland
PRNG seeding.  Improve documentation.
ok miod matthew
2014-06-14 18:01:41 +00:00
deraadt
eacbc5b32c Add new getentropy() system call. Code and pressure from matthew.
I accepted that he's right (again) to seperate this out from heavy
sysctl API and this will simply a variety of things.  Functionname
is not used by anyone in the ports tree, so we guess we can use it.
Shocking that no application has a function called this.
ok matthew & others who pushed him to start this early on
2014-06-13 08:26:09 +00:00
matthew
abf4a3ad42 Add timingsafe_memcmp().
ok deraadt, jmc, tedu
2014-06-13 02:12:17 +00:00
guenther
6ffa79183a Can't use a variable 'c' in a standard include; rename it to '_c'
ok deraadt@ millert@
2014-05-26 01:49:36 +00:00
tedu
5f7129452b add prototypes for new crypt functions 2014-05-16 21:28:15 +00:00
espie
2bf795a714 these files have moved to libutil 2014-05-12 19:27:24 +00:00
tedu
c0e6b18c7f no md5crypt 2014-05-12 19:13:51 +00:00
espie
42dcb48712 move the ohash functions into libutil by popular demand.
It's not a standard interface, so it doesn't belong in libc.
I hate duplicating the code in client programs, so do beck@, kettenis@,
schwarze@, millert@, miod@... and they agree with libutil.
2014-05-12 19:09:00 +00:00
espie
a795a9b40f tweak interface to do the right thing, after useful comments from millert@
(mostly use a calloc function to avoid potential integer overflow)
2014-05-12 19:07:37 +00:00
martynas
0ad9e87784 Annotate wide character routines so they get protected by Wbounded.
OK millert@
2014-05-03 16:19:53 +00:00
martynas
7c58654270 - Provide extended-precision math constants req'd by POSIX
- Explicitly cast double-precision constants as needed for
FLT_EVAL_METHOD = 2 archs
OK guenther@, ratchov@
2014-05-03 16:13:03 +00:00
sperreault
20149d178a Implement AI_ADDRCONFIG
This is a getaddrinfo() flag that is defined thusly in RFC 3493:

   If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
   returned only if an IPv4 address is configured on the local system,
   and IPv6 addresses shall be returned only if an IPv6 address is
   configured on the local system.  The loopback address is not
   considered for this case as valid as a configured address.

      For example, when using the DNS, a query for AAAA records should
      occur only if the node has at least one IPv6 address configured
      (other than IPv6 loopback) and a query for A records should occur
      only if the node has at least one IPv4 address configured (other
      than the IPv4 loopback).

The flag is set by default when hints is NULL.

ok Eric Faurot, Jason McIntyre
2014-04-28 21:38:59 +00:00
tedu
7e25e286a3 change mallocarray to reallocarray. useful in a few more situations.
malloc can, as always, be emulated via realloc(NULL).
ok deraadt
2014-04-22 14:26:26 +00:00
reyk
84fc8f7ce6 Remove KERBEROS5 from the Makefiles (except ssh for now, where it is
already manually disabled).

ok deraadt@
2014-04-22 10:21:56 +00:00
guenther
d01ec05984 Add errc/verrc/warnc/vwarnc family: versions of err/... that take the errno
value to use for the strerror() message as an argument.  Originally from
FreeBSD 3.0

Patch from Steffen Nurpmeso (sdaoden (at) gmail.com) with minor tweaks.
2014-04-22 00:33:02 +00:00
guenther
0dd8069ec2 Remove historical comment about <varargs.h> and warn people from using
the _* functions outside libc
2014-04-21 16:13:24 +00:00
deraadt
e1603b917b Introducing: void *mallocarray(size_t nmemb, size_t size);
Like calloc(), except without the cleared-memory gaurantee
ok beck guenther, discussed for more than a year...
2014-04-21 13:17:32 +00:00
guenther
ece79e109f Use internal '__' names for __attributes__ in public headers 2014-04-21 11:27:34 +00:00
henning
4254632602 stop installing altq includes 2014-04-19 15:58:56 +00:00
miod
252ab50e97 Move build machinery for libcrypto from libssl/crypto to libcrypto, as well
as configuration files; split manpages and .pc files between libcrypto and
libssl.
No functional change, only there to make engineering easier, and libcrypto
sources are still found in libssl/src/crypto at the moment.

ok reyk@, also discussed with deraadt@ beck@ and the usual crypto suspects.
2014-04-11 22:51:51 +00:00
matthew
d5aa66952d Define intptr_t in <unistd.h> as specified by POSIX
ok millert
2014-04-01 05:04:50 +00:00
tedu
d8e2f36e09 safe to remove gets, now that's gone from cstdio too 2014-03-27 15:28:16 +00:00
eric
d216d6b129 Make the asr API public. Install asr.h to /usr/include.h and manpages.
Include tweaks suggested by mpi@

ok deraadt@
2014-03-26 18:13:15 +00:00
tedu
62c9c9a7ee try to put the pin back in.
removing gets means removing it from libstdc++ and guenther tells me
that will require changing version numbers.
2014-03-25 15:55:15 +00:00
tedu
c792825af2 no gets 2014-03-25 15:23:27 +00:00
kettenis
383d6c0749 unbreak the tree; no more libwrap 2014-03-24 19:09:14 +00:00
tedu
c0c2aeee79 more bm excision 2014-03-23 23:41:31 +00:00
naddy
022886465c Remove the MD4 functions.
"A collision attack published in 2007 can find collisions for full
MD4 in less than two hash operations."

ok deraadt@, man pages ok jmc@
2014-03-23 23:27:22 +00:00
guenther
acf82b0a9d lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@
2014-03-16 18:38:30 +00:00
tedu
11f7b9b824 the default rsh is now spelled ssh. ok deraadt 2014-03-13 15:24:41 +00:00
florian
32f51239e2 Unhook httpd(8) from build
OK krw@, gilles@, lteo@, tedu@, todd@, benno@, sthen@
"The time is right." and much help getting the show on
the road deraadt@
2014-03-13 10:09:43 +00:00
tedu
2fa321beb4 add explicit_bzero to libc. implementation subject to change, but start
the ball rolling. ok deraadt.
2014-01-22 21:06:45 +00:00
guenther
746ad4a9f9 Delete struct definitions that have been obsolete for a dozen years
ok deraadt@
2014-01-08 06:50:57 +00:00
martynas
0ad647d636 Annotate a few more bounded functions: realpath(3) needs a buffer
of size at least PATH_MAX.  pread(2), pwrite(2) and readlinkat(2)
also take the buffer and the bound.  OK theo.
2013-12-28 01:51:53 +00:00
millert
9a476230f2 Fix typo; 200809 not 20080 for __POSIX_VISIBLE. Noticed by jca@ 2013-12-13 20:48:39 +00:00
zhuk
d33565a9ed Zap some getdirentries() leftovers.
okay guenther@
2013-12-13 18:09:27 +00:00
naddy
4ba3f2b83e remove the final vestiges of the stty(), gtty(), and ftime() compatibility
interfaces; ok deraadt@
2013-12-08 17:05:09 +00:00
deraadt
fcaa69366a oops, sgtty.h stays for a little longer 2013-12-05 17:16:02 +00:00
deraadt
6c13836a7e express final disapproval of the interfaces in libcompat, such as
them ftime(), gtty(), stty(), re_comp(), cuserid() and others.
Discussion and ongoing work to fix the ports tree from many, especially
naddy.
ok naddy
[There is a bit more cleanup possible after that, but this is considered
the current safe step]
2013-12-04 22:58:24 +00:00
krw
b50d95c846 CIRCLEQ begone.
ok miller@
2013-12-02 02:28:21 +00:00
millert
6290d6dbce The getopt() prototype and externs don't belong in stdlib.h. Berkeley
moved them to unistd.h to match POSIX in 1995 but we never did.
The exception to this is getsubopt() which POSIX says should be in
stdlib.h.  The non-standard suboptarg extern remains in the BSD-only
section of stdlib.h.  Neither getsubopt() nor suboptarg belong in
unistd.h or getopt.h.  They were only there to allow us to protect
all the getopt() bits from being multiply defined.  OK guenther@
2013-11-22 21:32:49 +00:00
sthen
268c92aa48 Install fuse headers in 'make includes', diff from stsp@, ok guenther@
Committing now to unbreak ports builds (gvfs fails without, which knocks
out building much of the tree.)
2013-11-03 11:48:49 +00:00
guenther
d24b5030bc Align suseconds_t with POSIX: it's the type of the tv_usec member of timeval.
Use useconds_t in the ualarm() declaration.
Bump libstdc++ major to be sure there isn't ABI issues.

ok deraadt@ jca@ jmc@ millert@
ports testing by landry@
2013-10-24 07:34:56 +00:00
guenther
cef0bbe1cc - add UNIX-domain socket info to struct kinfo_file2
- convert netstat from kvm_getfiles() to kvm_getfile2() using that
- delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major)
- rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file
  and KERN_FILE2 to KERN_FILE.

ok deraadt@, millert@
ports scan sthen@
2013-10-22 16:40:25 +00:00
deraadt
e1968c998b Remove arc4random_stir() and arc4random_addrandom(), which none should
be using directly.  Well, a few rare people cloned it upstream and it
will take a bit of time for them to learn.
ok various
2013-10-21 20:33:23 +00:00
deraadt
c54927cb82 Remove more knowledge of a.out and stab information from the tree.
ok miod
2013-10-19 09:00:18 +00:00
deraadt
4c6d0bf743 remove bogus comment 2013-09-29 14:54:07 +00:00
jsg
6cae677047 netnatm is no more 2013-08-24 06:55:39 +00:00
guenther
e3635453c2 Tweak the getdents() kernel prototype to use "void *"
Provide a declaration for userspace
Fix the kernel's sanity check on the buflen argument

lack of prototype pointed out by sthen@ and landry@
ok kettenis@ otto@
2013-08-16 08:33:20 +00:00
kettenis
e67aac3c17 Make sure we don't install the private radeondrm(4) headers, by leaving out
headers from any subdirectory of dev/pci/drm.  If we ever add more drm(4)
drivers any headers needed by userland should end up in dev/pci/drm.

ok mpi@, miod@
2013-08-12 11:48:22 +00:00
ajacoutot
1a211d06d3 libkafs5->libkafs ; forgotten in previous 2013-08-10 14:38:26 +00:00
miod
88919d8294 Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.
2013-08-06 19:11:53 +00:00
miod
b67809f11d Try and avoid using __builtin_huge_val*() and __builtin_{inf,nan}* on vax
running gcc 3, for gcc will output a reserved operand for these.

ok martynas@ matthew@ espie@ guenther@
2013-08-06 19:04:50 +00:00
robert
88f3d58a8e unlink libheimntlm and libhx509 2013-06-19 19:47:48 +00:00
robert
b70a26d9ad switch to new kerberosV directory layout 2013-06-17 19:16:02 +00:00
guenther
7b36c281ba Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,
including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and
{clock,pthread}_getcpuclockid() functions.

Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@
ok matthew@
2013-06-17 19:11:54 +00:00
matthew
35bdce9da0 Contrary to C99's advice, C++ TR1 and C++ 11 require that <inttypes.h>
and <stdint.h> should unconditionally define all of their macros
regardless of whether the __STDC_*_MACROS macros are defined.

ok guenther, espie
bulk build tested by landry
2013-06-11 15:59:16 +00:00
brad
fa6f007d14 Enable the _POSIX_SHARED_MEMORY_OBJECTS option group now that we have shm_open / shm_unlink.
ok guenther@
2013-06-04 23:01:07 +00:00
guenther
cc0a63afba XPG 4 apparently exposed d_ino and ino_t. Also, always pull in
<sys/_types.h> for the internal types

ok matthew@
2013-06-02 16:14:59 +00:00
ajacoutot
c88a5da8d0 Add getprogname() and setprogname() to ease slackers^porters' work.
Man page adapted from FreeBSD and NetBSD.

Bump libc minor now (there will be more upcoming changes).

input from tedu@
get it in deraadt@
2013-05-31 20:59:23 +00:00
ajacoutot
2eb94c6c34 Add an implementation of memmem() -- from FreeBSD with some tweaks.
Requires a libc minor bump, committing now so that we have up-to-date
snapshots for the upcoming hackathon.

joint work with millert@
man page bits ok jmc@
input and ok millert@, guenther@, deraadt@
2013-05-13 10:37:02 +00:00
matthew
aa96fc3dc0 Implement fdatasync() as a wrapper around fsync()
ok guenther, deraadt, jmc
2013-04-15 16:38:21 +00:00
millert
2c851520d8 SHA-224 is to SHA-256 as SHA-384 is to SHA-512. It was added in a
later revision of FIPS-180.  OK miod@ jmc@ guenther@ djm@
2013-04-15 15:54:17 +00:00
guenther
76e45efd19 getpgid() and getsid() were rolled into POSIX in 2008
ok millert@
2013-04-11 03:09:16 +00:00
guenther
82d303adbd Add 'restrict' per POSIX, per prodding by tedu@. (Might permit more warnings?)
Tweak standards exposure of memchr (never) and strdup (POSIX-2008)
Remove unnecessary tests of __BSD_VISIBLE

ok millert@
2013-04-11 03:08:47 +00:00
guenther
1ec1251e0e Pull in <sys/_types.h> instead of <machine/_types.h> in prep for the future
ok deraadt@
2013-04-02 05:16:14 +00:00
eric
236998c6ac Enable fmemopen(3) and open_{w,}memstream(3)
commiting on behalf of mpi@
2013-03-28 16:37:13 +00:00
deraadt
d7fe39fbb4 I can see no reason for #ifndef _KERNEL check in a /usr/include
(ie. non-kernel) .h file
2013-03-24 17:46:58 +00:00
deraadt
ca229a5cc8 dlerror() should not return const char *, as noted by landry
ok guenther
2013-03-24 01:37:21 +00:00
deraadt
983d6f98aa Do not install the dev/pci/drm/i915 directory to /usr/include 2013-03-21 06:48:48 +00:00
deraadt
081bda17fe forget about this for now; wait till later 2013-03-18 19:15:04 +00:00
deraadt
8aeb33d13a Skip another irrelevant leaf when descending into sys/dev
ok kettenis
2013-03-18 19:04:12 +00:00
guenther
e0e73bdf40 Adds the (somewhat silly) _CS_V[67]_ENV and _CS_POSIX_V[67]_* defines
to <unistd.h> and confstr(3) per POSIX 1003.1-2008

Change confstr(_CS_PATH) to operate directly instead of calling sysctl(3)

ports build tested by espie@
2013-03-01 21:19:41 +00:00
guenther
5b8036b337 Add _POSIX_CLOCKRES_MIN and _POSIX2_CHARCLASS_NAME_MAX per POSIX 1003.1-2008
ports build tested by espie@
2013-03-01 21:16:34 +00:00
guenther
51e5ef5d22 Fix typo that hid PASS_MAX, TMP_MAX, NL_NMAX, and _XOPEN_{IOV,NAME,PATH}_MAX
defines.

ok deraadt@ millert@
2013-02-17 22:09:54 +00:00
brad
f2c0f4ac02 Add support for POSIX.1-2008 functions dprintf(3) and vdprintf(3).
Feedback from millert@ guenther@
OK guenther@ man page bits OK jmc@
2013-01-30 00:08:13 +00:00
deraadt
4a39ccd02c Remove excessive sys/cdefs.h inclusion
ok guenther millert kettenis
2012-12-05 23:19:48 +00:00
millert
8d2ec7ea7a Simple emulation of POSIX pty APIs posix_openpt(), ptsname(),
grantpt() and unlockpt() using /dev/ptm.  Man pages from FreeBSD.
OK kettenis@ deraadt@ beck@ ajacoutot@ naddy@
2012-12-03 20:08:33 +00:00
guenther
a737da7824 Change scandir()'s 'select' argument from
int (*)(struct dirent *)
to
	int (*)(const struct dirent *)
to match POSIX.

ok millert@, ports check by naddy@
2012-11-29 02:15:44 +00:00
guenther
2c79e7cc0b More compliance fixes: hiding non-standard stuff behind __BSD_VISIBLE,
making files stand-alone, some __restrict additions.

tweaks kettenis@; ports testing and fixes landry@ and jasper@
ok millert@
2012-10-01 00:21:19 +00:00
brad
ca958bc2fe Explicitly annotate setjmp() and longjmp() (and friends) as
__returns_twice and __dead instead of depending on GCC's special
handling of these function names.

With input from kettenis@ and guenther@
Fixes a warning from clang
ok matthew@
2012-09-26 00:09:48 +00:00
espie
1bb95fef65 uint32_t is the integer type defined in stdint.h
u_int32_t is historical BSD stuff.
fix to match the manpage, namely #include <stdint.h> as a prerequisite.

okay millert@
2012-09-23 15:05:23 +00:00
guenther
de9f3fadcd Improve POSIX/SUS compliance of <netdb.h>, <sys/socket.h>, and <sys/un.h>.
Much ports testing of various versions by naddy@ and jasper@
ok matthew@, miller@
2012-09-15 00:47:08 +00:00
deraadt
5abf15dca0 no more _PATH_AFSD required 2012-08-23 06:38:02 +00:00
deraadt
ddd720a847 do not install the nnpfs directory 2012-08-23 06:37:47 +00:00
espie
493ea52444 hex constants unsigned, prevents some gcc warnings
okay ratchov@
2012-08-22 08:56:46 +00:00
guenther
17c9ee9b67 Instead of <arpa/inet.h> pulling in <netinet/in.h>, just copy in the
three things that it needed from there: INET_ADDRSTRLEN, INET6_ADDRSTRLEN,
and struct in_addr.  Add protecting #ifndefs to netinet6?/in6?.h for those.

ok deraadt@
2012-07-10 11:49:42 +00:00
guenther
f4d024fab1 Stop pulling in <sys/param.h>
ok deraadt@
2012-07-10 11:46:23 +00:00
guenther
caad557685 bsearch() doesn't belong here (it's in <stdlib.h>)
Add __restrict bits for tdelete()

ok deraadt@
2012-07-10 11:44:55 +00:00
ratchov
7690362d6c Include sys/types.h rather than sys/param.h to pull BYTE_ORDER macros.
suggested by deraadt@
2012-07-08 17:55:50 +00:00
guenther
e3d7c70a1b Further standards compliance fixes: export LONG_BIT, WORD_BIT, and
NL_{ARG,LANG,MSG,SET,TEXT}MAX with newer POSIX.
Hide {FLT,DBL}_{DIG,MAX,MIN} and {PASS,TMP,NL_N}_MAX with newer XPG.
Make _POSIX_NGROUPS_MAX and _POSIX_OPEN_MAX conditional on the POSIX
version, like _POSIX_TZNAME_MAX already is.
Add some more _POSIX_* and _XOPEN_* 'specified' limits.

ok kettenis@
2012-06-30 20:21:10 +00:00
guenther
da179bac86 librthread has eaten libpthread, so build includes via the former instead
of the latter.  Permits the misleading lib/libpthread/Makefile to be
removed

discussed with deraadt@
2012-06-28 06:18:46 +00:00
deraadt
5bf4abd5ea create new machine/_float.h which is namespace clean. create a new
MI float.h which pulls in and defines the values that are needed from
there, and repair sys/limits.h so that it defines the values it needs
as well (depending on POSIX version, XPG version, etc).  guenther has
a more exact selection of that coming for limits.h.
this also fixes a few mistakes for the vax.
reviewed by kettenis and guenther.
2012-06-26 16:12:42 +00:00
guenther
fb11ead1ea Improve compliance for <arpa/inet.h> and <netinet/in.h> to define/declare
all the symbols that POSIX says they must and fewer that they can't and,
most importantly, to not require a specific ordering of headers.

ports testing by naddy@
ok millert@ deraadt@
2012-06-26 06:39:27 +00:00
guenther
16b62b6a0b __tfork() needs to set the stack address of the new thread in the kernel,
so that it can't get a signal while still running on the parent thread's
stack.  Also, pass in sizeof(struct __tfork) to provide forward compat
when more members are added.  This is an ABI change, so switch syscall
numbers and bump lib majors this time.

ok deraadt@ matthew@
2012-06-21 00:56:59 +00:00
espie
598752716c simplify includes prereq/req order:
- everything that has prereq will also do includes, add it late, so that
gnu stuff (the only part with prereq) happens late.
- new RUN_MAKE snippet, to be able to have the makefile magically decide
between Makefile.bsd-wrapper and Makefile.

So there's no longer any need to remember complicated rules: add it to
RDIRS if it just wants make includes, add it to PRDIRS if it wants prereq too,
and that's all.

okay deraadt@, miod@
2012-06-19 17:15:02 +00:00
guenther
d04f2212c6 Improve standards compliance: bsd_signal() was XSI only and has been dropped
from the most recent version, use the implementation namespace for variables
in inline functions, and add __restrict as specified.

ok millert@
2012-06-10 21:31:03 +00:00
matthew
5a08728ecb Add support for mbsnrtowcs() and wcsnrtombs() to libc.
Bulk build test by naddy.
2012-06-06 16:58:02 +00:00
guenther
b10cd18816 Improve standards conformance: ecvt(), fcvt(), gcvt(), mktemp(), ttyslot(),
and valloc() are not in the current version, while posix_memalign() mkstemp(),
and mkdtemp() are, and setstate()'s argument has lost a bogus 'const'.

ok millert@ jmc@ espie@ kettenis@; ports build testing by naddy@
2012-06-01 01:01:57 +00:00
matthew
90d0aeda4f Move the _SC_* and _CS_* configurable system variables and strings
from sys/unistd.h to unistd.h.

From Brad; ok millert and me
2012-05-30 19:34:30 +00:00
ratchov
9f9aa69f52 Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.
2012-05-23 19:25:11 +00:00
matthew
020d9bd9a2 More sysconf(3)-y and pathconf(3)-y goodness from Brad.
ok guenther, millert (and me); bulk build test by naddy
2012-05-14 23:21:35 +00:00
espie
6623f2ad86 functions are top-level objects anyways, make that clearer.
Okay otto@
2012-05-13 16:22:05 +00:00
kettenis
329a58af35 Recongnize that:
* strptime(3) was introduced in XPG 4.0
* clock_gettime(3) and friends were introduced in 1003.1b-1993
* asctime_r(3) and friends were introduced in 1003.1c-1995

and conditionally provide prototypes and associated types accordingly.
This makes our <time.h> standards compliant except for some functions that are
still missing.

ok guenther@
2012-05-10 19:13:12 +00:00
kettenis
c7280c708a Once more the people behind POSIX didn't think and put clock_gettime(2) and
friends in <time.h>.  The kernel needs access to the associated #defines, but
can't get them from <time.h>, so introduce a new header <sys/_time.h> and
include that from <time.h> for userland and <sys/time.h> for the kernel.

ok matthew@, guenther@, millert@
2012-05-07 22:34:00 +00:00
espie
77916c1d9f enable sqlite3, as prompted by theo 2012-04-22 23:43:38 +00:00
deraadt
78f78c26c3 remove rfork(); ok guenther miod 2012-04-12 12:33:03 +00:00
deraadt
e1eb7ae046 prototype getdtablecount() 2012-04-12 11:19:34 +00:00
ratchov
7207b06990 Use "unsigned int" rather than "unsigned". No object change.
suggested by deraadt@
2012-04-11 06:05:43 +00:00
guenther
1ef6a089d2 strsignal() was added to POSIX-2008; strerror_r() was in the base
of POSIX-2001, without the XSI qualifier.  Adjust conditionals to match.

ok millert@
2012-03-25 20:04:18 +00:00
guenther
d4dd0b48f8 Provide the old prototypes for scandir() and alphasort() for code that
requests the pre-standardized version

requested by millert@
2012-03-24 01:53:51 +00:00
matthew
e55576ca58 Make DIR a private type within libc, give it the same underlying
typedef regardless of __BSD_VISIBLE, and eliminate the dirfd() macro.

ok guenther@
2012-03-22 04:11:53 +00:00
guenther
9142ec076e Update alphasort() and scandir()'s argument types to match POSIX:
use "const struct dirent **" instead of "const void *".  Also, add
__restrict to readdir_r().

ok matthew@
2012-03-22 01:44:19 +00:00
matthew
94e5217d08 Add dirfd() as a function to libc per POSIX requirement; dirfd() macro
to be pruned later when DIR is made an opaque type.

ok guenther@; prodding by brad@ for VLC and other ports
2012-03-22 01:13:40 +00:00
fgsch
dc89375155 Implement getdelim(3) and getline(3).
Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de)
but this is based on NetBSD's implementation instead with some tweaks by me.
Further improvements would happen in tree.

ok millert@; discussed with many others
ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself.
2012-03-21 23:44:35 +00:00
matthew
5365c52e49 Implement execvpe(3) and posix_spawn(3) and family. Based on
FreeBSD's implementation via Frank Denis, with various cleanups and
tweaks by me.

ok deraadt@, guenther@; discussions and tweaks from many others
jmc@ promises to help me further with the man pages in tree
2012-03-21 23:20:35 +00:00
guenther
4f2939c2f9 Add stpcpy() and stpncpy(), pointless crap that made it into POSIX.
Includes friendly linker warning to wake up those dumb enough to use it.

Committing for kettenis@, who ran away to the hills after writing it
2012-01-17 02:48:01 +00:00
deraadt
95c1c14110 net_addrcmp() dies. found out to be a horrific function by eric
ok guenther
2012-01-17 02:33:20 +00:00
nigel
8803123df2 Replace _SELECT_DECLARED with _SELECT_DEFINED_
Ok sthen@, millert@, dcoppa@
2012-01-13 13:16:44 +00:00
guenther
a60854cd77 Add rtable id and thread id to struct kinfo_proc (and fix process id)
and add an 'rtableid' keyword to ps.

Add rtable id, thread id, and socket splice info to struct kinfo_file2
and make fstat display socket splice information.

Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major

Socket splice info and corrections from bluhm@  "Lovely" deraadt@
2012-01-07 05:38:12 +00:00
kettenis
ff74d4c225 C99 says that both <wchar.h> and <stdint.h> should define WCHAR_MIN/MAX.
ok beck@, guenther@, millert@, miod@
2012-01-05 20:37:50 +00:00
kettenis
7f6b726169 The prototype for pthread_sigmask(2) is supposed to live in <signal.h>
instead of <pthread.h>.

ok guenther@, millert@
2012-01-03 16:53:48 +00:00
guenther
3b196c124d sigstack() is long dead, and the compat sigaltstack syscall is gone too.
Correct the namespace protections for sigreturn(), sigwait(), and psignal()

ok millert@
2011-11-22 21:13:30 +00:00
fgsch
3ebeadf023 getcwd() buffer's length can be smaller than 1024. In that case it will
fail with errno set to ERANGE if not enough room is provided. Similar for
getlogin_r() so remove minbytes enforcement attribute.
ok kettenis@ guenther@ deraadt@ on getcwd, deraadt@ on getlogin_r.
2011-11-09 15:34:18 +00:00
stsp
0b5b2ca259 Hook wcsftime(3) to the build; committing on behalf of espie 2011-10-16 13:22:06 +00:00
stsp
2d31a56b68 Add wscanf(3) and friends. Based on our scanf(3) implementation, with wide
character support changes based on code from FreeBSD.
ok espie guenther; man page help from schwarze
2011-10-16 13:20:51 +00:00
matthew
f02fac78d1 Expose a bunch of new functionality from POSIX 2008: openat(2),
fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2),
faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2),
symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and
fdopendir(3).

"Minor" libc bump.

Tested in a bulk build by naddy@
Much help from guenther@, thib@, tedu@, oga@, and others.
ok deraadt@, naddy@
2011-07-18 17:29:49 +00:00
deraadt
8cf2685156 __opendir2, DTF_NODUP, and __DTF_READALL can die. struct dirent
dd_flags is renamed to the placeholder position dd_unused so that
we can spot "broken software" which assumes we have Jan Simon Pendry's
union mounts (we don't have them, and won't have them ever again).
__opendir2 question spotted by matthew
verified to not break ports by sthen
2011-07-14 02:16:00 +00:00
henning
4622327237 stop installing netatalk headers 2011-07-09 00:46:07 +00:00
martynas
8438bc4be5 Add support for tgmath--the type-generic math; now that both math
and complex math routines are complete.  OK kettenis@.
2011-07-08 19:28:06 +00:00
martynas
de3697aa94 Finalize work on complex math routines, now that we have the
extended-precision support.  Mostly from Cephes.
2011-07-08 19:25:31 +00:00
sobrado
0742bdbf96 fix typos; while here, improve spacing in comments.
changes to libevent and zlib headers sent to the upstream maintainers.

ok jmc@ (for typos), millert@
2011-07-07 14:25:15 +00:00
guenther
6bd17a161e sigset_t is unsigned, so eliminate a warning by shifting a 1U instead
of a 1 when creating signal masks.

ok millert@
2011-07-06 17:39:22 +00:00
martynas
49393c004c Finalize work on the math library. It's time to do this monster
commit, and deal with problems (if any) in tree.

Note that this adds the following functions.  Ports with hacks might
need adjustments.

nexttoward(3), fma(3), nexttowardf(3), fmaf(3), acoshl(3), asinhl(3),
atanhl(3), coshl(3), sinhl(3), tanhl(3), expl(3), expm1l(3), logl(3),
log10l(3), log1pl(3), log2l(3), modfl(3), cbrtl(3), hypotl(3),
powl(3), erfl(3), erfcl(3), lgammal(3), tgammal(3), ceill(3),
floorl(3), lrintl(3), llrintl(3), roundl(3), lroundl(3), llroundl(3),
truncl(3), fmodl(3), remainderl(3), remquol(3), nextafterl(3),
nexttowardl(3), fmal(3).

With this commit, our library implements all functionality required
by C99.  Documentation bits will follow.
2011-07-06 00:02:42 +00:00
nicm
2dcf140db7 Add wcsdup(), from NetBSD.
ok deraadt matthew
2011-07-04 04:37:34 +00:00
jsg
c4ff7bee63 As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@
2011-07-03 18:51:01 +00:00
espie
ca9d9491d5 half-guard the actual function prototypes.
precludes -Wredundant-declarations with multiple includes.

okay millert@
2011-06-26 21:11:41 +00:00
millert
e4bf39f15e Use __POSIX_VISIBLE not __POSIX_C_SOURCE to bracket the definitions
of wcscasecmp() and wcsncasecmp().  Noticed by naddy@ OK espie@
2011-06-01 16:39:07 +00:00
espie
42569c7ddd wcs(n)casecmp support, manpage comments from jmc@, okay deraadt@ 2011-05-28 15:16:46 +00:00
martynas
c968322491 Also enclose variable names with external linkage in __BEGIN_DECLS.
Doesn't matter much since C++ ABI used by GCC doesn't mangle variable
names;  however technically is required by Section 7.5 of the C++ spec.

Discussed with/OK guenther@, matthew@.
2011-05-25 21:46:49 +00:00
martynas
6e4b140d70 - enable fenv
- add nearbyint, nearbyintf and nearbyintl implemented using fenv
2011-04-28 18:05:39 +00:00
stsp
25963022b9 Bring back wprintf. We've sorted out what to do for gcc2 and gcc3.
"Yes, go ahead then" deraadt
2011-04-28 17:38:46 +00:00
sthen
cabdb1ca34 Teach sysconf(_SC_GETGR_R_SIZE_MAX) the correct size of a buffer for the
reentrant getgrent functions (getgrgid_r, getgrnam_r).

seems reasonable to millert@, ok deraadt@
2011-04-25 20:10:10 +00:00
stsp
760d4ce496 Back out wprintf until we've determined what to do for gcc2 and gcc3 arches. 2011-04-24 08:54:02 +00:00
stsp
92b22d3d07 Add fwprintf, swprintf, vfwprintf, vswprintf, vwprintf, and wprintf to libc.
Based on our vfprintf etc. implementations. Wide character parts based on
NetBSD but with lots of macros expanded. Minor bump for libc.
ok kettenis espie
2011-04-24 07:46:58 +00:00
martynas
602592de51 fenv for amd64; from matthew@
feedback & ok guenther@, matthew@
2011-04-21 21:12:55 +00:00
miod
0c2a5da7f0 Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.
2011-04-06 11:39:42 +00:00
matthew
f98b7d8494 Add AI_FQDN flag to getaddrinfo(3). Prompted by discussions with djm@
about cert checking in OpenSSH.  Man page wording tweaks thanks to
jmc@.

ok henning@, jmc@; positive feedback from djm@, ajacoutat@

Committing now to reuse guenther@'s libc minor bump instead of
cranking it again, as suggested by deraadt@.
2011-04-05 00:46:06 +00:00
guenther
09431e5c1c Replace the old, broken KERN_PROC ABI and its matching functions
in libkvm with the stable-ABI versions that are currently named
KERN_PROC2, kvm_get{proc,argv,envv}2().  The latter names and symbols
will continue to be supported for a few releases.

Committing now that they ports people have had a couple releases
to update pkgs that usd the old functions
2011-03-12 04:54:28 +00:00
guenther
3e110e7bec Standards compliance: expose dirfd with XPG7 and scandir and alphasort
with POSIX 2008

ok millert@
2010-12-31 19:54:05 +00:00
martynas
b79f38e521 - make HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN expand to the
constant expressions with the help of gcc post-3.3.
ok millert@, mikeb@.  been in snaps for weeks.
2010-12-14 11:16:15 +00:00
ratchov
4c68e88197 make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.
2010-11-06 20:25:42 +00:00
millert
3f3251d07e Change basep parameter of getdirentries() to be off_t *, not long *
so it works correctly with large offsets (and matches other systems).
This requires adding a new getdirentries syscall, with the old one
renamed to ogetdirentries.  All in-tree consumers of getdirentries()
have been updated.  Bump libc and libpthread major numbers.
OK and with deraadt@
2010-10-28 15:02:41 +00:00
mikeb
6f2828eb52 remove skipjack and cast from the libc; ok deraadt 2010-10-28 08:34:37 +00:00
djm
bab9f9c395 unlink libsectok from the build; ok markus@ deraadt@ 2010-10-17 08:44:15 +00:00
guenther
2095efaf70 Now that __only_inline is in <sys/cdefs.h>, replace the local versions in
<ctype.h> and <signal.h>

ok kettenis@ millert@ deraadt@
2010-10-01 20:10:24 +00:00
millert
0530874776 Bump fts_level from short to int and add a spare short so things
line up nicely.  OK deraadt@
2010-09-24 13:56:32 +00:00
matthew
03cd71ad9d Add timingsafe_bcmp(3) to libc, mention that it's already in the
kernel in kern(9), and remove it from OpenSSH.

ok deraadt@, djm@
2010-09-24 13:33:00 +00:00
djm
baa4cfea7c add a GLOB_KEEPSTAT option that retains a copy of the struct stat
information that is looked up while matching glob(3)s

Keeping this information around can make a big difference when
fetching it is expensive, e.g. in sftp which uses GLOB_ALTDIRFUNC

feedback millert@ jmc@

"get it in before the libc crank" deraadt@
2010-09-24 13:32:55 +00:00
millert
cb7760d181 Oracle has re-licensed sunrpc under a three-clause BSD license.
Update our sources appropriately.  OK deraadt@ jsg@
2010-09-01 14:43:34 +00:00
djm
24f1563c48 backout VIS_HEX. guenther@ points out that the C89 \xff encoding
idiotically accepts more then two hex digits following the \x, even
on platforms where a char has 8 bits. It is therefore dangerous to have
an almost-bit-not-quite compatible format in vis(3).

The VIS_ALL (encode all characters) option introduced in the same commit
remains.
2010-08-24 23:49:06 +00:00
djm
46b2c8d043 unbreak tree: add VIS_HEX and VIS_ALL flags 2010-08-23 02:07:50 +00:00
kettenis
1cad1807d8 Always force GNU inline semantics here as well. 2010-07-26 07:08:22 +00:00
kettenis
9add5cdd9c When using GCC, we always want GNU inline semantics. Fixes issues with
-Wsystem-headers and -std=c99, where GCC 4.2 would warn that it couldn't
give us C99 inline semantics.

ok guenther@, dcoppa@, millert@, deraadt@
2010-07-25 15:35:29 +00:00
guenther
5fdc311761 Teach lint about C99's _Bool and _Complex, plus some related gcc
extensions: __real__ and __imag__ operators, the use of '~' for
complex conjugation, and 'i' or 'j' as a suffix for complex constants.
While this doesn't handle folding and overflow detection for complex
constants correctly, it's good enough to make it through libm...and
found several bugs once it could do so.

"no objections" miod@, krw@
2010-07-24 22:17:03 +00:00
guenther
74ebee540e Don't declare wcscoll() twice 2010-07-24 09:58:39 +00:00
espie
623422e879 unlink g77 from the build.
as discussed with Theo, so that he can synch set.

(eventual gcc2 fallout to fix later)
2010-05-25 00:24:58 +00:00
tedu
243f393511 add posix_madvise, posix_memalign, strndup, and strnlen. mostly from
brad and millert, with hints from guenther, jmc, and otto I think.
ok previous.
2010-05-18 22:24:54 +00:00
drahn
24b66d9213 Switch to using COMPILER_VERSION instead of USE_GCC3, allows for more flexible
complier picking, eg supporting gcc2, gcc3, and gcc4. based on diff by Marco,
with fixes from espie@.
ok espie@ general mumbling of approval of others.
2010-05-10 18:20:31 +00:00
mk
5727ab90b7 incomming -> incoming
The ones found in gnu/ left out by intention.

ok jmc
2010-05-01 08:14:26 +00:00
miod
be960fe69d MACHINE_ARCH -> MACHINE_CPU when applicable.
** it is necessary to update make(1) before building now **
2010-02-03 20:49:58 +00:00
halex
0de56eb4e7 dumped is _still_ spelled with one p and not two
ok krw@
2009-12-15 13:11:42 +00:00
kurt
c5acf43a35 Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required.  Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking.  A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization.  Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

committing on behalf of and okay guenther@ now that we have install
media space available.
2009-11-09 00:18:27 +00:00
guenther
7ff09c5c6c Back out previous commit, as it caused too much growth for the install
media to fit
2009-10-22 01:23:16 +00:00
guenther
9962e7fd03 Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required.  Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking.  A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization.  Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

ok kurt@, earlier version tested by sthen@ and jj@
2009-10-21 16:04:23 +00:00
martynas
22dda6cb9f use c calling conventions so that g++ doesn't mangle fpgetmask &
friends' names unbreaking at least enblend-enfuse & inkscape on
macppc & alpha
reported, tested: ajacoutot@, sthen@
ok: millert@, otto@
2009-09-27 21:23:55 +00:00
jsg
36909e647c Use __builtin_offsetof for offsetof definition on gcc >= 4
This is required as gcc grows ever more pedantic with old age
and cavorts with standards bodies that like to create paradoxes.

ok kettenis@ miod@ millert@ espie@
2009-09-22 21:40:02 +00:00
millert
5fe0ba81f0 Don't stop traversing a directory hierarchy if we reach SHRT_MAX,
just stop updating fts_level so we don't overflow it.  This allows
rm, find, etc to operate on very deep hierarchies.  Consumers of
fts(3) do need to be aware that the actual level may be larger
than fts_level.  During the next libc major bump we will make
fts_level an int instead of a short.  OK deraadt@
2009-08-27 16:19:27 +00:00
martynas
ed1ba055d0 int is big enough to fully represent exponents of all supported fp
formats.  which even for 80-bit & 128-bit long doubles is only 15
bits.  therefore, scalbln, scalblnf, scalblnl are essentially the
same as scalbn, scalbnf, scalbnl with bounds checking so that
LONG_MIN..INT_MIN, and INT_MAX..LONG_MAX ranges properly raise
exceptions & yield correct values.  looks good to millert@
2009-07-25 11:38:09 +00:00
ratchov
bb957eee77 use const qualifier in libsndio, making it slightly more consistent
with open(2) and write(2) syscalls.
from Thomas Pfaff, jakemsr is fine with it
2009-07-25 11:27:14 +00:00
ratchov
6efede295b Currently midi capable programs can control midi hardware, but
cannot cooperate with other programs.  The aim of this change is
to allow any program to send midi data to other programs as they
were midi hardware. For instance, this change should solve the
longstanding problem of using a midi sequencer with software
synthesizers. More precisely:

 - new midicat(1) utility (actually hardlink to aucat(1)).
   it creates software midi thru boxes, allowing programs
   to send midi messages to other programs as they were
   midi(4) hardware.

 - new midi api in libsndio (see mio_open(3)), to access
   midi(4) devices and midicat(1) sockets in a uniform way.

 - new device naming scheme <service>:<unit>[.<option>],
   common to audio and midi.

 - new sndio(7) manual describing concepts and naming

The current audio device naming still works, but people having
scripts or configuration files containing device names could read
the sndio(7) man page and slowly start updating device names.

discussed with jakemsr@ and deraadt@, help form jmc@
2009-07-25 08:44:26 +00:00
millert
9938c24341 Install ntfs includes and add libkvm (fstat) support. ntfs bits
adapted from NetBSD fstat.  OK deraadt@
2009-06-24 13:04:24 +00:00
millert
e5d1abe31d Install msdosfs includes; ok krw@ 2009-06-20 12:19:44 +00:00
millert
9dc8fca88d Add kvm_getfile2 which uses KERN_FILE2 when possible, falling
back on kmem grovelling for non-live kernels.  OK deraadt@
2009-06-07 03:09:34 +00:00
pyr
60842fda97 Add a resolv.conf option to specify the order in which getaddrinfo
PF_UNSPEC queries are made. While there change the default from inet6
first then inet4 to inet4 first then inet6, this prevents the many
people with IPv4 only connectivity from constantly trying to contact
IPv6 addresses, and also unbreaks many ports who don't use getaddrinfo
right.

ok deraadt@, plenty of cheering in the room wrt the idea, not loud
enough complaining from the v6 crowd.
2009-06-04 18:06:35 +00:00
millert
471b62eeaa Make putenv(), setenv() and unsetenv() standards compliant. The
standard explicitly disallows passing setenv a name with a '=' in
it but historic BSD behavior is to allow this but to ignore the '='
and anything after it.
2009-06-03 15:52:16 +00:00
jj
f64d9cd67d Arla client rename from xfs to nnpfs for later upgrades. Tested on various arches. ok todd@ beck@ 2009-06-03 14:45:39 +00:00
jasper
ab0c76cf9a - define EAI_OVERFLOW, as per IEEE Std 1003.1-2001(Interpretation #13)
hint from claudio@, ok millert@
2009-06-02 16:47:50 +00:00
jacekm
ce40aaaee9 fix confusing comment; ok krw@ 2009-05-07 16:32:53 +00:00
ratchov
fcb16ac022 move src/lib/libsndio/sndio.h into src/include where other include
files leave.

requested by deraadt@, ok miod@
2009-04-21 19:14:33 +00:00
martynas
ec91bd97ac nuke extern from func decls. ok millert@ 2009-04-08 23:09:50 +00:00
miod
c764b4617e _PATH_DRUM is no more. 2009-01-21 22:19:42 +00:00
kettenis
416b788cd9 Add wcstof(3) and wcstold(3).
ok miod@
2009-01-13 18:18:31 +00:00
kettenis
65b8c882d5 Add wcstoimax(3) and wcstoumax(3).
ok miod@
2009-01-13 18:13:51 +00:00
martynas
426f92abd4 add __infinityf declaration. (only affects vax). pointed out by miod@ 2008-12-11 12:08:27 +00:00
martynas
ec3edc56ae expose extended-precision definitions. ok millert@ 2008-12-09 20:02:02 +00:00
otto
ee1a9978f9 Commit requested by marco:
Add nonblock support for xdrrecs
ok millert blambert & otto; from NetBSD. libc bump to follow soon.
2008-12-09 19:40:10 +00:00
otto
abf3e76998 fix inet_ntop(3) prototype; ok millert@ libc to be bumbed very soon 2008-12-09 19:38:38 +00:00
ray
a0599817f9 Don't have anything after #endif.
Caught by pcc.

OK martynas
2008-12-04 03:52:31 +00:00
ratchov
f153e44069 rename libsa to libsndio
requested by many, "just go for it" deraadt@
2008-10-27 00:26:33 +00:00
espie
845e44732a no cookie for ratchov, committed things without running make build. 2008-10-26 12:02:53 +00:00
martynas
190a67d733 sigh, gamma got lost 2008-09-09 20:42:55 +00:00
martynas
7b36286a70 - replace dtoa w/ David's gdtoa, version 2008-03-15
- provide proper dtoa locks
- use the real strtof implementation
- add strtold, __hdtoa, __hldtoa
- add %a/%A support
- don't lose precision in printf, don't round to double anymore
- implement extended-precision versions of libc functions: fpclassify,
isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is
fixed
- separate vax versions of strtof, and __hdtoa
- add complex math support.  added functions: cacos, casin, catan,
ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp,
clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf,
casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf,
ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf,
cimagf, conjf, cprojf, crealf
- add fdim, fmax, fmin
- add log2. (adapted implementation e_log.c.  could be more acruate
& faster, but it's good enough for now)
- remove wrappers & cruft in libm, supposed to work-around mistakes
in SVID, etc.;  use ieee versions.  fixes issues in python 2.6 for
djm@
- make _digittoint static
- proper definitions for i386, and amd64 in ieee.h
- sh, powerpc don't really have extended-precision
- add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h
for LDBL_*
- merge lead to frac for m{6,8}k, for gdtoa to work properly
- add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa
to use
- add EXT_IMPLICIT_NBIT definition, which indicates implicit
normalization bit
- add regression tests for libc: fpclassify and printf
- arith.h & gd_qnan.h definitions
- update ieee.h: hppa doesn't have quad-precision, hppa64 does
- add missing prototypes to gdtoaimp
- on 64-bit platforms make sure gdtoa doesn't use a long when it
really wants an int
- etc., what i may have forgotten...
- bump libm major, due to removed&changed symbols
- no libc bump, since this is riding on djm's libc major crank from
a day ago

discussed with / requested by / testing theo, sthen@, djm@, jsg@,
merdely@, jsing@, tedu@, brad@, jakemsr@, and others.
looks good to millert@
parts of the diff ok kettenis@

this commit does not include:
- man page changes
2008-09-07 20:36:06 +00:00
djm
4ef0b5fdda Rename SHA256/384/512 API to avoid namespace collisions with
forthcoming OpenSSL update.

Function names lose their underscore (SHA256_Init => SHA256Init) and
the various SHA256_CTX, SHA512_CTX are merged into a single SHA2_CTX
that is used for all these hashes.

ok millert@ manpage bits jmc@ "please commit" deraadt@
2008-09-06 12:00:19 +00:00
kettenis
9ba94f0a94 Don't install libbfd and libopcodes and the associated headers.
They really are just a way to share common code between gdb and binutils
(which in the GNU world are seperate packages).  The developers (and I'm
one of them) make absolutely no effert to maintain a stable API/ABI.

If ports people really need libbfd or libopcodes, they should just
package a suitable version.

ok weingart@, deraadt@
2008-08-22 13:02:53 +00:00
martynas
49b719a259 unXXX prototypes: exp2, remquo, nan, exp2f, remquof, nanf 2008-07-24 09:41:58 +00:00
martynas
8fe5dbae4f - add NAN definition (except on VAX)
- add C99 real-floating macros fpclassify isfinite isinf isnan
isnormal signbit
- add C99 macros isgreater isgreaterequal isless islessequal
islessgreater isunordered
- add function prototypes, __fpclassify __fpclassifyf __fpclassifyl
__isfinite __isfinitef __isfinitel __isinf __isinfl __isnan __isnanl
__isnormal __isnormalf __isnormall __signbit __signbitf __signbitl
ok millert@
2008-07-24 09:35:30 +00:00
martynas
a170c290bc - added HUGE_VALF, HUGE_VALL, INFINITY, FP_INFINITE, FP_NAN,
FP_NORMAL, FP_SUBNORMAL, FP_ZERO, FP_ILOGB0, FP_ILOGBNAN definitions,
per C99
- classify functions into sections, add missing definitions, add
and some '#if 0' functions, and long double definitions, so we see
what's needed to be done
- other stuff is XXX'd, and will be uncommented soon
ok millert@
2008-07-22 16:01:46 +00:00
martynas
7c79e32890 - add proper double_t and float_t definitions for each arch
- math.h shouldn't define FLT_EVAL_METHOD, but float.h should (per
C99).  remove from math.h, and add proper definitions in float.h
ok millert@
2008-07-21 20:50:54 +00:00
martynas
67203373ed infnan always returned wrong values, because compiler assumed it
returns integer value, so add missing prototype
ok millert@
2008-07-16 15:01:19 +00:00
ray
d874cce4b1 First pass at removing clauses 3 and 4 from NetBSD licenses.
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@
2008-06-26 05:42:03 +00:00
millert
4ab37d14b5 Move _POSIX_THREAD_SAFE_FUNCTIONS into unistd.h and set it to 200112
now that we support all the _r functions required by POSIX 1003.1-2001.
Also define _POSIX_REENTRANT_FUNCTIONS.  OK kurt@ deraadt@
2008-06-25 14:58:54 +00:00
millert
c39c6cccd9 Add _PW_BUF_LEN define and use it instead of hard-coding 1024 for
the buffer size.  OK deraadt@
2008-06-25 14:51:27 +00:00
deraadt
9eb309bbb4 prototypes for getpwnam_r() and getpwuid_r() 2008-06-24 14:31:59 +00:00
otto
67821f6d28 remove recalloc; sloppy me; ok deraadt@ 2008-06-24 06:01:33 +00:00
ragge
57d1d82645 Remove obsolete (and erroneous) #if statement that caused all compilers
except for gcc to get the wrong prototype.  Ok millert@
2008-06-20 15:21:06 +00:00
sturm
3ae1bc46f2 implement xdr_int64_t, xdr_u_int64_t
from NetBSD
2008-06-13 21:12:11 +00:00
landry
8f9e5b6355 Add strtof() to libc, some ports seem to like it. Currently it's a simple
call to strtod() with bounding check.
Discussed with pyr@ and otto@

ok otto@ deraadt@
2008-06-13 21:04:24 +00:00
martynas
3102793312 tgamma and tgammaf 2008-06-11 21:16:43 +00:00
deraadt
ddc33aaef8 olf support starts to die (easy stuff first); ok miod 2008-06-04 21:12:49 +00:00
kurt
b1f9cfb709 Remove duplicate psignal(3) and sys_siglist definitions. signal.h
is the correct place for them and nothing gets them from here in
base/xenocara/ports. no objection millert@ okay kettenis@
2008-04-29 14:52:54 +00:00
kettenis
8958e66d81 Make sure sys_signame and sys_siglist are wrapped in __BEGIN_DECLS.
Needed to tell pedantic C++ compilers these symbols have 'C' linkage.

ok kurt@
2008-04-29 14:44:04 +00:00
kurt
aa23f690d8 - correct brk(2) prototype and man page to match implementation and POSIX.
brk(2) returns an int value not a void *. brk(2) returns 0 upon success not
a pointer to the new end of memory. okay millert@, kettenis@, deraadt@
2008-04-24 20:43:20 +00:00
norby
d90b97932d Import MPLS (Multi Protocol Label Switching)
MPLS support partly based on the (abandoned?) AYAME project.
Basic LSR (Label Switch Router) functionality is present, but not fully
functional yet.

It is currently possible to insert entries in the LIB (Label Information Base)
with route(8), but setting the operation type is not supported yet.

Imported to allow more people to work on this in the coming weeks.

ok claudio@ laurent@ dlg@
2008-04-23 10:55:13 +00:00
matthieu
4eff13294a Get rid of 3 extra leading spaces. ok deraadt@ 2008-03-22 10:36:11 +00:00
otto
f7b5bfc7f0 diff from djm@ committed at his request:
introduce two new APIs for requesting strong random numbers:

arc4random_buf() - fill an arbitrary memory range with random numbers

arc4random_uniform() - return a uniformly distributed random number
below
a specified upper bound, avoiding the bias that comes from a naive
"arc4random() % upper_bound" construction.

these mirror similarly-named functions in the kernel;
lots of discussion deraadt@ mcbride@
2008-03-16 19:47:43 +00:00
kettenis
ac8ea6071f Define _POSIX_TZNAME_MAX to 6 if the user requested POSIX 1003.1-2001.
ok millert@
2008-02-10 09:59:54 +00:00
kettenis
8729246fec Define _POSIX_HOST_NAME_MAX and HOST_NAME_MAX.
ok krw@, laurent@
2008-02-02 15:31:31 +00:00
jmc
f7ab9cefff some spelling fixes from Martynas Venckus 2007-11-24 12:59:28 +00:00
deraadt
cbac0f3a6b install includes from libexpat 2007-10-19 14:28:15 +00:00
otto
780a6ae76a pcc knows _Bool. ok beck@ miod @millert 2007-10-02 14:06:16 +00:00
millert
dce89cbd3f add recaloc(3) 2007-09-03 14:37:02 +00:00
millert
6d0ae6a4bc add memrchr(3) 2007-09-03 14:36:40 +00:00
deraadt
744047fcee no longer make include/netipx dir 2007-06-06 20:44:06 +00:00
kurt
45e14c3813 _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, so
isolate its usage to libpthread only and replace with generic non-static
mutex support in the one place it is needed:
 - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the
   functions weak so that libpthread can override with its own new
   versions that do the locking.
 - remove _thread_fd_lock/unlock() weak functions from libc and adjust
   libpthread for the change.
 - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc
   to support non-static mutexes in libc and add libpthread and librthread
   implementations for them. libc can utilize non-static mutexes via the
   new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can
   support both static and non-static mutexes but currently only using
   them for non-static.
 - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe
   for both thread libraries by using a non-static mutex in the struct
   _dirdesc (typedef DIR), utilizing it in the *dir functions and remove
   remaining and incorrect _FD_LOCK/UNLOCK() use in libc.
 - add comments to both thread libraries to indicate libc depends on the
   current implementation of static mutex initialization. suggested by
   marc@
 - major bump libc and libpthread due to function removal, structure
   change and weak symbol conversions.
okay marc@, tedu@
2007-06-05 18:11:48 +00:00
millert
0155e65346 Add ffs2 support to dump/restore. From FreeBSD with some NetBSD changes.
With help from otto@
2007-06-03 20:16:07 +00:00
jason
2e10aa311d based on a diff from Matt Provost: allow printing of ldd information
on libraries themselves.  Works by setting up the debugging flags then
calling dlopen() to do the heavy lifting.  ok drahn
2007-05-29 04:47:17 +00:00
drahn
1e440e158a Provide hook so that rthreads can provide a spinlock to protect from races
in lazy binding. ok art@, kurt@
2007-05-05 15:21:21 +00:00
espie
ddaabf24dd allow extern inline stuff to proceed unchanged thru the mess that the
combined GCC and ISO committees managed to make out of it.

With this, gcc >= 4.3 can grok its way through it correctly.

okay kettenis@, with some help figuring stuff out.
2007-03-17 21:38:14 +00:00
grunk
f6144d89fe do the adjustment of arbitrary 128 -> BLF_MAXUTILIZED in userland as well,
also discussed on tech@ a while ago.

ok pedro@ tedu@ thib@
2007-03-14 17:59:41 +00:00
millert
7e91b1a94f Remove _err() calls from getnetgrent.c. This is a minor API change
as _ng_sl_add() now returns a value. The only consumer of that
interface is netgroup_mkdb(8).  Adapted from NetBSD.
OK deraadt@
2007-03-05 20:29:14 +00:00