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
guenther
181ba704e2 Use new framework for wrapping dbopen()
Move internal declarations from <db.h> to libc's hidden/db.h

ok kettenis@
2015-09-05 11:28:35 +00:00
daniel
f7094e1118 These days pcc defines __GNUC__ and we don't support gcc2. Also needed
for upcoming CompCert port.

Final version of the diff is from kettenis@ with input from jsg@ and tedu@.

ok kettenis@, jsg@, "I agree" millert@
2015-09-04 23:47:09 +00:00
guenther
9b9d2a55a6 Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT.  Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h.  Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.

tests clean on i386, amd64, sparc64, powerpc, and mips64

naming feedback from kettenis@ and millert@
ok kettenis@
2015-08-31 02:53:56 +00:00
guenther
bb64080b0f Use static and __{BEGIN,ENV}_HIDDEN_DECLS to hide a bunch of internal
symbols that are not longer exported.  (This improves the generated code.)

ok deraadt@
2015-08-27 04:37:09 +00:00
guenther
b3b7ef2e4e Hide many (194!) symbols that nothing should be using.
Delete exect(2); it wasn't portable across archs and nothing used it.

ports test build by naddy@
ok deraadt@ kettenis@
2015-08-26 01:54:08 +00:00
yasuoka
572174f265 Build and install libradius as default.
ok deraadt
2015-07-23 06:04:12 +00:00
millert
5dd668c8ea Add VIS_DQ to escape double quotes. OK deraadt@ semarie@ reyk@ 2015-07-20 01:52:27 +00:00
martynas
2c96417951 Define new C99 macros:
- MATH_ERRNO, MATH_ERREXCEPTION and math_errhandling
- Optional FP_FAST_FMA{,F,L} macros if fma() executes as fast or faster
than (x * y) + z;  which in practice is achievable if gcc implements
__FP_FAST_FMA{,F,L}
Reported by John Marino @ DragonFlyBSD.
2015-07-19 17:41:49 +00:00
millert
8fb4bdfc76 The first argument to devname(3) should be dev_t, not int.
The man page was already correct.
2015-07-14 19:05:11 +00:00
millert
b5c8b44bc3 Remove function argument name from posix_spawnattr_getsigmask()
prototype to match other prototypes in the file.  OK guenther@ deraadt@
2015-05-20 22:50:07 +00:00
millert
c9da469ac9 Remove obsolete timezone() function.
Add timezone and daylight symbols for XSI compatibility.
2015-04-07 01:47:04 +00:00
guenther
fd7ad13f9e gcc 2.x is dead
ok millert@
2015-04-04 18:05:04 +00:00
millert
62f3e54ab3 Remove obsolete copy of tzfile.h. It is an internal tzcode header
that should never have been installed.
2015-03-17 20:40:41 +00:00
millert
78badebcb0 Eliminate use of TM_YEAR_BASE. OK guenther@ deraadt@ miod@ 2015-03-17 19:31:30 +00:00
millert
f7055df57d tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time.  This makes the
tree safe for /usr/include/tzfile.h removal.  The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree.  Actual removal of tzfile.h is pending
a ports build.  Based on a diff from deraadt@
2015-03-15 00:41:27 +00:00
tedu
b8a0470688 Use standard spelling for types, and rename local variable from "free".
No actual change, but makes it easier to reuse the code elsewhere.
Suggested by Andre Smagin
2015-02-20 11:51:03 +00:00
sthen
1c6b5d0448 Make sure to replace an existing /usr/include/ssl symlink, otherwise repeated
builds will have a bogus /usr/include/openssl/openssl as found by naddy. ok jca@
2015-02-18 15:31:10 +00:00
tedu
06bb4cbae5 stop deleting the openssl include directory, causing unnecessary rebuilds.
ok jca sthen
2015-02-16 14:06:15 +00:00
millert
3a41feed02 Protect fgetwln(), wcslcat() and wcslcpy() with __BSD_VISIBLE
OK tedu@ kettenis@
2015-02-09 23:02:25 +00:00
tedu
e58af03110 add restrict to strtol like functions. ok guenther 2015-02-08 02:58:50 +00:00
guenther
8a1f5a5836 Delete option COMPAT_43: support for pre-sa_len binaries has been obsolete
for a couple decades.  Keep the OSIOCGIFCONF ioctl to support COMPAT_LINUX
but move the rest of the Linux-specific ioctl() handling into linux_socket.c
This lets struct osockaddr finally move from sys/socket.h to protocols/talkd.h

ok krw@ deraadt@ mpi@
2015-01-21 02:23:14 +00:00
tedu
7a4e5fc41a increase TMP_MAX to the equivalent of INT_MAX. it's actually more,
but safer not to wraparound by accident.
ok deraadt millert miod
2015-01-20 22:09:50 +00:00
krw
5f1af72573 Make some $OpenBSD$ lines prettier/standardier by eliminating
superflous '*' after '/*' and adding blank after terminating '$'.
Also eases parsing of the lines by simple awk scripts.

