From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v2 1/3] syscalls: refactor fork09 using new API
Date: Thu, 5 Mar 2026 15:09:14 +0100 [thread overview]
Message-ID: <aamOijT3cpbg89yj@yuki.lan> (raw)
In-Reply-To: <20260304-fork_refactoring-v2-1-016c47c90bc1@suse.com>
Hi!
> - * ALGORITHM
> - * Parent opens a maximum number of files
> - * Child closes one and attempts to open another, it should be
> - * available
This is different description than the new one below.
> -#include <sys/types.h>
> -#include <sys/wait.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <stdio.h>
> -#include <errno.h>
> -#include <unistd.h> /* for _SC_OPEN_MAX */
> -#include "test.h"
> -#include "tso_safe_macros.h"
> -
> -char *TCID = "fork09";
> -int TST_TOTAL = 1;
> +/*\
> + * Verify that a forked child can close all the files which have been open by
> + * the parent process.
> + */
Which is a different assertion from what the test did before.
I would keep the code we have after the conversion but we should close a
file in the child and ten open another one before we attemp to close all
the files in the child.
> + tst_res(TINFO, "Opening files from parent");
> +
> + for (nfiles = 0; nfiles < file_open_max; nfiles++) {
> + memset(name, 0, PATH_MAX);
I wonder what is this memset() needed for?
snprintf() always terminates the string
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-03-05 14:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 15:02 [LTP] [PATCH v2 0/3] Refactor tests which are verifying fork/vfork functionalities Andrea Cervesato
2026-03-04 15:02 ` [LTP] [PATCH v2 1/3] syscalls: refactor fork09 using new API Andrea Cervesato
2026-03-05 14:09 ` Cyril Hrubis [this message]
2026-03-04 15:02 ` [LTP] [PATCH v2 2/3] syscalls: refactor vfork01 " Andrea Cervesato
2026-03-05 15:03 ` Cyril Hrubis
2026-03-04 15:02 ` [LTP] [PATCH v2 3/3] syscalls: refactor vfork02 " Andrea Cervesato
2026-03-05 15:32 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aamOijT3cpbg89yj@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox