From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 6 15:56:42 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 BEB7316A41F for ; Tue, 6 Sep 2005 15:56:42 +0000 (GMT) (envelope-from victor.cruceru@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id A99FB43D67 for ; Tue, 6 Sep 2005 15:56:35 +0000 (GMT) (envelope-from victor.cruceru@gmail.com) Received: by wproxy.gmail.com with SMTP id 37so1090104wra for ; Tue, 06 Sep 2005 08:56:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IgoDPpSmXH4GR3Cea0iG29qqwzzY6i0szjqs7mZ4WSjQyGfyMrjMJ492MSwVeupr/0Jf1gN9yOHyutTWX94mNt7EwGU5Pq/2F3CWNrW5mj9rJFuUg5CKOr++I/nVTWiLP/kJ2lF0ZbdokomIVSqCmhDAgO5sGvuO+4fH5lXzmdM= Received: by 10.54.56.77 with SMTP id e77mr4925081wra; Tue, 06 Sep 2005 08:56:29 -0700 (PDT) Received: by 10.54.91.20 with HTTP; Tue, 6 Sep 2005 08:56:16 -0700 (PDT) Message-ID: <494025505090608566b1c7bb0@mail.gmail.com> Date: Tue, 6 Sep 2005 18:56:16 +0300 From: victor cruceru To: erkan kolemen In-Reply-To: <20050906153451.86233.qmail@web33406.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050906153451.86233.qmail@web33406.mail.mud.yahoo.com> Cc: freebsd-hackers@freebsd.org Subject: Re: accept: Invalid argument X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: soc-victor@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2005 15:56:42 -0000 Did you call bind() and especially listen() before accept()? victor cruceru On 9/6/05, erkan kolemen wrote: > Hi, >=20 > In a daemon loop, i am using accept() to accept > incoming connections. >=20 > while(1) { > if((fd =3D accept(socketd, (struct sockaddr *) &addr, > &addrlen)) =3D=3D -1) { > syslog(LOG_ERR, "accept: %s", strerror(errno)); > continue; > } > else { > ... > } >=20 > accept always fails. What is wrong? i could create > socket and i got a positive integer value as socket > descriptor. following is from syslog: >=20 > Sep 6 17:20:50 devel pro[99227]: accept: Invalid > argument > Sep 6 17:21:20 devel last message repeated 204686 > times >=20 > What is wrong? i am calling accept before fork().. So > i don't think child process affecting parent process. >=20 > thanks and regards... >=20 > - erkan >=20 >=20 >=20 >=20 > ______________________________________________________ > Click here to donate to the Hurricane Katrina relief effort. > http://store.yahoo.com/redcross-donate3/ > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >