zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>,
	"ZSH Workers Mailing List" <zsh-workers@sunsite.dk>
Subject: Re: General unqueue_signal problem
Date: Wed, 13 Jun 2001 10:57:28 +0000	[thread overview]
Message-ID: <1010613105728.ZM26315@candle.brasslantern.com> (raw)
In-Reply-To: <000401c0f3d2$dd2dc560$21c9ca95@mow.siemens.ru>

On Jun 13, 10:34am, Andrej Borsenkow wrote:
} Subject: General unqueue_signal problem
}
} > ld: 0711-317 ERROR: Undefined symbol: .handler
} 
} This comes from unqueue_signals() macro. This macro directly calls
} handler() from signals.c (at least, I presume it is this one). But
} as I understand, zftp.c sometimes install its own handler. Any other
} module may possible install own handler as well.

It would be a very bad idea in most cases for a module to install its
own signal handler.  Dispatch of the `trap' mechanism is done through
the handler() function, etc.  zftp goes to some lengths to do the right
thing in spite of this.

} I do not understand how signal queuing works - anybody cares to check
} it?

Most of the time signals that zsh doesn't want can simply be blocked and
the OS will queue them up and deliver them when they're unblocked.  In a
few cases it needs to let the signal be delivered but avoid dispatching
the traps mechanism or other code that would (for example) call malloc().

So zsh sets up its own internal queue (really, just pointers into a fixed
array of integers) where handler() records the numbers of the signals it
has caught.  When signals are dequeued, handler() is called a second time
to dispatch the signal as it would have if queuing had not been in force.

Since the signal wouldn't have gotten into the queue in the first place
unless handler() caught it, handler() is the right function to call to
finish dispatching it later, even if some other handler has been put in
place in the meantime.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


      parent reply	other threads:[~2001-06-13 11:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.SV4.4.33.0106120954500.24714-200000@itsrm2.mow.siemens.ru>
     [not found] ` <yeh3d95lsa0.fsf@water.cs.brown.edu>
2001-06-12 17:58   ` AIX-problem: the main module won't link statically Andrej Borsenkow
2001-06-12 18:19     ` Peter Stephenson
2001-06-12 19:14       ` Bart Schaefer
2001-06-12 20:09         ` Wayne Davison
2001-06-13  9:20           ` Peter Stephenson
2001-06-13  6:09         ` 4.0.2 patches " Andrej Borsenkow
2001-06-13  9:22           ` Peter Stephenson
2001-06-13  8:46         ` Sven Wischnowsky
2001-06-13  8:48           ` Sven Wischnowsky
2001-06-13  6:34     ` General unqueue_signal problem Andrej Borsenkow
2001-06-13  9:30       ` Peter Stephenson
2001-06-18  7:21         ` Sven Wischnowsky
2001-06-18  9:20           ` Peter Stephenson
2001-06-13 10:57       ` Bart Schaefer [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=1010613105728.ZM26315@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=Andrej.Borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).