sigset_t change (part 5 of 5)

-----------------------------

Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c

The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.

There are version bumps for the following libraries:
  libdialog
  libreadline
  libc
  libc_r
  libedit
  libftpio
  libss

These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.

NOTE: libncurses already had an version bump and has not been
      given one now.

NOTE: doscmd is a real casualty and has been disconnected for
      the moment. Reconnection will eventually happen after
      doscmd has been fixed. I'm aware that being the last one
      to touch it, I'm automaticly promoted to being maintainer.
      According to good taste this means that I will receive a
      badge which either will be glued or mechanically stapled,
      drilled or otherwise violently forced onto me :-)

NOTE: pcvt/vttest cannot be compiled with -traditional. The
      change cause sys/types to be included along the way which
      contains the const and volatile modifiers. I don't consider
      this a solution, but more a workaround.
This commit is contained in:
Marcel Moolenaar 1999-09-29 15:18:46 +00:00
parent 956d3333ca
commit 3cf3c5d9dd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51794
46 changed files with 372 additions and 156 deletions

View File

@ -4,7 +4,7 @@
LIB= dialog
MAN3= dialog.3
SHLIB_MAJOR= 3
SHLIB_MAJOR= 4
SHLIB_MINOR= 0
SRCS= kernel.c rc.c checklist.c inputbox.c menubox.c msgbox.c \
lineedit.c radiolist.c textbox.c yesno.c prgbox.c raw_popen.c \

View File

@ -1,6 +1,6 @@
# $FreeBSD$
SHLIB_MAJOR= 3
SHLIB_MAJOR= 4
SHLIB_MINOR= 0
RL_LIBRARY_VERSION= 4.0

View File

@ -31,6 +31,8 @@
* SUCH DAMAGE.
*
* @(#)signal.h 8.3 (Berkeley) 3/30/94
*
* $FreeBSD$
*/
#ifndef _SIGNAL_H_
@ -40,6 +42,7 @@
#include <sys/_posix.h>
#include <machine/ansi.h>
#include <sys/signal.h>
#include <sys/time.h>
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
extern __const char *__const sys_signame[NSIG];
@ -67,18 +70,18 @@ int sigwait __P((const sigset_t *, int *));
__BEGIN_DECLS
int sigqueue __P((_BSD_PID_T_, int, const union sigval));
int sigtimedwait __P((const sigset_t *, siginfo_t *));
int sigtimedwait __P((const sigset_t *, siginfo_t *, const struct timespec *));
int sigwaitinfo __P((const sigset_t *, siginfo_t *));
__END_DECLS
#endif
#ifndef _POSIX_SOURCE
int killpg __P((_BSD_PID_T_, int));
int sigaltstack __P((const struct sigaltstack *, struct sigaltstack *));
int sigaltstack __P((const stack_t *, stack_t *));
int sigblock __P((int));
int siginterrupt __P((int, int));
int sigpause __P((int));
int sigreturn __P((struct sigcontext *));
int sigreturn __P((ucontext_t *));
int sigsetmask __P((int));
int sigstack __P((const struct sigstack *, struct sigstack *));
int sigvec __P((int, struct sigvec *, struct sigvec *));
@ -89,11 +92,55 @@ __END_DECLS
#ifndef _ANSI_SOURCE
/* List definitions after function declarations, or Reiser cpp gets upset. */
#define sigaddset(set, signo) (*(set) |= 1 << ((signo) - 1), 0)
#define sigdelset(set, signo) (*(set) &= ~(1 << ((signo) - 1)), 0)
#define sigemptyset(set) (*(set) = 0, 0)
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
#define sigismember(set, signo) ((*(set) & (1 << ((signo) - 1))) != 0)
extern __inline int sigaddset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
return (0);
}
extern __inline int sigdelset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
return (0);
}
extern __inline int sigemptyset(sigset_t *set)
{
int i;
for (i = 0; i < _SIG_WORDS; i++)
set->__bits[i] = 0;
return (0);
}
extern __inline int sigfillset(sigset_t *set)
{
int i;
for (i = 0; i < _SIG_WORDS; i++)
set->__bits[i] = ~(unsigned int)0;
return (0);
}
extern __inline int sigismember(__const sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
return ((set->__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) ? 1 : 0);
}
#endif /* !_ANSI_SOURCE */
#endif /* !_SIGNAL_H_ */

