build: Improve --with-system-libc support.
* build-aux/build-lib.sh: Avoid building libc for --with-system-libc. Make libmes richer. build-aux/check-mescc.sh: Enable 50-malloc test. * include/dirstream.h: Use HAVE_DIRSTREAM_H to cater for non-existing dirstream.h. * include/grp.h[SYSTEM_LIBC]: Typo. * include/mes/lib.h (__brk, __call_at_exit)[SYSTEM_LIBC]: Declare. * include/stdlib.h (comparison_fn_t)[SYSTEM_LIBC]: Declare. * include/time.h (mktime): Return time_t. * lib/posix/isatty.c [SYSTEM_LIBC]: Do not (re)declare termios. * lib/stub/mktime.c (mktime): Return time_t. * lib/tests/scaffold/41-ternary.c (main): Remove assumption that locals are initialized. * lib/tests/scaffold/70-stdarg.c: Cater for SYSTEM_LIBC. * lib/tests/setjmp/80-setjmp.c: Declare jmp buf. * lib/*/*.c: Add missing mes/lib.h, errno.h includes.
This commit is contained in:
parent
fd1109a25f
commit
58fb0cf764
|
@ -59,7 +59,7 @@ struct timespec
|
||||||
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||||
struct tm *localtime (time_t const *timep);
|
struct tm *localtime (time_t const *timep);
|
||||||
struct tm *gmtime (time_t const *time);
|
struct tm *gmtime (time_t const *time);
|
||||||
int mktime (struct tm *broken_time);
|
time_t mktime (struct tm *broken_time);
|
||||||
int nanosleep (struct timespec const *requested_time, struct timespec const *remaining);
|
int nanosleep (struct timespec const *requested_time, struct timespec const *remaining);
|
||||||
time_t time (time_t * tloc);
|
time_t time (time_t * tloc);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
struct group *
|
struct group *
|
||||||
|
@ -27,8 +28,13 @@ getgrgid (gid_t gid)
|
||||||
static int stub = 0;
|
static int stub = 0;
|
||||||
if (__mes_debug () && !stub)
|
if (__mes_debug () && !stub)
|
||||||
eputs ("getgrid stub\n");
|
eputs ("getgrid stub\n");
|
||||||
static char *groups[2] = {"root", 0 };
|
static char *groups[2] = { "root", 0 };
|
||||||
static struct group root = {"root", 0, groups};
|
#if SYSTEM_LIBC
|
||||||
|
static struct group root = { "root", 0, 0 };
|
||||||
|
root.gr_mem = groups;
|
||||||
|
#else
|
||||||
|
static struct group root = { "root", 0, groups };
|
||||||
|
#endif
|
||||||
stub = 1;
|
stub = 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
return &root;
|
return &root;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
struct group *
|
struct group *
|
||||||
|
@ -27,8 +28,13 @@ getgrnam (char const *name)
|
||||||
static int stub = 0;
|
static int stub = 0;
|
||||||
if (__mes_debug () && !stub)
|
if (__mes_debug () && !stub)
|
||||||
eputs ("getgrid stub\n");
|
eputs ("getgrid stub\n");
|
||||||
static char *groups[2] = {"root", 0 };
|
static char *groups[2] = { "root", 0 };
|
||||||
static struct group root = {"root", 0, groups};
|
#if SYSTEM_LIBC
|
||||||
|
static struct group root = { "root", 0, 0 };
|
||||||
|
root.gr_mem = groups;
|
||||||
|
#else
|
||||||
|
static struct group root = { "root", 0, groups };
|
||||||
|
#endif
|
||||||
stub = 1;
|
stub = 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
return &root;
|
return &root;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
pid_t
|
pid_t
|
||||||
|
|
|
@ -19,9 +19,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
int
|
time_t
|
||||||
mktime (struct tm *broken_time)
|
mktime (struct tm *broken_time)
|
||||||
{
|
{
|
||||||
static int stub = 0;
|
static int stub = 0;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
setgrent (void)
|
setgrent (void)
|
||||||
|
|
Loading…
Reference in a new issue