1.1 --- a/test_files/programs/Makefile Fri May 10 19:19:33 2024 +0200
1.2 +++ b/test_files/programs/Makefile Fri May 10 19:21:48 2024 +0200
1.3 @@ -1,7 +1,7 @@
1.4 PKGDIR ?= ..
1.5 L4DIR ?= $(PKGDIR)/../../..
1.6
1.7 -TARGET = cat clip dstest_exec_payload ls
1.8 +TARGET = cat clip dstest_exec_payload ls test_systemv
1.9
1.10 MODE = static_newlib
1.11
1.12 @@ -13,6 +13,8 @@
1.13
1.14 SRC_C_ls = ls.c
1.15
1.16 +SRC_C_test_systemv = test_systemv.c
1.17 +
1.18 REQUIRES_LIBS = libe2access
1.19
1.20 include $(L4DIR)/mk/prog.mk
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/test_files/programs/test_systemv.c Fri May 10 19:21:48 2024 +0200
2.3 @@ -0,0 +1,50 @@
2.4 +/*
2.5 + * Run a program using the supplied arguments.
2.6 + *
2.7 + * Copyright (C) 2024 Paul Boddie <paul@boddie.org.uk>
2.8 + *
2.9 + * This program is free software; you can redistribute it and/or
2.10 + * modify it under the terms of the GNU General Public License as
2.11 + * published by the Free Software Foundation; either version 2 of
2.12 + * the License, or (at your option) any later version.
2.13 + *
2.14 + * This program is distributed in the hope that it will be useful,
2.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.17 + * GNU General Public License for more details.
2.18 + *
2.19 + * You should have received a copy of the GNU General Public License
2.20 + * along with this program; if not, write to the Free Software
2.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
2.22 + * Boston, MA 02110-1301, USA
2.23 + */
2.24 +
2.25 +#include <stdio.h>
2.26 +#include <errno.h>
2.27 +
2.28 +/* NOTE: To be provided via a header. */
2.29 +
2.30 +extern int systemv(int, const char *[]);
2.31 +
2.32 +
2.33 +
2.34 +/* List objects in the filesystem image. */
2.35 +
2.36 +int main(int argc, char *argv[])
2.37 +{
2.38 + int result;
2.39 +
2.40 + printf("Running: %s\n", argv[1]);
2.41 +
2.42 + result = systemv(argc - 1, (const char **) argv + 1);
2.43 +
2.44 + if (result == -1)
2.45 + printf("Error: %d\n", errno);
2.46 + else
2.47 + printf("Result: %d\n", result);
2.48 +
2.49 + return 0;
2.50 +}
2.51 +
2.52 +/* vim: tabstop=4 expandtab shiftwidth=4
2.53 +*/