From owner-freebsd-threads@FreeBSD.ORG Mon Jul 7 19:51:03 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D74A037B401 for ; Mon, 7 Jul 2003 19:51:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E87343FCB for ; Mon, 7 Jul 2003 19:51:03 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from davidw2k (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h682p0Up087595 for ; Mon, 7 Jul 2003 19:51:02 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <008201c344fc$392c0760$f001a8c0@davidw2k> From: "David Xu" To: Date: Tue, 8 Jul 2003 10:54:14 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Subject: Re: ttyname_r X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2003 02:51:04 -0000 I found our ttyname_r has different return type than POSIX: http://www.opengroup.org/onlinepubs/007904975/functions/ttyname.html and POSIX says: If successful, the ttyname_r() function shall return zero. Otherwise, an error number shall be returned to indicate the error. libc implements it as following format: char * ttyname_r(int fd, char *buf, size_t len); and when success, it returns non-NULL pointer, it almost has opposite meaning with POSIX. This causes some pthread tests failed here. David Xu