xref: /original-bsd/lib/libc/mips/sys/sigprocmask.s (revision 94e7bb75)
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Ralph Campbell.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#include "SYS.h"
12
13#if defined(LIBC_SCCS) && !defined(lint)
14	ASMSTR("@(#)sigprocmask.s	5.1 (Berkeley) 02/29/92")
15#endif /* LIBC_SCCS and not lint */
16
17LEAF(sigprocmask)	# sigprocmask(how, new, old) sigset_t *new, *old;
18	bne	a1, zero, gotptr	# if new sigset pointer not null
19	li	a0, 1			# how = SIG_BLOCK
20	b	doit			# mask = zero
21gotptr:
22	lw	a1, 0(a1)		# indirect to new mask arg
23doit:
24	li	v0, SYS_sigprocmask
25	syscall
26	bne	a3, zero, err
27	beq	a2, zero, out		# test if old mask requested
28	sw	v0, 0(a2)		# store old mask
29out:
30	move	v0, zero
31	j	ra
32err:
33	j	_cerror
34END(sigprocmask)
35