head	1.104;
access;
symbols
	netbsd-11-0-RC4:1.100.2.1
	netbsd-11-0-RC3:1.100.2.1
	netbsd-11-0-RC2:1.100.2.1
	netbsd-11-0-RC1:1.100.2.1
	perseant-exfatfs-base-20250801:1.100
	netbsd-11:1.100.0.2
	netbsd-11-base:1.100
	netbsd-10-1-RELEASE:1.96.8.1
	perseant-exfatfs-base-20240630:1.98
	perseant-exfatfs:1.98.0.2
	perseant-exfatfs-base:1.98
	netbsd-8-3-RELEASE:1.87
	netbsd-9-4-RELEASE:1.94.2.1
	netbsd-10-0-RELEASE:1.96
	netbsd-10-0-RC6:1.96
	netbsd-10-0-RC5:1.96
	netbsd-10-0-RC4:1.96
	netbsd-10-0-RC3:1.96
	netbsd-10-0-RC2:1.96
	netbsd-10-0-RC1:1.96
	netbsd-10:1.96.0.8
	netbsd-10-base:1.96
	netbsd-9-3-RELEASE:1.94.2.1
	cjep_sun2x-base1:1.96
	cjep_sun2x:1.96.0.6
	cjep_sun2x-base:1.96
	cjep_staticlib_x-base1:1.96
	netbsd-9-2-RELEASE:1.94.2.1
	cjep_staticlib_x:1.96.0.4
	cjep_staticlib_x-base:1.96
	netbsd-9-1-RELEASE:1.94.2.1
	phil-wifi-20200421:1.96
	phil-wifi-20200411:1.96
	is-mlppp:1.96.0.2
	is-mlppp-base:1.96
	phil-wifi-20200406:1.96
	netbsd-8-2-RELEASE:1.87
	netbsd-9-0-RELEASE:1.94.2.1
	netbsd-9-0-RC2:1.94.2.1
	netbsd-9-0-RC1:1.94.2.1
	phil-wifi-20191119:1.96
	netbsd-9:1.94.0.2
	netbsd-9-base:1.94
	phil-wifi-20190609:1.94
	netbsd-8-1-RELEASE:1.87
	netbsd-8-1-RC1:1.87
	pgoyette-compat-merge-20190127:1.88.2.1
	pgoyette-compat-20190127:1.90
	pgoyette-compat-20190118:1.90
	pgoyette-compat-1226:1.90
	pgoyette-compat-1126:1.90
	pgoyette-compat-1020:1.90
	pgoyette-compat-0930:1.90
	pgoyette-compat-0906:1.90
	netbsd-7-2-RELEASE:1.84
	pgoyette-compat-0728:1.90
	netbsd-8-0-RELEASE:1.87
	phil-wifi:1.90.0.2
	phil-wifi-base:1.90
	pgoyette-compat-0625:1.90
	netbsd-8-0-RC2:1.87
	pgoyette-compat-0521:1.88
	pgoyette-compat-0502:1.88
	pgoyette-compat-0422:1.88
	netbsd-8-0-RC1:1.87
	pgoyette-compat-0415:1.88
	pgoyette-compat-0407:1.88
	pgoyette-compat-0330:1.88
	pgoyette-compat-0322:1.88
	pgoyette-compat-0315:1.88
	netbsd-7-1-2-RELEASE:1.84
	pgoyette-compat:1.88.0.2
	pgoyette-compat-base:1.88
	netbsd-7-1-1-RELEASE:1.84
	matt-nb8-mediatek:1.87.0.12
	matt-nb8-mediatek-base:1.87
	perseant-stdc-iso10646:1.87.0.10
	perseant-stdc-iso10646-base:1.87
	netbsd-8:1.87.0.8
	netbsd-8-base:1.87
	prg-localcount2-base3:1.87
	prg-localcount2-base2:1.87
	prg-localcount2-base1:1.87
	prg-localcount2:1.87.0.6
	prg-localcount2-base:1.87
	pgoyette-localcount-20170426:1.87
	bouyer-socketcan-base1:1.87
	pgoyette-localcount-20170320:1.87
	netbsd-7-1:1.84.0.8
	netbsd-7-1-RELEASE:1.84
	netbsd-7-1-RC2:1.84
	netbsd-7-nhusb-base-20170116:1.84
	bouyer-socketcan:1.87.0.4
	bouyer-socketcan-base:1.87
	pgoyette-localcount-20170107:1.87
	netbsd-7-1-RC1:1.84
	pgoyette-localcount-20161104:1.87
	netbsd-7-0-2-RELEASE:1.84
	localcount-20160914:1.87
	netbsd-7-nhusb:1.84.0.6
	netbsd-7-nhusb-base:1.84
	pgoyette-localcount-20160806:1.87
	pgoyette-localcount-20160726:1.87
	pgoyette-localcount:1.87.0.2
	pgoyette-localcount-base:1.87
	netbsd-7-0-1-RELEASE:1.84
	netbsd-7-0:1.84.0.4
	netbsd-7-0-RELEASE:1.84
	netbsd-7-0-RC3:1.84
	netbsd-7-0-RC2:1.84
	netbsd-7-0-RC1:1.84
	netbsd-5-2-3-RELEASE:1.55
	netbsd-5-1-5-RELEASE:1.55
	netbsd-6-0-6-RELEASE:1.73
	netbsd-6-1-5-RELEASE:1.73.2.1
	netbsd-7:1.84.0.2
	netbsd-7-base:1.84
	yamt-pagecache-base9:1.83
	yamt-pagecache-tag8:1.72.2.2
	netbsd-6-1-4-RELEASE:1.73.2.1
	netbsd-6-0-5-RELEASE:1.73
	tls-earlyentropy:1.83.0.2
	tls-earlyentropy-base:1.83
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.83
	riastradh-drm2-base3:1.83
	netbsd-6-1-3-RELEASE:1.73.2.1
	netbsd-6-0-4-RELEASE:1.73
	netbsd-5-2-2-RELEASE:1.55
	netbsd-5-1-4-RELEASE:1.55
	netbsd-6-1-2-RELEASE:1.73.2.1
	netbsd-6-0-3-RELEASE:1.73
	netbsd-5-2-1-RELEASE:1.55
	netbsd-5-1-3-RELEASE:1.55
	netbsd-6-1-1-RELEASE:1.73.2.1
	riastradh-drm2-base2:1.80
	riastradh-drm2-base1:1.80
	riastradh-drm2:1.80.0.4
	riastradh-drm2-base:1.80
	netbsd-6-1:1.73.2.1.0.2
	netbsd-6-0-2-RELEASE:1.73
	netbsd-6-1-RELEASE:1.73.2.1
	netbsd-6-1-RC4:1.73.2.1
	netbsd-6-1-RC3:1.73
	agc-symver:1.80.0.2
	agc-symver-base:1.80
	netbsd-6-1-RC2:1.73
	netbsd-6-1-RC1:1.73
	yamt-pagecache-base8:1.77
	netbsd-5-2:1.55.0.16
	netbsd-6-0-1-RELEASE:1.73
	yamt-pagecache-base7:1.77
	netbsd-5-2-RELEASE:1.55
	netbsd-5-2-RC1:1.55
	matt-nb6-plus-nbase:1.73
	yamt-pagecache-base6:1.77
	netbsd-6-0:1.73.0.6
	netbsd-6-0-RELEASE:1.73
	netbsd-6-0-RC2:1.73
	tls-maxphys:1.77.0.2
	tls-maxphys-base:1.84
	matt-nb6-plus:1.73.0.4
	matt-nb6-plus-base:1.73
	netbsd-6-0-RC1:1.73
	yamt-pagecache-base5:1.76
	yamt-pagecache-base4:1.76
	netbsd-6:1.73.0.2
	netbsd-6-base:1.73
	netbsd-5-1-2-RELEASE:1.55
	netbsd-5-1-1-RELEASE:1.55
	yamt-pagecache-base3:1.72
	yamt-pagecache-base2:1.72
	yamt-pagecache:1.72.0.2
	yamt-pagecache-base:1.72
	cherry-xenmp:1.71.0.4
	cherry-xenmp-base:1.71
	bouyer-quota2-nbase:1.71
	bouyer-quota2:1.71.0.2
	bouyer-quota2-base:1.71
	matt-mips64-premerge-20101231:1.71
	matt-nb5-mips64-premerge-20101231:1.55
	matt-nb5-pq3:1.55.0.14
	matt-nb5-pq3-base:1.55
	netbsd-5-1:1.55.0.12
	PROVOS:1.1.1
	netbsd-5-1-RELEASE:1.55
	netbsd-5-1-RC4:1.55
	matt-nb5-mips64-k15:1.55
	netbsd-5-1-RC3:1.55
	netbsd-5-1-RC2:1.55
	netbsd-5-1-RC1:1.55
	netbsd-5-0-2-RELEASE:1.55
	matt-nb5-mips64-premerge-20091211:1.55
	matt-premerge-20091211:1.56
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.55
	matt-nb4-mips64-k7-u2a-k9b:1.55
	matt-nb5-mips64-u1-k1-k5:1.55
	matt-nb5-mips64:1.55.0.10
	netbsd-5-0-1-RELEASE:1.55
	jym-xensuspend-nbase:1.55
	netbsd-5-0:1.55.0.8
	netbsd-5-0-RELEASE:1.55
	netbsd-5-0-RC4:1.55
	netbsd-5-0-RC3:1.55
	netbsd-5-0-RC2:1.55
	jym-xensuspend:1.55.0.6
	jym-xensuspend-base:1.55
	netbsd-5-0-RC1:1.55
	christos-time_t-nbase:1.55
	christos-time_t:1.55.0.4
	christos-time_t-base:1.55
	netbsd-5:1.55.0.2
	netbsd-5-base:1.55
	matt-mips64-base2:1.54
	matt-mips64:1.40.0.6
	netbsd-4-0-1-RELEASE:1.35
	wrstuden-revivesa-base-3:1.52
	wrstuden-revivesa-base-2:1.52
	wrstuden-fixsa-newbase:1.35
	wrstuden-revivesa-base-1:1.52
	yamt-pf42-base4:1.52
	yamt-pf42-base3:1.51
	hpcarm-cleanup-nbase:1.51
	yamt-pf42-baseX:1.51
	yamt-pf42-base2:1.51
	wrstuden-revivesa:1.51.0.4
	wrstuden-revivesa-base:1.52
	yamt-pf42:1.51.0.2
	yamt-pf42-base:1.51
	keiichi-mipv6:1.50.0.2
	keiichi-mipv6-base:1.51
	matt-armv6-nbase:1.51
	matt-armv6-prevmlocking:1.42.2.1
	wrstuden-fixsa-base-1:1.35
	netbsd-4-0:1.35.0.8
	netbsd-4-0-RELEASE:1.35
	cube-autoconf:1.47.0.2
	cube-autoconf-base:1.47
	netbsd-4-0-RC5:1.35
	netbsd-4-0-RC4:1.35
	netbsd-4-0-RC3:1.35
	netbsd-4-0-RC2:1.35
	nick-csl-alignment-base5:1.43
	nick-csl-alignment-base4:1.42
	netbsd-4-0-RC1:1.35
	matt-armv6:1.42.0.2
	matt-armv6-base:1.48
	nick-csl-alignment-base3:1.42
	nick-csl-alignment-base2:1.40
	matt-mips64-base:1.40
	hpcarm-cleanup:1.40.0.4
	hpcarm-cleanup-base:1.50
	nick-csl-alignment:1.40.0.2
	nick-csl-alignment-base:1.40
	netbsd-3-1-1-RELEASE:1.30.2.2
	netbsd-3-0-3-RELEASE:1.30.2.2
	wrstuden-fixsa:1.35.0.6
	wrstuden-fixsa-base:1.35
	abandoned-netbsd-4-base:1.35
	abandoned-netbsd-4:1.35.0.2
	netbsd-3-1:1.30.2.2.0.4
	netbsd-3-1-RELEASE:1.30.2.2
	netbsd-3-0-2-RELEASE:1.30.2.2
	netbsd-3-1-RC4:1.30.2.2
	netbsd-3-1-RC3:1.30.2.2
	netbsd-3-1-RC2:1.30.2.2
	netbsd-3-1-RC1:1.30.2.2
	netbsd-4:1.35.0.4
	netbsd-4-base:1.35
	netbsd-3-0-1-RELEASE:1.30.2.2
	netbsd-3-0:1.30.2.2.0.2
	netbsd-3-0-RELEASE:1.30.2.2
	netbsd-3-0-RC6:1.30.2.2
	netbsd-3-0-RC5:1.30.2.2
	netbsd-3-0-RC4:1.30.2.2
	netbsd-3-0-RC3:1.30.2.2
	netbsd-3-0-RC2:1.30.2.2
	netbsd-3-0-RC1:1.30.2.2
	netbsd-2-0-3-RELEASE:1.25
	netbsd-2-1:1.25.4.1.0.2
	netbsd-2-1-RELEASE:1.25.4.1
	netbsd-2-1-RC6:1.25.4.1
	netbsd-2-1-RC5:1.25.4.1
	netbsd-2-1-RC4:1.25.4.1
	netbsd-2-1-RC3:1.25.4.1
	netbsd-2-1-RC2:1.25.4.1
	netbsd-2-1-RC1:1.25.4.1
	netbsd-2-0-2-RELEASE:1.25
	netbsd-3:1.30.0.2
	netbsd-3-base:1.30
	netbsd-2-0-1-RELEASE:1.25
	netbsd-2:1.25.0.4
	netbsd-2-base:1.25
	netbsd-2-0-RELEASE:1.25
	netbsd-2-0-RC5:1.25
	netbsd-2-0-RC4:1.25
	netbsd-2-0-RC3:1.25
	netbsd-2-0-RC2:1.25
	netbsd-2-0-RC1:1.25
	netbsd-2-0:1.25.0.2
	netbsd-2-0-base:1.25
	nathanw_sa_end:1.8.2.21
	nathanw_sa_before_merge:1.8
	nathanw_sa:1.8.0.2
	netbsd-1-2-PATCH001:1.7
	netbsd-1-2-RELEASE:1.7
	netbsd-1-2-BETA:1.7
	netbsd-1-2:1.7.0.8
	netbsd-1-2-base:1.7
	netbsd-1-1-PATCH001:1.7
	netbsd-1-1-RELEASE:1.7
	netbsd-1-1:1.7.0.4
	netbsd-1-1-base:1.7
	netbsd-1-0-PATCH06:1.7
	netbsd-1-0-PATCH05:1.7
	netbsd-1-0-PATCH04:1.7
	netbsd-1-0-PATCH03:1.7
	netbsd-1-0-PATCH02:1.7
	netbsd-1-0-PATCH1:1.7
	netbsd-1-0-PATCH0:1.7
	netbsd-1-0-RELEASE:1.7
	netbsd-1-0:1.7.0.2
	netbsd-1-0-base:1.7
	proven:1.1.1.1;
