musl: more cleanups in stdio/

Remove 4 files that were identical to the musl originals except the
include of <stdio.h> was replaced by either "stdio.h" or "stdio_impl.h".

It is working well with <stdio.h>, so we can use the unmodified musl
files.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: _chk versions for memset and memmove

The needed check should be pretty trivial, it is just a matter of ensuring the
size is respected. To move towards a more common implementation, I am bringing
in here a new function _chk_fail, that can be called when the check fails. I am
not converting any users, but I can do that, if we agree upon this approach. In
any case, because I abort on _chk_fail, the current behavior should be consistent
with existing checks.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/time: Migrate to upstream musl

Migrate all identical files under libc/time to upstream musl.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/temp: Migrate to upstream musl

Migrate all identical files under libc/temp to upstream musl.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/network: Migrate to upstream musl

Migrate all identical files under libc/network to upstream musl.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: clean more files from libc/stdio

A few files only added "#define _GNU_SOURCE" to the original musl code,
supposedly to make this work together with glibc headers. Since we no
longer use glibc headers in our compilation (and haven't done so in a
very long time), this different is no longer relevant, and can be dropped.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add the new memory files to the build

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: more stdio files from musl

libc/stdio/stdio_ext.h is identical to include/api/stdio_ext.h, so can
be removed. ext.c's only change was from <stdio_ext.h> to "stdio_ext.h"
so it can be removed too.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: remove libc/stdio/stdio.h

Remove libc/stdio/stdio.h, which was an unnecessary slightly-modified copy
of include/api/stdio.h. Musl doesn't have a stdio/stdio.h file either.
In a few places that included "stdio.h" and similar, include <stdio.h> instead.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: get rid of more stdio files with trivial changes

Get rid of several files which are identical to Musl except trivial
changes, like adding an (unnecessary) header #include, or changing
an include from < to ".

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
musl: remove libc/errno/*

The two files in libc/errno are identical to Musl. So use the one from
Musl.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>