1 --- telldir.c.orig 2003-05-20 15:21:03.000000000 -0700
2 +++ telldir.c 2004-11-19 17:18:44.000000000 -0800
4 * cookie may be used only once before it is freed. This option
5 * is used to avoid having memory usage grow without bound.
9 +#endif /* !__DARWIN_UNIX03 */
12 * return a pointer into a directory
19 + _pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
20 + LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) {
21 + if ((lp->loc_seek == dirp->dd_seek) &&
22 + (lp->loc_loc == dirp->dd_loc))
25 + if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL) {
27 + _pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
30 +#else /* !__DARWIN_UNIX03 */
31 if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL)
34 _pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
35 +#endif /* __DARWIN_UNIX03 */
36 lp->loc_index = dirp->dd_td->td_loccnt++;
37 lp->loc_seek = dirp->dd_seek;
38 lp->loc_loc = dirp->dd_loc;
39 LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe);
42 +#endif /* __DARWIN_UNIX03 */
44 _pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
45 return (lp->loc_index);
53 LIST_REMOVE(lp, loc_lqe);
58 +#ifndef BUILDING_VARIANT
60 * Reclaim memory for telldir cookies which weren't used.
64 LIST_INIT(&dirp->dd_td->td_locq);
66 +#endif /* !BUILDING_VARIANT */