locks; strict;
comment	@# @;


1.104
date	2026.05.01.11.00.21;	author wiz;	state Exp;
branches;
next	1.103;
commitid	H5M6p9ZXBn1mk6EG;

1.103
date	2025.11.23.22.11.41;	author riastradh;	state Exp;
branches;
next	1.102;
commitid	sJ27FLJIN6vN9JjG;

1.102
date	2025.10.27.16.29.15;	author christos;	state Exp;
branches;
next	1.101;
commitid	7ln6hKuChcR28egG;

1.101
date	2025.10.26.20.48.28;	author christos;	state Exp;
branches;
next	1.100;
commitid	U0QR1DhNshttA7gG;

1.100
date	2025.04.07.16.07.05;	author rillig;	state Exp;
branches
	1.100.2.1;
next	1.99;
commitid	DnwXMne9FyE0x8QF;

1.99
date	2024.11.22.15.51.34;	author riastradh;	state Exp;
branches;
next	1.98;
commitid	VI7h249aKEMMOEyF;

1.98
date	2023.09.14.03.17.02;	author rin;	state Exp;
branches
	1.98.2.1;
next	1.97;
commitid	iu8H8FN5J9EECGEE;

1.97
date	2023.07.14.23.28.01;	author lukem;	state Exp;
branches;
next	1.96;
commitid	mAb2GaO5VL1RjPwE;

1.96
date	2019.11.11.22.45.27;	author joerg;	state Exp;
branches
	1.96.8.1;
next	1.95;
commitid	IMynySmLyNzibuKB;

1.95
date	2019.09.22.18.45.20;	author brad;	state Exp;
branches;
next	1.94;
commitid	jgzIBTWlcjibr2EB;

1.94
date	2019.05.07.18.45.37;	author maya;	state Exp;
branches
	1.94.2.1;
next	1.93;
commitid	E5Rk3vuyxS0WTimB;

1.93
date	2019.05.07.18.12.53;	author maya;	state Exp;
branches;
next	1.92;
commitid	Jp6KT8VCocQpGimB;

1.92
date	2019.04.24.11.43.19;	author kamil;	state Exp;
branches;
next	1.91;
commitid	57svUzWvgJpPPAkB;

1.91
date	2019.02.03.03.20.24;	author thorpej;	state Exp;
branches;
next	1.90;
commitid	3nk41B7ZKcMyLgaB;

1.90
date	2018.06.09.23.45.56;	author christos;	state Exp;
branches
	1.90.2.1;
next	1.89;
commitid	og8aDCWCo3vJeFFA;

1.89
date	2018.06.09.22.41.55;	author christos;	state Exp;
branches;
next	1.88;
commitid	Bb4e4iWyjlyISEFA;

1.88
date	2018.02.25.18.51.18;	author chs;	state Exp;
branches
	1.88.2.1;
next	1.87;
commitid	eocIuc0y8QSWWgsA;

1.87
date	2016.07.03.14.24.58;	author christos;	state Exp;
branches;
next	1.86;
commitid	k9tYpImPbpiGOScz;

1.86
date	2016.04.23.23.12.19;	author christos;	state Exp;
branches;
next	1.85;
commitid	ZONFxyfIjJKE1O3z;

1.85
date	2014.12.16.20.05.54;	author pooka;	state Exp;
branches;
next	1.84;
commitid	LoRZzedFe3YfRi2y;

1.84
date	2014.08.10.23.25.49;	author matt;	state Exp;
branches;
next	1.83;
commitid	nUOYsVLDom8Q5SLx;

1.83
date	2013.10.09.22.33.41;	author matt;	state Exp;
branches;
next	1.82;
commitid	WR37W1zugLHOBF8x;

1.82
date	2013.08.15.22.38.24;	author matt;	state Exp;
branches;
next	1.81;
commitid	fI9uvdcJ0i63pB1x;

1.81
date	2013.08.12.17.15.46;	author joerg;	state Exp;
branches;
next	1.80;
commitid	blZzZx7cWv4iIb1x;

1.80
date	2013.03.21.16.49.11;	author christos;	state Exp;
branches;
next	1.79;

1.79
date	2013.02.25.17.04.46;	author apb;	state Exp;
branches;
next	1.78;

1.78
date	2013.01.31.20.57.58;	author riastradh;	state Exp;
branches;
next	1.77;

1.77
date	2012.08.04.15.13.09;	author matt;	state Exp;
branches
	1.77.2.1;
next	1.76;

1.76
date	2012.04.04.10.59.46;	author joerg;	state Exp;
branches;
next	1.75;

1.75
date	2012.03.21.05.37.43;	author matt;	state Exp;
branches;
next	1.74;

1.74
date	2012.03.12.21.35.10;	author joerg;	state Exp;
branches;
next	1.73;

1.73
date	2011.11.10.14.01.11;	author yamt;	state Exp;
branches
	1.73.2.1;
next	1.72;

1.72
date	2011.08.16.10.36.30;	author christos;	state Exp;
branches
	1.72.2.1;
next	1.71;

1.71
date	2010.12.24.12.41.42;	author skrll;	state Exp;
branches;
next	1.70;

1.70
date	2010.08.06.05.35.42;	author christos;	state Exp;
branches;
next	1.69;

1.69
date	2010.07.09.08.22.04;	author jruoho;	state Exp;
branches;
next	1.68;

1.68
date	2010.07.09.07.31.01;	author jruoho;	state Exp;
branches;
next	1.67;

1.67
date	2010.07.08.22.19.26;	author jruoho;	state Exp;
branches;
next	1.66;

1.66
date	2010.07.08.19.20.16;	author rmind;	state Exp;
branches;
next	1.65;

1.65
date	2010.07.07.16.22.30;	author jruoho;	state Exp;
branches;
next	1.64;

1.64
date	2010.07.07.16.04.19;	author jruoho;	state Exp;
branches;
next	1.63;

1.63
date	2010.07.07.15.30.32;	author jruoho;	state Exp;
branches;
next	1.62;

1.62
date	2010.07.07.13.04.20;	author jruoho;	state Exp;
branches;
next	1.61;

1.61
date	2010.07.07.11.04.54;	author jruoho;	state Exp;
branches;
next	1.60;

1.60
date	2010.07.07.08.57.36;	author jruoho;	state Exp;
branches;
next	1.59;

1.59
date	2010.07.07.08.22.53;	author jruoho;	state Exp;
branches;
next	1.58;

1.58
date	2010.07.06.21.36.34;	author jruoho;	state Exp;
branches;
next	1.57;

1.57
date	2010.05.19.20.04.43;	author jruoho;	state Exp;
branches;
next	1.56;

1.56
date	2009.05.16.22.21.18;	author ad;	state Exp;
branches;
next	1.55;

1.55
date	2008.10.26.00.00.27;	author mrg;	state Exp;
branches
	1.55.4.1;
next	1.54;

1.54
date	2008.10.08.08.27.07;	author ad;	state Exp;
branches;
next	1.53;

1.53
date	2008.09.29.08.48.15;	author ad;	state Exp;
branches;
next	1.52;

1.52
date	2008.06.16.14.25.49;	author rmind;	state Exp;
branches;
next	1.51;

1.51
date	2008.03.10.14.47.06;	author rmind;	state Exp;
branches
	1.51.2.1
	1.51.4.1;
next	1.50;

1.50
date	2008.02.10.18.50.54;	author ad;	state Exp;
branches
	1.50.2.1;
next	1.49;

1.49
date	2008.01.15.03.37.14;	author rmind;	state Exp;
branches;
next	1.48;

1.48
date	2007.12.14.21.51.21;	author yamt;	state Exp;
branches;
next	1.47;

1.47
date	2007.11.19.15.14.11;	author ad;	state Exp;
branches;
next	1.46;

1.46
date	2007.11.13.17.20.08;	author ad;	state Exp;
branches;
next	1.45;

1.45
date	2007.10.13.20.36.43;	author jnemeth;	state Exp;
branches;
next	1.44;

1.44
date	2007.10.04.21.08.35;	author ad;	state Exp;
branches;
next	1.43;

1.43
date	2007.09.07.14.09.27;	author ad;	state Exp;
branches;
next	1.42;

1.42
date	2007.08.16.13.54.16;	author ad;	state Exp;
branches
	1.42.2.1;
next	1.41;

1.41
date	2007.08.16.01.09.34;	author ad;	state Exp;
branches;
next	1.40;

1.40
date	2007.03.02.18.53.51;	author ad;	state Exp;
branches
	1.40.2.1;
next	1.39;

1.39
date	2007.02.09.22.08.48;	author ad;	state Exp;
branches;
next	1.38;

1.38
date	2007.01.20.04.56.25;	author christos;	state Exp;
branches;
next	1.37;

1.37
date	2006.12.24.18.39.45;	author ad;	state Exp;
branches;
next	1.36;

1.36
date	2006.12.23.05.14.46;	author ad;	state Exp;
branches;
next	1.35;

1.35
date	2005.12.13.22.07.20;	author christos;	state Exp;
branches;
next	1.34;

1.34
date	2005.09.13.02.45.38;	author christos;	state Exp;
branches;
next	1.33;

1.33
date	2005.06.17.18.37.24;	author peter;	state Exp;
branches;
next	1.32;

1.32
date	2005.06.17.18.23.19;	author peter;	state Exp;
branches;
next	1.31;

1.31
date	2005.05.30.16.02.56;	author thorpej;	state Exp;
branches;
next	1.30;

1.30
date	2005.02.03.17.30.33;	author christos;	state Exp;
branches
	1.30.2.1;
next	1.29;

1.29
date	2004.12.14.01.47.13;	author yamt;	state Exp;
branches;
next	1.28;

1.28
date	2004.12.10.16.40.40;	author nathanw;	state Exp;
branches;
next	1.27;

1.27
date	2004.06.02.14.07.07;	author pooka;	state Exp;
branches;
next	1.26;

1.26
date	2004.05.21.03.40.51;	author christos;	state Exp;
branches;
next	1.25;

1.25
date	2004.01.02.01.37.53;	author lukem;	state Exp;
branches
	1.25.4.1;
next	1.24;

1.24
date	2003.11.27.16.30.54;	author cl;	state Exp;
branches;
next	1.23;

1.23
date	2003.11.12.02.44.22;	author christos;	state Exp;
branches;
next	1.22;

1.22
date	2003.10.26.07.25.34;	author lukem;	state Exp;
branches;
next	1.21;

1.21
date	2003.08.13.18.52.01;	author nathanw;	state Exp;
branches;
next	1.20;

1.20
date	2003.08.01.17.03.59;	author lukem;	state Exp;
branches;
next	1.19;

1.19
date	2003.07.24.07.50.24;	author wiz;	state Exp;
branches;
next	1.18;

1.18
date	2003.07.18.22.33.45;	author nathanw;	state Exp;
branches;
next	1.17;

1.17
date	2003.06.03.21.34.00;	author nathanw;	state Exp;
branches;
next	1.16;

1.16
date	2003.03.10.22.16.36;	author nathanw;	state Exp;
branches;
next	1.15;

1.15
date	2003.02.28.18.37.44;	author nathanw;	state Exp;
branches;
next	1.14;

1.14
date	2003.02.15.22.15.50;	author nathanw;	state Exp;
branches;
next	1.13;

1.13
date	2003.01.24.01.53.27;	author thorpej;	state Exp;
branches;
next	1.12;

1.12
date	2003.01.21.02.24.41;	author christos;	state Exp;
branches;
next	1.11;

1.11
date	2003.01.20.20.10.19;	author christos;	state Exp;
branches;
next	1.10;

1.10
date	2003.01.19.19.55.13;	author thorpej;	state Exp;
branches;
next	1.9;

1.9
date	2003.01.18.10.34.14;	author thorpej;	state Exp;
branches;
next	1.8;

1.8
date	97.10.08.17.14.36;	author scottr;	state dead;
branches
	1.8.2.1;
next	1.7;

1.7
date	94.02.07.21.59.27;	author proven;	state Exp;
branches;
next	1.6;

1.6
date	93.11.22.19.37.48;	author proven;	state Exp;
branches;
next	1.5;

1.5
date	93.11.16.03.21.44;	author proven;	state Exp;
branches;
next	1.4;

1.4
date	93.11.15.11.11.00;	author cgd;	state Exp;
branches;
next	1.3;

1.3
date	93.11.15.10.02.18;	author proven;	state Exp;
branches;
next	1.2;

1.2
date	93.11.15.06.49.08;	author proven;	state Exp;
branches;
next	1.1;

1.1
date	93.11.14.22.06.21;	author proven;	state Exp;
branches
	1.1.1.1;
next	;

1.100.2.1
date	2025.11.29.16.08.01;	author martin;	state Exp;
branches;
next	;
commitid	32FbfPcwTbl5XskG;

1.98.2.1
date	2025.08.02.05.54.55;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;

1.96.8.1
date	2024.09.20.11.05.44;	author martin;	state Exp;
branches;
next	;
commitid	wBMosNEJq20igxqF;

1.94.2.1
date	2019.09.27.09.24.29;	author martin;	state Exp;
branches;
next	;
commitid	Sk8ki5IPAe9DcDEB;

1.90.2.1
date	2019.06.10.22.05.26;	author christos;	state Exp;
branches;
next	1.90.2.2;
commitid	jtc8rnCzWiEEHGqB;

1.90.2.2
date	2020.04.13.08.03.15;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.88.2.1
date	2018.06.25.07.25.35;	author pgoyette;	state Exp;
branches;
next	;
commitid	8PtAu9af7VvhiDHA;

1.77.2.1
date	2013.02.25.00.27.59;	author tls;	state Exp;
branches;
next	1.77.2.2;

1.77.2.2
date	2013.06.23.06.21.08;	author tls;	state Exp;
branches;
next	1.77.2.3;
commitid	NYFFXRB0xCbrHHUw;

1.77.2.3
date	2014.08.20.00.02.20;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.73.2.1
date	2013.04.29.01.50.19;	author riz;	state Exp;
branches;
next	;

1.72.2.1
date	2012.04.17.00.05.30;	author yamt;	state Exp;
branches;
next	1.72.2.2;

