From owner-freebsd-threads@FreeBSD.ORG Mon Mar 9 05:11:05 2009 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F014A1065674; Mon, 9 Mar 2009 05:11:05 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DC9878FC0C; Mon, 9 Mar 2009 05:11:05 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n295B4mK065635; Mon, 9 Mar 2009 05:11:04 GMT (envelope-from davidxu@freebsd.org) Message-ID: <49B4A571.7000302@freebsd.org> Date: Mon, 09 Mar 2009 13:13:21 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Daniel Eischen References: <49B480F7.8040800@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: threads@freebsd.org, Pawel Worach Subject: Re: libthr does not obey WITHOUT_SYSCALL_COMPAT X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2009 05:11:06 -0000 Daniel Eischen wrote: > On Mon, 9 Mar 2009, David Xu wrote: > >> Pawel Worach wrote: >>> Hi, >>> >>> If libc is built using WITHOUT_SYSCALL_COMPAT applications linked with >>> libthr end up having unresolved symbols since libthr references >>> __fcntl_compat unconditionally. >>> Here is a patch to make libthr also obey WITHOUT_SYSCALL_COMPAT >>> http://www.vlakno.cz/~pwo/libthr.diff >>> >>> Regards >> >> Committed! > > I never got around to replying to this... > > I don't quite understand why __fcntl_compat is there. We have > F_GETFD, F_SETFD, F_DUPFD, F_DUP2FD, F_GETFL, F_SETFL, F_GETOWN, > and F_SETOWN according to fcntl(2). But thr_syscalls.c only > handles F_DUPFD, F_SETFD, F_SETFL, F_GETFD, and F_GETFL, leaving > F_DUP2FD, F_GETOWN, and F_SETOWN to be handled by the default > case. And the default case does nothing now if WITHOUT_SYSCALL_COMPAT > is defined. So how do F_DUP2FD, F_GETOWN, and F_SETOWN get > handled? > > Do we really need to call __sys_fcntl_compat() from libthr? > When did the ABI change, before or after libc.so.7? > I don't know when it appeared. Would this patch eliminate the shit ? Index: thr_syscalls.c =================================================================== --- thr_syscalls.c (revision 189549) +++ thr_syscalls.c (working copy) @@ -258,7 +258,7 @@ #ifdef SYSCALL_COMPAT ret = __fcntl_compat(fd, cmd, va_arg(ap, void *)); #else - ret = EOPNOTSUPP; + ret = __sys_fcntl(fd, cmd, va_arg(ap, void *)); #endif } va_end(ap);