[773] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

pthreads on FreeBSD

daemon@ATHENA.MIT.EDU (Alan Batie)
Wed Jun 3 19:12:00 1998

Date: Wed, 3 Jun 1998 16:05:40 -0700
From: Alan Batie <batie@aahz.jf.intel.com>
To: pthreads@MIT.EDU


--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Platform: FreeBSD 2.2.2-RELEASE and 3.0-971225-SNAP
Pthreads 1.8.8

I've just gotten basically my first threads program working, after
several days of exploring the kernel and the thread library to find out
who was trashing my buffer.  It turns out that the recvmsg routine in
pthreads/fd_kern.c uses the old msg structure and FreeBSD is using a
new one (probably a 4.4-ism).  I'm not really sure *what* pthread's
trying to do --- the old message structure had something about access
rights, but the fd_kern module was playing funny games with file
descriptors in there.  Anyway, I commented that whole block out and my
program started working.

Also, there are a number of function declarations missing in the include
files (I don't have time to fill them in right now, unfortunately, trying
to meet a deadline, etc), and to build on 3.0, I had to clone the 2.0
config files and change the 2.0's to 3.0's.  Seems to work, but...

For what it's worth, here's a quick patch showing exactly what I commented
out:


*** fd_kern.c.org       Wed Jun  3 13:42:09 1998
--- fd_kern.c   Wed Jun  3 15:37:16 1998
***************
*** 1696,1701 ****
--- 1696,1702 ----
      }
      fd_unlock(fd, FD_READ);
 =20
+ #ifdef USE_OLD_MSG_STRUCT
      /* Handle getting the real file descriptor */
      for (i =3D 0; i < (((struct omsghdr *)msg)->msg_accrightslen / sizeof=
(i));
         i++) {
***************
*** 1724,1729 ****
--- 1725,1731 ----
        break;
        }
      }
+ #endif /*  USE_OLD_MSG_STRUCT  */
    }
    return(ret);
  }

--=20
Alan Batie                     ------        What goes up, must come down.
batie@aahz.jf.intel.com        \    /        Ask any system administrator.
+1 503-264-8844 (voice)         \  /         --unknown
D0 D2 39 0E 02 34 D6 B4          \/          5A 41 21 8F 23 5F 08 9D

--wRRV7LY7NUeQGEoC
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNXXWxBCfrckvDwdpAQEOwAP/ehKzlWurcjUuWK96xLW64qa++YSTeVUq
qolOGtUjYecIq6OMLBH6pj2CHdm3w3QlsMwUCST56LqTUj1WejYDOSReWkITx37I
SUosjadDkLtrJTPPjX16sZP5eFvX8sY9Ha1eiApyB5K2ZPStj5ExhLvaPQQSsITk
RAkBcV6SBMk=
=Exxy
-----END PGP SIGNATURE-----

--wRRV7LY7NUeQGEoC--

home help back first fref pref prev next nref lref last post