]> andersk Git - moira.git/blame - server/mr_sbrk.c
missing SRCDIR; ifdef on GDSS
[moira.git] / server / mr_sbrk.c
CommitLineData
349e85df 1/*
2 * $Source$
3 * $Author$
4 * $Header$
5 *
6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
c801de4c 7 * For copying and distribution information, please see the file
8 * <mit-copyright.h>.
349e85df 9 */
10
11#ifndef lint
12static char *rcsid_sms_sbrk_c = "$Header$";
13#endif lint
14
c801de4c 15#include <mit-copyright.h>
16
349e85df 17/*
18 * The following routine is a kludge around a deficiency in the Ingres
19 * memory allocator; it likes to call sbrk(0) a lot to check on the
20 * amount of memory allocated.
21 */
22#include <sys/types.h>
23
24#ifdef vax
25extern char end;
26asm(" .data");
27asm(" .globl curbrk");
28asm(" .globl minbrk");
29asm("_curbrk:");
30asm("curbrk: .long _end");
31asm("_minbrk:");
32asm("minbrk: .long _end");
33
34extern caddr_t curbrk;
35extern caddr_t minbrk;
36
37caddr_t sbrk(incr)
38 register int incr;
39{
40 register caddr_t oldbrk = curbrk;
41 if (incr) {
42 if (brk(oldbrk + incr) < 0)
43 return (caddr_t)-1;
44 curbrk += incr;
45 }
46 return oldbrk;
47}
48#endif vax
49
50/*
51 * Local Variables:
52 * mode: c
53 * c-indent-level: 4
54 * c-continued-statement-offset: 4
55 * c-brace-offset: -4
56 * c-argdecl-indent: 4
57 * c-label-offset: -4
58 * End:
59 */
This page took 0.109513 seconds and 5 git commands to generate.