From owner-freebsd-hackers Sun Dec 26 5:29:22 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.erlangen.netsurf.de (erlangen.netsurf.de [194.163.170.1]) by hub.freebsd.org (Postfix) with ESMTP id EF79B14EF4 for ; Sun, 26 Dec 1999 05:29:16 -0800 (PST) (envelope-from d_f0rce@gmx.de) Received: from blade (user-er-u1.erlangen.netsurf.de [194.163.170.161]) by mail.erlangen.netsurf.de (8.9.3/8.9.3) with SMTP id OAA32868 for ; Sun, 26 Dec 1999 14:29:05 +0100 (CET) Message-ID: <000c01bf4fa5$44bf5050$0201a8c0@blade> From: "Steffen Merkel" To: Subject: Posix Threads Date: Sun, 26 Dec 1999 14:23:40 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I'm learning C now for some weeks and today I wanted to program POSIX threads. Unfortunately my source seems not to run. Could you please have a look at my code and tell me whats wrong: #include #include #include void print( char *string ){ fprintf(stderr,"String: %s\n",string); } void main(void){ pthread_t thread; char string[] = "Hallo"; if( pthread_create( &thread, (const pthread_attr_t *)NULL, (void *)&print, &string ) != 0 ){ perror("pthread_create()"); exit(EXIT_FAILURE); } } I compiled this source with: gcc -pthreads -o pthread pthread.c Please reply to me directly, as I'm not subscribed to freebsd-hackers. Thanks in advance, Steffen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message