DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 55HCsiXA408397 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 55HCsiXA408397 X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA4F63843B6E ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DA4F63843B6E ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750164854; cv=none; b=SoWKMFjJo+W1gLa4YINWJhZfO85885FRdQefLKfk7NuI0X70dC0QPZ3n7I7zubzcuC0mrY7QP7yX9SXOHcVYlf80u5NxLMaGb8ejEdYdJje05E1dMhhHhAH7UUW9x10XTTLAAHmjkTnehfDVDqA8LWjJ8NQ3Nyseg84h7krupL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750164854; c=relaxed/simple; bh=fhG5mkxh531nujusQ+6/DKCYWyk3A1c3wxL6heqj7no=; h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature; b=ODjt048+3V8c14Ae7Z5OumBqVa9S0uZQDyOKKl0hQIbubT7W7rchZ/jhAHhkHpG5AQxh6Mhse0dIpg3e/+qQqrWEX/73Y1dHSbSvQ46Vwpvwnh1zV34D5dCosUDxEgKUKO2aWa8QKMk2R2tYEd/86Dk8mwvII1/5K78RxlkreYY= ARC-Authentication-Results: i=1; server2.sourceware.org Date: Tue, 17 Jun 2025 21:54:11 +0900 To: cygwin AT cygwin DOT com Subject: Calling system() in multi-threads. Message-Id: <20250617215411.ebf69d1c18b55191a1b76c01@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__17_Jun_2025_21_54_11_+0900_QbbixUt3agTsYghg" X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Sender: "Cygwin" This is a multi-part message in MIME format. --Multipart=_Tue__17_Jun_2025_21_54_11_+0900_QbbixUt3agTsYghg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, If system() is called in parallel in threads, system() fails with exit code 127. Just compile pthread_system.c attached and run. I believe system() is multi-thread safe so the STC should work. -- Takashi Yano --Multipart=_Tue__17_Jun_2025_21_54_11_+0900_QbbixUt3agTsYghg Content-Type: text/x-csrc; name="pthread_system.c" Content-Disposition: attachment; filename="pthread_system.c" Content-Transfer-Encoding: 7bit #include #include #include #include #include void *func(void *arg) { printf("%d\n", system("/usr/bin/echo AAAAAAAAAAAAAAAAAAAA")); return NULL; } #define N 10 int main() { pthread_t th[N]; for (int i=0; i