about summary refs log tree commit diff
path: root/nptl/pthread_setattr_default_np.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* nptl: Move pthread_setattr_default_np into libcFlorian Weimer2021-05-111-2/+8
| | | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The export of __default_pthread_attr_freeres is temporary. There is a minor regression in freeres coverage because in the dynamic case, __default_pthread_attr_freeres is no longer called if libpthread is not linked in. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* nptl: Destroy the default thread attribute as part of freeresFlorian Weimer2020-06-021-0/+10
| | | | | | This avoids a spurious memory leak report by valgrind. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Change type of __default_pthread_attrFlorian Weimer2020-06-021-3/+3
| | | | | | | | | | | | union pthread_attr_transparent has always the correct size, even if pthread_attr_t has padding that is not present in struct pthread_attr. This should not result in an observable behavioral change. The existing code appears to have been correct, but it was brittle because it was not clear which functions were allowed to write to an entire pthread_attr_t argument (e.g., by copying it). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Use __pthread_attr_copy in pthread_setattr_default_npFlorian Weimer2020-05-201-38/+15
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* nptl: Change tst-typesizes to _Static_assertAdhemerval Zanella2017-11-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of rely on runtime check to assure correct pthread types size a better strategy would use _Static_assert to trigger an error on build time (and thus allowing to check to potentially ABI breakage on cross-compiling make check). This patch moves nptl/tst-typesizes.c to libpthread build time on each specific initialization routine and also remove some runtime redundant asserts for the same type sizes. Checked on x86_64-linux-gnu and with a build check for all affected ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf, hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu, mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu, s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32, tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32). * nptl/pthreadP.h (ASSERT_TYPE_SIZE, ASSERT_PTHREAD_INTERNAL_SIZE): New macros. * nptl/pthread_attr_init.c (__pthread_mutex_init): Add build time checks for expected input type size. * nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * nptl/pthread_barrierattr_init.c (pthread_barrierattr_init): Likewise. * nptl/pthread_cond_init.c (__pthread_cond_init): Likewise. * nptl/pthread_condattr_init.c (__pthread_condattr_init): Likewise. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Likewise. * nptl/pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise. * nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise. * nptl/pthread_rwlockattr_init.c (pthread_rwlockattr_init): Likewise. * nptl/sem_init.c (__new_sem_init, __old_sem_init): Likewise * nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Remove superflous runtime assert check. * nptl/pthread_attr_getaffinity.c (__pthread_attr_getaffinity_new): Likewise. * nptl/pthread_attr_getdetachstate.c (__pthread_attr_getdetachstate): Likewise. * nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize): Likewise. * nptl/pthread_attr_getinheritsched.c (__pthread_attr_getinheritsched): Likewise. * nptl/pthread_attr_getschedparam.c (__pthread_attr_getschedparam): Likewise. * nptl/pthread_attr_getschedpolicy.c (__pthread_attr_getschedpolicy): Likewise. * nptl/pthread_attr_getscope.c (__pthread_attr_getscope): Likewise. * nptl/pthread_attr_getstack.c (__pthread_attr_getstack): Likewise. * nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Likewise. * nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize): Likewise. * nptl/pthread_attr_setaffinity.c (__pthread_attr_setaffinity_new): Likewise. * nptl/pthread_attr_setdetachstate.c (__pthread_attr_setdetachstate): Likewise. * nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize): Likewise. * nptl/pthread_attr_setinheritsched.c (__pthread_attr_setinheritsched): Likewise. * nptl/pthread_attr_setschedparam.c (__pthread_attr_setschedparam): Likewise. * nptl/pthread_attr_setschedpolicy.c (__pthread_attr_setschedpolicy): Likewise. * nptl/pthread_attr_setscope.c (__pthread_attr_setscope): Likewise. * nptl/pthread_attr_setstack.c (__pthread_attr_setstack, __old_pthread_attr_setstack): Likewise. * nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr): Likewise. * nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize): Likewise. * nptl/pthread_getattr_default_np.c (pthread_getattr_default_np): Likewise. * nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise. * nptl/pthread_setattr_default_np.c (pthread_setattr_default_np): Likewise. * nptl/tst-typesizes.c: Remove file. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* Remove CPU set size checking from affinity functions [BZ #19143]Florian Weimer2015-11-241-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With current kernel versions, the check does not reliably detect that unavailable CPUs are requested, for these reasons: (1) The kernel will silently ignore non-allowed CPUs, that is, CPUs which are physically present but disallowed for the thread based on system configuration. (2) Similarly, CPU bits which lack an online CPU (possible CPUs) are ignored. (3) The existing probing code assumes that the CPU mask size is a power of two and at least 1024. Neither has it to be a power of two, nor is the minimum possible value 1024, so the value determined is often too large. This means that the CPU set size check in glibc accepts CPU bits beyond the actual hard system limit. (4) Future kernel versions may not even have a fixed CPU set size. After the removal of the probing code, the kernel still returns EINVAL if no CPU in the requested set remains which can run the thread after the affinity change. Applications which care about the exact affinity mask will have to query it using sched_getaffinity after setting it. Due to the effects described above, this commit does not change this. The new tests supersede tst-getcpu, which is removed. This addresses bug 19164 because the new tests allocate CPU sets dynamically. * nptl/check-cpuset.h: Remove. * nptl/pthread_attr_setaffinity.c (__pthread_attr_setaffinity_new): Remove CPU set size check. * nptl/pthread_setattr_default_np.c (pthread_setattr_default_np): Likewise. * sysdeps/unix/sysv/linux/check-cpuset.h: Remove. * sysdeps/unix/sysv/linux/pthread_setaffinity.c (__kernel_cpumask_size, __determine_cpumask_size): Remove. (__pthread_setaffinity_new): Remove CPU set size check. * sysdeps/unix/sysv/linux/sched_setaffinity.c (__kernel_cpumask_size): Remove. (__sched_setaffinity_new): Remove CPU set size check. * manual/threads.texi (Default Thread Attributes): Remove stale reference to check_cpuset_attr, determine_cpumask_size in comment. * sysdeps/unix/sysv/linux/Makefile [$(subdir) == posix] (tests): Remove tst-getcpu. Add tst-affinity, tst-affinity-pid. [$(subdir) == nptl] (tests): Add tst-thread-affinity-pthread, tst-thread-affinity-pthread2, tst-thread-affinity-sched. * sysdeps/unix/sysv/linux/tst-affinity.c: New file. * sysdeps/unix/sysv/linux/tst-affinity-pid.c: New file. * sysdeps/unix/sysv/linux/tst-skeleton-affinity.c: New skeleton test file. * sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c: New file. * sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c: New file. * sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c: New file. * sysdeps/unix/sysv/linux/tst-thread-skeleton-affinity.c: New skeleton test file. * sysdeps/unix/sysv/linux/tst-getcpu.c: Remove. Superseded by tst-affinity-pid.
* NPTL: Refactor cpu_set_t validation to be sysdeps-controlledRoland McGrath2015-01-081-0/+2
| | | | | This removes Linuxisms related to cpu_set_t validation from the generic NPTL code and puts them into a new sysdeps header file.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Include <string.h> in nptl/pthread_setattr_default_np.c.Joseph Myers2013-06-221-0/+1
|
* New API to set default thread attributesSiddhesh Poyarekar2013-06-151-0/+110
This patch introduces two new convenience functions to set the default thread attributes used for creating threads. This allows a programmer to set the default thread attributes just once in a process and then run pthread_create without additional attributes.