1.72.2.2
date	2012.10.30.18.59.14;	author yamt;	state Exp;
branches;
next	1.72.2.3;

1.72.2.3
date	2014.05.22.11.36.59;	author yamt;	state Exp;
branches;
next	;
commitid	HJV5p3BoaVY5KwBx;

1.55.4.1
date	2008.10.26.00.00.27;	author mrg;	state dead;
branches;
next	1.55.4.2;

1.55.4.2
date	2008.10.26.00.00.28;	author mrg;	state Exp;
branches;
next	;

1.51.2.1
date	2008.06.17.09.13.39;	author yamt;	state Exp;
branches;
next	;

1.51.4.1
date	2008.06.23.04.29.53;	author wrstuden;	state Exp;
branches;
next	;

1.50.2.1
date	2008.03.24.07.14.45;	author keiichi;	state Exp;
branches;
next	;

1.42.2.1
date	2007.11.06.23.11.38;	author matt;	state Exp;
branches;
next	1.42.2.2;

1.42.2.2
date	2008.01.09.01.36.29;	author matt;	state Exp;
branches;
next	1.42.2.3;

1.42.2.3
date	2008.03.23.00.40.28;	author matt;	state Exp;
branches;
next	;

1.40.2.1
date	2007.09.03.10.14.13;	author skrll;	state Exp;
branches;
next	1.40.2.2;

1.40.2.2
date	2007.09.10.10.54.03;	author skrll;	state Exp;
branches;
next	;

1.30.2.1
date	2005.06.18.11.03.13;	author tron;	state Exp;
branches;
next	1.30.2.2;

1.30.2.2
date	2005.06.18.11.04.44;	author tron;	state Exp;
branches;
next	;

1.25.4.1
date	2005.06.21.22.38.33;	author riz;	state Exp;
branches;
next	;

1.8.2.1
date	2001.03.08.00.20.10;	author nathanw;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2001.07.13.02.10.35;	author nathanw;	state Exp;
branches;
next	1.8.2.3;

1.8.2.3
date	2001.07.13.21.53.40;	author nathanw;	state Exp;
branches;
next	1.8.2.4;

1.8.2.4
date	2001.07.17.20.22.40;	author nathanw;	state Exp;
branches;
next	1.8.2.5;

1.8.2.5
date	2001.07.25.21.24.12;	author nathanw;	state Exp;
branches;
next	1.8.2.6;

1.8.2.6
date	2001.07.25.23.56.54;	author nathanw;	state Exp;
branches;
next	1.8.2.7;

1.8.2.7
date	2001.08.08.16.39.33;	author nathanw;	state Exp;
branches;
next	1.8.2.8;

1.8.2.8
date	2001.09.06.19.11.53;	author nathanw;	state Exp;
branches;
next	1.8.2.9;

1.8.2.9
date	2001.11.16.18.09.26;	author thorpej;	state Exp;
branches;
next	1.8.2.10;

1.8.2.10
date	2002.01.28.19.02.35;	author nathanw;	state Exp;
branches;
next	1.8.2.11;

1.8.2.11
date	2002.04.04.00.39.41;	author nathanw;	state Exp;
branches;
next	1.8.2.12;

1.8.2.12
date	2002.04.11.02.53.09;	author nathanw;	state Exp;
branches;
next	1.8.2.13;

1.8.2.13
date	2002.04.11.18.54.16;	author thorpej;	state Exp;
branches;
next	1.8.2.14;

1.8.2.14
date	2002.05.02.16.49.24;	author nathanw;	state Exp;
branches;
next	1.8.2.15;

1.8.2.15
date	2002.05.03.18.50.49;	author nathanw;	state Exp;
branches;
next	1.8.2.16;

1.8.2.16
date	2002.08.14.18.41.50;	author nathanw;	state Exp;
branches;
next	1.8.2.17;

1.8.2.17
date	2002.10.07.01.23.07;	author thorpej;	state Exp;
branches;
next	1.8.2.18;

1.8.2.18
date	2002.10.07.02.17.37;	author thorpej;	state Exp;
branches;
next	1.8.2.19;

1.8.2.19
date	2002.10.28.00.06.09;	author nathanw;	state Exp;
branches;
next	1.8.2.20;

1.8.2.20
date	2003.01.07.17.25.35;	author thorpej;	state Exp;
branches;
next	1.8.2.21;

1.8.2.21
date	2003.01.08.19.34.21;	author thorpej;	state Exp;
branches;
next	;

1.1.1.1
date	93.11.14.22.06.22;	author proven;	state Exp;
branches;
next	;


desc
@@


1.104
log
@libpthread: add pthread_main_np(3)

Bump minor version of the shared library.

As proposed on current-users.
@
text
@#	$NetBSD: Makefile,v 1.103 2025/11/23 22:11:41 riastradh Exp $
#

NOSANITIZER=	# defined
WARNS?=	5
LIB=	pthread

.include <bsd.own.mk>

USE_SHLIBDIR=	yes

.if defined(PTHREAD_MACHINE_ARCH) && !empty(PTHREAD_MACHINE_ARCH) && \
    exists(${.CURDIR}/arch/${PTHREAD_MACHINE_ARCH})
ARCHSUBDIR=	${PTHREAD_MACHINE_ARCH}
.elif defined(PTHREAD_MACHINE_CPU) && !empty(PTHREAD_MACHINE_CPU) && \
    exists(${.CURDIR}/arch/${PTHREAD_MACHINE_CPU})
ARCHSUBDIR=	${PTHREAD_MACHINE_CPU}
.elif exists(${.CURDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR=	${MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_CPU})
ARCHSUBDIR=	${MACHINE_CPU}
.else
.BEGIN:
	@@echo "WARNING: no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
.endif

INCS=	pthread.h pthread_types.h pthread_queue.h
INCSDIR=/usr/include

.if defined(ARCHSUBDIR)

ARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
.PATH:	${ARCHDIR}

EXPSYM_SRCS+=	pthread_mi.expsym
.  if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa"
# PTHREAD__ASM_RASOPS
EXPSYM_SRCS+=	pthread_md.expsym
.  else
# !PTHREAD__ASM_RASOPS
# XXX These really shouldn't be exported.
EXPSYM_SRCS+=	pthread_ras.expsym
.  endif

LIB_EXPSYM=	pthread.expsym
pthread.expsym: ${EXPSYM_SRCS}
	${_MKTARGET_CREATE}
	LC_ALL=C sort -m ${.ALLSRC} >${.TARGET}.tmp && \
	${MV} ${.TARGET}.tmp ${.TARGET}
CLEANFILES+=	pthread.expsym pthread.expsym.tmp

CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC -D_REENTRANT
CPPFLAGS+=	-I${.CURDIR}/../libc/include
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__ -D__LIBC_THREAD_STUBS

# Since <pthread.h> is not used, allow declaring pthread_create and
# friends locally.
CWARNFLAGS.clang+=	-Wno-builtin-requires-header

# XXX: This crappy poke at libc's internals needs to be fixed.
CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CURDIR}/../libc

# providing alternative MI implementations for creating an lwp is
# possible by setting PTHREAD_MAKELWP.  Currently, alternatives are
# set by the rumprun software stacks (see https://github.com/rumpkernel/rumprun )
PTHREAD_MAKELWP?=	pthread_makelwp_netbsd.c

# Prevent unloading libpthread.
#
# libpthread provides strong definitions of some symbols defined weakly
# by libc, such as pthread_mutex_lock (actually __libc_mutex_lock under
# the hood), which are used in libraries that take locks for
# thread-safety -- this way, in non-threaded applications,
# pthread_mutex_lock is a cheap noop libc stub, while in threaded
# applications, it's a real libpthread operation.  If libpthread is
# dlopened, the symbol might be lazily resolved _after_ it is dlopened
# to point at libpthread; then it cannot be safely unloaded, because
# there's no way to roll back symbol resolution.
#
# PR lib/59784: dlopening and dlclosing libpthread is broken
#
LDADD+=		-Wl,-z,nodelete

#
# NOTE: When you create a new file for libpthread, make sure that pthread.c
# gets a reference to a symbol in that file.  Otherwise, Unix's stupid static
# library semantics will end up discarding potentially important objects.
#
SRCS=	pthread.c
SRCS+=	pthread_attr.c
SRCS+=	pthread_barrier.c
# used by rumprun-posix to work around symbol collisions
.if ${PTHREAD_CANCELSTUB:Uyes} != "no"
SRCS+=	pthread_cancelstub.c
.endif
SRCS+=	pthread_cond.c
SRCS+=	pthread_getcpuclockid.c
SRCS+=	pthread_lock.c
SRCS+=	${PTHREAD_MAKELWP}
SRCS+=	pthread_misc.c
SRCS+=	pthread_mutex.c
SRCS+=	pthread_once.c
SRCS+=	pthread_rwlock.c
SRCS+=	pthread_specific.c
SRCS+=	pthread_spin.c
SRCS+=	pthread_tsd.c
SRCS+=	res_state.c
.PATH: ${.CURDIR}/../librt
SRCS+=	sem.c
# Architecture-dependent files
.if exists(${ARCHDIR}/pthread_md.S)
SRCS+= pthread_md.S
.endif
.if exists(${ARCHDIR}/Makefile.inc)
.include "${ARCHDIR}/Makefile.inc"
.endif

# The PTHREAD__COMPAT flag builds a libpthread that can be dropped
# into a NetBSD 2/3/4 chroot with a NetBSD 5 or later kernel.
# This makes threading work in the chroot, no other modifications
# required.
#
.if defined(PTHREAD__COMPAT)
SRCS+=		pthread_compat.c
.PATH.c:	${.CURDIR}/../../common/lib/libc/arch/${ARCHSUBDIR}/atomic
.PATH.S:	${.CURDIR}/../../common/lib/libc/arch/${ARCHSUBDIR}/atomic
.PATH.c:	${.CURDIR}/../../common/lib/libc/atomic
.PATH.c:	${.CURDIR}/../libc/misc
.include "../../common/lib/libc/arch/${ARCHSUBDIR}/atomic/Makefile.inc"
.endif

ALIGN_FUNCTIONS=	${${ACTIVE_CC} == "gcc":? -falign-functions=32 :}

# The TSD routines are used in the implementation of profiling, and so
# can't be profiled themselves.
COPTS.pthread_specific.c+=	${ALIGN_FUNCTIONS}
pthread_specific.po: pthread_specific.o
	${_MKTARGET_CREATE}
	cp pthread_specific.o pthread_specific.po

COPTS.pthread.c += -Wno-stack-protector -Wno-format-nonliteral
COPTS.pthread_attr.c += -Wno-format-nonliteral

LINTFLAGS+=	-Ac11		# for _Atomic

MAN+=	affinity.3 pthread.3 \
	pthread_attr.3 \
	pthread_attr_get_np.3 \
	pthread_attr_getdetachstate.3 \
	pthread_attr_getguardsize.3 \
	pthread_attr_getinheritsched.3 \
	pthread_attr_getname_np.3 \
	pthread_attr_getschedparam.3 \
	pthread_attr_getscope.3 \
	pthread_attr_getstack.3 \
	pthread_attr_setcreatesuspend_np.3 \
	pthread_barrier.3 pthread_barrierattr.3 \
	pthread_cancel.3 pthread_cleanup_push.3 \
	pthread_cond.3 pthread_condattr.3 \
	pthread_create.3 pthread_detach.3 pthread_equal.3 \
	pthread_curcpu_np.3 \
	pthread_exit.3 \
	pthread_getcpuclockid.3 \
	pthread_getname_np.3 \
	pthread_getspecific.3 pthread_join.3 \
	pthread_key_create.3 pthread_kill.3 \
	pthread_main_np.3 pthread_mutex.3 pthread_mutexattr.3 \
	pthread_once.3 pthread_rwlock.3 pthread_rwlockattr.3 \
	pthread_schedparam.3 pthread_self.3 \
	pthread_sigmask.3 pthread_spin.3 \
	pthread_suspend_np.3 pthread_testcancel.3

MLINKS+=	pthread_attr_get_np.3 pthread_getattr_np.3
MLINKS+=	affinity.3 pthread_setaffinity_np.3
MLINKS+=	affinity.3 pthread_getaffinity_np.3

MLINKS+=	pthread_attr.3 pthread_attr_init.3
MLINKS+=	pthread_attr.3 pthread_attr_destroy.3

MLINKS+=	pthread_attr_getdetachstate.3 pthread_attr_setdetachstate.3
MLINKS+=	pthread_attr_getguardsize.3 pthread_attr_setguardsize.3
MLINKS+=	pthread_attr_getinheritsched.3 pthread_attr_setinheritsched.3
MLINKS+=	pthread_attr_getname_np.3 pthread_attr_setname_np.3

MLINKS+=	pthread_attr_getschedparam.3 pthread_attr_setschedparam.3 \
		pthread_attr_getschedparam.3 pthread_attr_getschedpolicy.3 \
		pthread_attr_getschedparam.3 pthread_attr_setschedpolicy.3

MLINKS+=	pthread_attr_getscope.3 pthread_attr_setscope.3

MLINKS+=	pthread_attr_getstack.3 pthread_attr_setstack.3 \
		pthread_attr_getstack.3 pthread_attr_getstacksize.3 \
		pthread_attr_getstack.3 pthread_attr_setstacksize.3 \
		pthread_attr_getstack.3 pthread_attr_getstackaddr.3 \
		pthread_attr_getstack.3 pthread_attr_setstackaddr.3

MLINKS+=	pthread_cleanup_push.3 pthread_cleanup_pop.3

MLINKS+=	pthread_barrier.3 pthread_barrier_init.3
MLINKS+=	pthread_barrier.3 pthread_barrier_destroy.3
MLINKS+=	pthread_barrier.3 pthread_barrier_wait.3

MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_init.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_destroy.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_getpshared.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_setpshared.3

MLINKS+=	pthread_cond.3 pthread_cond_init.3
MLINKS+=	pthread_cond.3 pthread_cond_destroy.3
MLINKS+=	pthread_cond.3 pthread_cond_broadcast.3
MLINKS+=	pthread_cond.3 pthread_cond_wait.3
MLINKS+=	pthread_cond.3 pthread_cond_signal.3
MLINKS+=	pthread_cond.3 pthread_cond_timedwait.3

MLINKS+=	pthread_condattr.3 pthread_condattr_init.3
MLINKS+=	pthread_condattr.3 pthread_condattr_destroy.3
MLINKS+=	pthread_condattr.3 pthread_condattr_setclock.3
MLINKS+=	pthread_condattr.3 pthread_condattr_getclock.3
MLINKS+=	pthread_condattr.3 pthread_condattr_getpshared.3
MLINKS+=	pthread_condattr.3 pthread_condattr_setpshared.3

