xref: /csrg-svn/lib/libc/vax/sys/cache.lib/getgid.c (revision 61226)
147918Sbostic /*-
2*61226Sbostic  * Copyright (c) 1983, 1993
3*61226Sbostic  *	The Regents of the University of California.  All rights reserved.
447913Sbostic  *
547918Sbostic  * %sccs.include.redist.c%
647913Sbostic  */
747913Sbostic 
847913Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*61226Sbostic 	.asciz "@(#)getgid.c	8.1 (Berkeley) 06/04/93"
1047913Sbostic #endif /* LIBC_SCCS and not lint */
1147913Sbostic 
1247913Sbostic #include "SYS.h"
1347913Sbostic 
1447913Sbostic 	.data
1547913Sbostic mygid:	.long	-1
1647913Sbostic myegid:	.long	-1
1747913Sbostic 	.text
1847913Sbostic 
1947913Sbostic ENTRY(getgid)
2047913Sbostic 	movl	mygid,r0	# check cache
2147913Sbostic 	cmpl	$-1,r0
2247913Sbostic 	bneq	doit
2347913Sbostic 	ret
2447913Sbostic doit:
2547913Sbostic 	chmk	$SYS_getgid
2647913Sbostic 	jcs	err
2747913Sbostic 	movl	r0,mygid	# set cache
2847913Sbostic 	movl	r1,myegid	# set cache
2947913Sbostic 	ret			# gid = getgid();
3047913Sbostic 
3147913Sbostic ENTRY(getegid)
3247913Sbostic 	movl	myegid,r0	# check cache
3347913Sbostic 	cmpl	$-1,r0
3447913Sbostic 	bneq	doit
3547913Sbostic 	ret
3647913Sbostic doit:
3747913Sbostic 	chmk	$SYS_getgid
3847913Sbostic 	jcs	err
3947913Sbostic 	movl	r0,mygid	# set cache
4047913Sbostic 	movl	r1,r0
4147913Sbostic 	movl	r0,myegid	# set cache
4247913Sbostic 	ret			# gid = getegid();
4347913Sbostic err:
4447913Sbostic 	jmp cerror
4547913Sbostic 
4647913Sbostic ENTRY(setregid)
4747913Sbostic 	mnegl	$1,mygid
4847913Sbostic 	mnegl	$1,myegid
4947913Sbostic 	chmk	$SYS_setregid
5047913Sbostic 	jcs	err
5147913Sbostic 	ret		# setregid(rgid, egid)
52