These are error-checked versions of memory allocation routines used by
NetBSD code, and are being added to facilitate updates to makefs.
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D10291
This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD
Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.
Improve compatibility with NetBSD in the following headers:
- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
for the functions.
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
FreeBSD has pthread_np.h, which is used for consolidating all non-POSIX
functions, but NetBSD doesn't have this concept. Make _np functions work
seamlessly when ported from NetBSD to FreeBSD
- stdio.h needs to pull in stdio.h/util.h for fparseln, not util.h
- util.h needs to #include sys/types.h for flags_to_string, etc as
flags_to_string uses u_long, which is typedef'ed in sys/types.h on
FreeBSD
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.
Still need to add real targets under targets/ to build packages.
Differential Revision: D2796
Reviewed by: brooks imp
FreeBSD
Add the missing compat definitions/macros to lib/libnetbsd so the testcases
can be compiled with libnetbsd without having to invent ad hoc #define's, or
having to convert things over to FreeBSD idioms
Reviewed by: brooks
Phabric: D993
Sponsored by: EMC / Isilon Storage Division
set of NetBSD software to compile as part of the FreeBSD build with
little or no modifiction. It is built as a static library and not
installed for general use. Likewise, its header files are not
installed.
Sponsored by: DARPA, AFRL