Home | History | Annotate | Download | only in libpthread
History log of /src/lib/libpthread/pthread_attr.c
RevisionDateAuthorComments
 1.21  10-Apr-2022  riastradh pthread: Nix trailing whitespace.
 1.20  12-Feb-2022  riastradh libpthread: Move namespacing include to top of .c files.

Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file. If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.

I tripped over this by including <sys/atomic.h> in mips
<machine/lock.h>.

(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)
 1.19  29-Jan-2020  kamil Use the pta_magic field in pthread attribute

Set PT_ATTR_DEAD on pthread_attr_destroy().
Check pta_magic before using pthread_attr_t in a bunch of other functions.
 1.18  01-Aug-2017  martin branches: 1.18.4;
pthread__attr_init_private:
malloc+memset -> calloc. Also initialize all values to the proper
defaults.
This fixes the "rustc panic" discussed on pkgsrc-users.
OK: joerg
 1.17  02-Jul-2017  joerg Export the guard size of the main thread via vm.guard_size. Add a
complementary writable sysctl for the initial guard size of threads
created via pthread_create. Let the existing attribut accessors do the
right thing. Raise the default guard size for threads to 64KB.
 1.16  02-Mar-2012  joerg branches: 1.16.24;
Separate pthread_t from thread stack. Drop additional alignment
restrictions on the thread stack. Remove remaining parts of stackid.
 1.15  06-Aug-2010  christos branches: 1.15.6;
move namespace protection before inclusion.
 1.14  06-Aug-2010  christos Add a weak alias for pthread_attr_get_np. Noted my Matthias Drochner.
 1.13  06-Aug-2010  christos Add pthread_getattr_np()
 1.12  18-Jan-2009  lukem fix -Wsign-compare issues
 1.11  10-Oct-2008  ad branches: 1.11.4;
pthread_attr_getschedparam: allow without preceding setparam on the
attr structure.
 1.10  28-Jun-2008  ad Now that we have all the scheduling gunk, make these do something useful:

pthread_attr_get_np
pthread_attr_setschedparam
pthread_attr_getschedparam
pthread_attr_setschedpolicy
pthread_attr_getschedpolicy
 1.9  25-Jun-2008  ad pthread_attr_setstacksize: EINVAL if the requested size is less than
sysconf(_SC_THREAD_STACK_MIN).
 1.8  28-Apr-2008  martin branches: 1.8.2;
Remove clause 3 and 4 from TNF licenses
 1.7  08-Jan-2008  christos branches: 1.7.4;
add missing static decls.
 1.6  16-Aug-2007  ad branches: 1.6.2;
Remove PT_FIXEDSTACKSIZE_LG.
 1.5  21-Sep-2005  tv branches: 1.5.8;
pthread_attr_getschedpolicy() wasn't setting the return buffer at all.
SCHED_OTHER happens to be 0, so this assignment to "int *" succeeds,
and becomes a no-op.

Fix by dereferencing "policy" to do the assignment, thus filling the
return buffer with 0.
 1.4  29-Dec-2004  nathanw branches: 1.4.2;
Implement pthread_attr_{set,get}schedpolicy() at the same level as the other
scheduling stuff: only handle SCHED_OTHER. Like the rest of the scheduling
stuff, this is for the benefit of code that can't be bothered to test against
_POSIX_THREAD_PRIORITY_SCHEDULING.
 1.3  09-Nov-2003  christos Add:

int pthread_attr_setcreatesuspend_np(pthread_attr_t *);
int pthread_suspend_np(pthread_t);
int pthread_resume_np(pthread_t);

needed for java. Approved and fixed by cl.
 1.2  11-Sep-2003  christos sprinkle ARGSUSED for good cheer.
 1.1  18-Jul-2003  nathanw 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.
 1.4.2.1  27-Sep-2005  tron Pull up following revision(s) (requested by tv in ticket #818):
lib/libpthread/pthread_attr.c: revision 1.5
pthread_attr_getschedpolicy() wasn't setting the return buffer at all.
SCHED_OTHER happens to be 0, so this assignment to "int *" succeeds,
and becomes a no-op.
Fix by dereferencing "policy" to do the assignment, thus filling the
return buffer with 0.
 1.5.8.1  03-Sep-2007  skrll Sync with HEAD.
 1.6.2.1  23-Mar-2008  matt sync with HEAD
 1.7.4.1  18-May-2008  yamt sync with head.
 1.8.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.11.4.2  10-Oct-2008  ad pthread_attr_getschedparam: allow without preceding setparam on the
attr structure.
 1.11.4.1  10-Oct-2008  ad file pthread_attr.c was added on branch christos-time_t on 2008-10-10 09:13:21 +0000
 1.15.6.1  17-Apr-2012  yamt sync with head
 1.16.24.2  01-Oct-2017  snj Pull up following revision(s) (requested by martin in ticket #295):
lib/libpthread/pthread_attr.c: revision 1.18
pthread__attr_init_private:
malloc+memset -> calloc. Also initialize all values to the proper
defaults.
This fixes the "rustc panic" discussed on pkgsrc-users.
OK: joerg
 1.16.24.1  31-Aug-2017  bouyer Pull up following revision(s) (requested by joerg in ticket #234):
sys/arch/amd64/include/vmparam.h: revision 1.43
sys/kern/exec_subr.c: revision 1.79
lib/libpthread/pthread_int.h: revision 1.94
sys/arch/mips/include/vmparam.h: revision 1.58
sys/arch/mips/include/vmparam.h: revision 1.59
lib/libpthread/TODO: revision 1.19
sys/arch/powerpc/include/vmparam.h: revision 1.20
sys/arch/riscv/include/vmparam.h: revision 1.2
sys/arch/riscv/include/vmparam.h: revision 1.3
sys/arch/i386/include/vmparam.h: revision 1.85
tests/lib/libpthread/t_join.c: revision 1.9
sys/uvm/uvm_meter.c: revision 1.66
sys/uvm/uvm_param.h: revision 1.36
sys/kern/exec_subr.c: revision 1.80
sys/uvm/uvm_param.h: revision 1.37
sys/kern/exec_subr.c: revision 1.81
sys/kern/exec_subr.c: revision 1.82
lib/libpthread/pthread_attr_getguardsize.3: revision 1.4
lib/libpthread/pthread.c: revision 1.148
lib/libpthread/pthread_attr.c: revision 1.17
sys/arch/amd64/include/vmparam.h: revision 1.42
Always include a 1MB guard area beyond the end of stack. While ASLR will
normally create a guard area as well, this provides a deterministic area
for all binaries.
Mitigates the rest of CVE-2017-1000374 and CVE-2017-1000375 from
Qualys.
Revert for the moment, creates problems on i386.
Recommit exec_subr.c revision 1.79:
Always include a 1MB guard area beyond the end of stack. While ASLR will
normally create a guard area as well, this provides a deterministic area
for all binaries.
Mitigates the rest of CVE-2017-1000374 and CVE-2017-1000375 from
Qualys.
Additionally, change VM_DEFAULT_ADDRESS_TOPDOWN to include
user_stack_guard_size in the size reservation.
Update VM_DEFAULT_ADDRESS32_TOPDOWN to include guard area.
Export the guard size of the main thread via vm.guard_size. Add a
complementary writable sysctl for the initial guard size of threads
created via pthread_create. Let the existing attribut accessors do the
right thing. Raise the default guard size for threads to 64KB.
 1.18.4.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed