From owner-freebsd-hackers Thu Nov 7 3:35: 6 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A643137B401 for ; Thu, 7 Nov 2002 03:35:04 -0800 (PST) Received: from aragorn.reaumur.absolight.net (ATuileries-113-2-1-167.abo.wanadoo.fr [80.11.216.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id A644243E42 for ; Thu, 7 Nov 2002 03:35:03 -0800 (PST) (envelope-from mat@mat.cc) Received: from andromede.reaumur.absolight.net (andromede.reaumur.absolight.net [212.43.217.61]) by aragorn.reaumur.absolight.net (Postfix) with ESMTP id ED2047CB9 for ; Thu, 7 Nov 2002 12:35:01 +0100 (CET) Date: Thu, 07 Nov 2002 12:34:58 +0100 From: Mathieu Arnold To: freebsd-hackers@freebsd.org Subject: pthreads on 4.7-RELEASE Message-ID: <180816670.1036672498@andromede.reaumur.absolight.net> X-Mailer: Mulberry/3.0.0b8 (Win32) X-wazaaa: True, true MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi I'm having a bit of difficulties with pthreads, lets explain : $ cat test.c #include "pthread.h" void * test (void* t) { while (1) { printf("pouet"); sleep(1); } } main () { pthread_t th; if (pthread_create(&th, NULL, test, NULL)) { perror("pthread_create"); exit(1); } if (pthread_detach(th)) { perror("pthread_detach"); exit(2); } exit(0); } $ gcc -pthread -D_REENTRANT -D_THREAD_SAFE test.c -o test $ ./test pthread_create: Cannot allocate memory I must be doing something stupid, but I cannot really find what... -- Mathieu Arnold To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message