1*47912Sbostic /*
2*47912Sbostic  * Copyright (c) 1983 The Regents of the University of California.
3*47912Sbostic  * All rights reserved.
4*47912Sbostic  *
5*47912Sbostic  * Redistribution and use in source and binary forms are permitted
6*47912Sbostic  * provided that the above copyright notice and this paragraph are
7*47912Sbostic  * duplicated in all such forms and that any documentation,
8*47912Sbostic  * advertising materials, and other materials related to such
9*47912Sbostic  * distribution and use acknowledge that the software was developed
10*47912Sbostic  * by the University of California, Berkeley.  The name of the
11*47912Sbostic  * University may not be used to endorse or promote products derived
12*47912Sbostic  * from this software without specific prior written permission.
13*47912Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*47912Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*47912Sbostic  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16*47912Sbostic  */
17*47912Sbostic 
18*47912Sbostic #if defined(LIBC_SCCS) && !defined(lint)
19*47912Sbostic 	.asciz "@(#)getdtablesize.c	5.1 (Berkeley) 04/12/91"
20*47912Sbostic #endif /* LIBC_SCCS and not lint */
21*47912Sbostic 
22*47912Sbostic #include "SYS.h"
23*47912Sbostic 
24*47912Sbostic 	.data
25*47912Sbostic dtablesize:
26*47912Sbostic 	.long	0
27*47912Sbostic 	.text
28*47912Sbostic 
29*47912Sbostic ENTRY(getdtablesize)
30*47912Sbostic 	movl	dtablesize,r0	# check cache
31*47912Sbostic 	beql	doit
32*47912Sbostic 	ret
33*47912Sbostic doit:
34*47912Sbostic 	chmk	$SYS_getdtablesize
35*47912Sbostic 	jcs	err
36*47912Sbostic 	movl	r0,dtablesize	# set cache
37*47912Sbostic 	ret			# dtablesize = dtablesize();
38*47912Sbostic err:
39*47912Sbostic 	jmp cerror;
40