36
include/ucontext.h Normal file
View File

@ -0,0 +1,36 @@
/*-
* Copyright (c) 1999 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer
* in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _UCONTEXT_H_
#define _UCONTEXT_H_ 1
#include <sys/ucontext.h>
#endif /* _UCONTEXT_H_ */

View File

@ -7,8 +7,8 @@
# from CFLAGS below. To remove these strings from just the system call
# stubs, remove just -DSYSLIBC_RCS from CFLAGS.
LIB=c
SHLIB_MAJOR= 3
SHLIB_MINOR= 1
SHLIB_MAJOR= 4
SHLIB_MINOR= 0
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/include
AINC= -I${.CURDIR}/${MACHINE_ARCH}
CLEANFILES+=tags

View File

@ -25,6 +25,8 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $FreeBSD$
*/
#include "SYS.h"
@ -61,9 +63,10 @@ LEAF(setjmp, 1)
mov a0, s0 /* squirrel away ptr to sc */
/* see what's blocked */
mov zero, a0
PCALL(sigblock) /* see what's blocked */
stq v0, (1 * 8)(s0) /* and remember it in sc_mask */
lda a2, (71 * 8)(a0) /* oset: sc_reserved */
mov zero, a1 /* set: NULL */
add a1, 1, a0 /* how: SIG_BLOCK */
PCALL(sigprocmask) /* see what's blocked */
lda sp, -24(sp) /* sizeof struct sigaltstack */
mov zero, a0
@ -115,7 +118,7 @@ END(setjmp)
LEAF(longjmp, 2)
LDGP(pv)
stq a1, (( 0 + 4) * 8)(a0) /* save return value */
PCALL(sigreturn) /* use sigreturn to return */
PCALL(osigreturn) /* use sigreturn to return */
botch:
CALL(longjmperror)

View File

