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

Message ID 20251029-fix-libgloss-i386-compile-issues-v1-2-26edcb02f69c@kernel.org
State New
Headers
Series libgloss: i386: fix compilation issues |

Commit Message

Vincent Mailhol Oct. 29, 2025, 6:58 a.m. UTC
  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(+)
  

Patch

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
  */