xref: /illumos-gate/usr/src/contrib/ast/src/lib/libast/vmalloc/vmdisc.c (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2011 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                 Eclipse Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *          http://www.eclipse.org/org/documents/epl-v10.html           *
11 *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                 Glenn Fowler <gsf@research.att.com>                  *
18 *                  David Korn <dgk@research.att.com>                   *
19 *                   Phong Vo <kpv@research.att.com>                    *
20 *                                                                      *
21 ***********************************************************************/
22 #if defined(_UWIN) && defined(_BLD_ast)
23 
_STUB_vmdisc()24 void _STUB_vmdisc(){}
25 
26 #else
27 
28 #include	"vmhdr.h"
29 
30 /*	Change the discipline for a region.  The old discipline
31 **	is returned.  If the new discipline is NULL then the
32 **	discipline is not changed.
33 **
34 **	Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
35 */
36 #if __STD_C
vmdisc(Vmalloc_t * vm,Vmdisc_t * disc)37 Vmdisc_t* vmdisc(Vmalloc_t* vm, Vmdisc_t* disc)
38 #else
39 Vmdisc_t* vmdisc(vm, disc)
40 Vmalloc_t*	vm;
41 Vmdisc_t*	disc;
42 #endif
43 {
44 	Vmdisc_t*	old = vm->disc;
45 
46 	if(disc)
47 	{	if(old->exceptf &&
48 		   (*old->exceptf)(vm,VM_DISC,(Void_t*)disc,old) != 0 )
49 			return NIL(Vmdisc_t*);
50 		vm->disc = disc;
51 	}
52 	return old;
53 }
54 
55 #endif
56