public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Lukasz Florczak <lukasz.florczak@intel.com>,
	Jes Sorensen <jes@trained-monkey.org>,
	linux-raid@vger.kernel.org
Subject: Re: [PATCH] Replace error prone signal() with sigaction()
Date: Tue, 8 Feb 2022 10:52:46 +0100	[thread overview]
Message-ID: <20220208105246.0000602a@linux.intel.com> (raw)
In-Reply-To: <17c41b6e-ed53-aeed-87e0-a6cbf96f44a2@molgen.mpg.de>

On Tue, 8 Feb 2022 09:52:03 +0100
Paul Menzel <pmenzel@molgen.mpg.de> wrote:

> Dear Lukasz,
> 
> 
> Am 08.02.22 um 16:29 schrieb Lukasz Florczak:
> > Up to this date signal() was used which is deprecated [1].
> > Sigaction() call is preferred. This commit introduces replacement
> > from signal() to sigaction() by the use of signal_s() wrapper.
> > Also remove redundant signal.h header includes.
> 
> signal(2) also says:
> 
> >        * By  default, in glibc 2 and later, the signal() wrapper
> > function does not invoke the kernel system call.  Instead,  it
> > calls  sigaction(2) using flags that supply BSD semantics.  This
> > default behavior is pro‐ vided  as  long  as  a  suitable  feature
> > test  macro  is   defined: _BSD_SOURCE  on  glibc  2.19  and
> > earlier or _DEFAULT_SOURCE in glibc 2.19 and later.  (By default,
> > these  macros  are  defined;  see  fea‐ ture_test_macros(7)  for
> > details.)   If such a feature test macro is not defined, then
> > signal() provides System V semantics.
> 
> Does that mean, it should still be replaced?
Hi Paul,

Both ways are correct. signal() is not deprecated but the behavior may
vary. It can be avoided by sigaction(), so it is better to use
sigaction() then. Do you agree?

Thanks,
Mariusz

  reply	other threads:[~2022-02-08 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 15:29 [PATCH] Replace error prone signal() with sigaction() Lukasz Florczak
2022-02-08  8:52 ` Paul Menzel
2022-02-08  9:52   ` Mariusz Tkaczyk [this message]
2022-02-08  9:56     ` Paul Menzel
2022-02-08  9:41 ` Messages with timestamps from the future from intel.com (was: [PATCH] Replace error prone signal() with sigaction()) Paul Menzel

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=20220208105246.0000602a@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=lukasz.florczak@intel.com \
    --cc=pmenzel@molgen.mpg.de \
    /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