[PATCH 4/7] Port strnstr.c to FreeBSD.

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Aug 17 08:12:50 UTC 2017


Two points regarding patch 3 and 4:

First the easy one: I expect that you need it for wpa_supplicant to
compile? In that case these two patches should be in front of 1 and 2.

The second point is harder to resolve. I wouldn't even be sure myself
what to do here: strnstr seems to be a function provided by the C
library. In our case that would be newlib. I'm not sure whether it is a
good idea to import some parts of the BSD C library. On the other hand,
there are already some other function imported from there too.

To our C-library experts: What would be the right way of handling this?

Am 17.08.2017 um 02:23 schrieb Sichen Zhao:
> ---
>  libbsd.py     | 1 +
>  libbsd_waf.py | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/libbsd.py b/libbsd.py
> index ea469d3..a0b7f1a 100644
> --- a/libbsd.py
> +++ b/libbsd.py
> @@ -2534,6 +2534,7 @@ def user_space(mm):
>              'lib/libc/stdlib/strtonum.c',
>              'lib/libc/stdlib/strtoumax.c',
>              'lib/libc/string/strsep.c',
> +            'lib/libc/string/strnstr.c',
>              'lib/libc/xdr/xdr_array.c',
>              'lib/libc/xdr/xdr.c',
>              'lib/libc/xdr/xdr_float.c',
> diff --git a/libbsd_waf.py b/libbsd_waf.py
> index 329a62a..02b2cbd 100644
> --- a/libbsd_waf.py
> +++ b/libbsd_waf.py
> @@ -465,6 +465,7 @@ def build(bld):
>                       'freebsd/lib/libc/stdlib/strtoimax.c',
>                       'freebsd/lib/libc/stdlib/strtonum.c',
>                       'freebsd/lib/libc/stdlib/strtoumax.c',
> +                     'freebsd/lib/libc/string/strnstr.c',
>                       'freebsd/lib/libc/string/strsep.c',
>                       'freebsd/lib/libc/xdr/xdr.c',
>                       'freebsd/lib/libc/xdr/xdr_array.c',
> 

-- 
--------------------------------------------
embedded brains GmbH
Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list