MLINKS+=	pthread_getname_np.3 pthread_setname_np.3
MLINKS+=	pthread_getspecific.3 pthread_setspecific.3
MLINKS+=	pthread_key_create.3 pthread_key_delete.3

MLINKS+=	pthread_mutex.3 pthread_mutex_init.3
MLINKS+=	pthread_mutex.3 pthread_mutex_destroy.3
MLINKS+=	pthread_mutex.3 pthread_mutex_lock.3
MLINKS+=	pthread_mutex.3 pthread_mutex_trylock.3
MLINKS+=	pthread_mutex.3 pthread_mutex_unlock.3
MLINKS+=	pthread_mutex.3 pthread_mutex_timedlock.3
MLINKS+=	pthread_mutex.3	pthread_mutex_getprioceiling.3
MLINKS+=	pthread_mutex.3	pthread_mutex_setprioceiling.3

MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_init.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_destroy.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_getpshared.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_setpshared.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_settype.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_gettype.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_getprotocol.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_setprotocol.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_getprioceiling.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_setprioceiling.3

MLINKS+=	pthread_rwlock.3 pthread_rwlock_init.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_destroy.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_rdlock.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_wrlock.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_unlock.3

MLINKS+=	pthread_rwlock.3 pthread_rwlock_timedrdlock.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_timedwrlock.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_tryrdlock.3
MLINKS+=	pthread_rwlock.3 pthread_rwlock_trywrlock.3

MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_init.3
MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_destroy.3
MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_getpshared.3
MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_setpshared.3

MLINKS+=	pthread_spin.3 pthread_spin_init.3
MLINKS+=	pthread_spin.3 pthread_spin_destroy.3
MLINKS+=	pthread_spin.3 pthread_spin_lock.3
MLINKS+=	pthread_spin.3 pthread_spin_trylock.3
MLINKS+=	pthread_spin.3 pthread_spin_unlock.3

MLINKS+=	pthread_schedparam.3 pthread_setschedparam.3
MLINKS+=	pthread_schedparam.3 pthread_getschedparam.3
MLINKS+=	pthread_suspend_np.3 pthread_resume_np.3
MLINKS+=	pthread_testcancel.3 pthread_setcancelstate.3
MLINKS+=	pthread_testcancel.3 pthread_setcanceltype.3

# ISO C threads (ISO/IEC 9899:2011)

SRCS+=		call_once.c cnd.c mtx.c thrd.c tss.c
MAN+=		threads.3 call_once.3 cnd.3 mtx.3 thrd.3 tss.3

MLINKS+=	call_once.3 ONCE_FLAG_INIT.3
MLINKS+=	call_once.3 once_flag.3

MLINKS+=	cnd.3 cnd_broadcast.3
MLINKS+=	cnd.3 cnd_destroy.3
MLINKS+=	cnd.3 cnd_init.3
MLINKS+=	cnd.3 cnd_signal.3
MLINKS+=	cnd.3 cnd_timedwait.3
MLINKS+=	cnd.3 cnd_wait.3

MLINKS+=	mtx.3 mtx_destroy.3
MLINKS+=	mtx.3 mtx_init.3
MLINKS+=	mtx.3 mtx_lock.3
MLINKS+=	mtx.3 mtx_timedlock.3
MLINKS+=	mtx.3 mtx_trylock.3
MLINKS+=	mtx.3 mtx_unlock.3

MLINKS+=	thrd.3 thrd_create.3
MLINKS+=	thrd.3 thrd_current.3
MLINKS+=	thrd.3 thrd_detach.3
MLINKS+=	thrd.3 thrd_equal.3
MLINKS+=	thrd.3 thrd_exit.3
MLINKS+=	thrd.3 thrd_join.3
MLINKS+=	thrd.3 thrd_sleep.3
MLINKS+=	thrd.3 thrd_yield.3

MLINKS+=	tss.3 TSS_DTOR_ITERATIONS.3
MLINKS+=	tss.3 tss_create.3
MLINKS+=	tss.3 tss_delete.3
MLINKS+=	tss.3 tss_get.3
MLINKS+=	tss.3 tss_set.3

INCS+=		threads.h

# PR lib/54001: create libpthread.a as a single large object, with all the
# symbols in one section. ensures that if any libpthread function is used,
# you get all of them from libpthread, and not the libc stubs.
#
# This makes -lpthread equivalent to -Wl,--whole-archive -lpthread

__archivebuild: .USE
	${_MKTARGET_BUILD}
	@@rm -f ${.TARGET}
	${LD} -r -o ${.TARGET}.o `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
	${AR} ${_ARFL} ${.TARGET} ${.TARGET}.o

CLEANFILES+=	${_LIBS:=.o}

.include <bsd.lib.mk>

.else

.include <bsd.man.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>

.endif

# WARNS=2 sets -Wcast-qual. This causes problems for one of
# pthread_setspecific() and pthread_getspecific(), since the constness
# of the argument to setspecific() has to be discarded *somewhere*
# before returning it from getspecific().
CWARNFLAGS+= -Wno-cast-qual
@


1.103
log
@libpthread: Link with -Wl,-z,nodelete.

Can't safely unload libpthread because of the interaction with libc
thread stubs.

PR lib/59784: dlopening and dlclosing libpthread is broken
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.102 2025/10/27 16:29:15 christos Exp $
d167 1
a167 1
	pthread_mutex.3 pthread_mutexattr.3 \
@


1.102
log
@revert previous; needs more discussion/testing.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.100 2025/04/07 16:07:05 rillig Exp $
d68 16
@


1.101
log
@Make pthread_setname_np variadic for compatibility with FreeBSD and GLIBC.
Bump.
@
text
@a100 1
.include "${.CURDIR}/compat/Makefile.inc"
d125 1
a125 1
COPTS.pthread.c += -Wno-stack-protector
@


1.100
log
@libpthread: fix lint build
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.99 2024/11/22 15:51:34 riastradh Exp $
d101 1
d126 1
a126 1
COPTS.pthread.c += -Wno-stack-protector -Wno-format-nonliteral
@


1.100.2.1
log
@Pull up following revision(s) (requested by riastradh in ticket #110):

	lib/libpthread/Makefile: revision 1.103
	tests/lib/libpthread/dlopen/t_dso_pthread_create.c: revision 1.2
	tests/lib/libpthread/dlopen/t_dlopen.c: revision 1.2
	tests/lib/libpthread/dlopen/t_dlopen.c: revision 1.3
	lib/libpthread/shlib_version: revision 1.24

tests/lib/libpthread: Test unloading libpthread after lazy binding.

If you dlopen libpthread and dlclose it again, the thread stubs like
pthread_mutex_lock need to continue working -- a library might have
calls to it in order to support thread-safety for threaded
applications, but that library needs to continue working even in
non-threaded applications after lazy binding of the libpthread symbol
instead of the libc stub.

PR lib/59784: dlopening and dlclosing libpthread is broken


tests/lib/libpthread: Don't abuse xfail.

Use a signal handler to check for SIGABRT, rather than
atf_tc_expect_signal.

xfail is for when there is a bug that we haven't fixed yet and the
test manifests a symptom of that bug -- a list of xfails is a list of
open bugs to be fixed.  In this case, we are verifying that
pthread_create _correctly_ raises SIGABRT (or fails with nonzero
return code -- both are acceptable outcomes, really), and there is no
bug here at the moment.

Prompted by (but unrelated to):
PR lib/59784: dlopening and dlclosing libpthread is broken


libpthread: Link with -Wl,-z,nodelete.
Can't safely unload libpthread because of the interaction with libc
thread stubs.

PR lib/59784: dlopening and dlclosing libpthread is broken


libpthread: Touch comment in shlib_version for recent LDADD.

This provokes relinking libpthread.so with the new arguments, without
needing manual intervention to follow a note in UPDATING.

PR lib/59784: dlopening and dlclosing libpthread is broken
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.100 2025/04/07 16:07:05 rillig Exp $
a67 16
# Prevent unloading libpthread.
#
# libpthread provides strong definitions of some symbols defined weakly
# by libc, such as pthread_mutex_lock (actually __libc_mutex_lock under
# the hood), which are used in libraries that take locks for
# thread-safety -- this way, in non-threaded applications,
# pthread_mutex_lock is a cheap noop libc stub, while in threaded
# applications, it's a real libpthread operation.  If libpthread is
# dlopened, the symbol might be lazily resolved _after_ it is dlopened
# to point at libpthread; then it cannot be safely unloaded, because
# there's no way to roll back symbol resolution.
#
# PR lib/59784: dlopening and dlclosing libpthread is broken
#
LDADD+=		-Wl,-z,nodelete

@


1.99
log
@libpthread: Fix expected symbols on alpha and hppa.

These have PTHREAD__ASM_RASOPS and define a different subset of
symbols which get exported.  None of these pthread__ras_* and
pthread__lock_* symbols _should_ be exported but we can fix that in a
future revbump.

PR lib/58838: shared libraries in base should all have expsym lists
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.98 2023/09/14 03:17:02 rin Exp $
d128 2
@


1.98
log
@libpthread/Makefile: trailing whitespace
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.97 2023/07/14 23:28:01 lukem Exp $
d35 17
@


1.98.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.100 2025/04/07 16:07:05 rillig Exp $
a34 17
EXPSYM_SRCS+=	pthread_mi.expsym
.  if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa"
# PTHREAD__ASM_RASOPS
EXPSYM_SRCS+=	pthread_md.expsym
.  else
# !PTHREAD__ASM_RASOPS
# XXX These really shouldn't be exported.
EXPSYM_SRCS+=	pthread_ras.expsym
.  endif

LIB_EXPSYM=	pthread.expsym
pthread.expsym: ${EXPSYM_SRCS}
	${_MKTARGET_CREATE}
	LC_ALL=C sort -m ${.ALLSRC} >${.TARGET}.tmp && \
	${MV} ${.TARGET}.tmp ${.TARGET}
CLEANFILES+=	pthread.expsym pthread.expsym.tmp

a110 2
LINTFLAGS+=	-Ac11		# for _Atomic

@


1.97
log
@fix rump URLs

Link to https://github.com/rumpkernel/ instead of
a site now taken over by an SEO squatter.

Per discussion on github.com/rumpkernel issues with pooka.

PR misc/57501
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.96 2019/11/11 22:45:27 joerg Exp $
d20 1
a20 1
.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
d56 1
a56 1
SRCS=	pthread.c 
d65 1
a65 1
SRCS+=	pthread_lock.c 
d198 1
a198 1
MLINKS+=	pthread_mutex.3	pthread_mutex_setprioceiling.3 
d209 1
a209 1
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_setprioceiling.3	
@


1.96
log
@Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.95 2019/09/22 18:45:20 brad Exp $
d48 1
a48 1
# set by the rumprun software stacks (see repo.rumpkernel.org)
@


1.96.8.1
log
@Pull up following revision(s) (requested by rin in ticket #889):

	lib/librumpuser/configure.ac: revision 1.6
	lib/librumpuser/rumpuser_port.h: revision 1.53
	lib/libpthread/Makefile: revision 1.97
	sys/rump/share/man/man3/rumpuser.3: revision 1.4
	sys/rump/share/man/man7/rumpkernel.7: revision 1.4
	sys/rump/share/man/man7/rumpkernel.7: revision 1.5

fix rump URLs in man pages

Link to https://github.com/rumpkernel/wiki/wiki instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues
with pooka.
PR misc/57501

fix rump URLs
Link to https://github.com/rumpkernel/ instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues with pooka.
PR misc/57501

use rumpkernel.github.io as the entry point
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.96 2019/11/11 22:45:27 joerg Exp $
d48 1
a48 1
# set by the rumprun software stacks (see https://github.com/rumpkernel/rumprun )
@


1.95
log
@

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.94 2019/05/07 18:45:37 maya Exp $
d39 4
@


1.94
log
@Make CLEANFILES actually work. .TARGET is not defined when not in a target
rule.

Thanks xtos for the heads up.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.93 2019/05/07 18:12:53 maya Exp $
d10 2
@


1.94.2.1
log
@Pull up following revision(s) (requested by brad in ticket #252):

	external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
	lib/libpthread/Makefile: revision 1.95
	external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
	distrib/sets/lists/base/shl.mi: revision 1.871
	external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
	external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
	external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
	external/cddl/osnet/lib/libavl/Makefile: revision 1.6
	distrib/sets/lists/debug/shl.mi: revision 1.230
	external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.94 2019/05/07 18:45:37 maya Exp $
a9 2
USE_SHLIBDIR=	yes

@


1.93
log
@Replace the link command for libpthread.a so that we create a single section
with all the libpthread symbols in it.
This makes -lpthread behave like to -Wl,--whole-archive -lpthread.

This avoids a situation where threaded static binaries use some libc thread
stubs, which are racy.

Fixes PR lib/54001: call_once2_32, call_once2_static test cases failing on
amd64 since gcc7 import.

Suggested by Jonathan Wakely, thanks!
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.92 2019/04/24 11:43:19 kamil Exp $
d284 1
a284 1
CLEANFILES+=	${.TARGET}.o
@


1.92
log
@Add a complete C11 threads(3) implementation

C11 Thread support library is a portable threading C API between OSs,
similar to std::threads in the C++ world.

The library is implemented as a thin shim over POSIX interfaces.

NetBSD implements the API as a part of the POSIX threading library
(libpthread(3)).

C11 threads(3) are in the process of making them an integral part
of the POSIX standard. The interface has been implemented in major
OSs and used with stopgap libraries for older versions of them.

C11 threading library is already used (with a stopgap implementation)
in the NetBSD distribution in MESA.

Original implementation by myself from 2016.

ATF tests are new and cover almost all interfaces.

Proposed on tech-userlevel@@.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.91 2019/02/03 03:20:24 thorpej Exp $
d272 14
@


1.91
log
@Implement support for "pshared" POSIX semaphores.

Fixes lib/53273 (and Firefox's multi-process tab feature).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.90 2018/06/09 23:45:56 christos Exp $
d233 39
@


1.90
log
@But set NOSANITIZER
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.89 2018/06/09 22:41:55 christos Exp $
d69 1
@


1.90.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.94 2019/05/07 18:45:37 maya Exp $
a68 1
.PATH: ${.CURDIR}/../librt
a231 53
# ISO C threads (ISO/IEC 9899:2011)

SRCS+=		call_once.c cnd.c mtx.c thrd.c tss.c
MAN+=		threads.3 call_once.3 cnd.3 mtx.3 thrd.3 tss.3

MLINKS+=	call_once.3 ONCE_FLAG_INIT.3
MLINKS+=	call_once.3 once_flag.3

MLINKS+=	cnd.3 cnd_broadcast.3
MLINKS+=	cnd.3 cnd_destroy.3
MLINKS+=	cnd.3 cnd_init.3
MLINKS+=	cnd.3 cnd_signal.3
MLINKS+=	cnd.3 cnd_timedwait.3
MLINKS+=	cnd.3 cnd_wait.3

MLINKS+=	mtx.3 mtx_destroy.3
MLINKS+=	mtx.3 mtx_init.3
MLINKS+=	mtx.3 mtx_lock.3
MLINKS+=	mtx.3 mtx_timedlock.3
MLINKS+=	mtx.3 mtx_trylock.3
MLINKS+=	mtx.3 mtx_unlock.3

MLINKS+=	thrd.3 thrd_create.3
MLINKS+=	thrd.3 thrd_current.3
MLINKS+=	thrd.3 thrd_detach.3
MLINKS+=	thrd.3 thrd_equal.3
MLINKS+=	thrd.3 thrd_exit.3
MLINKS+=	thrd.3 thrd_join.3
MLINKS+=	thrd.3 thrd_sleep.3
MLINKS+=	thrd.3 thrd_yield.3

MLINKS+=	tss.3 TSS_DTOR_ITERATIONS.3
MLINKS+=	tss.3 tss_create.3
MLINKS+=	tss.3 tss_delete.3
MLINKS+=	tss.3 tss_get.3
MLINKS+=	tss.3 tss_set.3

INCS+=		threads.h

# PR lib/54001: create libpthread.a as a single large object, with all the
# symbols in one section. ensures that if any libpthread function is used,
# you get all of them from libpthread, and not the libc stubs.
#
# This makes -lpthread equivalent to -Wl,--whole-archive -lpthread

__archivebuild: .USE
	${_MKTARGET_BUILD}
	@@rm -f ${.TARGET}
	${LD} -r -o ${.TARGET}.o `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
	${AR} ${_ARFL} ${.TARGET} ${.TARGET}.o

