All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Shirisha G <shirisha@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] Migrating the libhugetlbfs/testcases/truncate.c test
Date: Tue, 28 Nov 2023 12:22:54 +0100	[thread overview]
Message-ID: <20231128112254.GA367506@pevik> (raw)
In-Reply-To: <20230929091401.205277-1-shirisha@linux.ibm.com>

Hi,

...
> +static void sigbus_handler(int signum)
> +{
> +	test_pass = 1;
> +	siglongjmp(sig_escape, 17);
What 17 stands for? Is there any constant which could be used? Or can you define
something (the name of the constant would be self-describing).
> +}
> +
> +static void run_test(void)
> +{
> +	void *p;
> +	volatile unsigned int *q;
> +
> +	sigbus_count = 0;
> +	test_pass = 0;
> +	int err;
> +
> +	p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED,
> +			fd, 0);
> +	q = p;
> +	*q = 0;
> +	err = ftruncate(fd, 0);
> +	if (err)
> +		tst_res(TFAIL, "ftruncate failed");
We have SAFE_FTRUNCATE(), error check is not needed.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2023-11-28 11:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  9:14 [LTP] [PATCH v3] Migrating the libhugetlbfs/testcases/truncate.c test Shirisha G
2023-11-28 11:10 ` Petr Vorel
2024-03-21  6:49   ` Shirisha ganta
2023-11-28 11:22 ` Petr Vorel [this message]
2024-03-21  7:03   ` Shirisha ganta
2024-03-21  7:35     ` Petr Vorel

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=20231128112254.GA367506@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=shirisha@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.