summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkurt <kurt@openbsd.org>2008-04-24 20:43:20 +0000
committerkurt <kurt@openbsd.org>2008-04-24 20:43:20 +0000
commitaa23f690d874cd27a43516de8f2be93ea7d6a7ad (patch)
treeba7713c633cc8d02d5034f0fee4cc985abcbf199
parentPrevent overflow of cmd_argv if RCS_INIT and command line arguments (diff)
downloadwireguard-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@
-rw-r--r--include/unistd.h4
-rw-r--r--lib/libc/sys/Lint_brk.c4
-rw-r--r--lib/libc/sys/brk.28
-rw-r--r--lib/libc/sys/vfork.24
4 files changed, 10 insertions, 10 deletions
diff --git a/include/unistd.h b/include/unistd.h
index b093a5a7215..0dbe24f6e42 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.59 2006/12/20 08:12:00 espie Exp $ */
+/* $OpenBSD: unistd.h,v 1.60 2008/04/24 20:43:20 kurt Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -176,7 +176,7 @@ int ttyname_r(int, char *, size_t)
#if __BSD_VISIBLE || __XPG_VISIBLE <= 500
/* Interfaces withdrawn by X/Open Issue 5 Version 0 */
-void *brk(void *);
+int brk(void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void);
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