CLEANFILES+=	${_LIBS:=.o}

@


1.90.2.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d1 1
a1 1
#	$NetBSD$
a9 2
USE_SHLIBDIR=	yes

a36 4
# Since <pthread.h> is not used, allow declaring pthread_create and
# friends locally.
CWARNFLAGS.clang+=	-Wno-builtin-requires-header

@


1.89
log
@We can't build those three with MKSANITIZER, they are used too early.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.88 2018/02/25 18:51:18 chs Exp $
d4 1
a4 1
#NOSANITIZER=	# defined
@


1.88
log
@remove hard-coded -fomit-frame-pointer for pthread stuff,
let these use the same setting as the rest of the tree.
the performance difference is marginal and this allows
dtrace ustack() to work better.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.87 2016/07/03 14:24:58 christos Exp $
d4 1
@


1.88.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.90 2018/06/09 23:45:56 christos Exp $
a3 1
NOSANITIZER=	# defined
@


1.87
log
@GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.86 2016/04/23 23:12:19 christos Exp $
a92 6
.if ${MACHINE_CPU} != "m68k" && ${MACHINE_CPU} != "sh3" && ${MACHINE_ARCH} != "vax"
OMIT_FRAME_POINTER=	-fomit-frame-pointer
.else
OMIT_FRAME_POINTER=
.endif

d95 1
a95 1
COPTS.pthread_specific.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
a99 12
# Internal spinlock routines are performance critical.  Don't profile them,
# it's incompatibile with -fomit-frame-pointer.
COPTS.pthread_lock.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
pthread_lock.po: pthread_lock.o
	${_MKTARGET_CREATE}
	cp pthread_lock.o pthread_lock.po

COPTS.pthread_mutex.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
pthread_mutex.po: pthread_mutex.o
	${_MKTARGET_CREATE}
	cp pthread_mutex.o pthread_mutex.po

@


1.86
log
@Add pthread_getcpuclockid(3)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.85 2014/12/16 20:05:54 pooka Exp $
d180 2
d193 3
d206 3
d212 2
d216 4
d234 2
@


1.85
log
@Allow for arbitrary MI scheduler implementations.

A concrete result is enabling unpatched libpthread to run on the
rumprun stacks (e.g. Xen and bare metal) with a non-NetBSD scheduler.
Those schedulers hook into the existing _lwp_frobnitz() NetBSD syscall
interfaces (well, "syscall" interfaces in that scenario ;)

More specifically about the change itself:

1) instead of calling _lwp_makecontext() followed by _lwp_create()
   and passing the entry point in ucontext_t (MD) through the calls, roll
   the calls into pthread__makelwp() and allow alternate implementations
   for that MI interface.

2) allow compile-time overriding of __lwp_gettcb_fast() or
   __lwp_getprivate_fast, which are inline and leak MD scheduler/thread
   details into libpthread


Additionally, two small nits:

I)  define LIB=pthread before including mk.conf so that it's possible
    to test for LIB==pthread in mk.conf

II) make it possible to leave out pthread_cancelstub.c.  This is required
    by the current implementation of rumprun-posix (i.e. rumprun on
    POSIX hosts) due to symbol collisions.  It needs to be fixed properly
    some day, but for now allows an almost-correct libpthread to run.
    I am sure @@justin will be happy to explain the details ;)


no change to NetBSD
tested: anita+atf
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.84 2014/08/10 23:25:49 matt Exp $
d57 1
d138 1
@


1.84
log
@MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.83 2013/10/09 22:33:41 matt Exp $
d5 1
d39 4
a42 1
LIB=	pthread
d52 2
d55 1
d58 1
@


1.83
log
@Use MACHINE_CPU for m68k.  Use similar logic for both tests.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.82 2013/08/15 22:38:24 matt Exp $
d11 3
@


1.82
log
@Add support for an optional ARCHSUBDIR/Makefile.inc
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.81 2013/08/12 17:15:46 joerg Exp $
d81 3
a83 2
.if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m68000" || \
    ${MACHINE_CPU} == "sh3" || ${MACHINE_ARCH} == "vax"
a84 2
.else
OMIT_FRAME_POINTER=	-fomit-frame-pointer
@


1.81
log
@Some architectures can't create unwind tables without the frame pointer,
so don't use -fomit-frame-pointer on those.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.80 2013/03/21 16:49:11 christos Exp $
d61 3
@


1.80
log
@- Allow libpthread to be dlopened again, by providing libc stubs to libpthread.
- Fail if the dlopened libpthread does pthread_create(). From manu@@
- Discussed at length in the mailing lists; approved by core@@
- This was chosen as the least intrusive patch that will provide
  the necessary functionality.
XXX: pullup to 6
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.79 2013/02/25 17:04:46 apb Exp $
d78 7
d87 1
a87 1
COPTS.pthread_specific.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
d94 1
a94 1
COPTS.pthread_lock.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
d99 1
a99 1
COPTS.pthread_mutex.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
@


1.79
log
@Explain what PTHREAD__COMPAT is for.  This comment in
src/libpthread/Makefile is adated from a comment in
src/doc/CHANGES.prev.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.78 2013/01/31 20:57:58 riastradh Exp $
d28 3
a30 2
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__
a36 2
LDFLAGS+=	-Wl,-znodlopen

@


1.78
log
@Add pthread_condattr_setclock(3) man page link.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.77 2012/08/04 15:13:09 matt Exp $
d63 5
@


1.77
log
@-Wfoo goes into CWARNFLAGS
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.76 2012/04/04 10:59:46 joerg Exp $
d164 1
@


1.77.2.1
log
@resync with head
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.77 2012/08/04 15:13:09 matt Exp $
a163 1
MLINKS+=	pthread_condattr.3 pthread_condattr_setclock.3
@


1.77.2.2
log
@resync from head
@
text
@d1 1
a1 1
#	$NetBSD$
d28 2
a29 3
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC -D_REENTRANT
CPPFLAGS+=	-I${.CURDIR}/../libc/include
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__ -D__LIBC_THREAD_STUBS
d36 2
a62 5
# The PTHREAD__COMPAT flag builds a libpthread that can be dropped
# into a NetBSD 2/3/4 chroot with a NetBSD 5 or later kernel.
# This makes threading work in the chroot, no other modifications
# required.
#
@


1.77.2.3
log
@Rebase to HEAD as of a few days ago.
@
text
@a10 3
.elif defined(PTHREAD_MACHINE_CPU) && !empty(PTHREAD_MACHINE_CPU) && \
    exists(${.CURDIR}/arch/${PTHREAD_MACHINE_CPU})
ARCHSUBDIR=	${PTHREAD_MACHINE_CPU}
a60 3
.if exists(${ARCHDIR}/Makefile.inc)
.include "${ARCHDIR}/Makefile.inc"
.endif
a77 6
.if ${MACHINE_CPU} != "m68k" && ${MACHINE_CPU} != "sh3" && ${MACHINE_ARCH} != "vax"
OMIT_FRAME_POINTER=	-fomit-frame-pointer
.else
OMIT_FRAME_POINTER=
.endif

d80 1
a80 1
COPTS.pthread_specific.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
d87 1
a87 1
COPTS.pthread_lock.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
d92 1
a92 1
COPTS.pthread_mutex.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
@


1.76
log
@Disable new -Wstring-plus-int warning where needed for now.
Adjust various places that add GCC-only options to check for the active
compiler first.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.75 2012/03/21 05:37:43 matt Exp $
d220 1
a220 1
CFLAGS+= -Wno-cast-qual
@


1.75
log
@These directories default to WARNS?=5
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.74 2012/03/12 21:35:10 joerg Exp $
d72 2
d76 1
a76 1
COPTS.pthread_specific.c+=	-fomit-frame-pointer -falign-functions=32
d83 1
a83 1
COPTS.pthread_lock.c+=	-fomit-frame-pointer -falign-functions=32
d88 1
a88 1
COPTS.pthread_mutex.c+=	-fomit-frame-pointer -falign-functions=32
@


1.74
log
@Move pthread_once implementation into a separate file, it doesn't depend
on the mutex implementation in any way.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.73 2011/11/10 14:01:11 yamt Exp $
d4 1
a4 1
WARNS=	4
@


1.73
log
@document pthread_curcpu_np
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.72 2011/08/16 10:36:30 christos Exp $
d51 1
@


