Subject: pkg/4610: mit-pthreads broken w.r.t. fstat and friends
To: None <gnats-bugs@gnats.netbsd.org>
From: Gary D. Duzan <gary@wheel.tiac.net>
List: netbsd-bugs
Date: 11/30/1997 12:50:22
>Number:         4610
>Category:       pkg
>Synopsis:       mit-pthreads broken w.r.t. fstat and friends
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 30 10:20:01 1997
>Last-Modified:
>Originator:     Gary D. Duzan
>Organization:
>Release:        Sun Nov 30 08:27:44 EST 1997
>Environment:
System: NetBSD wheel.tiac.net 1.3_ALPHA NetBSD 1.3_ALPHA (WHEEL) #0: Sat Nov 22 16:34:20 EST 1997 gary@wheel.tiac.net:/disk1/build/NetBSD/src/sys/arch/i386/compile/WHEEL i386


>Description:

   Under -current, mit-pthreads seems to be broken. In particular,
configure is failing to detect that NetBSD has the fstat, lstat,
and stat system calls. The absence of fstat appears first because
pthread libraries use machdep_sys_fstat internally, causing link
errors when using libpthread.a. The basic problem seems to be that
it expects SYS_fstat, when it really needs SYS___fstat13.

>How-To-Repeat:
   Build and link against /usr/pkg/pthread/*

>Fix:

At the moment I'm attempting to work around the problem by adding
__fstat13 and friends to pthreads_syscall_list in config/configure,
then adding bits of code of the form:

int machdep_sys_fstat(int fd, struct stat *buf)
{
	return(machdep_sys___fstat13(fd,buf));
}

So far (which is not very far, really) it seems to be working,
though I could hope for a more elegant solution.
>Audit-Trail:
>Unformatted: