Rename __unused struct members to include a namespace
[uclibc-ng.git] / libc / sysdeps / linux / m68k / brk.c
blob40ebf4fc7fd694041833c064afbd73d5e79d4a67
1 /* consider this code LGPL - davidm */
2 /*
3 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
8 #include <unistd.h>
9 #include <sys/syscall.h>
10 #include <errno.h>
13 /* This must be initialized data because commons can't have aliases. */
14 void * __curbrk = 0;
16 int brk (void *addr)
18 void *newbrk;
20 __asm__ __volatile__ ("movel %2,%/d1\n\t"
21 "moveq %1,%/d0\n\t"
22 "trap #0\n\t"
23 "movel %/d0,%0"
24 :"=g" (newbrk)
25 :"i" (__NR_brk),"g" (addr) : "%d0", "%d1");
27 __curbrk = newbrk;
29 if (newbrk < addr)
31 __set_errno (ENOMEM);
32 return -1;
35 return 0;
37 libc_hidden_def(brk)