jehanne: fix Makefile; add sigsuspend
This commit is contained in:
parent
fd7cb6bd3d
commit
0f0b5a3ca5
|
@ -6,7 +6,7 @@ noinst_LIBRARIES = lib.a
|
|||
|
||||
if MAY_SUPPLY_SYSCALLS
|
||||
extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
||||
chmod.o sigsets.o
|
||||
chmod.o sigsets.o sigaction.o sigsuspend.o
|
||||
else
|
||||
extra_objs =
|
||||
endif
|
||||
|
@ -16,7 +16,7 @@ lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \
|
|||
|
||||
lib_a_LIBADD = $(extra_objs)
|
||||
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
||||
ids.c chmod.c sigsets.c sigaction.c
|
||||
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c
|
||||
lib_a_DEPENDENCIES = $(extra_objs)
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
|
|
|
@ -53,7 +53,8 @@ ARFLAGS = cru
|
|||
lib_a_AR = $(AR) $(ARFLAGS)
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@am__DEPENDENCIES_1 = syscalls.o \
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ libposix_conf.o chown.o getrusage.o \
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ ids.o chmod.o sigsets.o
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ ids.o chmod.o sigsets.o sigaction.o \
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ sigsuspend.o
|
||||
am_lib_a_OBJECTS = lib_a-getenv_r.$(OBJEXT) lib_a-getenv.$(OBJEXT) \
|
||||
lib_a-malloc.$(OBJEXT) lib_a-mallocr.$(OBJEXT) \
|
||||
lib_a-free.$(OBJEXT) lib_a-freer.$(OBJEXT) \
|
||||
|
@ -180,14 +181,14 @@ AM_CCASFLAGS = $(INCLUDES)
|
|||
noinst_LIBRARIES = lib.a
|
||||
@MAY_SUPPLY_SYSCALLS_FALSE@extra_objs =
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ chmod.o sigsets.o
|
||||
@MAY_SUPPLY_SYSCALLS_TRUE@ chmod.o sigsets.o sigaction.o sigsuspend.o
|
||||
|
||||
lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \
|
||||
calloc.c callocr.c realloc.c reallocr.c environ.c signal.c
|
||||
|
||||
lib_a_LIBADD = $(extra_objs)
|
||||
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
||||
ids.c chmod.c sigsets.c sigaction.c
|
||||
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c
|
||||
|
||||
lib_a_DEPENDENCIES = $(extra_objs)
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
|
@ -376,6 +377,12 @@ lib_a-sigaction.o: sigaction.c
|
|||
lib_a-sigaction.obj: sigaction.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sigaction.obj `if test -f 'sigaction.c'; then $(CYGPATH_W) 'sigaction.c'; else $(CYGPATH_W) '$(srcdir)/sigaction.c'; fi`
|
||||
|
||||
lib_a-sigsuspend.o: sigsuspend.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sigsuspend.o `test -f 'sigsuspend.c' || echo '$(srcdir)/'`sigsuspend.c
|
||||
|
||||
lib_a-sigsuspend.obj: sigsuspend.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sigsuspend.obj `if test -f 'sigsuspend.c'; then $(CYGPATH_W) 'sigsuspend.c'; else $(CYGPATH_W) '$(srcdir)/sigsuspend.c'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
|
|
@ -350,21 +350,3 @@ initialize_newlib(void)
|
|||
if(__application_newlib_init != 0)
|
||||
__application_newlib_init();
|
||||
}
|
||||
|
||||
int
|
||||
sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
|
||||
{
|
||||
if(sig <= 0 || sig > SIGUSR2 || sig == SIGKILL){
|
||||
_REENT->_errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
if(oact){
|
||||
oact->sa_handler = _REENT->_sig_func[sig];
|
||||
oact->sa_mask = 0;
|
||||
oact->sa_flags = 0;
|
||||
}
|
||||
if(act){
|
||||
_REENT->_sig_func[sig] = act->sa_handler;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* This file is part of Jehanne.
|
||||
*
|
||||
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
|
||||
*
|
||||
* Jehanne is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 2 of the License.
|
||||
*
|
||||
* Jehanne is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <posix.h>
|
||||
#include <reent.h>
|
||||
|
||||
int
|
||||
sigsuspend(const PosixSignalMask *mask)
|
||||
{
|
||||
int *errnop = &_REENT->_errno;
|
||||
return POSIX_sigsuspend(errnop, mask);
|
||||
}
|
Loading…
Reference in New Issue