Aesthetic approval from tedu@.
2015-01-19 15:30:52 +00:00
deraadt
e87170bba9 Stop including <sys/param.h> from <netdb.h>. Portable software must either
include <sys/param.h> (to operate in legacy mode) or if it wishes to operate
in the POSIX world use <limits.h>
ok guenther millert doug naddy
2015-01-18 20:29:31 +00:00
tedu
c0497f64e1 remove des.h. it somehow escaped from ssleay into /usr/include, but none
of the functions prototyped here exist in libc, making it useless.
2015-01-17 20:37:04 +00:00
deraadt
0ea6fd7293 Since <netdb.h> soon won't include <sys/param.h>, MAXHOSTNAMELEN may
not be in scope, so hardcode as 256.  Other options have more downside.
2015-01-16 00:27:00 +00:00
deraadt
587e6a09eb Switch to including <sys/types.h> instead of <sys/param.h>
This hides the unavoidably cruddy sys/param.h namespace in some programs.
Little impact, because many programs are cruddy and still get it via
other includes.
ports testing thanks to sthen and naddy
ok guenther millert
2015-01-16 00:01:28 +00:00
tedu
af4f502b8b we don't have an alloca() symbol anywhere in libc, don't prototype it.
instead, #define to __builtin_alloca. if that doesn't work, you're hosed.
from an old discussion about the perils of alloca. (don't use alloca!)
2015-01-15 19:55:58 +00:00
millert
8acb1e22e6 Add fgetwln(3) from FreeBSD and bump libc minor revision. 2015-01-12 20:58:07 +00:00
guenther
d4bb4faeba $OpenBSD for our rev here 2014-12-20 05:43:26 +00:00
tedu
7f91f42385 claim posix 2008 compat. apparently people look at this and get scared
when it's really old. but no actual ports fallout in espie's build.
ok deraadt
2014-12-13 20:42:41 +00:00
tedu
0a2869cb84 update swab() to match the current posix definition. "rationale: none."
rewrite the function to be simpler as well. the compiler can unroll the
loop for us if necessary.
ok schwarze
2014-12-11 23:05:38 +00:00
deraadt
f7510a6ece Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()
to returning strong random by default, source from arc4random(3).
Parameters to the seeding functions are ignored, and the subsystems remain
in strong random mode.  If you wish the standardized deterministic mode,
call srand_deterministic(), srandom_determistic(), srand48_deterministic(),
seed48_deterministic() or lcong48_deterministic() instead.
The re-entrant functions rand_r(), erand48(), nrand48(), jrand48() are
unaffected by this change and remain in deterministic mode (for now).

Verified as a good roadmap forward by auditing 8800 pieces of software.
Roughly 60 pieces of software will need adaptation to request the
deterministic mode.

Violates POSIX and C89, which violate best practice in this century.
ok guenther tedu millert
2014-12-08 21:45:19 +00:00
tedu
80dc78aa39 header changes for recent libc changes:
add siphash
delete setkey, encrypt, cfree
2014-12-08 20:39:56 +00:00
tedu
817d1ee3be change prototype for crypt_newhash. the login_cap_t is a holdover from its
pwd_gensalt origins, but a string argument works equally work and is more
friendly to consumers beyond local user accounts.
ok deraadt
2014-11-21 05:13:44 +00:00
tedu
faa4eeece1 prototype for crypt_newhash(). adding it here because this is where
login_cap_t lives and i don't want to forward declare it in unistd.h
2014-11-19 22:59:50 +00:00
millert
c2a8008657 Add prototype for stravis(). 2014-11-17 19:51:54 +00:00
jsing
b600beed7b Rename libressl to libtls to avoid confusion and to make it easier to
distinguish between LibreSSL (the project) and libressl (the library).

Discussed with many.
2014-10-31 13:46:17 +00:00
guenther
e356e1c257 Add prototypes for xdr_{accepted,rejected}_reply() and svcudp_enablecache()
(Both NetBSD and FreeBSD provide these prototypes)

ok millert@
2014-10-29 04:34:21 +00:00
guenther
9f295d469e Our setpgrp() is the BSD version with two args and not the XSI
version with zero args, so it should only be visible if __BSD_VISIBLE
(and not also for __XPG_VISIBLE).  Contrawise, readlink() has been
part of base POSIX since 1995, so move to proper #if area for that.
Move crypt_checkpass() to the pure-BSD section of the file.

setpgrp() issue noted by Matti Karnaattu (mkarnaattu (at) gmail.com)
ok millert@
2014-09-18 04:37:56 +00:00
matthieu
cb736800fc Missed this sendmail reference in the sendmail removal 2014-09-16 00:19:31 +00:00
doug
e6ff12da83 Sync readlink(2) with IEEE Std 1003.1-2008.
discussion, help and ok guenther@
2014-09-01 05:09:52 +00:00
miod
9a210c530b Add uuid support routines to libc. From FreeBSD via NetBSD via Bitrig via
Markus Mueller.
2014-08-31 09:36:36 +00:00
guenther
7496a82a13 setgrfile() isn't implemented 2014-08-31 04:04:38 +00:00
guenther
b099c39fbd inet_nsap_{addr,ntoa}() were removed on 2013/12/17 2014-08-31 04:04:01 +00:00
guenther
cbcba4176a Declare and document getthrid()
indirectly prodded by krw@
2014-08-31 04:02:08 +00:00
guenther
ed42a740c1 Add additional userland interfaces for setting close-on-exec on fds
when creating them: mkostemp(), mkostemps(), the 'e' mode letter for
fopen(), freopen(), fdopen(), and popen().  The close-on-exec flag will
be cleared by the action created by posix_spawn_file_actions_adddup2().

Also, add support for the C11 'x' mode letter for fopen() and freopen(),
setting O_EXCL when possibly creating files.

Note: this requires kernel support for pipe2() and dup3()!

ok millert@
2014-08-31 02:21:18 +00:00
guenther
b65639bd21 Add additional kernel interfaces for setting close-on-exec on fds
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC,
SOCK_CLOEXEC.  Includes SOCK_NONBLOCK support.

ok matthew@
2014-08-31 01:42:36 +00:00
guenther
8cf7d58c8a Delete duplicate conditional
diff from frantisek holop (minusf (at) obiit.org)
2014-08-10 02:49:24 +00:00
matthew
177a742757 Change lsearch()'s "base" argument to require a non-const pointer to
align with POSIX and other systems.

Pointed out by Elliott Hughes on tech
ok deraadt
2014-07-18 04:16:09 +00:00
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