From 9a2b435dd837bbc0baba16a5ef8dbcff1bdeabf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.barton@microsoft.com>
Date: Tue, 1 Jul 2025 17:49:55 +0200
Subject: [PATCH] Cygwin: winchild: fix missing stdlib.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The posix_spawn/winchild test was added recently by
2af1914b6ad673a2041cf94cc8e78e1bdec57a27 commit. It fails to build for AArch64
due to missing stdlib.h header where malloc and free functions are defined.
This patch fixes the missing header.

Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
---
 winsup/testsuite/winsup.api/posix_spawn/winchild.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/testsuite/winsup.api/posix_spawn/winchild.c b/winsup/testsuite/winsup.api/posix_spawn/winchild.c
index 6fdfa002c..43fd35c58 100644
--- a/winsup/testsuite/winsup.api/posix_spawn/winchild.c
+++ b/winsup/testsuite/winsup.api/posix_spawn/winchild.c
@@ -3,7 +3,7 @@
 #include <winternl.h>
 #include <ctype.h>
 #include <stdio.h>
-
+#include <stdlib.h>
 
 int wmain (int argc, wchar_t **argv)
 {
-- 
2.50.1.vfs.0.0

