[PATCH 2/6] libgloss: i386: cygmon-gmon.c: add profil() prototype

Vincent Mailhol mailhol@kernel.org
Wed Oct 29 06:58:27 GMT 2025


Add the prototype of profil() to resolve below GCC error:

  cygmon-gmon.c: In function 'moncontrol':
  cygmon-gmon.c:349:7: error: implicit declaration of function 'profil' [-Wimplicit-function-declaration]
    349 |       profil((unsigned short *)(sbuf + sizeof(struct phdr)),
        |       ^~~~~~

Note that unistd.h in which profil() is normally present is not
sufficient here because newlib's unistd.h does not provide it.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
 libgloss/i386/cygmon-gmon.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index ac3af30a6..7d0697852 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -68,6 +68,9 @@ static char sccsid[] = "@(#)gmon.c	5.3 (Berkeley) 5/22/91";
 
 #include "cygmon-gmon.h"
 
+int profil(unsigned short *tampon, size_t taille_tampon,
+	   size_t offset, unsigned int echelle);
+
 /*
  *	froms is actually a bunch of unsigned shorts indexing tos
  */

-- 
2.51.0



More information about the Newlib mailing list