help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: PATCH: move $ERRNO to the system module
Date: Thu, 12 Jan 2023 17:14:00 +0000	[thread overview]
Message-ID: <7a115b06-4268-409b-a8a8-5b683567a827@app.fastmail.com> (raw)
In-Reply-To: <63758-1673479188.568367@mRHO.g-Av.gAfN>

Oliver Kiddle wrote on Wed, 11 Jan 2023 23:19 +00:00:
> This would not be a strictly backward-compatible change.

Does moving $ERRNO from the core to a module "reorder or add system
calls" to the codepath that expands/evaluates uses of ERRNO?  I.e.,
even assuming scripts already do load zsh/system, is it safe to
assume the value of errno by the time Src/Modules/system.c code runs
will be the same value errno had at the point execution with this patch
diverges from execution without it?

> My justification is that, given how close it is to the system, any
> reliance on it is already liable to break just because we might reorder
> or add system calls.

How does the conclusion "It's fine to move ERRNO to a module" follow
from the premise "Scripts that rely on ERRNO are liable to break if zsh.c
changes"?  It's not immediately clear that a script that guards
against some C code modifying errno [possibly as a side effect] will
also be safe against ERRNO having been moved to a module, cf.
Stephane's example.

>                      ERRNO is not especially portable, either.

Portability is neither here nor there.

> ERRNO predates the system module, and loadable modules in general. I had
> even forgotten it existed until it was mentioned recently. I doubt it's
> especially widely used. system.mdd does specify load=no so there would
> be no automatic loading. The trick with defining it as PM_UNSET doesn't
> appear to work from a module. But that's less necessary if the variable
> is in a module.
> I'll allow plenty of time for dissenting opinions on this but it'd also
> be good to hear if anyone agrees.

Well, it's backwards incompatible and I don't understand the
justification given, so I can't say I'm +1 on this.



  parent reply	other threads:[~2023-01-12 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 23:19 Oliver Kiddle
2023-01-12  8:47 ` Stephane Chazelas
2023-01-12 17:14 ` Daniel Shahaf [this message]
2023-01-16 21:34   ` Bart Schaefer

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a115b06-4268-409b-a8a8-5b683567a827@app.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \


* 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.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).