From owner-freebsd-hackers Fri Oct 5 1:31:42 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id 870C737B40B; Fri, 5 Oct 2001 01:31:35 -0700 (PDT) Received: from mindspring.com (dialup-209.247.136.36.Dial1.SanJose1.Level3.net [209.247.136.36]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id BAA06264; Fri, 5 Oct 2001 01:31:29 -0700 (PDT) Message-ID: <3BBD7013.997C025B@mindspring.com> Date: Fri, 05 Oct 2001 01:32:19 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Oleg Golovanov Cc: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Question about pthread References: <3BBB77A7.5C4B129E@home.krasnoyarsk.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Oleg Golovanov wrote: > > Dear Sirs: > > I am using FreeBSD-2.2.8 and after calling pthread_create() > my programs get sigfault (SIGSEGV) and exited with core dump. > > I should like to ask if somebody know the solve of this problem. > My example of using pthread is included below. > > I ask to answer me directly on my e-mail. [ ... ] > pthread_create(NULL, NULL, &coms, confd); 2.2.8 is a pre draft 4 standard pthreads implementation. void coms( void *confdp) { int confd = *(int *)confdp; ... } main() { pthread_t id; /* REQUIRED */ ... /* Note: "coms", _NOT_ "&coms"... */ pthread_create( &id, NULL, coms, (void *)&confd); ... } -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message