1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Add test case for O_TMPFILE handling in open, openat

Also put xasprintf into test-skeleton.c (written in such a way that
including <stdarg.h> is not needed).
This commit is contained in:
Florian Weimer
2016-09-21 15:24:01 +02:00
parent fc3e1337be
commit 85f7554cd9
4 changed files with 239 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include <sys/wait.h>
#include <sys/param.h>
#include <time.h>
#include <stdarg.h>
/* The test function is normally called `do_test' and it is called
with argc and argv as the arguments. We nevertheless provide the
@ -115,6 +116,20 @@ xrealloc (void *p, size_t n)
return result;
}
/* Call asprintf with error checking. */
__attribute__ ((always_inline, format (printf, 1, 2)))
static __inline__ char *
xasprintf (const char *format, ...)
{
char *result;
if (asprintf (&result, format, __builtin_va_arg_pack ()) < 0)
{
printf ("error: asprintf: %m\n");
exit (1);
}
return result;
}
/* Write a message to standard output. Can be used in signal
handlers. */
static void