diff options
author | 2008-04-24 20:43:20 +0000 | |
---|---|---|
committer | 2008-04-24 20:43:20 +0000 | |
commit | aa23f690d874cd27a43516de8f2be93ea7d6a7ad (patch) | |
tree | ba7713c633cc8d02d5034f0fee4cc985abcbf199 /lib/libc/sys | |
parent | Prevent overflow of cmd_argv if RCS_INIT and command line arguments (diff) | |
download | wireguard-openbsd-aa23f690d874cd27a43516de8f2be93ea7d6a7ad.tar.xz wireguard-openbsd-aa23f690d874cd27a43516de8f2be93ea7d6a7ad.zip |
- correct brk(2) prototype and man page to match implementation and POSIX.
brk(2) returns an int value not a void *. brk(2) returns 0 upon success not
a pointer to the new end of memory. okay millert@, kettenis@, deraadt@
Diffstat (limited to 'lib/libc/sys')
-rw-r--r-- | lib/libc/sys/Lint_brk.c | 4 | ||||
-rw-r--r-- | lib/libc/sys/brk.2 | 8 | ||||
-rw-r--r-- | lib/libc/sys/vfork.2 | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc/sys/Lint_brk.c b/lib/libc/sys/Lint_brk.c index 3d194b81941..6ce98c0675a 100644 --- a/lib/libc/sys/Lint_brk.c +++ b/lib/libc/sys/Lint_brk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: Lint_brk.c,v 1.3 2005/11/28 16:54:07 deraadt Exp $ */ +/* $OpenBSD: Lint_brk.c,v 1.4 2008/04/24 20:43:20 kurt Exp $ */ /* $NetBSD: Lint_brk.c,v 1.1 1997/11/06 00:52:52 cgd Exp $ */ /* @@ -9,7 +9,7 @@ #include <unistd.h> /*ARGSUSED*/ -void * +int brk(void *addr) { return (0); diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2 index 0c71a148eb8..c6b85aa5681 100644 --- a/lib/libc/sys/brk.2 +++ b/lib/libc/sys/brk.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: brk.2,v 1.17 2007/05/31 19:19:32 jmc Exp $ +.\" $OpenBSD: brk.2,v 1.18 2008/04/24 20:43:20 kurt Exp $ .\" $NetBSD: brk.2,v 1.7 1995/02/27 12:31:57 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)brk.2 8.2 (Berkeley) 12/11/93 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: April 24 2008 $ .Dt BRK 2 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd change data segment size .Sh SYNOPSIS .Fd #include <unistd.h> -.Ft void * +.Ft int .Fn brk "void *addr" .Ft void * .Fn sbrk "int incr" @@ -105,7 +105,7 @@ for the definition of .Em etext ) . .Sh RETURN VALUES .Fn brk -returns a pointer to the new end of memory if successful; +returns 0 if successful; otherwise \-1 with .Va errno set to indicate why the allocation failed. diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2 index ec0e5a75639..6eaa56aedf7 100644 --- a/lib/libc/sys/vfork.2 +++ b/lib/libc/sys/vfork.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vfork.2,v 1.16 2008/04/04 19:30:41 kurt Exp $ +.\" $OpenBSD: vfork.2,v 1.17 2008/04/24 20:43:20 kurt Exp $ .\" $NetBSD: vfork.2,v 1.8 1997/07/10 07:54:13 mikel Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)vfork.2 8.1 (Berkeley) 6/4/93 .\" -.Dd $Mdocdate: April 4 2008 $ +.Dd $Mdocdate: April 24 2008 $ .Dt VFORK 2 .Os .Sh NAME |