Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 2023 21:30:17 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: c7dd4601aeeb - main - libc: Add a rudimentary test for quick_exit(3).
Message-ID:  <3FB4642C-6B3D-4125-8E71-F99D61FF0B16@freebsd.org>
In-Reply-To: <202309262026.38QKQY4A083001@gitrepo.freebsd.org>
References:  <202309262026.38QKQY4A083001@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


Jess

> On 26 Sep 2023, at 21:26, Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> =
wrote:
>=20
> The branch main has been updated by des:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dc7dd4601aeebbc1bbe131cbe6747476c=
124b47fe
>=20
> commit c7dd4601aeebbc1bbe131cbe6747476c124b47fe
> Author:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> AuthorDate: 2023-09-26 20:07:03 +0000
> Commit:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> CommitDate: 2023-09-26 20:07:10 +0000
>=20
>    libc: Add a rudimentary test for quick_exit(3).
>=20
>    Sponsored by:   Klara, Inc.
>    Reviewed by:    kib
>    Differential Revision:  https://reviews.freebsd.org/D41937
> ---
> lib/libc/tests/stdlib/Makefile          |  1 +
> lib/libc/tests/stdlib/quick_exit_test.c | 81 =
+++++++++++++++++++++++++++++++++
> 2 files changed, 82 insertions(+)
>=20
> diff --git a/lib/libc/tests/stdlib/Makefile =
b/lib/libc/tests/stdlib/Makefile
> index a2a6420aba41..860e530389df 100644
> --- a/lib/libc/tests/stdlib/Makefile
> +++ b/lib/libc/tests/stdlib/Makefile
> @@ -12,6 +12,7 @@ ATF_TESTS_C+=3D qsort_b_test
> ATF_TESTS_C+=3D qsort_r_compat_test
> ATF_TESTS_C+=3D qsort_r_test
> ATF_TESTS_C+=3D qsort_s_test
> +ATF_TESTS_C+=3D quick_exit_test
> ATF_TESTS_C+=3D set_constraint_handler_s_test
> ATF_TESTS_C+=3D strfmon_test
> ATF_TESTS_C+=3D tsearch_test
> diff --git a/lib/libc/tests/stdlib/quick_exit_test.c =
b/lib/libc/tests/stdlib/quick_exit_test.c
> new file mode 100644
> index 000000000000..9feed8a6fa63
> --- /dev/null
> +++ b/lib/libc/tests/stdlib/quick_exit_test.c
> @@ -0,0 +1,81 @@
> +/*-
> + * Copyright (c) 2023 Klara, Inc.
> + *
> + * SPDX-License-Identifier: BSD-2-Clause
> + */
> +
> +#include <sys/wait.h>
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +
> +#include <atf-c.h>
> +
> +static void func_a(void)
> +{
> + if (write(STDOUT_FILENO, "a", 1) !=3D 1)
> + _Exit(1);
> +}
> +
> +static void func_b(void)
> +{
> + if (write(STDOUT_FILENO, "b", 1) !=3D 1)
> + _Exit(1);
> +}
> +
> +static void func_c(void)
> +{
> + if (write(STDOUT_FILENO, "c", 1) !=3D 1)
> + _Exit(1);
> +}
> +
> +static void child(void)
> +{
> + // this will be received by the parent

style(9) is to only do C-style /* */ comments.

Jess




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FB4642C-6B3D-4125-8E71-F99D61FF0B16>