mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
* libc/include/signal.h (psignal): Declare.
* libc/sys/linux/psignal.c: Move from here... * libc/signal/psignal.c: ... to here. Document. * libc/sys/linux/Makefile.am (GENERAL_SOURCES): Move psignal.c from here... * libc/signal/Makefile.am (LIB_SOURCES): ... to here. (CHEWOUT_FILES): Add psignal.def. * libc/sys/linux/Makefile.in: Regenerate. * libc/signal/Makefile.in: Ditto. * libc/signal/signal.tex: Add references to psignal.
This commit is contained in:
parent
b27340db63
commit
307b0a5d4b
@ -1,3 +1,15 @@
|
||||
2011-05-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
||||
|
||||
* libc/include/signal.h (psignal): Declare.
|
||||
* libc/sys/linux/psignal.c: Move from here...
|
||||
* libc/signal/psignal.c: ... to here. Document.
|
||||
* libc/sys/linux/Makefile.am (GENERAL_SOURCES): Move psignal.c from here...
|
||||
* libc/signal/Makefile.am (LIB_SOURCES): ... to here.
|
||||
(CHEWOUT_FILES): Add psignal.def.
|
||||
* libc/sys/linux/Makefile.in: Regenerate.
|
||||
* libc/signal/Makefile.in: Ditto.
|
||||
* libc/signal/signal.tex: Add references to psignal.
|
||||
|
||||
2011-05-04 Corinna Vinschen <vinschen@redhat.com>
|
||||
|
||||
* libc/locale/lmessages.h (__messages_load_locale): Declare. Remove
|
||||
|
@ -24,6 +24,7 @@ int _EXFUN(_raise_r, (struct _reent *, int));
|
||||
#ifndef _REENT_ONLY
|
||||
_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr));
|
||||
int _EXFUN(raise, (int));
|
||||
void _EXFUN(psignal, (int, const char *));
|
||||
#endif
|
||||
|
||||
_END_STD_C
|
||||
|
@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
|
||||
LIB_SOURCES = raise.c signal.c
|
||||
LIB_SOURCES = psignal.c raise.c signal.c
|
||||
|
||||
libsignal_la_LDFLAGS = -Xcompiler -nostdlib
|
||||
|
||||
@ -21,7 +21,7 @@ endif # USE_LIBTOOL
|
||||
|
||||
include $(srcdir)/../../Makefile.shared
|
||||
|
||||
CHEWOUT_FILES = raise.def signal.def
|
||||
CHEWOUT_FILES = psignal.def raise.def signal.def
|
||||
|
||||
SUFFIXES = .def
|
||||
|
||||
|
@ -55,12 +55,13 @@ LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
lib_a_AR = $(AR) $(ARFLAGS)
|
||||
lib_a_LIBADD =
|
||||
am__objects_1 = lib_a-raise.$(OBJEXT) lib_a-signal.$(OBJEXT)
|
||||
am__objects_1 = lib_a-psignal.$(OBJEXT) lib_a-raise.$(OBJEXT) \
|
||||
lib_a-signal.$(OBJEXT)
|
||||
@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1)
|
||||
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libsignal_la_LIBADD =
|
||||
am__objects_2 = raise.lo signal.lo
|
||||
am__objects_2 = psignal.lo raise.lo signal.lo
|
||||
@USE_LIBTOOL_TRUE@am_libsignal_la_OBJECTS = $(am__objects_2)
|
||||
libsignal_la_OBJECTS = $(am_libsignal_la_OBJECTS)
|
||||
libsignal_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
@ -228,7 +229,7 @@ top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
LIB_SOURCES = raise.c signal.c
|
||||
LIB_SOURCES = psignal.c raise.c signal.c
|
||||
libsignal_la_LDFLAGS = -Xcompiler -nostdlib
|
||||
@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libsignal.la
|
||||
@USE_LIBTOOL_TRUE@libsignal_la_SOURCES = $(LIB_SOURCES)
|
||||
@ -237,7 +238,7 @@ libsignal_la_LDFLAGS = -Xcompiler -nostdlib
|
||||
@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
|
||||
@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(LIB_SOURCES)
|
||||
@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
CHEWOUT_FILES = raise.def signal.def
|
||||
CHEWOUT_FILES = psignal.def raise.def signal.def
|
||||
SUFFIXES = .def
|
||||
CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
|
||||
TARGETDOC = ../tmp.texi
|
||||
@ -310,6 +311,12 @@ distclean-compile:
|
||||
.c.lo:
|
||||
$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
lib_a-psignal.o: psignal.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-psignal.o `test -f 'psignal.c' || echo '$(srcdir)/'`psignal.c
|
||||
|
||||
lib_a-psignal.obj: psignal.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-psignal.obj `if test -f 'psignal.c'; then $(CYGPATH_W) 'psignal.c'; else $(CYGPATH_W) '$(srcdir)/psignal.c'; fi`
|
||||
|
||||
lib_a-raise.o: raise.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-raise.o `test -f 'raise.c' || echo '$(srcdir)/'`raise.c
|
||||
|
||||
|
51
newlib/libc/signal/psignal.c
Normal file
51
newlib/libc/signal/psignal.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* Copyright 2002, 2011 Red Hat Inc. */
|
||||
/*
|
||||
FUNCTION
|
||||
<<psignal>>---print a signal message on standard error
|
||||
|
||||
INDEX
|
||||
psignal
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <stdio.h>
|
||||
void psignal(int <[signal]>, const char *<[prefix]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <stdio.h>
|
||||
void psignal(<[signal]>, <[prefix]>)
|
||||
int <[signal]>;
|
||||
const char *<[prefix]>;
|
||||
|
||||
DESCRIPTION
|
||||
Use <<psignal>> to print (on standard error) a signal message
|
||||
corresponding to the value of the signal number <[signal]>.
|
||||
Unless you use <<NULL>> as the value of the argument <[prefix]>, the
|
||||
signal message will begin with the string at <[prefix]>, followed by a
|
||||
colon and a space (<<: >>). The remainder of the signal message is one
|
||||
of the strings described for <<strsignal>>.
|
||||
|
||||
RETURNS
|
||||
<<psignal>> returns no result.
|
||||
|
||||
PORTABILITY
|
||||
POSIX.1-2008 requires <<psignal>>, but the strings issued vary from one
|
||||
implementation to another.
|
||||
|
||||
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
|
||||
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
_VOID
|
||||
_DEFUN(psignal, (sig, s),
|
||||
int sig _AND
|
||||
_CONST char *s)
|
||||
{
|
||||
if (s != NULL && *s != '\0')
|
||||
fprintf (stderr, "%s: %s\n", s, strsignal (sig));
|
||||
else
|
||||
fprintf (stderr, "%s\n", strsignal (sig));
|
||||
}
|
@ -59,10 +59,14 @@ they may store a signal value. (Static storage is not otherwise
|
||||
reliable from signal handlers.)
|
||||
|
||||
@menu
|
||||
* psignal:: Print a signal message to standard error
|
||||
* raise:: Send a signal
|
||||
* signal:: Specify handler subroutine for a signal
|
||||
@end menu
|
||||
|
||||
@page
|
||||
@include signal/psignal.def
|
||||
|
||||
@page
|
||||
@include signal/raise.def
|
||||
|
||||
|
@ -72,7 +72,6 @@ GENERAL_SOURCES = \
|
||||
process.c \
|
||||
prof-freq.c \
|
||||
profile.c \
|
||||
psignal.c \
|
||||
pwrite.c \
|
||||
raise.c \
|
||||
realloc.c \
|
||||
|
@ -82,24 +82,23 @@ am__objects_1 = lib_a-aio.$(OBJEXT) lib_a-brk.$(OBJEXT) \
|
||||
lib_a-mtrim.$(OBJEXT) lib_a-mtrimr.$(OBJEXT) \
|
||||
lib_a-ntp_gettime.$(OBJEXT) lib_a-pread.$(OBJEXT) \
|
||||
lib_a-process.$(OBJEXT) lib_a-prof-freq.$(OBJEXT) \
|
||||
lib_a-profile.$(OBJEXT) lib_a-psignal.$(OBJEXT) \
|
||||
lib_a-pwrite.$(OBJEXT) lib_a-raise.$(OBJEXT) \
|
||||
lib_a-realloc.$(OBJEXT) lib_a-reallocr.$(OBJEXT) \
|
||||
lib_a-rename.$(OBJEXT) lib_a-resource.$(OBJEXT) \
|
||||
lib_a-sched.$(OBJEXT) lib_a-select.$(OBJEXT) \
|
||||
lib_a-seteuid.$(OBJEXT) lib_a-sethostid.$(OBJEXT) \
|
||||
lib_a-sethostname.$(OBJEXT) lib_a-shm_open.$(OBJEXT) \
|
||||
lib_a-shm_unlink.$(OBJEXT) lib_a-sig.$(OBJEXT) \
|
||||
lib_a-sigaction.$(OBJEXT) lib_a-sigqueue.$(OBJEXT) \
|
||||
lib_a-signal.$(OBJEXT) lib_a-siglongjmp.$(OBJEXT) \
|
||||
lib_a-sigset.$(OBJEXT) lib_a-sigwait.$(OBJEXT) \
|
||||
lib_a-socket.$(OBJEXT) lib_a-sleep.$(OBJEXT) \
|
||||
lib_a-strsignal.$(OBJEXT) lib_a-strverscmp.$(OBJEXT) \
|
||||
lib_a-sysconf.$(OBJEXT) lib_a-sysctl.$(OBJEXT) \
|
||||
lib_a-systat.$(OBJEXT) lib_a-tcdrain.$(OBJEXT) \
|
||||
lib_a-tcsendbrk.$(OBJEXT) lib_a-termios.$(OBJEXT) \
|
||||
lib_a-time.$(OBJEXT) lib_a-usleep.$(OBJEXT) \
|
||||
lib_a-versionsort.$(OBJEXT)
|
||||
lib_a-profile.$(OBJEXT) lib_a-pwrite.$(OBJEXT) \
|
||||
lib_a-raise.$(OBJEXT) lib_a-realloc.$(OBJEXT) \
|
||||
lib_a-reallocr.$(OBJEXT) lib_a-rename.$(OBJEXT) \
|
||||
lib_a-resource.$(OBJEXT) lib_a-sched.$(OBJEXT) \
|
||||
lib_a-select.$(OBJEXT) lib_a-seteuid.$(OBJEXT) \
|
||||
lib_a-sethostid.$(OBJEXT) lib_a-sethostname.$(OBJEXT) \
|
||||
lib_a-shm_open.$(OBJEXT) lib_a-shm_unlink.$(OBJEXT) \
|
||||
lib_a-sig.$(OBJEXT) lib_a-sigaction.$(OBJEXT) \
|
||||
lib_a-sigqueue.$(OBJEXT) lib_a-signal.$(OBJEXT) \
|
||||
lib_a-siglongjmp.$(OBJEXT) lib_a-sigset.$(OBJEXT) \
|
||||
lib_a-sigwait.$(OBJEXT) lib_a-socket.$(OBJEXT) \
|
||||
lib_a-sleep.$(OBJEXT) lib_a-strsignal.$(OBJEXT) \
|
||||
lib_a-strverscmp.$(OBJEXT) lib_a-sysconf.$(OBJEXT) \
|
||||
lib_a-sysctl.$(OBJEXT) lib_a-systat.$(OBJEXT) \
|
||||
lib_a-tcdrain.$(OBJEXT) lib_a-tcsendbrk.$(OBJEXT) \
|
||||
lib_a-termios.$(OBJEXT) lib_a-time.$(OBJEXT) \
|
||||
lib_a-usleep.$(OBJEXT) lib_a-versionsort.$(OBJEXT)
|
||||
am__objects_2 = lib_a-aio64.$(OBJEXT) lib_a-confstr.$(OBJEXT) \
|
||||
lib_a-ctermid.$(OBJEXT) lib_a-fclean.$(OBJEXT) \
|
||||
lib_a-fpathconf.$(OBJEXT) lib_a-fstab.$(OBJEXT) \
|
||||
@ -141,8 +140,8 @@ am__objects_6 = aio.lo brk.lo calloc.lo callocr.lo cfreer.lo \
|
||||
mq_close.lo mq_getattr.lo mq_notify.lo mq_open.lo \
|
||||
mq_receive.lo mq_send.lo mq_setattr.lo mq_unlink.lo msize.lo \
|
||||
msizer.lo mstats.lo mtrim.lo mtrimr.lo ntp_gettime.lo pread.lo \
|
||||
process.lo prof-freq.lo profile.lo psignal.lo pwrite.lo \
|
||||
raise.lo realloc.lo reallocr.lo rename.lo resource.lo sched.lo \
|
||||
process.lo prof-freq.lo profile.lo pwrite.lo raise.lo \
|
||||
realloc.lo reallocr.lo rename.lo resource.lo sched.lo \
|
||||
select.lo seteuid.lo sethostid.lo sethostname.lo shm_open.lo \
|
||||
shm_unlink.lo sig.lo sigaction.lo sigqueue.lo signal.lo \
|
||||
siglongjmp.lo sigset.lo sigwait.lo socket.lo sleep.lo \
|
||||
@ -396,7 +395,6 @@ GENERAL_SOURCES = \
|
||||
process.c \
|
||||
prof-freq.c \
|
||||
profile.c \
|
||||
psignal.c \
|
||||
pwrite.c \
|
||||
raise.c \
|
||||
realloc.c \
|
||||
@ -865,12 +863,6 @@ lib_a-profile.o: profile.c
|
||||
lib_a-profile.obj: profile.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-profile.obj `if test -f 'profile.c'; then $(CYGPATH_W) 'profile.c'; else $(CYGPATH_W) '$(srcdir)/profile.c'; fi`
|
||||
|
||||
lib_a-psignal.o: psignal.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-psignal.o `test -f 'psignal.c' || echo '$(srcdir)/'`psignal.c
|
||||
|
||||
lib_a-psignal.obj: psignal.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-psignal.obj `if test -f 'psignal.c'; then $(CYGPATH_W) 'psignal.c'; else $(CYGPATH_W) '$(srcdir)/psignal.c'; fi`
|
||||
|
||||
lib_a-pwrite.o: pwrite.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-pwrite.o `test -f 'pwrite.c' || echo '$(srcdir)/'`pwrite.c
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
/* libc/sys/linux/psignal.c - print signal message to stderr */
|
||||
|
||||
/* Copyright 2002, Red Hat Inc. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void
|
||||
psignal (int sig, const char *s)
|
||||
{
|
||||
if (s != NULL)
|
||||
fprintf (stderr, "%s: %s\n", s, strsignal (sig));
|
||||
else
|
||||
fprintf (stderr, "%s\n", strsignal (sig));
|
||||
}
|
@ -37,7 +37,6 @@ typedef _sig_func_ptr __sighandler_t;
|
||||
#include <_ansi.h>
|
||||
|
||||
int _EXFUN(kill, (int, int));
|
||||
_VOID _EXFUN(psignal, (int, const char *));
|
||||
int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
|
||||
int _EXFUN(sigaddset, (sigset_t *, const int));
|
||||
int _EXFUN(sigdelset, (sigset_t *, const int));
|
||||
|
Loading…
x
Reference in New Issue
Block a user