[newlib-cygwin/main] libgloss: i386: move profil_write() from cygmon-salib.c to cygmon-gmon.c
Jeff Johnston
jjohnstn@sourceware.org
Mon Nov 3 20:33:30 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c14452572127b467b776ed2fbad90de0f3708550
commit c14452572127b467b776ed2fbad90de0f3708550
Author: Vincent Mailhol <mailhol@kernel.org>
Date: Mon Nov 3 15:30:12 2025 -0500
libgloss: i386: move profil_write() from cygmon-salib.c to cygmon-gmon.c
Diff:
---
libgloss/i386/cygmon-gmon.c | 20 ++++++++++++++++++++
libgloss/i386/cygmon-salib.c | 19 -------------------
2 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index 88bdf251c..778dbd76d 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -62,6 +62,7 @@ static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91";
#include <stdio.h>
#endif
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -193,6 +194,25 @@ monstartup(lowpc, highpc)
moncontrol (1);
}
+static void
+profil_write (int type, void *buffer, int len)
+{
+ static int des = -1;
+
+ if (des < 0)
+ {
+ des = open ("gmon.out", O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ }
+ if (len == 0)
+ {
+ close (des);
+ }
+ else
+ {
+ write (des, buffer, len);
+ }
+}
+
void
_mcleanup()
{
diff --git a/libgloss/i386/cygmon-salib.c b/libgloss/i386/cygmon-salib.c
index b4a4d34b3..734afe9d6 100644
--- a/libgloss/i386/cygmon-salib.c
+++ b/libgloss/i386/cygmon-salib.c
@@ -161,22 +161,3 @@ __do_global_dtors ()
}
}
#endif
-
-void
-profil_write (int type, char *buffer, int len)
-{
- static int des = -1;
-
- if (des < 0)
- {
- des = open ("gmon.out", O_WRONLY | O_CREAT | O_TRUNC, 0644);
- }
- if (len == 0)
- {
- close (des);
- }
- else
- {
- write (des, buffer, len);
- }
-}
More information about the Newlib-cvs
mailing list