xref: /original-bsd/lib/libc/i386/sys/sigprocmask.s (revision b4971bb3)
1/*-
2 * Copyright (c) 1990, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#if defined(SYSLIBC_SCCS) && !defined(lint)
12	.asciz "@(#)sigprocmask.s	8.1 (Berkeley) 06/04/93"
13#endif /* SYSLIBC_SCCS and not lint */
14
15#include "SYS.h"
16
17err:
18	jmp	cerror
19
20ENTRY(sigprocmask)
21	movl	8(%esp),%ecx		# fetch new sigset pointer
22	cmpl	$0,%ecx			# check new sigset pointer
23	jne	1f			# if not null, indirect
24/*	movl	$0,8(%esp)		# null mask pointer: block empty set */
25	movl	$1,4(%esp)		# SIG_BLOCK
26	jmp	2f
271:	movl	(%ecx),%ecx		# fetch indirect  ...
28	movl	%ecx,8(%esp)		# to new mask arg
292:	movl	$ SYS_sigprocmask , %eax
30	LCALL(0x7,0)
31	jb	err
32	movl	12(%esp),%ecx		# fetch old mask requested
33	cmpl	$0,%ecx			# test if old mask requested
34	je	out
35	movl	%eax,(%ecx)		# store old mask
36out:
37	xorl	%eax,%eax
38	ret
39