NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/47827: [PATCH] improve portability of NetBSD libc testcases



>Number:         47827
>Category:       misc
>Synopsis:       [PATCH] improve portability of NetBSD libc testcases
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 17 16:25:00 +0000 2013
>Originator:     Garrett Cooper
>Release:        CURRENT
>Organization:
EMC Isilon
>Environment:
n/a
>Description:
The attached patch improves portability of the libc testcases such that I could 
relatively easily port the NetBSD testcases to FreeBSD, with minor fudging (not 
noted here because the libc/kernel features differ between FreeBSD and NetBSD 
for obvious reasons).

The summary of the changes are as follows:
1. FreeBSD almost always requires sys/param.h in order for types and other 
things to get pulled in properly -- in part because sys/types.h is needed for a 
number of datatypes, but also for macros being used by the project.
2. ___STRING is being replaced by __STRING as it's common between FreeBSD and 
NetBSD.
3. sys/syslimits.h is being replaced by syslimits.h as it's standard between 
FreeBSD and NetBSD.
4. __unused is being added to signal handlers to suppress warnings from 
compilers.
5. h_macros.h inclusion with a hardcoded relative path in the .c files is being 
replaced with a single -I directive being appended to CFLAGS in 
tests/lib/libc/Makefile.inc ; this alleviates relocation of h_macros.h for the 
time being until I figure out where it needs to go finally since the directory 
layout of testcases in FreeBSD being implemented in soon is going to be 
fundamentally different from NetBSD (tests are localized near the sources, e.g. 
tests/lib/libc/ vs lib/libc/tests/).
6. machine/ headers (machine/disklabel.h) are being replaced with non-machine/ 
headers (sys/disklabel.h).
7. limits.h is being #include'd for macro definitions per POSIX, required by 
FreeBSD.
8. sys/sockets.h is being #included for socket constants in FreeBSD.
9. stdint.h is being pulled in for formatting constants per POSIX.
10. sys/stat.h is being pulled in for *stat*(2), etc, per the manpages on both 
FreeBSD and NetBSD.
11. stdio.h is being #include'd wherever printf(3) is being used.

THESE CHANGES HAVE NOT BEEN BUILD TESTED ON NetBSD -- only on FreeBSD (I need 
to create a build VM in order to test these changes)!
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index