All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Shirisha ganta <shirisha@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] Migrating the libhugetlbfs/testcases/truncate.c test
Date: Thu, 21 Mar 2024 08:35:34 +0100	[thread overview]
Message-ID: <20240321073534.GA533096@pevik> (raw)
In-Reply-To: <c58c5365f7c801e93745775577a3cbb83159fb91.camel@linux.ibm.com>

> > ...
> > > +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).
> The value 17 is often chosen as a non-zero return value for sigsetjmp
> because it is unlikely to be a valid return value from a normal
> function. By using a non-zero value, you can distinguish between a
> direct return from sigsetjmp (where the return value is 0) and a return
> after a siglongjmp (where the return value is non-zero).
> By using a non-zero value (like 17), you can differentiate between
> normal function returns and jumps due to exceptional conditions. he
> specific value chosen (such as 17) can vary based on the programmer’s
> preference or the context of the application. Some developers might use
> other non-zero values, but 17 has become a convention due to its
> uniqueness and readability.

Thanks for info!

Kind regards,
Petr

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

      reply	other threads:[~2024-03-21  7:35 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
2024-03-21  7:03   ` Shirisha ganta
2024-03-21  7:35     ` Petr Vorel [this message]

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=20240321073534.GA533096@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.