view msdos/sigaction.c @ 51102:d604b76d3bbd

Doc fixes. (xml-parse-file, xml-parse-region): Autoload. (xml-syntax-table, xml-name-regexp): New. (xml-parse-region): Narrow to region, set syntax-table and case-fold-search. Reject fewer valid documents. (xml-parse-tag): Remove arg END. Callers changed. (xml-parse-tag): Use skip-syntax-forward. Use PARSE-DTD arg properly. Don't use buffer-substring-no-properties. Don't bind case-fold-search. Fix syntax for empty elements. Hoist consing of end-of-tag regexp out of loop. (xml-parse-attlist): Remove arg. Callers changed. Use skip-syntax-forward, replace-regexp-in-string, forward-sexp. Allow non-ASCII names. (xml-skip-dtd): Remove arg. Callers changed. Change matching code. (xml-parse-dtd): Grok external DTDs. Allow non-ASCII. Don't use match-string-no-properties. (xml-ucs-to-string): Deleted. (xml-substitute-entity): New. (xml-substitute-special): Use it. (xml-debug-print-internal): Simplify insertions. (xml-parse-file): Avoid finding file in xml-mode.
author Dave Love <fx@gnu.org>
date Mon, 19 May 2003 16:01:39 +0000
parents 354e0c45cedf
children 695cf19ef79e
line wrap: on
line source

/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <signal.h>
#include <errno.h>

int
sigaction(int _sig, const struct sigaction *_act, struct sigaction *_oact)
{
  int retval = 0;

  if (_oact)
  {
    void (*installed_sig)(int) = signal (_sig, SIG_IGN);

    /* FIXME */
    if (installed_sig == SIG_ERR)
    {
      retval = -1;
      errno = EINVAL;
    }
    else
      signal (_sig, installed_sig);
    _oact->sa_handler = installed_sig;
    retval = sigemptyset (&_oact->sa_mask);
    _oact->sa_flags = 0;
  }
  if (_act)
  {
    if (signal (_sig, _act->sa_handler) == SIG_ERR)
    {
      retval = -1;
      errno = EINVAL;
    }
  }
  return 0;
}