1.1 --- a/test_files/programs/dstest_exec_payload.c Mon Dec 11 19:17:25 2023 +0100
1.2 +++ b/test_files/programs/dstest_exec_payload.c Mon Dec 11 19:23:39 2023 +0100
1.3 @@ -20,6 +20,13 @@
1.4 */
1.5
1.6 #include <stdio.h>
1.7 +#include <string.h>
1.8 +
1.9 +/* NOTE: For inclusion in the C library. */
1.10 +
1.11 +#include <fsclient/client.h>
1.12 +#include <systypes/env.h>
1.13 +#include <systypes/fcntl.h>
1.14
1.15
1.16
1.17 @@ -27,10 +34,24 @@
1.18 {
1.19 int i;
1.20
1.21 + /* NOTE: For inclusion in the C library. */
1.22 +
1.23 + file_t *output = client_get_stream(ENV_OUTPUT_STREAM_NAME, O_WRONLY);
1.24 +
1.25 + /* Write the arguments to the output stream. */
1.26 +
1.27 + char buffer[32];
1.28 +
1.29 for (i = 0; i < argc; i++)
1.30 - printf("Arg #%d: %s\n", i, argv[i]);
1.31 + {
1.32 + sprintf(buffer, "Arg #%d: ", i);
1.33 + client_write(output, buffer, strlen(buffer));
1.34 + client_write(output, argv[i], strlen(argv[i]));
1.35 + client_write(output, "\n", 1);
1.36 + }
1.37
1.38 - printf("Terminating.\n");
1.39 + client_write(output, "Terminating.\n", 13);
1.40 + client_flush(output);
1.41 return 0;
1.42 }
1.43