|
Packit Service |
ef9500 |
/* Wrapper to invoke tst-glibc-hwcaps in a container, to test ld.so.cache.
|
|
Packit Service |
ef9500 |
Copyright (C) 2020 Free Software Foundation, Inc.
|
|
Packit Service |
ef9500 |
This file is part of the GNU C Library.
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
ef9500 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
ef9500 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
ef9500 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
ef9500 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
ef9500 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
ef9500 |
Lesser General Public License for more details.
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
ef9500 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
ef9500 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
/* This program is just a wrapper that runs ldconfig followed by
|
|
Packit Service |
ef9500 |
tst-glibc-hwcaps. The actual test is provided via an
|
|
Packit Service |
ef9500 |
implementation in a sysdeps subdirectory. */
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
#include <stdio.h>
|
|
Packit Service |
ef9500 |
#include <stdlib.h>
|
|
Packit Service |
ef9500 |
#include <support/support.h>
|
|
Packit Service |
ef9500 |
#include <unistd.h>
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
int
|
|
Packit Service |
ef9500 |
main (int argc, char **argv)
|
|
Packit Service |
ef9500 |
{
|
|
Packit Service |
ef9500 |
/* Run ldconfig to populate the cache. */
|
|
Packit Service |
ef9500 |
{
|
|
Packit Service |
ef9500 |
char *command = xasprintf ("%s/ldconfig", support_install_rootsbindir);
|
|
Packit Service |
ef9500 |
if (system (command) != 0)
|
|
Packit Service |
ef9500 |
return 1;
|
|
Packit Service |
ef9500 |
free (command);
|
|
Packit Service |
ef9500 |
}
|
|
Packit Service |
ef9500 |
|
|
Packit Service |
ef9500 |
/* Reuse tst-glibc-hwcaps. Since this code is running in a
|
|
Packit Service |
ef9500 |
container, we can launch it directly. */
|
|
Packit Service |
ef9500 |
char *path = xasprintf ("%s/elf/tst-glibc-hwcaps", support_objdir_root);
|
|
Packit Service |
ef9500 |
execv (path, argv);
|
|
Packit Service |
ef9500 |
printf ("error: execv of %s failed: %m\n", path);
|
|
Packit Service |
ef9500 |
return 1;
|
|
Packit Service |
ef9500 |
}
|