1.73.2.1
log
@Pull up following revision(s) (requested by manu in ticket #869):
	lib/libpthread/pthread_rwlock.c: revision 1.33
	lib/libc/include/reentrant.h: revision 1.16
	lib/libpthread/pthread_cond.c: revision 1.59
	lib/libpthread/pthread_misc.c: revision 1.15
	lib/libc/thread-stub/thread-stub.c: revision 1.23
	lib/libpthread/pthread_cancelstub.c: revision 1.38
	lib/libpthread/pthread_specific.c: revision 1.26
	lib/libpthread/pthread_mutex.c: revision 1.56
	lib/libpthread/pthread_tsd.c: revision 1.11
	lib/libpthread/Makefile: revision 1.80
	lib/libpthread/pthread.c: revision 1.143
	lib/libpthread/pthread_int.h: revision 1.89
- Allow libpthread to be dlopened again, by providing libc stubs to
libpthread.
- Fail if the dlopened libpthread does pthread_create(). From manu@@
- Discussed at length in the mailing lists; approved by core@@
- This was chosen as the least intrusive patch that will provide
  the necessary functionality.
XXX: pullup to 6
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.80 2013/03/21 16:49:11 christos Exp $
d28 2
a29 3
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC -D_REENTRANT
CPPFLAGS+=	-I${.CURDIR}/../libc/include
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__ -D__LIBC_THREAD_STUBS
d36 2
@


1.72
log
@document non-literal format strings
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.71 2010/12/24 12:41:42 skrll Exp $
d108 1
@


1.72.2.1
log
@sync with head
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.72 2011/08/16 10:36:30 christos Exp $
d4 1
a4 1
WARNS?=	5
a50 1
SRCS+=	pthread_once.c
a70 2
ALIGN_FUNCTIONS=	${${ACTIVE_CC} == "gcc":? -falign-functions=32 :}

d73 1
a73 1
COPTS.pthread_specific.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
d80 1
a80 1
COPTS.pthread_lock.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
d85 1
a85 1
COPTS.pthread_mutex.c+=	-fomit-frame-pointer ${ALIGN_FUNCTIONS}
a107 1
	pthread_curcpu_np.3 \
@


1.72.2.2
log
@sync with head
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.72.2.1 2012/04/17 00:05:30 yamt Exp $
d220 1
a220 1
CWARNFLAGS+= -Wno-cast-qual
@


1.72.2.3
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.72.2.2 2012/10/30 18:59:14 yamt Exp $
d28 2
a29 3
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC -D_REENTRANT
CPPFLAGS+=	-I${.CURDIR}/../libc/include
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__ -D__LIBC_THREAD_STUBS
d36 2
a61 3
.if exists(${ARCHDIR}/Makefile.inc)
.include "${ARCHDIR}/Makefile.inc"
.endif
a62 5
# The PTHREAD__COMPAT flag builds a libpthread that can be dropped
# into a NetBSD 2/3/4 chroot with a NetBSD 5 or later kernel.
# This makes threading work in the chroot, no other modifications
# required.
#
a73 6
.if ${MACHINE_CPU} != "m68k" && ${MACHINE_CPU} != "sh3" && ${MACHINE_ARCH} != "vax"
OMIT_FRAME_POINTER=	-fomit-frame-pointer
.else
OMIT_FRAME_POINTER=
.endif

d76 1
a76 1
COPTS.pthread_specific.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
d83 1
a83 1
COPTS.pthread_lock.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
d88 1
a88 1
COPTS.pthread_mutex.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
a163 1
MLINKS+=	pthread_condattr.3 pthread_condattr_setclock.3
@


1.71
log
@Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.70 2010/08/06 05:35:42 christos Exp $
d90 2
a91 1
COPTS.pthread.c += -Wno-stack-protector
@


1.70
log
@document pthread_getattr_np
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.69 2010/07/09 08:22:04 jruoho Exp $
d36 2
@


1.69
log
@Rationalize by moving

	pthread_key_delete(3) to pthread_key_create(3); and
	pthread_setspecific(3) to pthread_getspecific(3)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.68 2010/07/09 07:31:01 jruoho Exp $
d115 1
@


1.68
log
@Rationalize by moving

	pthread_attr_setname_np(3) to pthread_attr_getname_np(3); and
	pthread_setname_np(3) to pthread_getname_np(3).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.67 2010/07/08 22:19:26 jruoho Exp $
d108 1
a108 1
	pthread_key_create.3 pthread_key_delete.3 pthread_kill.3 \
d112 1
a112 1
	pthread_setspecific.3 pthread_sigmask.3 pthread_spin.3 \
d158 2
@


1.67
log
@Group also pthread_attr_getschedparam(3) and pthread_attr_getschedpolicy(3),
as these two pages fit well together.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.66 2010/07/08 19:20:16 rmind Exp $
a100 1
	pthread_attr_setname_np.3 \
a111 1
	pthread_setname_np.3 \
d124 1
d157 2
@


1.66
log
@Merge/group man pages:
- pthread_barrier_{init,destroy,wait} into pthread_barrier(3).
- pthread_cond_* into pthread_cond(3).
- pthread_mutex_* into pthread_mutex(3).
- pthread_rwlock_* into pthread_rwlock(3).
- pthread_spin_* into pthread_spin(3).
Cross-link amongst groups.
OK jruoho@@
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.65 2010/07/07 16:22:30 jruoho Exp $
a97 1
	pthread_attr_getschedpolicy.3 \
d126 5
a130 2
MLINKS+=	pthread_attr_getschedparam.3 pthread_attr_setschedparam.3
MLINKS+=	pthread_attr_getschedpolicy.3 pthread_attr_setschedpolicy.3
d132 1
@


1.65
log
@Finally, split pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy()
to their own page.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.64 2010/07/07 16:04:19 jruoho Exp $
d103 1
a103 2
	pthread_barrier_destroy.3 pthread_barrier_init.3 \
	pthread_barrier_wait.3 pthread_barrierattr.3 \
d105 2
a106 3
	pthread_cond_broadcast.3 pthread_cond_destroy.3 pthread_cond_init.3 \
	pthread_cond_wait.3 \
	pthread_condattr.3 pthread_create.3 pthread_detach.3 pthread_equal.3 \
d111 2
a112 5
	pthread_mutex_destroy.3 pthread_mutex_init.3 pthread_mutex_lock.3 \
	pthread_mutex_unlock.3 pthread_mutexattr.3 \
	pthread_once.3 pthread_rwlock_destroy.3 pthread_rwlock_init.3 \
	pthread_rwlock_rdlock.3 pthread_rwlock_unlock.3 \
	pthread_rwlock_wrlock.3 pthread_rwlockattr.3 \
d115 1
a115 2
	pthread_setspecific.3 pthread_sigmask.3 pthread_spin_destroy.3 \
	pthread_spin_init.3 pthread_spin_lock.3 pthread_spin_unlock.3 \
d136 6
d144 8
a151 3
MLINKS+=	pthread_cleanup_push.3 pthread_cleanup_pop.3
MLINKS+=	pthread_cond_broadcast.3 pthread_cond_signal.3
MLINKS+=	pthread_cond_wait.3 pthread_cond_timedwait.3
d154 7
a160 1
MLINKS+=	pthread_mutex_lock.3 pthread_mutex_trylock.3
d165 12
a176 4
MLINKS+=	pthread_rwlock_rdlock.3 pthread_rwlock_timedrdlock.3
MLINKS+=	pthread_rwlock_rdlock.3 pthread_rwlock_tryrdlock.3
MLINKS+=	pthread_rwlock_wrlock.3 pthread_rwlock_timedwrlock.3
MLINKS+=	pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3
d179 7
a187 1
MLINKS+=	pthread_spin_lock.3 pthread_spin_trylock.3
@


1.64
log
@Split pthread_attr_getschedparam() and pthread_attr_setschedparam() to a
separate page.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.63 2010/07/07 15:30:32 jruoho Exp $
d98 1
a128 2
MLINKS+=	pthread_attr.3 pthread_attr_setschedpolicy.3
MLINKS+=	pthread_attr.3 pthread_attr_getschedpolicy.3
d134 1
@


1.63
log
@Split pthread_attr_getinheritsched() and pthread_attr_setinheritsched() to a
separate page, and actually document these.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.62 2010/07/07 13:04:20 jruoho Exp $
d97 1
a127 2
MLINKS+=	pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+=	pthread_attr.3 pthread_attr_getschedparam.3
d134 1
@


1.62
log
@Move pthread_attr_getguardsize() and pthread_attr_setguardsize() to a
separate page, and actually document these.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.61 2010/07/07 11:04:54 jruoho Exp $
d95 1
a126 2
MLINKS+=	pthread_attr.3 pthread_attr_setinheritsched.3
MLINKS+=	pthread_attr.3 pthread_attr_getinheritsched.3
d134 1
@


1.61
log
@Move the thread stack attribute functions to a separate page. In addition,
document pthread_attr_getstack() and pthread_attr_setstack(). Try to also
document these a little better (in particular, note some items in the long
list of caveats and questions related to application-controlled thread stack).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.60 2010/07/07 08:57:36 jruoho Exp $
d94 1
a125 2
MLINKS+=	pthread_attr.3 pthread_attr_setguardsize.3
MLINKS+=	pthread_attr.3 pthread_attr_getguardsize.3
d134 1
@


1.60
log
@Split pthread_attr_getdetachstate(3) and pthread_attr_setdetachstate(3) to a
separate page. Once ready, the main page, pthread_attr(3), will contain a
summary of the various thread attribute functions.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.59 2010/07/07 08:22:53 jruoho Exp $
d96 1
a124 2
MLINKS+=	pthread_attr.3 pthread_attr_setstacksize.3
MLINKS+=	pthread_attr.3 pthread_attr_getstacksize.3
a126 2
MLINKS+=	pthread_attr.3 pthread_attr_setstackaddr.3
MLINKS+=	pthread_attr.3 pthread_attr_getstackaddr.3
d136 5
@


1.59
log
@Move pthread_attr_{g,s}etscope() to a separate page and try to document
these better. Should fix PR lib/41831 from Wolfgang Stukenbrock.

XXX: Please proofread.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.58 2010/07/06 21:36:34 jruoho Exp $
d93 1
a129 2
MLINKS+=	pthread_attr.3 pthread_attr_setdetachstate.3
MLINKS+=	pthread_attr.3 pthread_attr_getdetachstate.3
d137 1
@


1.58
log
@Document pthread_attr_get_np(). Fixes PR lib/39289 from ahoka@@.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.57 2010/05/19 20:04:43 jruoho Exp $
d94 1
d137 2
a138 2
MLINKS+=	pthread_attr.3 pthread_attr_setscope.3
MLINKS+=	pthread_attr.3 pthread_attr_getscope.3
@


1.57
log
@Build links for rest of the pthread_attr(3) functions.
Hopefully I got all of them right in the setlist...
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.56 2009/05/16 22:21:18 ad Exp $
d92 1
@


1.56
log
@Remove unused code that's confusing when using cscope/opengrok.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.55 2008/10/26 00:00:27 mrg Exp $
d118 1
d121 6
d129 2
d133 5
@


1.55
log
@check for ${PTHREAD_MACHINE_ARCH} before ${MACHINE_ARCH} or ${MACHINE_CPU}
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.54 2008/10/08 08:27:07 ad Exp $
a31 2
# We need to put this *after our own includes, so that our "assym.h"
# gets picked, instead of the libc one
a33 9
DPSRCS+=	assym.h
CLEANFILES+=	assym.h

assym.h: ${ARCHDIR}/genassym.cf pthread.h pthread_int.h pthread_md.h
	${_MKTARGET_CREATE}
	${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
		< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h

d56 2
a57 3
SRCS+=	_context_u.S
.if exists(${ARCHDIR}/pthread_md.c)
SRCS+= pthread_md.c
a89 4
_context_u.po: _context_u.o
	${_MKTARGET_CREATE}
	cp _context_u.o _context_u.po

a148 2
pthread_switch.S _context_u.S: assym.h

@


1.55.4.1
log
@file Makefile was added on branch christos-time_t on 2008-10-26 00:00:28 +0000
@
text
@d1 181
@


1.55.4.2
log
@check for ${PTHREAD_MACHINE_ARCH} before ${MACHINE_ARCH} or ${MACHINE_CPU}
@
text
@a0 181
#	$NetBSD: Makefile,v 1.55 2008/10/26 00:00:27 mrg Exp $
#

WARNS=	4

.include <bsd.own.mk>

.if defined(PTHREAD_MACHINE_ARCH) && !empty(PTHREAD_MACHINE_ARCH) && \
    exists(${.CURDIR}/arch/${PTHREAD_MACHINE_ARCH})
ARCHSUBDIR=	${PTHREAD_MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR=	${MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
ARCHSUBDIR=	${MACHINE_CPU}
.else
.BEGIN:
	@@echo "WARNING: no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
.endif

INCS=	pthread.h pthread_types.h pthread_queue.h
INCSDIR=/usr/include

.if defined(ARCHSUBDIR)

ARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
.PATH:	${ARCHDIR}

CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__

# XXX: This crappy poke at libc's internals needs to be fixed.
# We need to put this *after our own includes, so that our "assym.h"
# gets picked, instead of the libc one
CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CURDIR}/../libc

DPSRCS+=	assym.h
CLEANFILES+=	assym.h

assym.h: ${ARCHDIR}/genassym.cf pthread.h pthread_int.h pthread_md.h
	${_MKTARGET_CREATE}
	${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
		< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h

LIB=	pthread

#
# NOTE: When you create a new file for libpthread, make sure that pthread.c
# gets a reference to a symbol in that file.  Otherwise, Unix's stupid static
# library semantics will end up discarding potentially important objects.
#
SRCS=	pthread.c 
SRCS+=	pthread_attr.c
SRCS+=	pthread_barrier.c
SRCS+=	pthread_cancelstub.c
SRCS+=	pthread_cond.c
SRCS+=	pthread_lock.c 
SRCS+=	pthread_misc.c
SRCS+=	pthread_mutex.c
SRCS+=	pthread_rwlock.c
SRCS+=	pthread_specific.c
SRCS+=	pthread_spin.c
SRCS+=	pthread_tsd.c
SRCS+=	res_state.c
SRCS+=	sem.c
# Architecture-dependent files
SRCS+=	_context_u.S
.if exists(${ARCHDIR}/pthread_md.c)
SRCS+= pthread_md.c
.endif

.if defined(PTHREAD__COMPAT)
SRCS+=		pthread_compat.c
.PATH.c:	${.CURDIR}/../../common/lib/libc/arch/${ARCHSUBDIR}/atomic
.PATH.S:	${.CURDIR}/../../common/lib/libc/arch/${ARCHSUBDIR}/atomic
.PATH.c:	${.CURDIR}/../../common/lib/libc/atomic
.PATH.c:	${.CURDIR}/../libc/misc
.include "../../common/lib/libc/arch/${ARCHSUBDIR}/atomic/Makefile.inc"
.endif

# The TSD routines are used in the implementation of profiling, and so
# can't be profiled themselves.
COPTS.pthread_specific.c+=	-fomit-frame-pointer -falign-functions=32
pthread_specific.po: pthread_specific.o
	${_MKTARGET_CREATE}
	cp pthread_specific.o pthread_specific.po

# Internal spinlock routines are performance critical.  Don't profile them,
# it's incompatibile with -fomit-frame-pointer.
COPTS.pthread_lock.c+=	-fomit-frame-pointer -falign-functions=32
pthread_lock.po: pthread_lock.o
	${_MKTARGET_CREATE}
	cp pthread_lock.o pthread_lock.po

COPTS.pthread_mutex.c+=	-fomit-frame-pointer -falign-functions=32
pthread_mutex.po: pthread_mutex.o
	${_MKTARGET_CREATE}
	cp pthread_mutex.o pthread_mutex.po

COPTS.pthread.c += -Wno-stack-protector

_context_u.po: _context_u.o
	${_MKTARGET_CREATE}
	cp _context_u.o _context_u.po

MAN+=	affinity.3 pthread.3 \
	pthread_attr.3 \
	pthread_attr_getname_np.3 \
	pthread_attr_setcreatesuspend_np.3 \
	pthread_attr_setname_np.3 \
	pthread_barrier_destroy.3 pthread_barrier_init.3 \
	pthread_barrier_wait.3 pthread_barrierattr.3 \
	pthread_cancel.3 pthread_cleanup_push.3 \
	pthread_cond_broadcast.3 pthread_cond_destroy.3 pthread_cond_init.3 \
	pthread_cond_wait.3 \
	pthread_condattr.3 pthread_create.3 pthread_detach.3 pthread_equal.3 \
	pthread_exit.3 \
	pthread_getname_np.3 \
	pthread_getspecific.3 pthread_join.3 \
	pthread_key_create.3 pthread_key_delete.3 pthread_kill.3 \
	pthread_mutex_destroy.3 pthread_mutex_init.3 pthread_mutex_lock.3 \
	pthread_mutex_unlock.3 pthread_mutexattr.3 \
	pthread_once.3 pthread_rwlock_destroy.3 pthread_rwlock_init.3 \
	pthread_rwlock_rdlock.3 pthread_rwlock_unlock.3 \
	pthread_rwlock_wrlock.3 pthread_rwlockattr.3 \
	pthread_schedparam.3 pthread_self.3 \
	pthread_setname_np.3 \
	pthread_setspecific.3 pthread_sigmask.3 pthread_spin_destroy.3 \
	pthread_spin_init.3 pthread_spin_lock.3 pthread_spin_unlock.3 \
	pthread_suspend_np.3 pthread_testcancel.3

MLINKS+=	affinity.3 pthread_setaffinity_np.3
MLINKS+=	affinity.3 pthread_getaffinity_np.3
MLINKS+=	pthread_attr.3 pthread_attr_init.3
MLINKS+=	pthread_attr.3 pthread_attr_destroy.3
MLINKS+=	pthread_attr.3 pthread_attr_setdetachstate.3
MLINKS+=	pthread_attr.3 pthread_attr_getdetachstate.3
MLINKS+=	pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+=	pthread_attr.3 pthread_attr_getschedparam.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_init.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_destroy.3
MLINKS+=	pthread_cleanup_push.3 pthread_cleanup_pop.3
MLINKS+=	pthread_cond_broadcast.3 pthread_cond_signal.3
MLINKS+=	pthread_cond_wait.3 pthread_cond_timedwait.3
MLINKS+=	pthread_condattr.3 pthread_condattr_init.3
MLINKS+=	pthread_condattr.3 pthread_condattr_destroy.3
MLINKS+=	pthread_mutex_lock.3 pthread_mutex_trylock.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_init.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_destroy.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_settype.3
MLINKS+=	pthread_mutexattr.3 pthread_mutexattr_gettype.3
MLINKS+=	pthread_rwlock_rdlock.3 pthread_rwlock_timedrdlock.3
MLINKS+=	pthread_rwlock_rdlock.3 pthread_rwlock_tryrdlock.3
MLINKS+=	pthread_rwlock_wrlock.3 pthread_rwlock_timedwrlock.3
MLINKS+=	pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3
MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_init.3
MLINKS+=	pthread_rwlockattr.3 pthread_rwlockattr_destroy.3
MLINKS+=	pthread_schedparam.3 pthread_setschedparam.3
MLINKS+=	pthread_schedparam.3 pthread_getschedparam.3
MLINKS+=	pthread_spin_lock.3 pthread_spin_trylock.3
MLINKS+=	pthread_suspend_np.3 pthread_resume_np.3
MLINKS+=	pthread_testcancel.3 pthread_setcancelstate.3
MLINKS+=	pthread_testcancel.3 pthread_setcanceltype.3

pthread_switch.S _context_u.S: assym.h

.include <bsd.lib.mk>

.else

.include <bsd.man.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>

.endif

# WARNS=2 sets -Wcast-qual. This causes problems for one of
# pthread_setspecific() and pthread_getspecific(), since the constness
# of the argument to setspecific() has to be discarded *somewhere*
# before returning it from getspecific().
CFLAGS+= -Wno-cast-qual
@


1.54
log
@Adjust the compat stuff slightly so that the changes are mostly self
contained (Makefile, pthread_compat.c).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.53 2008/09/29 08:48:15 ad Exp $
d8 4
a11 1
.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
@


1.53
log
@make PTHREAD__COMPAT=1

Builds a libpthread that can be dropped into a NetBSD 2/3/4 chroot.

This makes threading work in the chroot when using a NetBSD 5 kernel, no
other modifications required.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.52 2008/06/16 14:25:49 rmind Exp $
a70 1
CPPFLAGS+=	-DPTHREAD__COMPAT
@


1.52
log
@- Add affinity(3) manual page, which describes thread affinity,
  pthread_setaffinity_np(3) and pthread_getaffinity_np(3) functions,
  provides simple code example.
- Add cpuset(3) manual page, which describes API of CPU-sets.

Thanks <wiz> for many improvements!
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.51 2008/03/10 14:47:06 rmind Exp $
d69 10
@


1.51
log
@Add sched(3) manual page, and appropriate links.
Thanks <wiz> for review and fixes!
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.50 2008/02/10 18:50:54 ad Exp $
d94 1
a94 1
MAN+=	pthread.3 \
d120 2
@


1.51.4.1
log
@Sync w/ -current. 34 merge conflicts to follow.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.51 2008/03/10 14:47:06 rmind Exp $
d94 1
a94 1
MAN+=	affinity.3 pthread.3 \
a119 2
MLINKS+=	affinity.3 pthread_setaffinity_np.3
MLINKS+=	affinity.3 pthread_getaffinity_np.3
@


1.51.2.1
log
@sync with head.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.51 2008/03/10 14:47:06 rmind Exp $
d94 1
a94 1
MAN+=	affinity.3 pthread.3 \
a119 2
MLINKS+=	affinity.3 pthread_setaffinity_np.3
MLINKS+=	affinity.3 pthread_getaffinity_np.3
@


1.50
log
@- Remove libpthread's atomic ops.
- Remove the old spinlock-based mutex and rwlock implementations.
- Use the atomic ops from libc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.49 2008/01/15 03:37:14 rmind Exp $
d118 1
a118 2
	pthread_suspend_np.3 pthread_testcancel.3 \
	sched_yield.3
@


1.50.2.1
log
@sync with head.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.51 2008/03/10 14:47:06 rmind Exp $
d118 2
a119 1
	pthread_suspend_np.3 pthread_testcancel.3
@


1.49
log
@Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.48 2007/12/14 21:51:21 yamt Exp $
a56 1
SRCS+=	pthread_mutex2.c
a57 1
SRCS+=	pthread_rwlock2.c
d83 2
a84 2
COPTS.pthread_mutex2.c+=	-fomit-frame-pointer -falign-functions=32
pthread_mutex2.po: pthread_mutex2.o
d86 1
a86 1
	cp pthread_mutex2.o pthread_mutex2.po
@


1.48
log
@document following functions.
	pthread_attr_getname_np
	pthread_attr_setname_np
	pthread_getname_np
	pthread_setname_np
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.47 2007/11/19 15:14:11 ad Exp $
a63 1
SRCS+=	sched.c
@


1.47
log
@Remove the debuglog stuff. ktrace is more useful now.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.46 2007/11/13 17:20:08 ad Exp $
d98 4
a101 1
	pthread_attr.3 pthread_attr_setcreatesuspend_np.3 \
d108 3
a110 1
	pthread_exit.3 pthread_getspecific.3 pthread_join.3 \
d118 1
@


1.46
log
@Mutexes:

- Play scrooge again and chop more cycles off acquire/release.
- Spin while the lock holder is running on another CPU (adaptive mutexes).
- Do non-atomic release.

Threadreg:

- Add the necessary hooks to use a thread register.
- Add the code for i386, using %gs.
- Leave i386 code disabled until xen and COMPAT_NETBSD32 have the changes.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.45 2007/10/13 20:36:43 jnemeth Exp $
a62 1
SRCS+=  pthread_debug.c
a150 3
debuglog: debuglog.o
	$(CC) -o debuglog debuglog.o -lpthread

@


1.45
log
@SSP doesn't like alloca...
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.44 2007/10/04 21:08:35 ad Exp $
d87 5
@


1.44
log
@Compile pthread_getspecific / pthread_setspecific with -fomit-frame-pointer
-falign-functions=32, since these two really get hammered on. To make them
faster needs a threadreg or TLS, unless there is a way to tell gcc that a
library-local (pthread__threadmask) variable does not need to be PIC.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.43 2007/09/07 14:09:27 ad Exp $
d87 2
@


1.43
log
@- Don't take the mutex's spinlock (ptr_interlock) in pthread_cond_wait().
  Instead, make the deferred wakeup list a per-thread array and pass down
  the lwpid_t's that way.

- In pthread_cond_wait(), take the mutex before dealing with early wakeup.
  In this way there should never be contention on the CV's spinlock if
  the app follows POSIX rules (there should only be contention on the
  user-provided mutex).

- Add a port of the kernel's rwlocks. The rwlock's spinlock is only taken if
  there is contention. This is enabled where atomic ops are available. Right
  now that is only i386 and amd64 because I don't have other hardware to
  test with. It's trivial to add stubs for other architectures as long as
  they have compare-and-swap. When we have proper atomic ops the old rwlock
  code can be removed.

- Add a new mutex implementation that's similar to the kernel's mutexes, but
  uses compare-and-swap to maintain the waiters list, so no spinlocks are
  involved. Same caveats apply as for the rwlocks.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/08/16 13:54:16 ad Exp $
d75 1
@


1.42
log
@Trim fat off libpthread internal spinlock operations. Makes a mesurable
improvement across the board.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.41 2007/08/16 01:09:34 ad Exp $
d57 1
d59 1
@


1.42.2.1
log
@sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.45 2007/10/13 20:36:43 jnemeth Exp $
a56 1
SRCS+=	pthread_mutex2.c
a57 1
SRCS+=	pthread_rwlock2.c
a72 1
COPTS.pthread_specific.c+=	-fomit-frame-pointer -falign-functions=32
a83 2
COPTS.pthread.c += -Wno-stack-protector

@


1.42.2.2
log
@sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD$
d63 1
a86 5
COPTS.pthread_mutex2.c+=	-fomit-frame-pointer -falign-functions=32
pthread_mutex2.po: pthread_mutex2.o
	${_MKTARGET_CREATE}
	cp pthread_mutex2.o pthread_mutex2.po

d94 1
a94 4
	pthread_attr.3 \
	pthread_attr_getname_np.3 \
	pthread_attr_setcreatesuspend_np.3 \
	pthread_attr_setname_np.3 \
d101 1
a101 3
	pthread_exit.3 \
	pthread_getname_np.3 \
	pthread_getspecific.3 pthread_join.3 \
a108 1
	pthread_setname_np.3 \
d147 3
@


1.42.2.3
log
@sync with HEAD
@
text
@d1 1
a1 1
#	Makefile,v 1.42.2.2 2008/01/09 01:36:29 matt Exp
d57 1
d59 1
d64 1
d86 2
a87 2
COPTS.pthread_mutex.c+=	-fomit-frame-pointer -falign-functions=32
pthread_mutex.po: pthread_mutex.o
d89 1
a89 1
	cp pthread_mutex.o pthread_mutex.po
d121 2
a122 1
	pthread_suspend_np.3 pthread_testcancel.3
@


1.41
log
@Remove PT_FIXEDSTACKSIZE_LG.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.40 2007/03/02 18:53:51 ad Exp $
d59 1
d77 7
@


1.40
log
@Remove the PTHREAD_SA option. If M:N threads is reimplemented it's
better off done with a seperate library.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.39 2007/02/09 22:08:48 ad Exp $
a5 3
# Define PT_FIXEDSTACKSIZE_LG to set a fixed stacksize
#CPPFLAGS+=-DPT_FIXEDSTACKSIZE_LG=18

a58 1
SRCS+=  pthread_stack.c
@


1.40.2.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.42 2007/08/16 13:54:16 ad Exp $
d6 3
d62 1
a62 1
SRCS+=	pthread_spin.c
a79 7
# Internal spinlock routines are performance critical.  Don't profile them,
# it's incompatibile with -fomit-frame-pointer.
COPTS.pthread_lock.c+=	-fomit-frame-pointer -falign-functions=32
pthread_lock.po: pthread_lock.o
	${_MKTARGET_CREATE}
	cp pthread_lock.o pthread_lock.po

@


1.40.2.2
log
@Sync with HEAD.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.40.2.1 2007/09/03 10:14:13 skrll Exp $
a56 1
SRCS+=	pthread_mutex2.c
a57 1
SRCS+=	pthread_rwlock2.c
@


1.39
log
@Sync with kernel changes introduced by merging the newlock2 branch.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.38 2007/01/20 04:56:25 christos Exp $
a3 1
#PTHREAD_SA=1
a30 4
.if defined(PTHREAD_SA)
CPPFLAGS+=	-DPTHREAD_SA -DPTHREAD_MLOCK_KLUDGE
.endif

a52 1
SRCS+=	pthread_alarms.c
d58 1
a59 1
SRCS+=	pthread_run.c
a60 3
SRCS+=	pthread_sa.c
SRCS+=	pthread_sig.c
SRCS+=	pthread_sleep.c
a68 3
.if defined(PTHREAD_SA)
SRCS+=	pthread_switch.S
.endif
@


1.38
log
@set warns to 4
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.37 2006/12/24 18:39:45 ad Exp $
d4 1
a4 1
PTHREAD_SA=1
@


1.37
log
@Fix bugs with and improve upon previous.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.36 2006/12/23 05:14:46 ad Exp $
d5 1
a5 1
WARNS=	2
@


1.36
log
@Conditionalised support for 1:1 threads. Needs associated kernel changes
and more work to be useful.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.35 2005/12/13 22:07:20 christos Exp $
d30 1
a30 1
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__ -DPTHREAD_MLOCK_KLUDGE
d33 1
a33 1
CPPFLAGS+=	-DPTHREAD_SA
@


1.35
log
@include libc after our own files to fix ports that have 2 assym.h's. One
in pthread and one in libc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.34 2005/09/13 02:45:38 christos Exp $
d4 1
d32 4
d78 4
a81 1
SRCS+=	pthread_switch.S _context_u.S
@


1.34
log
@XXX: Work around libpthread's "intimate" connection with libc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.33 2005/06/17 18:37:24 peter Exp $
a19 2
# XXX: This crappy poke at libc's internals needs to be fixed.
CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CURDIR}/../libc
d31 5
@


1.33
log
@Create links for pthread_attr_setschedparam.3
and pthread_attr_getschedparam.3 to pthread_attr.3.

From Igor Sobrado in PR/29997.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.32 2005/06/17 18:23:19 peter Exp $
d20 2
@


1.32
log
@Don't create links to pthread_barierattr_init.3 and
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3
and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.31 2005/05/30 16:02:56 thorpej Exp $
d108 2
@


1.31
log
@Use TOOL_GENASSYM.  Part of PR toolchain/30350
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.30 2005/02/03 17:30:33 christos Exp $
d108 2
a109 2
MLINKS+=	pthread_barrierattr.3 pthread_barierattr_init.3
MLINKS+=	pthread_barrierattr.3 pthread_barierattr_destroy.3
@


1.30
log
@Add charles' mlock fixes, protected with PTHREAD_MLOCK_KLUDGE and enabled
by default, until we come up with a real fix.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.29 2004/12/14 01:47:13 yamt Exp $
d34 1
a34 2
assym.h: genassym.sh ${ARCHDIR}/genassym.cf \
		pthread.h pthread_int.h pthread_md.h
d36 1
a36 1
	${HOST_SH} ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
@


1.30.2.1
log
@Pull up revision 1.32 (requested by peter in ticket #473):
Don't create links to pthread_barierattr_init.3 and
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3
and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
@
text
@d1 1
a1 1
#	$NetBSD$
d109 2
a110 2
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_init.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_destroy.3
@


1.30.2.2
log
@Pull up revision 1.33 (requested by peter in ticket #473):
Create links for pthread_attr_setschedparam.3
and pthread_attr_getschedparam.3 to pthread_attr.3.
From Igor Sobrado in PR/29997.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.30.2.1 2005/06/18 11:03:13 tron Exp $
a108 2
MLINKS+=	pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+=	pthread_attr.3 pthread_attr_getschedparam.3
@


1.29
log
@document sched_yield.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.28 2004/12/10 16:40:40 nathanw Exp $
d29 1
a29 1
CPPFLAGS+=	-D__LIBPTHREAD_SOURCE__
@


1.28
log
@Use CPP macros to cause many libpthread functions used by applications
to be transformed into the do-nothing-when-libpthread-isn't-linked libc
stub names. This will permit library code that uses <pthread.h> and pthread
functions "defensively" to not need to link against libpthread and not need
to be patched to the threadlib.h API.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.27 2004/06/02 14:07:07 pooka Exp $
d102 2
a103 1
	pthread_suspend_np.3 pthread_testcancel.3
@


1.27
log
@pthread_spin_lock.3 also describes pthread_spin_trylock(),
so link them together
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.26 2004/05/21 03:40:51 christos Exp $
d29 1
@


1.26
log
@add pool code for res state.
XXX: could be more efficient.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.25 2004/01/02 01:37:53 lukem Exp $
d127 1
@


1.25
log
@Add dependencies to assym.h on:
	pthread.h pthread_int.h pthread_md.h
Should help prevent the problem I raised in [kern/23946], based on
a hint from Christian Limpach.

Add MAKEVERBOSE support.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.24 2003/11/27 16:30:54 cl Exp $
d64 1
@


1.25.4.1
log
@Pull up revision 1.32 (requested by peter in ticket #2002):
Don't create links to pthread_barierattr_init.3 and
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3
and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.25 2004/01/02 01:37:53 lukem Exp $
d106 2
a107 4
MLINKS+=	pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+=	pthread_attr.3 pthread_attr_getschedparam.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_init.3
MLINKS+=	pthread_barrierattr.3 pthread_barrierattr_destroy.3
@


1.24
log
@Set default stack size to the current limit on the stack size as set
with the shell's command to change limits.  Make the PTHREAD_STACKSIZE
environment variable override the default stack size.  The old fixed
stack size behaviour can be enable with PT_FIXEDSTACKSIZE_LG when building
libpthread.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.23 2003/11/12 02:44:22 christos Exp $
d33 3
a35 1
assym.h: genassym.sh ${ARCHDIR}/genassym.cf
d75 1
d79 1
@


1.23
log
@Document pthread_attr_setcreatesuspend_np, pthread_suspend_np, pthread_resume_np
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.22 2003/10/26 07:25:34 lukem Exp $
d5 3
@


1.22
log
@Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.21 2003/08/13 18:52:01 nathanw Exp $
d76 1
a76 1
	pthread_attr.3 \
d93 1
a93 1
	pthread_testcancel.3
d119 1
@


1.21
log
@Split out pthread_{set,get}specific() into a separate file and arrange
for that file to not be built with profiling. This makes it reasonable to
use pthread_{set,get}specific() to implement thread-safe profiline call counts.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.20 2003/08/01 17:03:59 lukem Exp $
d31 1
a31 1
	sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
@


1.20
log
@Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.19 2003/07/24 07:50:24 wiz Exp $
d57 1
d66 8
@


1.19
log
@Add pthread(3), based on one by Hubert Feyrer, improved by yours truly,
reviewed by Nathan J. Williams.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.18 2003/07/18 22:33:45 nathanw Exp $
d28 1
@


1.18
log
@pthread.c was getting a bit unwieldly. Move pthread_attr stuff out
into a new file, and put the shared private structure definition in
pthread_int.h.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.17 2003/06/03 21:34:00 nathanw Exp $
d65 2
a66 1
MAN+=	pthread_attr.3 \
@


1.17
log
@Make infrastructure for man pages.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.16 2003/03/10 22:16:36 nathanw Exp $
d43 1
@


1.16
log
@Re-enable nanosleep(); kernel bug is squished (kern_time.c:1.67).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.15 2003/02/28 18:37:44 nathanw Exp $
d63 46
@


1.15
log
@Disable userlevel nanosleep() until I find the timer/alarm bug that it
is tickling.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.14 2003/02/15 22:15:50 nathanw Exp $
d52 1
a52 1
#SRCS+=	pthread_sleep.c
@


1.14
log
@Implement nanosleep() at userlevel. Threaded applications seem to like
to sleep a lot, and there's no need for each such thread to consume kernel
resources.

(accidentally checked the pthread.c part of this in yesterday; no reason
 not to finish the job)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.13 2003/01/24 01:53:27 thorpej Exp $
d52 1
a52 1
SRCS+=	pthread_sleep.c
@


1.13
log
@p1003.1b semaphore manual pages have been moved to librt.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.12 2003/01/21 02:24:41 christos Exp $
d52 1
@


1.12
log
@add manual pages.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.11 2003/01/20 20:10:19 christos Exp $
a66 11

MAN+=	sem_destroy.3
MAN+=	sem_getvalue.3
MAN+=	sem_init.3
MAN+=	sem_open.3
MAN+=	sem_post.3
MAN+=	sem_wait.3

MLINKS+=	sem_open.3 sem_close.3
MLINKS+=	sem_open.3 sem_unlink.3
MLINKS+=	sem_wait.3 sem_trywait.3
@


1.11
log
@add support for p1003.1b semaphores. From FreeBSD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.10 2003/01/19 19:55:13 thorpej Exp $
d67 11
@


1.10
log
@Always allow includes to be installed.  This makes it easier for
people to get straggling ports bootstrapped (pthread.h is required
in order to build libc).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.9 2003/01/18 10:34:14 thorpej Exp $
d25 1
a25 1
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR}
d56 1
@


1.9
log
@Merge the nathanw_sa branch.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.21 2003/01/08 19:34:21 thorpej Exp $
d14 1
a14 1
	@@echo "no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
d17 3
a63 3
INCS=	pthread.h pthread_types.h pthread_queue.h
INCSDIR=/usr/include

d72 2
@


1.8
log
@This incarnation of the pthreads library is ancient and not useful, and
should have been mothballed some time ago...
@
text
@d1 65
a65 1
#	from: @@(#)Makefile	5.2 (Berkeley) 3/5/91
a66 18
LIB=pthread
NOPIC= no
CPPFLAGS+= -DPTHREAD_KERNEL -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE}
CFLAGS+= ${CPPFLAGS}

.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc"
.include "${.CURDIR}/pthreads/Makefile.inc"
.include "${.CURDIR}/stdio/Makefile.inc"

all beforedepend: pthread

CLEANFILES+=pthread 

pthread: 
	if [ ! -e pthread ]; then \
		ln -s ${.CURDIR}/include pthread; \
	fi
	
d69 11
@


1.8.2.1
log
@Forgot this file, somehow.
@
text
@d1 1
a1 2
#	$NetBSD$
#
d3 19
a21 30
.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR=	${MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_CPU}) 
ARCHSUBDIR=	${MACHINE_CPU}
.else
.BEGIN:
	@@echo no ARCHSUBDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
	@@false
.endif

ARCHDIR=	${.CURDIR}/arch/${ARCHSUBDIR}
AINC=		-I${ARCHDIR}
.PATH:	${ARCHDIR}

CPPFLAGS+=	${AINC} -I${.CURDIR} -I${.OBJDIR}

DPSRCS+=	assym.h

assym.h: genassym.sh ${ARCHDIR}/genassym.cf
	sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
		< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
	mv -f assym.h.tmp assym.h

LIB=	pthread
SRCS=	pthread.c pthread_lock.c pthread_mutex.c pthread_run.c
SRCS+=	pthread_sa.c pthread_sig.c pthread_stack.c pthread_switch.S
SRCS+=	sched.c

INCS=	pthread.h sched.h
INCSDIR=/usr/include
a22 1
.include <bsd.lib.mk>
@


1.8.2.2
log
@Add the new headers.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.1 2001/03/08 00:20:10 nathanw Exp $
d32 1
a32 1
INCS=	pthread.h pthread_types.h pthread_queue.h sched.h
a35 1
# DO NOT DELETE
@


1.8.2.3
log
@Make userlevel-only *context functions part of libpthread rather than libc.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.2 2001/07/13 02:10:35 nathanw Exp $
d29 1
a29 1
SRCS+=	pthread_sa.c pthread_sig.c pthread_stack.c
a30 3
# Architecture-dependent files
SRCS+=	pthread_switch.S _context_u.S

@


1.8.2.4
log
@Add a mechanisim for debugging that is less likely to change scheduling
behaviour than using printf (writing to a shared memory segment), and a
simple tool for dumping the buffer. Partly inspired by the kernel msgbuf
code.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.3 2001/07/13 21:53:40 nathanw Exp $
a29 1
SRCS+=  pthread_debug.c
a36 3

debuglog: debuglog.o
	$(CC) -o debuglog debuglog.o -lpthread
@


1.8.2.5
log
@Implement most of condition variables
(pthread_cond_timedwait() is not yet done).
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.4 2001/07/17 20:22:40 nathanw Exp $
d28 2
a29 2
SRCS=	pthread.c pthread_cond.c pthread_lock.c pthread_mutex.c
SRCS+=	pthread_run.c pthread_sa.c pthread_sig.c pthread_stack.c
@


1.8.2.6
log
@WARNS=2
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.5 2001/07/25 21:24:12 nathanw Exp $
a2 2

WARNS=	2
@


1.8.2.7
log
@Implement thread-specific data.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.6 2001/07/25 23:56:54 nathanw Exp $
d31 1
a31 2
SRCS+=	pthread_run.c pthread_sa.c pthread_sig.c pthread_specific.c
SRCS+=  pthread_stack.c
a44 8

# WARNS=2 sets -Wcast-qual. This causes problems for one of
# pthread_setspecific() and pthread_getspecific(), since the constness
# of the argument to setspecific() has to be discarded *somewhere*
# before returning it from getspecific().
CFLAGS+= -Wno-cast-qual


@


1.8.2.8
log
@Add dependancies on assym.h, so that "make depend" is not strictly necessary.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.7 2001/08/08 16:39:33 nathanw Exp $
a37 1
pthread_switch.S _context_u.S: assym.h
@


1.8.2.9
log
@Need bsd.own.mk early due to variable expansion rules and the use
of .if exists...
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.8 2001/09/06 19:11:53 nathanw Exp $
a4 2

.include <bsd.own.mk>
@


1.8.2.10
log
@Add new files.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.9 2001/11/16 18:09:26 thorpej Exp $
d32 2
a33 11

SRCS=	pthread.c 
SRCS+=	pthread_alarms.c
SRCS+=	pthread_cancelstub.c
SRCS+=	pthread_cond.c
SRCS+=	pthread_lock.c 
SRCS+=	pthread_mutex.c
SRCS+=	pthread_run.c
SRCS+=	pthread_sa.c
SRCS+=	pthread_sig.c
SRCS+=	pthread_specific.c
@


1.8.2.11
log
@Remove an unnecessary bit of variable indirection.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.10 2002/01/28 19:02:35 nathanw Exp $
d19 1
d22 1
a22 1
CPPFLAGS+=	-I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR}
@


1.8.2.12
log
@Add "hard" stubs for libc interface. Weak aliases didn't work so well.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.11 2002/04/04 00:39:41 nathanw Exp $
a43 1
SRCS+=	pthread_libcstubs.c
@


1.8.2.13
log
@This file is exactly the same as include/sched.h; don't bother with
the second copy.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.12 2002/04/11 02:53:09 nathanw Exp $
a22 3
STRIPFLAG=
COPTS+=-g

d51 1
a51 1
INCS=	pthread.h pthread_types.h pthread_queue.h
@


1.8.2.14
log
@Different way of integrating with libc: Create a vector type for pthread
operations; libc will have a pointer to such a vector. When the pthread
library is loaded, set libc's pointer to a vector of real operations.
This removes the reliance on weak symbol magic, which didn't work
for static binaries, and as an aesthetic side effect, we don't have to
export a bunch of ugly _libc_pthread_* wrappers.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.13 2002/04/11 18:54:16 thorpej Exp $
d47 1
@


1.8.2.15
log
@Remove accidentally committed variables.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.14 2002/05/02 16:49:24 nathanw Exp $
d22 3
@


1.8.2.16
log
@Infrastructure for machine-dependent init code.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.15 2002/05/03 18:50:49 nathanw Exp $
a46 3
.if exists(${ARCHDIR}/pthread_md.c)
SRCS+= pthread_md.c
.endif
@


1.8.2.17
log
@Issue a warning, but to not error out (just skip it) if we don't
yet have pthread support for the platform we're building on.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.16 2002/08/14 18:41:50 nathanw Exp $
d14 2
a15 1
	@@echo "no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
a17 2
.if defined(ARCHSUBDIR)

a57 2

.endif
@


1.8.2.18
log
@Slight adjustment to last -- Only bring in <bsd.lib.mk> if LIB is
defined, and bring in <bsd.man.mk> otherwise.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.17 2002/10/07 01:23:07 thorpej Exp $
d60 2
a63 6
.else

.include <bsd.man.mk>

.endif

d69 3
@


1.8.2.19
log
@Implement POSIX read-write locks.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.18 2002/10/07 02:17:37 thorpej Exp $
a39 1
SRCS+=	pthread_rwlock.c
@


1.8.2.20
log
@Implement the pthread_barrier API.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.19 2002/10/28 00:06:09 nathanw Exp $
a34 1
SRCS+=	pthread_barrier.c
@


1.8.2.21
log
@Rewrite the way libpthread provides thread primitives to libc, using
strong and weak aliases (the way cancelation points are handled).

Work around lame Unix static library semantics which could cause
the wrong thread primitives or cancelation point functions to be
included in a statically-linked program.

THIS IS AN ABI CHANGE.  People running the nathanw_sa branch should
ensure that their libc and libpthread are in sync after updating.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8.2.20 2003/01/07 17:25:35 thorpej Exp $
a32 5
#
# NOTE: When you create a new file for libpthread, make sure that pthread.c
# gets a reference to a symbol in that file.  Otherwise, Unix's stupid static
# library semantics will end up discarding potentially important objects.
#
@


1.7
log
@The latest pthread library.
@
text
@@


1.6
log
@Fix for older shells that can't handle then;
@
text
@d5 1
a5 1
CPPFLAGS+= -g -DPTHREAD_KERNEL -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE}
d10 1
@


1.5
log
@Added NOPIC flag.
@
text
@d16 1
a16 1
	if [ ! -e pthread ]; then; \
@


1.4
log
@correct my bad advice
@
text
@d4 1
a4 1
INSTALL_PIC_ARCHIVE= no
@


1.3
log
@OK one more try at getting it right ...
@
text
@d11 1
a11 1
all: includelinks
a12 2
beforedepend: includelinks

d15 1
a15 1
includelinks: 
@


1.2
log
@Makefile needed a preall to make a few links before compiling sources.
CVS doesn't check in symlinks.
@
text
@d5 1
a5 1
CPPFLAGS+= -g -DPTHREAD_KERNEL -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE}
d11 1
a11 1
all: preall
d13 7
a19 6
preall:
	if [ ! -e include/pthread ]; then; \
		ln -s . include/pthread; \
	fi
	if [ ! -e arch/${MACHINE}/pthread ]; then; \
		ln -s . arch/${MACHINE}/pthread; \
@


1.1
log
@Initial revision
@
text
@d10 10
@


1.1.1.1
log
@Initial release of the POSIX 1003.4a Draft 7 thread implementation.
@
text
@@