@ -62,7 +62,7 @@ ENTRY(_setjmp)
movl %ebp,12(%eax)
movl %esi,16(%eax)
movl %edi,20(%eax)
fnstcw 28(%eax)
fnstcw 24(%eax)
xorl %eax,%eax
ret
@ -76,7 +76,7 @@ ENTRY(_longjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -56,15 +56,19 @@
ENTRY(setjmp)
PIC_PROLOGUE
pushl $0
movl 4(%esp),%ecx
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigblock))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigblock))
call PIC_PLT(CNAME(sigprocmask))
#endif
popl %edx
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%ecx
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
@ -72,21 +76,23 @@ ENTRY(setjmp)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
movl %eax,24(%ecx)
fnstcw 28(%ecx)
fnstcw 24(%ecx)
xorl %eax,%eax
ret
ENTRY(longjmp)
movl 4(%esp),%edx
PIC_PROLOGUE
pushl 24(%edx)
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigsetmask))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigsetmask)) /* XXX this is not reentrant */
call PIC_PLT(CNAME(sigprocmask))
#endif
popl %eax
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
@ -97,7 +103,7 @@ ENTRY(longjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -61,21 +61,23 @@
ENTRY(sigsetjmp)
movl 8(%esp),%eax
movl 4(%esp),%ecx
movl %eax,32(%ecx)
movl 4(%esp),%ecx
movl %eax,44(%ecx)
testl %eax,%eax
jz 2f
PIC_PROLOGUE
pushl $0
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigblock))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigblock))
call PIC_PLT(CNAME(sigprocmask))
#endif
addl $4,%esp
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%ecx
movl %eax,24(%ecx)
movl 4(%esp),%ecx
2: movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
@ -83,25 +85,28 @@ ENTRY(sigsetjmp)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
fnstcw 28(%ecx)
fnstcw 24(%ecx)
xorl %eax,%eax
ret
ENTRY(siglongjmp)
movl 4(%esp),%edx
cmpl $0,32(%edx)
cmpl $0,44(%edx)
jz 2f
PIC_PROLOGUE
pushl 24(%edx)
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigsetmask))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigsetmask))
call PIC_PLT(CNAME(sigprocmask))
#endif
addl $4,%esp
addl $12,%esp
PIC_EPILOGUE
2: movl 4(%esp),%edx
movl 8(%esp),%eax
movl 4(%esp),%edx
2: movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
movl 8(%edx),%esp
@ -109,7 +114,7 @@ ENTRY(siglongjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -5,15 +5,16 @@ SRCS+= i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c i386_set_ldt.c \
i386_vm86.c
MDASM= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S \
ptrace.S reboot.S rfork.S sbrk.S setlogin.S sigpending.S \
sigprocmask.S sigreturn.S sigsuspend.S syscall.S
ptrace.S reboot.S rfork.S sbrk.S setlogin.S sigreturn.S syscall.S
# sigpending.S sigprocmask.S sigsuspend.S
# Don't generate default code for these syscalls:
NOASM= __semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \
lseek.o mlockall.o mmap.o msgctl.o msgget.o msgrcv.o msgsnd.o \
munlockall.o openbsd_poll.o pread.o pwrite.o semconfig.o semget.o \
semop.o setdomainname.o shmat.o shmctl.o shmdt.o shmget.o sstk.o \
thr_sleep.o thr_wakeup.o truncate.o uname.o vfork.o yield.o
thr_sleep.o thr_wakeup.o truncate.o uname.o vfork.o yield.o \
osigpending.o osigprocmask.o osigsuspend.o
PSEUDO= _getlogin.o

View File

@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@ -47,7 +49,8 @@ sigvec(signo, sv, osv)
if (sv)
sv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
ret = sigaction(signo, (struct sigaction *)sv, (struct sigaction *)osv);
ret = osigaction(signo, (struct osigaction *)sv,
(struct osigaction *)osv);
if (ret == 0 && osv)
osv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
return (ret);
@ -57,29 +60,34 @@ int
sigsetmask(mask)
int mask;
{
int omask, n;
sigset_t set, oset;
n = sigprocmask(SIG_SETMASK, (sigset_t *) &mask, (sigset_t *) &omask);
if (n)
return (n);
return (omask);
sigemptyset(&set);
set.__bits[0] = mask;
(void)sigprocmask(SIG_SETMASK, &set, &oset);
return (oset.__bits[0]);
}
int
sigblock(mask)
int mask;
{
int omask, n;
sigset_t set, oset;
n = sigprocmask(SIG_BLOCK, (sigset_t *) &mask, (sigset_t *) &omask);
if (n)
return (n);
return (omask);
sigemptyset(&set);
set.__bits[0] = mask;
(void)sigprocmask(SIG_BLOCK, &set, &oset);
return (oset.__bits[0]);
}
int
sigpause(mask)
int mask;
{
return (sigsuspend((sigset_t *)&mask));
sigset_t set;
sigemptyset(&set);
set.__bits[0] = mask;
return (sigsuspend(&set));
}

View File

@ -31,6 +31,8 @@
* SUCH DAMAGE.
*
* @(#)sigsetops.c 8.1 (Berkeley) 6/4/93
*
* $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@ -49,7 +51,10 @@ int
sigemptyset(set)
sigset_t *set;
{
*set = 0;
int i;
for (i = 0; i < _SIG_WORDS; i++)
set->__bits[i] = 0;
return (0);
}
@ -57,7 +62,10 @@ int
sigfillset(set)
sigset_t *set;
{
*set = ~(sigset_t)0;
int i;
for (i = 0; i < _SIG_WORDS; i++)
set->__bits[i] = ~(unsigned int)0;
return (0);
}
@ -66,7 +74,12 @@ sigaddset(set, signo)
sigset_t *set;
int signo;
{
*set |= sigmask(signo);
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
return (0);
}
@ -75,7 +88,12 @@ sigdelset(set, signo)
sigset_t *set;
int signo;
{
*set &= ~sigmask(signo);
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
return (0);
}
@ -84,5 +102,10 @@ sigismember(set, signo)
const sigset_t *set;
int signo;
{
return ((*set & sigmask(signo)) != 0);
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
return ((set->__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) ? 1 : 0);
}

View File

@ -62,7 +62,7 @@ ENTRY(_setjmp)
movl %ebp,12(%eax)
movl %esi,16(%eax)
movl %edi,20(%eax)
fnstcw 28(%eax)
fnstcw 24(%eax)
xorl %eax,%eax
ret
@ -76,7 +76,7 @@ ENTRY(_longjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -56,15 +56,19 @@
ENTRY(setjmp)
PIC_PROLOGUE
pushl $0
movl 4(%esp),%ecx
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigblock))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigblock))
call PIC_PLT(CNAME(sigprocmask))
#endif
popl %edx
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%ecx
movl 4(%esp),%ecx
movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
@ -72,21 +76,23 @@ ENTRY(setjmp)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
movl %eax,24(%ecx)
fnstcw 28(%ecx)
fnstcw 24(%ecx)
xorl %eax,%eax
ret
ENTRY(longjmp)
movl 4(%esp),%edx
PIC_PROLOGUE
pushl 24(%edx)
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigsetmask))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigsetmask)) /* XXX this is not reentrant */
call PIC_PLT(CNAME(sigprocmask))
#endif
popl %eax
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%edx
movl 8(%esp),%eax
@ -97,7 +103,7 @@ ENTRY(longjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -61,21 +61,23 @@
ENTRY(sigsetjmp)
movl 8(%esp),%eax
movl 4(%esp),%ecx
movl %eax,32(%ecx)
movl 4(%esp),%ecx
movl %eax,44(%ecx)
testl %eax,%eax
jz 2f
PIC_PROLOGUE
pushl $0
leal 28(%ecx), %eax
pushl %eax /* (sigset_t*)oset */
pushl $0 /* (sigset_t*)set */
pushl $1 /* SIG_BLOCK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigblock))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigblock))
call PIC_PLT(CNAME(sigprocmask))
#endif
addl $4,%esp
addl $12,%esp
PIC_EPILOGUE
movl 4(%esp),%ecx
movl %eax,24(%ecx)
movl 4(%esp),%ecx
2: movl 0(%esp),%edx
movl %edx, 0(%ecx)
movl %ebx, 4(%ecx)
@ -83,25 +85,28 @@ ENTRY(sigsetjmp)
movl %ebp,12(%ecx)
movl %esi,16(%ecx)
movl %edi,20(%ecx)
fnstcw 28(%ecx)
fnstcw 24(%ecx)
xorl %eax,%eax
ret
ENTRY(siglongjmp)
movl 4(%esp),%edx
cmpl $0,32(%edx)
cmpl $0,44(%edx)
jz 2f
PIC_PROLOGUE
pushl 24(%edx)
pushl $0 /* (sigset_t*)oset */
leal 28(%edx), %eax
pushl %eax /* (sigset_t*)set */
pushl $3 /* SIG_SETMASK */
#ifdef _THREAD_SAFE
call PIC_PLT(CNAME(_thread_sys_sigsetmask))
call PIC_PLT(CNAME(_thread_sys_sigprocmask))
#else
call PIC_PLT(CNAME(sigsetmask))
call PIC_PLT(CNAME(sigprocmask))
#endif
addl $4,%esp
addl $12,%esp
PIC_EPILOGUE
2: movl 4(%esp),%edx
movl 8(%esp),%eax
movl 4(%esp),%edx
2: movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
movl 8(%edx),%esp
@ -109,7 +114,7 @@ ENTRY(siglongjmp)
movl 16(%edx),%esi
movl 20(%edx),%edi
fninit
fldcw 28(%edx)
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax

View File

@ -5,15 +5,16 @@ SRCS+= i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c i386_set_ldt.c \
i386_vm86.c
MDASM= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S \
ptrace.S reboot.S rfork.S sbrk.S setlogin.S sigpending.S \
sigprocmask.S sigreturn.S sigsuspend.S syscall.S
ptrace.S reboot.S rfork.S sbrk.S setlogin.S sigreturn.S syscall.S
# sigpending.S sigprocmask.S sigsuspend.S
# Don't generate default code for these syscalls:
NOASM= __semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \
lseek.o mlockall.o mmap.o msgctl.o msgget.o msgrcv.o msgsnd.o \
munlockall.o openbsd_poll.o pread.o pwrite.o semconfig.o semget.o \
semop.o setdomainname.o shmat.o shmctl.o shmdt.o shmget.o sstk.o \
thr_sleep.o thr_wakeup.o truncate.o uname.o vfork.o yield.o
thr_sleep.o thr_wakeup.o truncate.o uname.o vfork.o yield.o \
osigpending.o osigprocmask.o osigsuspend.o
PSEUDO= _getlogin.o

View File

@ -499,7 +499,7 @@ struct pthread {
* Saved signal context used in call to sigreturn by
* _thread_kern_sched if sig_saved is TRUE.
*/
struct sigcontext saved_sigcontext;
ucontext_t saved_sigcontext;
/*
* Saved jump buffer used in call to longjmp by _thread_kern_sched
@ -954,15 +954,15 @@ void *_thread_cleanup(pthread_t);
void _thread_cleanupspecific(void);
void _thread_dump_info(void);
void _thread_init(void);
void _thread_kern_sched(struct sigcontext *);
void _thread_kern_sched(ucontext_t *);
void _thread_kern_sched_state(enum pthread_state,char *fname,int lineno);
void _thread_kern_sched_state_unlock(enum pthread_state state,
spinlock_t *lock, char *fname, int lineno);
void _thread_kern_set_timeout(struct timespec *);
void _thread_kern_sig_defer(void);
void _thread_kern_sig_undefer(void);
void _thread_sig_handler(int, int, struct sigcontext *);
void _thread_sig_handle(int, struct sigcontext *);
void _thread_sig_handler(int, int, ucontext_t *);
void _thread_sig_handle(int, ucontext_t *);
void _thread_sig_init(void);
void _thread_start(void);
void _thread_start_sig_handler(void);
@ -977,7 +977,7 @@ int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
int _thread_sys_sigsuspend(const sigset_t *);
int _thread_sys_siginterrupt(int, int);
int _thread_sys_sigpause(int);
int _thread_sys_sigreturn(struct sigcontext *);
int _thread_sys_sigreturn(ucontext_t *);
int _thread_sys_sigstack(const struct sigstack *, struct sigstack *);
int _thread_sys_sigvec(int, struct sigvec *, struct sigvec *);
void _thread_sys_psignal(unsigned int, const char *);

View File

@ -62,7 +62,7 @@ fork(void)
_thread_sys_close(_thread_kern_pipe[1]);
/* Reset signals pending for the running thread: */
_thread_run->sigpend = 0;
sigemptyset(&_thread_run->sigpend);
/*
* Create a pipe that is written to by the signal handler to

View File

@ -156,8 +156,14 @@ _thread_dump_info(void)
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
snprintf(s, sizeof(s), "sigmask 0x%08lx\n",
(unsigned long)pthread->sigmask);
snprintf(s, sizeof(s), "sigmask (hi)");
_thread_sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x\n",
pthread->sigmask.__bits[i]);
_thread_sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
_thread_sys_write(fd, s, strlen(s));
break;

View File

@ -61,7 +61,7 @@ static inline void
thread_run_switch_hook(pthread_t thread_out, pthread_t thread_in);
void
_thread_kern_sched(struct sigcontext * scp)
_thread_kern_sched(ucontext_t * scp)
{
#ifndef __alpha__
char *fdata;

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
@ -62,7 +65,7 @@ _thread_sig_init(void)
}
void
_thread_sig_handler(int sig, int code, struct sigcontext * scp)
_thread_sig_handler(int sig, int code, ucontext_t * scp)
{
char c;
int i;
@ -148,7 +151,7 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp)
}
void
_thread_sig_handle(int sig, struct sigcontext * scp)
_thread_sig_handle(int sig, ucontext_t * scp)
{
int i;
pthread_t pthread, pthread_next;
@ -360,13 +363,16 @@ _thread_signal(pthread_t pthread, int sig)
void
_dispatch_signals()
{
sigset_t sigset;
int i;
/*
* Check if there are pending signals for the running
* thread that aren't blocked:
*/
if ((_thread_run->sigpend & ~_thread_run->sigmask) != 0)
sigset = _thread_run->sigpend;
SIGSETNAND(sigset, _thread_run->sigmask);
if (SIGNOTEMPTY(sigset))
/* Look for all possible pending signals: */
for (i = 1; i < NSIG; i++)
/*

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <errno.h>
#include <signal.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <errno.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ sigprocmask(int how, const sigset_t * set, sigset_t * oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -68,7 +68,9 @@ sigwait(const sigset_t * set, int *sig)
sigdelset(&waitset, SIGINFO);
/* Check to see if a pending signal is in the wait mask. */
if (tempset = (_thread_run->sigpend & waitset)) {
tempset = _thread_run->sigpend;
SIGSETAND(tempset, waitset);
if (SIGNOTEMPTY(tempset)) {
/* Enter a loop to find a pending signal: */
for (i = 1; i < NSIG; i++) {
if (sigismember (&tempset, i))

View File

@ -1,6 +1,11 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
#
# $FreeBSD$
#
LIB= edit
SHLIB_MAJOR= 3
SHLIB_MINOR= 0
OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \
parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c

View File

@ -1,10 +1,14 @@
#
# $FreeBSD$
#
LIB= ftpio
CFLAGS+= -I${.CURDIR} -Wall
SRCS= ftpio.c ftperr.c
MAN3= ftpio.3
CLEANFILES+= ftperr.c
SHLIB_MAJOR= 4
SHLIB_MAJOR= 5
SHLIB_MINOR= 0
beforeinstall:

View File

@ -62,7 +62,7 @@ fork(void)
_thread_sys_close(_thread_kern_pipe[1]);
/* Reset signals pending for the running thread: */
_thread_run->sigpend = 0;
sigemptyset(&_thread_run->sigpend);
/*
* Create a pipe that is written to by the signal handler to

View File

@ -156,8 +156,14 @@ _thread_dump_info(void)
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
snprintf(s, sizeof(s), "sigmask 0x%08lx\n",
(unsigned long)pthread->sigmask);
snprintf(s, sizeof(s), "sigmask (hi)");
_thread_sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x\n",
pthread->sigmask.__bits[i]);
_thread_sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
_thread_sys_write(fd, s, strlen(s));
break;

View File

@ -61,7 +61,7 @@ static inline void
thread_run_switch_hook(pthread_t thread_out, pthread_t thread_in);
void
_thread_kern_sched(struct sigcontext * scp)
_thread_kern_sched(ucontext_t * scp)
{
#ifndef __alpha__
char *fdata;

View File

@ -499,7 +499,7 @@ struct pthread {
* Saved signal context used in call to sigreturn by
* _thread_kern_sched if sig_saved is TRUE.
*/
struct sigcontext saved_sigcontext;
ucontext_t saved_sigcontext;
/*
* Saved jump buffer used in call to longjmp by _thread_kern_sched
@ -954,15 +954,15 @@ void *_thread_cleanup(pthread_t);
void _thread_cleanupspecific(void);
void _thread_dump_info(void);
void _thread_init(void);
void _thread_kern_sched(struct sigcontext *);
void _thread_kern_sched(ucontext_t *);
void _thread_kern_sched_state(enum pthread_state,char *fname,int lineno);
void _thread_kern_sched_state_unlock(enum pthread_state state,
spinlock_t *lock, char *fname, int lineno);
void _thread_kern_set_timeout(struct timespec *);
void _thread_kern_sig_defer(void);
void _thread_kern_sig_undefer(void);
void _thread_sig_handler(int, int, struct sigcontext *);
void _thread_sig_handle(int, struct sigcontext *);
void _thread_sig_handler(int, int, ucontext_t *);
void _thread_sig_handle(int, ucontext_t *);
void _thread_sig_init(void);
void _thread_start(void);
void _thread_start_sig_handler(void);
@ -977,7 +977,7 @@ int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
int _thread_sys_sigsuspend(const sigset_t *);
int _thread_sys_siginterrupt(int, int);
int _thread_sys_sigpause(int);
int _thread_sys_sigreturn(struct sigcontext *);
int _thread_sys_sigreturn(ucontext_t *);
int _thread_sys_sigstack(const struct sigstack *, struct sigstack *);
int _thread_sys_sigvec(int, struct sigvec *, struct sigvec *);
void _thread_sys_psignal(unsigned int, const char *);

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
@ -62,7 +65,7 @@ _thread_sig_init(void)
}
void
_thread_sig_handler(int sig, int code, struct sigcontext * scp)
_thread_sig_handler(int sig, int code, ucontext_t * scp)
{
char c;
int i;
@ -148,7 +151,7 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp)
}
void
_thread_sig_handle(int sig, struct sigcontext * scp)
_thread_sig_handle(int sig, ucontext_t * scp)
{
int i;
pthread_t pthread, pthread_next;
@ -360,13 +363,16 @@ _thread_signal(pthread_t pthread, int sig)
void
_dispatch_signals()
{
sigset_t sigset;
int i;
/*
* Check if there are pending signals for the running
* thread that aren't blocked:
*/
if ((_thread_run->sigpend & ~_thread_run->sigmask) != 0)
sigset = _thread_run->sigpend;
SIGSETNAND(sigset, _thread_run->sigmask);
if (SIGNOTEMPTY(sigset))
/* Look for all possible pending signals: */
for (i = 1; i < NSIG; i++)
/*

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <errno.h>
#include <signal.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <errno.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ sigprocmask(int how, const sigset_t * set, sigset_t * oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -68,7 +68,9 @@ sigwait(const sigset_t * set, int *sig)
sigdelset(&waitset, SIGINFO);
/* Check to see if a pending signal is in the wait mask. */
if (tempset = (_thread_run->sigpend & waitset)) {
tempset = _thread_run->sigpend;
SIGSETAND(tempset, waitset);
if (SIGNOTEMPTY(tempset)) {
/* Enter a loop to find a pending signal: */
for (i = 1; i < NSIG; i++) {
if (sigismember (&tempset, i))

View File

@ -62,7 +62,7 @@ fork(void)
_thread_sys_close(_thread_kern_pipe[1]);
/* Reset signals pending for the running thread: */
_thread_run->sigpend = 0;
sigemptyset(&_thread_run->sigpend);
/*
* Create a pipe that is written to by the signal handler to

View File

@ -156,8 +156,14 @@ _thread_dump_info(void)
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
snprintf(s, sizeof(s), "sigmask 0x%08lx\n",
(unsigned long)pthread->sigmask);
snprintf(s, sizeof(s), "sigmask (hi)");
_thread_sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x\n",
pthread->sigmask.__bits[i]);
_thread_sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
_thread_sys_write(fd, s, strlen(s));
break;

View File

@ -61,7 +61,7 @@ static inline void
thread_run_switch_hook(pthread_t thread_out, pthread_t thread_in);
void
_thread_kern_sched(struct sigcontext * scp)
_thread_kern_sched(ucontext_t * scp)
{
#ifndef __alpha__
char *fdata;

View File

@ -499,7 +499,7 @@ struct pthread {
* Saved signal context used in call to sigreturn by
* _thread_kern_sched if sig_saved is TRUE.
*/
struct sigcontext saved_sigcontext;
ucontext_t saved_sigcontext;
/*
* Saved jump buffer used in call to longjmp by _thread_kern_sched
@ -954,15 +954,15 @@ void *_thread_cleanup(pthread_t);
void _thread_cleanupspecific(void);
void _thread_dump_info(void);
void _thread_init(void);
void _thread_kern_sched(struct sigcontext *);
void _thread_kern_sched(ucontext_t *);
void _thread_kern_sched_state(enum pthread_state,char *fname,int lineno);
void _thread_kern_sched_state_unlock(enum pthread_state state,
spinlock_t *lock, char *fname, int lineno);
void _thread_kern_set_timeout(struct timespec *);
void _thread_kern_sig_defer(void);
void _thread_kern_sig_undefer(void);
void _thread_sig_handler(int, int, struct sigcontext *);
void _thread_sig_handle(int, struct sigcontext *);
void _thread_sig_handler(int, int, ucontext_t *);
void _thread_sig_handle(int, ucontext_t *);
void _thread_sig_init(void);
void _thread_start(void);
void _thread_start_sig_handler(void);
@ -977,7 +977,7 @@ int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
int _thread_sys_sigsuspend(const sigset_t *);
int _thread_sys_siginterrupt(int, int);
int _thread_sys_sigpause(int);
int _thread_sys_sigreturn(struct sigcontext *);
int _thread_sys_sigreturn(ucontext_t *);
int _thread_sys_sigstack(const struct sigstack *, struct sigstack *);
int _thread_sys_sigvec(int, struct sigvec *, struct sigvec *);
void _thread_sys_psignal(unsigned int, const char *);

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
@ -62,7 +65,7 @@ _thread_sig_init(void)
}
void
_thread_sig_handler(int sig, int code, struct sigcontext * scp)
_thread_sig_handler(int sig, int code, ucontext_t * scp)
{
char c;
int i;
@ -148,7 +151,7 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp)
}
void
_thread_sig_handle(int sig, struct sigcontext * scp)
_thread_sig_handle(int sig, ucontext_t * scp)
{
int i;
pthread_t pthread, pthread_next;
@ -360,13 +363,16 @@ _thread_signal(pthread_t pthread, int sig)
void
_dispatch_signals()
{
sigset_t sigset;
int i;
/*
* Check if there are pending signals for the running
* thread that aren't blocked:
*/
if ((_thread_run->sigpend & ~_thread_run->sigmask) != 0)
sigset = _thread_run->sigpend;
SIGSETNAND(sigset, _thread_run->sigmask);
if (SIGNOTEMPTY(sigset))
/* Look for all possible pending signals: */
for (i = 1; i < NSIG; i++)
/*

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <errno.h>
#include <signal.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -31,6 +31,9 @@
*
* $FreeBSD$
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/signalvar.h>
#include <signal.h>
#include <errno.h>
#ifdef _THREAD_SAFE
@ -54,13 +57,13 @@ sigprocmask(int how, const sigset_t * set, sigset_t * oset)
/* Block signals: */
case SIG_BLOCK:
/* Add signals to the existing mask: */
_thread_run->sigmask |= *set;
SIGSETOR(_thread_run->sigmask, *set);
break;
/* Unblock signals: */
case SIG_UNBLOCK:
/* Clear signals from the existing mask: */
_thread_run->sigmask &= ~(*set);
SIGSETNAND(_thread_run->sigmask, *set);
break;
/* Set the signal process mask: */

View File

@ -68,7 +68,9 @@ sigwait(const sigset_t * set, int *sig)
sigdelset(&waitset, SIGINFO);
/* Check to see if a pending signal is in the wait mask. */
if (tempset = (_thread_run->sigpend & waitset)) {
tempset = _thread_run->sigpend;
SIGSETAND(tempset, waitset);
if (SIGNOTEMPTY(tempset)) {
/* Enter a loop to find a pending signal: */
for (i = 1; i < NSIG; i++) {
if (sigismember (&tempset, i))

View File

@ -1,6 +1,9 @@
# $FreeBSD$
LIB= ss
SHLIB_MAJOR= 3
SHLIB_MINOR= 0
SRCS= data.c error.c execute_cmd.c help.c invocation.c list_rqs.c \
listen.c pager.c parse.c prompt.c request_tbl.c requests.c \
ss_err.c ss_err.h std_rqs.c

View File

@ -209,7 +209,6 @@ SUBDIR+=telnet
# Things that don't compile on alpha or are aout specific:
SUBDIR+=ar \
brandelf \
doscmd \
gcore \
gprof4 \
nm \
@ -218,6 +217,7 @@ SUBDIR+=ar \
size \
strings \
strip
# doscmd \
.endif
.include <bsd.subdir.mk>

View File

@ -1,6 +1,9 @@
#
# $FreeBSD$
#
PROG= vttest
CFLAGS+= -traditional -DUSEMYSTTY
CFLAGS+= -DUSEMYSTTY
SRCS= main.c esc.c
.include <bsd.prog.mk>

View File

@ -125,7 +125,7 @@ usage()
children to exit when they have done their work.
*/
static void handle_sigchld(int sig, int code, struct sigcontext *scp)
static void handle_sigchld(int sig, int code, void *scp)
{
int pid, status;
pid = wait4(-1, &status, WNOHANG, (struct rusage*)0);