Define F_DUPFD_CLOEXEC.
[glibc-ports.git] / sysdeps / unix / sysv / linux / am33 / brk.c
blobf56736359e3bb385d1e5e8506da0fcd6d8f7145b
1 /* brk system call for Linux/am33.
2 Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Alexandre Oliva <aoliva@redhat.com>.
5 Based on ../i386/brk.c.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #include <errno.h>
23 #include <unistd.h>
24 #include <sysdep.h>
26 /* This must be initialized data because commons can't have aliases. */
27 void *__curbrk = 0;
29 int
30 __brk (void *addr)
32 void *newbrk;
34 newbrk = INLINE_SYSCALL (brk, 1, __ptrvalue (addr));
36 __curbrk = newbrk;
38 if (newbrk < addr)
40 __set_errno (ENOMEM);
41 return -1;
44 return 0;
46 weak_alias (__brk, brk)