summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:30:54 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:30:54 +0000
commitbf37253a5d69e1706f6287e376376ce7d0050965 (patch)
tree724ed399721200c1e749c052eebc372f991aa6a3 /lib
parent53b6a816b5e1968f5e2fdfde9f60156e3a0309db (diff)
Declare moncontrol(3) APIs in <sys/gmon.h>
Export _gmonparam again. Make gcrt0.o use an reserved name for _monstartup() ok millert@
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/crt0.c7
-rw-r--r--lib/libc/Symbols.list2
-rw-r--r--lib/libc/gmon/gmon.c7
-rw-r--r--lib/libc/gmon/moncontrol.39
4 files changed, 14 insertions, 11 deletions
diff --git a/lib/csu/crt0.c b/lib/csu/crt0.c
index 3b82f6a323e..64ec4dbdef0 100644
--- a/lib/csu/crt0.c
+++ b/lib/csu/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.6 2016/03/20 02:32:39 guenther Exp $ */
+/* $OpenBSD: crt0.c,v 1.7 2016/05/07 19:30:53 guenther Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@@ -55,8 +55,7 @@ static void ___start(MD_START_ARGS) __used;
char ***_csu_finish(char **_argv, char **_envp, void (*_cleanup)(void));
#ifdef MCRT0
-extern void monstartup(u_long, u_long);
-extern void _mcleanup(void);
+#include <sys/gmon.h>
extern unsigned char _etext, _eprol;
#endif /* MCRT0 */
@@ -86,7 +85,7 @@ MD_START(MD_START_ARGS)
#ifdef MCRT0
atexit(_mcleanup);
- monstartup((u_long)&_eprol, (u_long)&_etext);
+ _monstartup((u_long)&_eprol, (u_long)&_etext);
#endif
__init();
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list
index 58e05df793b..201a98ecdcc 100644
--- a/lib/libc/Symbols.list
+++ b/lib/libc/Symbols.list
@@ -848,7 +848,9 @@ strtof
strtold
/* gmon */
+_gmonparam
_mcleanup
+_monstartup
moncontrol
monstartup
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index 886505f0c79..f505eb79d12 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gmon.c,v 1.28 2016/03/14 14:48:02 mmcc Exp $ */
+/* $OpenBSD: gmon.c,v 1.29 2016/05/07 19:30:52 guenther Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -48,11 +48,9 @@ static int s_scale;
#define ERR(s) write(STDERR_FILENO, s, sizeof(s))
-void moncontrol(int);
PROTO_NORMAL(moncontrol);
+PROTO_DEPRECATED(monstartup);
static int hertz(void);
-void monstartup(u_long lowpc, u_long highpc);
-void _mcleanup(void);
void
monstartup(u_long lowpc, u_long highpc)
@@ -134,6 +132,7 @@ mapfailed:
}
ERR("monstartup: out of memory\n");
}
+__strong_alias(_monstartup,monstartup);
void
_mcleanup(void)
diff --git a/lib/libc/gmon/moncontrol.3 b/lib/libc/gmon/moncontrol.3
index 2443bd4379c..5d03634e2a7 100644
--- a/lib/libc/gmon/moncontrol.3
+++ b/lib/libc/gmon/moncontrol.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: moncontrol.3,v 1.7 2014/01/21 03:15:45 schwarze Exp $
+.\" $OpenBSD: moncontrol.3,v 1.8 2016/05/07 19:30:52 guenther Exp $
.\"
.\" Copyright (c) 1980, 1991, 1992, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 21 2014 $
+.Dd $Mdocdate: May 7 2016 $
.Dt MONCONTROL 3
.Os
.Sh NAME
@@ -35,8 +35,11 @@
.Nm monstartup
.Nd control execution profile
.Sh SYNOPSIS
+.In sys/gmon.h
+.Ft void
.Fn moncontrol "int mode"
-.Fn monstartup "u_long *lowpc" "u_long *highpc"
+.Ft void
+.Fn monstartup "u_long lowpc" "u_long highpc"
.Sh DESCRIPTION
An executable program compiled using the
.Fl pg