diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 7312870a17dc..0f371ef427bd 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -1,510 +1,511 @@ # @(#)Makefile 8.2 (Berkeley) 12/13/93 # $FreeBSD$ .include MAN= arb.3 \ assert.3 \ ATOMIC_VAR_INIT.3 \ bitstring.3 \ CMSG_DATA.3 \ end.3 \ fpgetround.3 \ intro.3 \ makedev.3 \ offsetof.3 \ ${PTHREAD_MAN} \ Q_FRAWMASK.3 \ Q_IFRAWMASK.3 \ Q_INI.3 \ Q_IRAWMASK.3 \ Q_QABS.3 \ Q_QADDI.3 \ Q_QADDQ.3 \ Q_SIGNED.3 \ Q_SIGNSHFT.3 \ qmath.3 \ queue.3 \ sigevent.3 \ siginfo.3 \ stats.3 \ stdarg.3 \ sysexits.3 \ tgmath.3 \ timeradd.3 \ tree.3 MLINKS= arb.3 ARB8_ENTRY.3 \ arb.3 ARB8_HEAD.3 \ arb.3 ARB16_ENTRY.3 \ arb.3 ARB16_HEAD.3 \ arb.3 ARB32_ENTRY.3 \ arb.3 ARB32_HEAD.3 \ arb.3 ARB_ALLOCSIZE.3 \ arb.3 ARB_CURNODES.3 \ arb.3 ARB_EMPTY.3 \ arb.3 ARB_FIND.3 \ arb.3 ARB_FOREACH.3 \ arb.3 ARB_FOREACH_FROM.3 \ arb.3 ARB_FOREACH_REVERSE.3 \ arb.3 ARB_FOREACH_REVERSE_FROM.3 \ arb.3 ARB_FOREACH_REVERSE_SAFE.3 \ arb.3 ARB_FOREACH_SAFE.3 \ arb.3 ARB_FREEIDX.3 \ arb.3 ARB_FULL.3 \ arb.3 ARB_GETFREE.3 \ arb.3 ARB_INIT.3 \ arb.3 ARB_INITIALIZER.3 \ arb.3 ARB_INSERT.3 \ arb.3 ARB_LEFT.3 \ arb.3 ARB_LEFTIDX.3 \ arb.3 ARB_MAX.3 \ arb.3 ARB_MAXNODES.3 \ arb.3 ARB_MIN.3 \ arb.3 ARB_NEXT.3 \ arb.3 ARB_NFIND.3 \ arb.3 ARB_PARENT.3 \ arb.3 ARB_PARENTIDX.3 \ arb.3 ARB_PREV.3 \ arb.3 ARB_REINSERT.3 \ arb.3 ARB_REMOVE.3 \ arb.3 ARB_RESET_TREE.3 \ arb.3 ARB_RIGHT.3 \ arb.3 ARB_RIGHTIDX.3 \ arb.3 ARB_ROOT.3 MLINKS+= assert.3 static_assert.3 MLINKS+= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_exchange.3 \ ATOMIC_VAR_INIT.3 atomic_exchange_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_add.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_add_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_and.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_and_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_or.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_or_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_sub.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_sub_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_xor.3 \ ATOMIC_VAR_INIT.3 atomic_fetch_xor_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_init.3 \ ATOMIC_VAR_INIT.3 atomic_is_lock_free.3 \ ATOMIC_VAR_INIT.3 atomic_load.3 \ ATOMIC_VAR_INIT.3 atomic_load_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_store.3 \ ATOMIC_VAR_INIT.3 atomic_store_explicit.3 MLINKS+= bitstring.3 bit_alloc.3 \ bitstring.3 bit_clear.3 \ bitstring.3 bit_decl.3 \ bitstring.3 bit_ffc.3 \ bitstring.3 bit_ffc_at.3 \ bitstring.3 bit_ffs.3 \ bitstring.3 bit_ffs_at.3 \ bitstring.3 bit_nclear.3 \ bitstring.3 bit_nset.3 \ bitstring.3 bit_set.3 \ bitstring.3 bitstr_size.3 \ bitstring.3 bit_test.3 MLINKS+= CMSG_DATA.3 CMSG_FIRSTHDR.3 \ CMSG_DATA.3 CMSG_LEN.3 \ CMSG_DATA.3 CMSG_NEXTHDR.3 \ CMSG_DATA.3 CMSG_SPACE.3 MLINKS+= end.3 edata.3 \ end.3 etext.3 MLINKS+= fpgetround.3 fpgetmask.3 \ fpgetround.3 fpgetprec.3 \ fpgetround.3 fpgetsticky.3 \ fpgetround.3 fpresetsticky.3 \ fpgetround.3 fpsetmask.3 \ fpgetround.3 fpsetprec.3 \ fpgetround.3 fpsetround.3 MLINKS+= makedev.3 major.3 \ makedev.3 minor.3 MLINKS+= ${PTHREAD_MLINKS} MLINKS+= Q_FRAWMASK.3 Q_GFRAW.3 \ Q_FRAWMASK.3 Q_GFABSVAL.3 \ Q_FRAWMASK.3 Q_GFVAL.3 \ Q_FRAWMASK.3 Q_SFVAL.3 MLINKS+= Q_IFRAWMASK.3 Q_IFVALIMASK.3 \ Q_IFRAWMASK.3 Q_IFVALFMASK.3 \ Q_IFRAWMASK.3 Q_GIFRAW.3 \ Q_IFRAWMASK.3 Q_GIFABSVAL.3 \ Q_IFRAWMASK.3 Q_GIFVAL.3 \ Q_IFRAWMASK.3 Q_SIFVAL.3 \ Q_IFRAWMASK.3 Q_SIFVALS.3 MLINKS+= Q_INI.3 Q_NCBITS.3 \ Q_INI.3 Q_BT.3 \ Q_INI.3 Q_TC.3 \ Q_INI.3 Q_NTBITS.3 \ Q_INI.3 Q_NFCBITS.3 \ Q_INI.3 Q_MAXNFBITS.3 \ Q_INI.3 Q_NFBITS.3 \ Q_INI.3 Q_NIBITS.3 \ Q_INI.3 Q_RPSHFT.3 \ Q_INI.3 Q_ABS.3 \ Q_INI.3 Q_MAXSTRLEN.3 \ Q_INI.3 Q_TOSTR.3 \ Q_INI.3 Q_SHL.3 \ Q_INI.3 Q_SHR.3 \ Q_INI.3 Q_DEBUG.3 \ Q_INI.3 Q_DFV2BFV.3 MLINKS+= Q_IRAWMASK.3 Q_GIRAW.3 \ Q_IRAWMASK.3 Q_GIABSVAL.3 \ Q_IRAWMASK.3 Q_GIVAL.3 \ Q_IRAWMASK.3 Q_SIVAL.3 MLINKS+= Q_QABS.3 Q_Q2D.3 \ Q_QABS.3 Q_Q2F.3 MLINKS+= Q_QADDI.3 Q_QDIVI.3 \ Q_QADDI.3 Q_QMULI.3 \ Q_QADDI.3 Q_QSUBI.3 \ Q_QADDI.3 Q_QFRACI.3 \ Q_QADDI.3 Q_QCPYVALI.3 MLINKS+= Q_QADDQ.3 Q_QDIVQ.3 \ Q_QADDQ.3 Q_QMULQ.3 \ Q_QADDQ.3 Q_QSUBQ.3 \ Q_QADDQ.3 Q_NORMPREC.3 \ Q_QADDQ.3 Q_QMAXQ.3 \ Q_QADDQ.3 Q_QMINQ.3 \ Q_QADDQ.3 Q_QCLONEQ.3 \ Q_QADDQ.3 Q_QCPYVALQ.3 MLINKS+= Q_SIGNED.3 Q_LTZ.3 \ Q_SIGNED.3 Q_PRECEQ.3 \ Q_SIGNED.3 Q_QLTQ.3 \ Q_SIGNED.3 Q_QLEQ.3 \ Q_SIGNED.3 Q_QGTQ.3 \ Q_SIGNED.3 Q_QGEQ.3 \ Q_SIGNED.3 Q_QEQ.3 \ Q_SIGNED.3 Q_QNEQ.3 \ Q_SIGNED.3 Q_OFLOW.3 \ Q_SIGNED.3 Q_RELPREC.3 MLINKS+= Q_SIGNSHFT.3 Q_SSIGN.3 \ Q_SIGNSHFT.3 Q_CRAWMASK.3 \ Q_SIGNSHFT.3 Q_SRAWMASK.3 \ Q_SIGNSHFT.3 Q_GCRAW.3 \ Q_SIGNSHFT.3 Q_GCVAL.3 \ Q_SIGNSHFT.3 Q_SCVAL.3 MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \ queue.3 LIST_CLASS_HEAD.3 \ queue.3 LIST_EMPTY.3 \ queue.3 LIST_ENTRY.3 \ queue.3 LIST_FIRST.3 \ queue.3 LIST_FOREACH.3 \ queue.3 LIST_FOREACH_FROM.3 \ queue.3 LIST_FOREACH_FROM_SAFE.3 \ queue.3 LIST_FOREACH_SAFE.3 \ queue.3 LIST_HEAD.3 \ queue.3 LIST_HEAD_INITIALIZER.3 \ queue.3 LIST_INIT.3 \ queue.3 LIST_INSERT_AFTER.3 \ queue.3 LIST_INSERT_BEFORE.3 \ queue.3 LIST_INSERT_HEAD.3 \ queue.3 LIST_NEXT.3 \ queue.3 LIST_PREV.3 \ queue.3 LIST_REMOVE.3 \ queue.3 LIST_SWAP.3 \ queue.3 SLIST_CLASS_ENTRY.3 \ queue.3 SLIST_CLASS_HEAD.3 \ queue.3 SLIST_EMPTY.3 \ queue.3 SLIST_ENTRY.3 \ queue.3 SLIST_FIRST.3 \ queue.3 SLIST_FOREACH.3 \ queue.3 SLIST_FOREACH_FROM.3 \ queue.3 SLIST_FOREACH_FROM_SAFE.3 \ queue.3 SLIST_FOREACH_SAFE.3 \ queue.3 SLIST_HEAD.3 \ queue.3 SLIST_HEAD_INITIALIZER.3 \ queue.3 SLIST_INIT.3 \ queue.3 SLIST_INSERT_AFTER.3 \ queue.3 SLIST_INSERT_HEAD.3 \ queue.3 SLIST_NEXT.3 \ queue.3 SLIST_REMOVE.3 \ queue.3 SLIST_REMOVE_AFTER.3 \ queue.3 SLIST_REMOVE_HEAD.3 \ queue.3 SLIST_REMOVE_PREVPTR.3 \ queue.3 SLIST_SWAP.3 \ queue.3 STAILQ_CLASS_ENTRY.3 \ queue.3 STAILQ_CLASS_HEAD.3 \ queue.3 STAILQ_CONCAT.3 \ queue.3 STAILQ_EMPTY.3 \ queue.3 STAILQ_ENTRY.3 \ queue.3 STAILQ_FIRST.3 \ queue.3 STAILQ_FOREACH.3 \ queue.3 STAILQ_FOREACH_FROM.3 \ queue.3 STAILQ_FOREACH_FROM_SAFE.3 \ queue.3 STAILQ_FOREACH_SAFE.3 \ queue.3 STAILQ_HEAD.3 \ queue.3 STAILQ_HEAD_INITIALIZER.3 \ queue.3 STAILQ_INIT.3 \ queue.3 STAILQ_INSERT_AFTER.3 \ queue.3 STAILQ_INSERT_HEAD.3 \ queue.3 STAILQ_INSERT_TAIL.3 \ queue.3 STAILQ_LAST.3 \ queue.3 STAILQ_NEXT.3 \ queue.3 STAILQ_REMOVE.3 \ queue.3 STAILQ_REMOVE_AFTER.3 \ queue.3 STAILQ_REMOVE_HEAD.3 \ queue.3 STAILQ_SWAP.3 \ queue.3 TAILQ_CLASS_ENTRY.3 \ queue.3 TAILQ_CLASS_HEAD.3 \ queue.3 TAILQ_CONCAT.3 \ queue.3 TAILQ_EMPTY.3 \ queue.3 TAILQ_ENTRY.3 \ queue.3 TAILQ_FIRST.3 \ queue.3 TAILQ_FOREACH.3 \ queue.3 TAILQ_FOREACH_FROM.3 \ queue.3 TAILQ_FOREACH_FROM_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE.3 \ queue.3 TAILQ_FOREACH_REVERSE_FROM.3 \ queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \ queue.3 TAILQ_FOREACH_SAFE.3 \ queue.3 TAILQ_HEAD.3 \ queue.3 TAILQ_HEAD_INITIALIZER.3 \ queue.3 TAILQ_INIT.3 \ queue.3 TAILQ_INSERT_AFTER.3 \ queue.3 TAILQ_INSERT_BEFORE.3 \ queue.3 TAILQ_INSERT_HEAD.3 \ queue.3 TAILQ_INSERT_TAIL.3 \ queue.3 TAILQ_LAST.3 \ queue.3 TAILQ_NEXT.3 \ queue.3 TAILQ_PREV.3 \ queue.3 TAILQ_REMOVE.3 \ queue.3 TAILQ_SWAP.3 MLINKS+= stats.3 stats_tpl_alloc.3 \ stats.3 stats_tpl_fetch_allocid.3 \ stats.3 stats_tpl_fetch.3 \ stats.3 stats_tpl_id2name.3 \ stats.3 stats_tpl_sample_rates.3 \ stats.3 stats_tpl_sample_rollthedice.3 \ stats.3 STATS_VSS_SUM.3 \ stats.3 STATS_VSS_MAX.3 \ stats.3 STATS_VSS_MIN.3 \ stats.3 STATS_VSS_CRHIST32_LIN.3 \ stats.3 STATS_VSS_CRHIST64_LIN.3 \ stats.3 stats_tpl_add_voistats.3 \ stats.3 stats_blob_alloc.3 \ stats.3 stats_blob_init.3 \ stats.3 stats_blob_clone.3 \ stats.3 stats_blob_destroy.3 \ stats.3 stats_voistat_fetch_dptr.3 \ stats.3 stats_blob_snapshot.3 \ stats.3 stats_blob_tostr.3 \ stats.3 stats_voistatdata_tostr.3 \ stats.3 stats_blob_visit.3 MLINKS+= stdarg.3 va_arg.3 \ stdarg.3 va_copy.3 \ stdarg.3 va_end.3 \ stdarg.3 varargs.3 \ stdarg.3 va_start.3 MLINKS+= timeradd.3 timerclear.3 \ timeradd.3 timercmp.3 \ timeradd.3 timerisset.3 \ timeradd.3 timersub.3 \ timeradd.3 timespecadd.3 \ timeradd.3 timespecsub.3 \ timeradd.3 timespecclear.3 \ timeradd.3 timespecisset.3 \ timeradd.3 timespeccmp.3 MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 RB_ENTRY.3 \ tree.3 RB_FIND.3 \ tree.3 RB_FOREACH.3 \ tree.3 RB_FOREACH_FROM.3 \ tree.3 RB_FOREACH_REVERSE.3 \ tree.3 RB_FOREACH_REVERSE_FROM.3 \ tree.3 RB_FOREACH_REVERSE_SAFE.3 \ tree.3 RB_FOREACH_SAFE.3 \ tree.3 RB_GENERATE.3 \ tree.3 RB_GENERATE_FIND.3 \ tree.3 RB_GENERATE_INSERT.3 \ tree.3 RB_GENERATE_INSERT_COLOR.3 \ tree.3 RB_GENERATE_MINMAX.3 \ tree.3 RB_GENERATE_NEXT.3 \ tree.3 RB_GENERATE_NFIND.3 \ tree.3 RB_GENERATE_PREV.3 \ tree.3 RB_GENERATE_REMOVE.3 \ tree.3 RB_GENERATE_REMOVE_COLOR.3 \ tree.3 RB_GENERATE_STATIC.3 \ tree.3 RB_HEAD.3 \ tree.3 RB_INIT.3 \ tree.3 RB_INITIALIZER.3 \ tree.3 RB_INSERT.3 \ tree.3 RB_LEFT.3 \ tree.3 RB_MAX.3 \ tree.3 RB_MIN.3 \ tree.3 RB_NEXT.3 \ tree.3 RB_NFIND.3 \ tree.3 RB_PARENT.3 \ tree.3 RB_PREV.3 \ tree.3 RB_PROTOTYPE.3 \ tree.3 RB_PROTOTYPE_FIND.3 \ tree.3 RB_PROTOTYPE_INSERT.3 \ tree.3 RB_PROTOTYPE_INSERT_COLOR.3 \ tree.3 RB_PROTOTYPE_MINMAX.3 \ tree.3 RB_PROTOTYPE_NEXT.3 \ tree.3 RB_PROTOTYPE_NFIND.3 \ tree.3 RB_PROTOTYPE_PREV.3 \ tree.3 RB_PROTOTYPE_REMOVE.3 \ tree.3 RB_PROTOTYPE_REMOVE_COLOR.3 \ tree.3 RB_PROTOTYPE_STATIC.3 \ tree.3 RB_REINSERT.3 \ tree.3 RB_REMOVE.3 \ tree.3 RB_RIGHT.3 \ tree.3 RB_ROOT.3 \ tree.3 SPLAY_EMPTY.3 \ tree.3 SPLAY_ENTRY.3 \ tree.3 SPLAY_FIND.3 \ tree.3 SPLAY_FOREACH.3 \ tree.3 SPLAY_GENERATE.3 \ tree.3 SPLAY_HEAD.3 \ tree.3 SPLAY_INIT.3 \ tree.3 SPLAY_INITIALIZER.3 \ tree.3 SPLAY_INSERT.3 \ tree.3 SPLAY_LEFT.3 \ tree.3 SPLAY_MAX.3 \ tree.3 SPLAY_MIN.3 \ tree.3 SPLAY_NEXT.3 \ tree.3 SPLAY_PROTOTYPE.3 \ tree.3 SPLAY_REMOVE.3 \ tree.3 SPLAY_RIGHT.3 \ tree.3 SPLAY_ROOT.3 PTHREAD_MAN= pthread.3 \ pthread_affinity_np.3 \ pthread_atfork.3 \ pthread_attr.3 \ pthread_attr_affinity_np.3 \ pthread_attr_get_np.3 \ pthread_attr_setcreatesuspend_np.3 \ pthread_barrierattr.3 \ pthread_barrier_destroy.3 \ pthread_cancel.3 \ pthread_cleanup_pop.3 \ pthread_cleanup_push.3 \ pthread_condattr.3 \ pthread_cond_broadcast.3 \ pthread_cond_destroy.3 \ pthread_cond_init.3 \ pthread_cond_signal.3 \ pthread_cond_timedwait.3 \ pthread_cond_wait.3 \ pthread_create.3 \ pthread_detach.3 \ pthread_equal.3 \ pthread_exit.3 \ pthread_getconcurrency.3 \ pthread_getcpuclockid.3 \ pthread_getspecific.3 \ pthread_getthreadid_np.3 \ pthread_join.3 \ pthread_key_create.3 \ pthread_key_delete.3 \ pthread_kill.3 \ pthread_main_np.3 \ pthread_multi_np.3 \ pthread_mutexattr.3 \ pthread_mutexattr_getkind_np.3 \ pthread_mutex_consistent.3 \ pthread_mutex_destroy.3 \ pthread_mutex_init.3 \ pthread_mutex_lock.3 \ pthread_mutex_timedlock.3 \ pthread_mutex_trylock.3 \ pthread_mutex_unlock.3 \ + pthread_np.3 \ pthread_once.3 \ pthread_resume_all_np.3 \ pthread_resume_np.3 \ pthread_rwlockattr_destroy.3 \ pthread_rwlockattr_getpshared.3 \ pthread_rwlockattr_init.3 \ pthread_rwlockattr_setpshared.3 \ pthread_rwlock_destroy.3 \ pthread_rwlock_init.3 \ pthread_rwlock_rdlock.3 \ pthread_rwlock_timedrdlock.3 \ pthread_rwlock_timedwrlock.3 \ pthread_rwlock_unlock.3 \ pthread_rwlock_wrlock.3 \ pthread_schedparam.3 \ pthread_self.3 \ pthread_set_name_np.3 \ pthread_setspecific.3 \ pthread_sigmask.3 \ pthread_spin_init.3 \ pthread_spin_lock.3 \ pthread_suspend_all_np.3 \ pthread_suspend_np.3 \ pthread_switch_add_np.3 \ pthread_testcancel.3 \ pthread_yield.3 PTHREAD_MLINKS= pthread_affinity_np.3 pthread_getaffinity_np.3 \ pthread_affinity_np.3 pthread_setaffinity_np.3 PTHREAD_MLINKS+=pthread_attr.3 pthread_attr_destroy.3 \ pthread_attr.3 pthread_attr_getdetachstate.3 \ pthread_attr.3 pthread_attr_getguardsize.3 \ pthread_attr.3 pthread_attr_getinheritsched.3 \ pthread_attr.3 pthread_attr_getschedparam.3 \ pthread_attr.3 pthread_attr_getschedpolicy.3 \ pthread_attr.3 pthread_attr_getscope.3 \ pthread_attr.3 pthread_attr_getstack.3 \ pthread_attr.3 pthread_attr_getstackaddr.3 \ pthread_attr.3 pthread_attr_getstacksize.3 \ pthread_attr.3 pthread_attr_init.3 \ pthread_attr.3 pthread_attr_setdetachstate.3 \ pthread_attr.3 pthread_attr_setguardsize.3 \ pthread_attr.3 pthread_attr_setinheritsched.3 \ pthread_attr.3 pthread_attr_setschedparam.3 \ pthread_attr.3 pthread_attr_setschedpolicy.3 \ pthread_attr.3 pthread_attr_setscope.3 \ pthread_attr.3 pthread_attr_setstack.3 \ pthread_attr.3 pthread_attr_setstackaddr.3 \ pthread_attr.3 pthread_attr_setstacksize.3 PTHREAD_MLINKS+=pthread_attr_affinity_np.3 pthread_attr_getaffinity_np.3 \ pthread_attr_affinity_np.3 pthread_attr_setaffinity_np.3 PTHREAD_MLINKS+=pthread_barrierattr.3 pthread_barrierattr_destroy.3 \ pthread_barrierattr.3 pthread_barrierattr_getpshared.3 \ pthread_barrierattr.3 pthread_barrierattr_init.3 \ pthread_barrierattr.3 pthread_barrierattr_setpshared.3 PTHREAD_MLINKS+=pthread_barrier_destroy.3 pthread_barrier_init.3 \ pthread_barrier_destroy.3 pthread_barrier_wait.3 PTHREAD_MLINKS+=pthread_condattr.3 pthread_condattr_destroy.3 \ pthread_condattr.3 pthread_condattr_init.3 \ pthread_condattr.3 pthread_condattr_getclock.3 \ pthread_condattr.3 pthread_condattr_setclock.3 \ pthread_condattr.3 pthread_condattr_getpshared.3 \ pthread_condattr.3 pthread_condattr_setpshared.3 PTHREAD_MLINKS+=pthread_getconcurrency.3 pthread_setconcurrency.3 PTHREAD_MLINKS+=pthread_multi_np.3 pthread_single_np.3 PTHREAD_MLINKS+=pthread_mutexattr.3 pthread_mutexattr_destroy.3 \ pthread_mutexattr.3 pthread_mutexattr_getprioceiling.3 \ pthread_mutexattr.3 pthread_mutexattr_getprotocol.3 \ pthread_mutexattr.3 pthread_mutexattr_getpshared.3 \ pthread_mutexattr.3 pthread_mutexattr_getrobust.3 \ pthread_mutexattr.3 pthread_mutexattr_gettype.3 \ pthread_mutexattr.3 pthread_mutexattr_init.3 \ pthread_mutexattr.3 pthread_mutexattr_setprioceiling.3 \ pthread_mutexattr.3 pthread_mutexattr_setprotocol.3 \ pthread_mutexattr.3 pthread_mutexattr_setpshared.3 \ pthread_mutexattr.3 pthread_mutexattr_setrobust.3 \ pthread_mutexattr.3 pthread_mutexattr_settype.3 PTHREAD_MLINKS+=pthread_mutexattr_getkind_np.3 pthread_mutexattr_setkind_np.3 PTHREAD_MLINKS+=pthread_rwlock_rdlock.3 pthread_rwlock_tryrdlock.3 PTHREAD_MLINKS+=pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3 PTHREAD_MLINKS+=pthread_schedparam.3 pthread_getschedparam.3 \ pthread_schedparam.3 pthread_setschedparam.3 PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 \ pthread_set_name_np.3 pthread_getname_np.3 \ pthread_set_name_np.3 pthread_setname_np.3 PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destroy.3 \ pthread_spin_lock.3 pthread_spin_trylock.3 \ pthread_spin_lock.3 pthread_spin_unlock.3 PTHREAD_MLINKS+=pthread_switch_add_np.3 pthread_switch_delete_np.3 PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \ pthread_testcancel.3 pthread_setcanceltype.3 PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \ pthread_join.3 pthread_timedjoin_np.3 .include diff --git a/share/man/man3/pthread.3 b/share/man/man3/pthread.3 index 8a437b1cedb4..6b7b82eb27f5 100644 --- a/share/man/man3/pthread.3 +++ b/share/man/man3/pthread.3 @@ -1,550 +1,554 @@ .\" Copyright (c) 1996 John Birrell . .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by John Birrell. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd October 12, 2021 .Dt PTHREAD 3 .Os .Sh NAME .Nm pthread .Nd POSIX thread functions .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Sh DESCRIPTION POSIX threads are a set of functions that support applications with requirements for multiple flows of control, called .Em threads , within a process. Multithreading is used to improve the performance of a program. .Pp The POSIX thread functions are summarized in this section in the following groups: .Pp .Bl -bullet -offset indent -compact .It Thread Routines .It Attribute Object Routines .It Mutex Routines .It Condition Variable Routines .It Read/Write Lock Routines .It Per-Thread Context Routines .It Cleanup Routines .El +.Pp +.Fx +extensions to the POSIX thread functions are summarized in +.Xr pthread_np 3 . .Ss Thread Routines .Bl -tag -width indent .It Xo .Ft int .Fo pthread_create .Fa "pthread_t *thread" "const pthread_attr_t *attr" .Fa "void *\*[lp]*start_routine\*[rp]\*[lp]void *\*[rp]" "void *arg" .Fc .Xc Creates a new thread of execution. .It Xo .Ft int .Fn pthread_cancel "pthread_t thread" .Xc Cancels execution of a thread. .It Xo .Ft int .Fn pthread_detach "pthread_t thread" .Xc Marks a thread for deletion. .It Xo .Ft int .Fn pthread_equal "pthread_t t1" "pthread_t t2" .Xc Compares two thread IDs. .It Xo .Ft void .Fn pthread_exit "void *value_ptr" .Xc Terminates the calling thread. .It Xo .Ft int .Fn pthread_join "pthread_t thread" "void **value_ptr" .Xc Causes the calling thread to wait for the termination of the specified thread. .It Xo .Ft int .Fn pthread_kill "pthread_t thread" "int sig" .Xc Delivers a signal to a specified thread. .It Xo .Ft int .Fn pthread_once "pthread_once_t *once_control" "void \*[lp]*init_routine\*[rp]\*[lp]void\*[rp]" .Xc Calls an initialization routine once. .It Xo .Ft pthread_t .Fn pthread_self void .Xc Returns the thread ID of the calling thread. .It Xo .Ft int .Fn pthread_setcancelstate "int state" "int *oldstate" .Xc Sets the current thread's cancelability state. .It Xo .Ft int .Fn pthread_setcanceltype "int type" "int *oldtype" .Xc Sets the current thread's cancelability type. .It Xo .Ft void .Fn pthread_testcancel void .Xc Creates a cancellation point in the calling thread. .It Xo .Ft void .Fn pthread_yield void .Xc Allows the scheduler to run another thread instead of the current one. .El .Ss Attribute Object Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_attr_destroy "pthread_attr_t *attr" .Xc Destroy a thread attributes object. .It Xo .Ft int .Fo pthread_attr_getinheritsched .Fa "const pthread_attr_t *attr" "int *inheritsched" .Fc .Xc Get the inherit scheduling attribute from a thread attributes object. .It Xo .Ft int .Fo pthread_attr_getschedparam .Fa "const pthread_attr_t *attr" "struct sched_param *param" .Fc .Xc Get the scheduling parameter attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy" .Xc Get the scheduling policy attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope" .Xc Get the contention scope attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" .Xc Get the stack size attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getstackaddr "const pthread_attr_t *attr" "void **stackaddr" .Xc Get the stack address attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getdetachstate "const pthread_attr_t *attr" "int *detachstate" .Xc Get the detach state attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_init "pthread_attr_t *attr" .Xc Initialize a thread attributes object with default values. .It Xo .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Xc Set the inherit scheduling attribute in a thread attributes object. .It Xo .Ft int .Fo pthread_attr_setschedparam .Fa "pthread_attr_t *attr" "const struct sched_param *param" .Fc .Xc Set the scheduling parameter attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy" .Xc Set the scheduling policy attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope" .Xc Set the contention scope attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" .Xc Set the stack size attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr" .Xc Set the stack address attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setdetachstate "pthread_attr_t *attr" "int detachstate" .Xc Set the detach state in a thread attributes object. .El .Ss Mutex Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_mutexattr_destroy "pthread_mutexattr_t *attr" .Xc Destroy a mutex attributes object. .It Xo .Ft int .Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *restrict attr" "int *restrict ceiling" .Xc Obtain priority ceiling attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Xc Obtain protocol attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" .Xc Obtain the mutex type attribute in the specified mutex attributes object. .It Xo .Ft int .Fn pthread_mutexattr_init "pthread_mutexattr_t *attr" .Xc Initialize a mutex attributes object with default values. .It Xo .Ft int .Fn pthread_mutexattr_setprioceiling "pthread_mutexattr_t *attr" "int ceiling" .Xc Set priority ceiling attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_setprotocol "pthread_mutexattr_t *attr" "int protocol" .Xc Set protocol attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_settype "pthread_mutexattr_t *attr" "int type" .Xc Set the mutex type attribute that is used when a mutex is created. .It Xo .Ft int .Fn pthread_mutex_destroy "pthread_mutex_t *mutex" .Xc Destroy a mutex. .It Xo .Ft int .Fo pthread_mutex_init .Fa "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" .Fc .Xc Initialize a mutex with specified attributes. .It Xo .Ft int .Fn pthread_mutex_lock "pthread_mutex_t *mutex" .Xc Lock a mutex and block until it becomes available. .It Xo .Ft int .Fo pthread_mutex_timedlock .Fa "pthread_mutex_t *mutex" "const struct timespec *abstime" .Fc .Xc Lock a mutex and block until it becomes available or until the timeout expires. .It Xo .Ft int .Fn pthread_mutex_trylock "pthread_mutex_t *mutex" .Xc Try to lock a mutex, but do not block if the mutex is locked by another thread, including the current thread. .It Xo .Ft int .Fn pthread_mutex_unlock "pthread_mutex_t *mutex" .Xc Unlock a mutex. .El .Ss Condition Variable Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_condattr_destroy "pthread_condattr_t *attr" .Xc Destroy a condition variable attributes object. .It Xo .Ft int .Fn pthread_condattr_init "pthread_condattr_t *attr" .Xc Initialize a condition variable attributes object with default values. .It Xo .Ft int .Fn pthread_cond_broadcast "pthread_cond_t *cond" .Xc Unblock all threads currently blocked on the specified condition variable. .It Xo .Ft int .Fn pthread_cond_destroy "pthread_cond_t *cond" .Xc Destroy a condition variable. .It Xo .Ft int .Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr" .Xc Initialize a condition variable with specified attributes. .It Xo .Ft int .Fn pthread_cond_signal "pthread_cond_t *cond" .Xc Unblock at least one of the threads blocked on the specified condition variable. .It Xo .Ft int .Fo pthread_cond_timedwait .Fa "pthread_cond_t *cond" "pthread_mutex_t *mutex" .Fa "const struct timespec *abstime" .Fc .Xc Unlock the specified mutex, wait no longer than the specified time for a condition, and then relock the mutex. .It Xo .Ft int .Fn pthread_cond_wait "pthread_cond_t *" "pthread_mutex_t *mutex" .Xc Unlock the specified mutex, wait for a condition, and relock the mutex. .El .Ss Read/Write Lock Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_rwlock_destroy "pthread_rwlock_t *lock" .Xc Destroy a read/write lock object. .It Xo .Ft int .Fo pthread_rwlock_init .Fa "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" .Fc .Xc Initialize a read/write lock object. .It Xo .Ft int .Fn pthread_rwlock_rdlock "pthread_rwlock_t *lock" .Xc Lock a read/write lock for reading, blocking until the lock can be acquired. .It Xo .Ft int .Fn pthread_rwlock_tryrdlock "pthread_rwlock_t *lock" .Xc Attempt to lock a read/write lock for reading, without blocking if the lock is unavailable. .It Xo .Ft int .Fn pthread_rwlock_trywrlock "pthread_rwlock_t *lock" .Xc Attempt to lock a read/write lock for writing, without blocking if the lock is unavailable. .It Xo .Ft int .Fn pthread_rwlock_unlock "pthread_rwlock_t *lock" .Xc Unlock a read/write lock. .It Xo .Ft int .Fn pthread_rwlock_wrlock "pthread_rwlock_t *lock" .Xc Lock a read/write lock for writing, blocking until the lock can be acquired. .It Xo .Ft int .Fn pthread_rwlockattr_destroy "pthread_rwlockattr_t *attr" .Xc Destroy a read/write lock attribute object. .It Xo .Ft int .Fo pthread_rwlockattr_getpshared .Fa "const pthread_rwlockattr_t *attr" "int *pshared" .Fc .Xc Retrieve the process shared setting for the read/write lock attribute object. .It Xo .Ft int .Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr" .Xc Initialize a read/write lock attribute object. .It Xo .Ft int .Fn pthread_rwlockattr_setpshared "pthread_rwlockattr_t *attr" "int pshared" .Xc Set the process shared setting for the read/write lock attribute object. .El .Ss Per-Thread Context Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_key_create "pthread_key_t *key" "void \*[lp]*routine\*[rp]\*[lp]void *\*[rp]" .Xc Create a thread-specific data key. .It Xo .Ft int .Fn pthread_key_delete "pthread_key_t key" .Xc Delete a thread-specific data key. .It Xo .Ft "void *" .Fn pthread_getspecific "pthread_key_t key" .Xc Get the thread-specific value for the specified key. .It Xo .Ft int .Fn pthread_setspecific "pthread_key_t key" "const void *value_ptr" .Xc Set the thread-specific value for the specified key. .El .Ss Cleanup Routines .Bl -tag -width indent .It Xo .Ft int .Fo pthread_atfork .Fa "void \*[lp]*prepare\*[rp]\*[lp]void\*[rp]" .Fa "void \*[lp]*parent\*[rp]\*[lp]void\*[rp]" .Fa "void \*[lp]*child\*[rp]\*[lp]void\*[rp]" .Fc .Xc Register fork handlers. .It Xo .Ft void .Fn pthread_cleanup_pop "int execute" .Xc Remove the routine at the top of the calling thread's cancellation cleanup stack and optionally invoke it. .It Xo .Ft void .Fn pthread_cleanup_push "void \*[lp]*routine\*[rp]\*[lp]void *\*[rp]" "void *routine_arg" .Xc Push the specified cancellation cleanup handler onto the calling thread's cancellation stack. .El .Sh IMPLEMENTATION NOTES The current .Fx POSIX thread implementation is built into the .Lb libthr library. It contains thread-safe versions of .Lb libc functions and the thread functions. Threaded applications are linked with this library. .Sh SEE ALSO .Xr libthr 3 , -.Xr pthread_affinity_np 3 , .Xr pthread_atfork 3 , .Xr pthread_attr 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_cleanup_push 3 , .Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , .Xr pthread_cond_init 3 , .Xr pthread_cond_signal 3 , .Xr pthread_cond_timedwait 3 , .Xr pthread_cond_wait 3 , .Xr pthread_condattr_destroy 3 , .Xr pthread_condattr_init 3 , .Xr pthread_create 3 , .Xr pthread_detach 3 , .Xr pthread_equal 3 , .Xr pthread_exit 3 , .Xr pthread_getspecific 3 , .Xr pthread_join 3 , .Xr pthread_key_delete 3 , .Xr pthread_kill 3 , .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , .Xr pthread_mutex_lock 3 , .Xr pthread_mutex_trylock 3 , .Xr pthread_mutex_unlock 3 , .Xr pthread_mutexattr_destroy 3 , .Xr pthread_mutexattr_getprioceiling 3 , .Xr pthread_mutexattr_getprotocol 3 , .Xr pthread_mutexattr_gettype 3 , .Xr pthread_mutexattr_init 3 , .Xr pthread_mutexattr_setprioceiling 3 , .Xr pthread_mutexattr_setprotocol 3 , .Xr pthread_mutexattr_settype 3 , +.Xr pthread_np 3 , .Xr pthread_once 3 , .Xr pthread_rwlock_destroy 3 , .Xr pthread_rwlock_init 3 , .Xr pthread_rwlock_rdlock 3 , .Xr pthread_rwlock_unlock 3 , .Xr pthread_rwlock_wrlock 3 , .Xr pthread_rwlockattr_destroy 3 , .Xr pthread_rwlockattr_getpshared 3 , .Xr pthread_rwlockattr_init 3 , .Xr pthread_rwlockattr_setpshared 3 , .Xr pthread_self 3 , .Xr pthread_setcancelstate 3 , .Xr pthread_setcanceltype 3 , .Xr pthread_setspecific 3 , .Xr pthread_testcancel 3 .Sh STANDARDS The functions with the .Nm pthread_ prefix and not .Nm _np suffix or .Nm pthread_rwlock prefix conform to .St -p1003.1-96 . .Pp The functions with the .Nm pthread_ prefix and .Nm _np suffix are non-portable extensions to POSIX threads. .Pp The functions with the .Nm pthread_rwlock prefix are extensions created by The Open Group as part of the .St -susv2 . diff --git a/share/man/man3/pthread_affinity_np.3 b/share/man/man3/pthread_affinity_np.3 index 24fef03ab4ed..0a52add2ee3c 100644 --- a/share/man/man3/pthread_affinity_np.3 +++ b/share/man/man3/pthread_affinity_np.3 @@ -1,152 +1,153 @@ .\"- .\" Copyright (c) 2010 Xin LI .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd March 23, 2010 +.Dd October 12, 2021 .Dt PTHREAD_AFFINITY_NP 3 .Os .Sh NAME .Nm pthread_getaffinity_np , .Nm pthread_setaffinity_np .Nd manage CPU affinity .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_getaffinity_np "pthread_t td" "size_t cpusetsize" "cpuset_t *cpusetp" .Ft int .Fn pthread_setaffinity_np "pthread_t td" "size_t cpusetsize" "const cpuset_t *cpusetp" .Sh DESCRIPTION .Fn pthread_getaffinity_np and .Fn pthread_setaffinity_np allow the manipulation of sets of CPUs available to the specified thread. .Pp Masks of type .Ft cpuset_t are composed using the .Dv CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to .Fn pthread_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_setaffinity_np tolerate small sets with no restrictions. .Pp The supplied mask should have a size of .Fa cpusetsize bytes. This size is usually provided by calling .Li sizeof(cpuset_t) which is ultimately determined by the value of .Dv CPU_SETSIZE as defined in .In sys/cpuset.h . .Pp .Fn pthread_getaffinity_np retrieves the mask from the thread specified by .Fa td , and stores it in the space provided by .Fa cpusetp . .Pp .Fn pthread_setaffinity_np attempts to set the mask for the thread specified by .Fa td to the value in .Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_getaffinity_np and .Fn pthread_setaffinity_np functions will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_getaffinity_np and .Fn pthread_setaffinity_np functions may fail if: .Bl -tag -width Er .It Bq Er EDEADLK The .Fn pthread_setaffinity_np call would leave a thread without a valid CPU to run on because the set does not overlap with the thread's anonymous mask. .It Bq Er EFAULT The .Fa cpusetp pointer passed was invalid. .It Bq Er ESRCH The thread specified by the .Fa td argument could not be found. .It Bq Er ERANGE The .Fa cpusetsize was either preposterously large or smaller than the kernel set size. .It Bq Er EPERM The calling thread did not have the credentials required to complete the operation. .El .Sh SEE ALSO .Xr cpuset 1 , .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , .Xr pthread 3 , .Xr pthread_attr_getaffinity_np 3 , -.Xr pthread_attr_setaffinity_np 3 +.Xr pthread_attr_setaffinity_np 3 , +.Xr pthread_np 3 .Sh STANDARDS The .Nm pthread_getaffinity_np and .Nm pthread_setaffinity_np functions are non-standard .Fx extensions and may be not available on other operating systems. .Sh HISTORY The .Nm pthread_getaffinity_np and .Nm pthread_setaffinity_np function first appeared in .Fx 7.2 . .Sh AUTHORS .An -nosplit The .Nm pthread_getaffinity_np and .Nm pthread_setaffinity_np functions were written by .An David Xu Aq Mt davidxu@FreeBSD.org , and this manpage was written by .An Xin LI Aq Mt delphij@FreeBSD.org . diff --git a/share/man/man3/pthread_attr_affinity_np.3 b/share/man/man3/pthread_attr_affinity_np.3 index 4c400b9a17e7..7b1cd3dea0d9 100644 --- a/share/man/man3/pthread_attr_affinity_np.3 +++ b/share/man/man3/pthread_attr_affinity_np.3 @@ -1,160 +1,161 @@ .\"- .\" Copyright (c) 2010 Xin LI .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_AFFINITY_NP 3 .Os .Sh NAME .Nm pthread_attr_getaffinity_np , .Nm pthread_attr_setaffinity_np .Nd manage CPU affinity in thread attribute objects .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_attr_getaffinity_np "const pthread_attr_t *pattr" "size_t cpusetsize" "cpuset_t *cpusetp" .Ft int .Fn pthread_attr_setaffinity_np "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" .Sh DESCRIPTION The .Fn pthread_attr_getaffinity_np and .Fn pthread_attr_setaffinity_np functions allow the manipulation of sets of CPUs available to the specified thread attribute object. .Pp Masks of type .Ft cpuset_t are composed using the .Dv CPU_SET macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to .Fn pthread_attr_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_attr_setaffinity_np tolerate small sets with no restrictions. .Pp The supplied mask should have a size of .Fa cpusetsize bytes. This size is usually provided by calling .Li sizeof(cpuset_t) which is ultimately determined by the value of .Dv CPU_SETSIZE as defined in .In sys/cpuset.h . .Pp .Fn pthread_attr_getaffinity_np retrieves the mask from the thread attribute object specified by .Fa pattr , and stores it in the space provided by .Fa cpusetp . .Pp .Fn pthread_attr_setaffinity_np sets the mask for the thread attribute object specified by .Fa pattr to the value in .Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_attr_getaffinity_np and .Fn pthread_attr_setaffinity_np functions will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_attr_getaffinity_np functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The .Fa pattr or the attribute specified by it is .Dv NULL . .It Bq Er ERANGE The .Fa cpusetsize is too small. .El .Pp The .Fn pthread_attr_setaffinity_np function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The .Fa pattr or the attribute specified by it is .Dv NULL . .It Bq Er EINVAL The .Fa cpusetp specified a CPU that was outside the set supported by the kernel. .It Bq Er ERANGE The .Fa cpusetsize is too small. .It Bq Er ENOMEM Insufficient memory exists to store the cpuset mask. .El .Sh SEE ALSO .Xr cpuset 1 , .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , .Xr pthread_getaffinity_np 3 , +.Xr pthread_np 3 , .Xr pthread_setaffinity_np 3 .Sh STANDARDS The .Nm pthread_attr_getaffinity_np and .Nm pthread_attr_setaffinity_np functions are non-standard .Fx extensions and may be not available on other operating systems. .Sh HISTORY The .Nm pthread_attr_getaffinity_np and .Nm pthread_attr_setaffinity_np functions first appeared in .Fx 7.2 . .Sh AUTHORS .An -nosplit The .Nm pthread_attr_getaffinity_np and .Nm pthread_attr_setaffinity_np functions were written by .An David Xu Aq Mt davidxu@FreeBSD.org , and this manpage was written by .An Xin LI Aq Mt delphij@FreeBSD.org . diff --git a/share/man/man3/pthread_attr_get_np.3 b/share/man/man3/pthread_attr_get_np.3 index a23cac6997c9..336c3626a27c 100644 --- a/share/man/man3/pthread_attr_get_np.3 +++ b/share/man/man3/pthread_attr_get_np.3 @@ -1,115 +1,116 @@ .\" Copyright (c) 2002,2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd January 31, 2003 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_GET_NP 3 .Os .Sh NAME .Nm pthread_attr_get_np .Nd get attributes of existent thread .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_attr_get_np "pthread_t pid" "pthread_attr_t *dst" .Sh DESCRIPTION The .Fn pthread_attr_get_np function is used to get existent thread's attributes. Most fields of .Vt pthread_attr_t structure are exact values of attributes provided at thread creation time (as parameter to .Xr pthread_create 3 function), except for the stack address. .Pp Value returned as .Fa dst is supposed to be used in conjunction with .Fn pthread_attr_get* functions to retrieve individual values from .Vt pthread_attr_t structure. Parameter .Fa dst should point to allocated memory area big enough to fit this structure. .Pp It is HIGHLY RECOMMENDED to use .Xr pthread_attr_init 3 function to allocate attribute storage. .Sh IMPLEMENTATION NOTES The .Fn pthread_attr_get_np function will always return a pointer to the thread's real stack address, regardless of its value in the original attributes structure. .Sh RETURN VALUES If successful, .Fn pthread_attr_get_np function returns 0. Otherwise, an error number is returned to indicate the error. .Sh EXAMPLES .Bd -literal size_t my_thread_stack_size(pthread_t pid) { pthread_attr_t attr; size_t size; pthread_attr_init(&attr); pthread_attr_get_np(pid, &attr); pthread_attr_getstacksize(&attr, &size); pthread_attr_destroy(&attr); return(size); } .Ed .Sh ERRORS The .Fn pthread_attr_get_np function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for one of given parameters. .It Bq Er ESRCH No thread could be found corresponding to that specified by the given thread ID. .El .Sh SEE ALSO .Xr pthread_attr_destroy 3 , .Xr pthread_attr_getdetachstate 3 , .Xr pthread_attr_getinheritsched 3 , .Xr pthread_attr_getschedparam 3 , .Xr pthread_attr_getschedpolicy 3 , .Xr pthread_attr_getscope 3 , .Xr pthread_attr_getstack 3 , .Xr pthread_attr_getstackaddr 3 , .Xr pthread_attr_getstacksize 3 , -.Xr pthread_attr_init 3 +.Xr pthread_attr_init 3 , +.Xr pthread_np 3 .Sh AUTHORS The .Fn pthread_attr_get_np function and this manual page were written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_attr_setcreatesuspend_np.3 b/share/man/man3/pthread_attr_setcreatesuspend_np.3 index 75408ccefc62..d2c6a6f74694 100644 --- a/share/man/man3/pthread_attr_setcreatesuspend_np.3 +++ b/share/man/man3/pthread_attr_setcreatesuspend_np.3 @@ -1,72 +1,73 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_ATTR_SETCREATESUSPEND_NP 3 .Os .Sh NAME .Nm pthread_attr_setcreatesuspend_np .Nd prepare attribute for creation of suspended thread .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_attr_setcreatesuspend_np "pthread_attr_t *attr" .Sh DESCRIPTION The .Fn pthread_attr_setcreatesuspend_np instructs .Xr pthread_create 3 that the thread created with the .Fa attr attribute should be created and left in a suspended state until explicitly resumed by the call to .Fn pthread_resume_np or .Fn pthread_resume_all_np . .Sh RETURN VALUES .Rv -std pthread_attr_setcreatesuspend_np .Sh ERRORS The .Fn pthread_attr_setcreatesuspend_np function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Sh SEE ALSO .Xr pthread_attr_destroy 3 , .Xr pthread_attr_init 3 , .Xr pthread_create 3 , +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_getthreadid_np.3 b/share/man/man3/pthread_getthreadid_np.3 index a912e7d42efa..562f6a7ae91a 100644 --- a/share/man/man3/pthread_getthreadid_np.3 +++ b/share/man/man3/pthread_getthreadid_np.3 @@ -1,56 +1,57 @@ .\" Copyright (c) 2011 Jung-uk Kim .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd October 12, 2021 .Dt PTHREAD_GETTHREADID_NP 3 .Os .Sh NAME .Nm pthread_getthreadid_np .Nd get the calling thread's integral ID .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_getthreadid_np void .Sh DESCRIPTION The .Fn pthread_getthreadid_np function returns the unique integral ID of the calling thread. Its semantics is similar to the AIX's .Fn pthread_getthreadid_np function. .Sh RETURN VALUES The .Fn pthread_getthreadid_np function returns the thread integral ID of the calling thread. .Sh ERRORS None. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_self 3 .Sh AUTHORS This manual page was written by .An Jung-uk Kim Aq Mt jkim@FreeBSD.org . diff --git a/share/man/man3/pthread_join.3 b/share/man/man3/pthread_join.3 index 799f6409fbfa..4cd04eade0aa 100644 --- a/share/man/man3/pthread_join.3 +++ b/share/man/man3/pthread_join.3 @@ -1,174 +1,176 @@ .\" Copyright (c) 1996-1998 John Birrell . .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by John Birrell. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2019 +.Dd October 12, 2021 .Dt PTHREAD_JOIN 3 .Os .Sh NAME .Nm pthread_join , .Nm pthread_peekjoin_np , .Nm pthread_timedjoin_np .Nd inspect thread termination state .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_join "pthread_t thread" "void **value_ptr" .In pthread_np.h .Ft int .Fo pthread_peekjoin_np .Fa "pthread_t thread" .Fa "void **value_ptr" .Fc .Ft int .Fo pthread_timedjoin_np .Fa "pthread_t thread" .Fa "void **value_ptr" .Fa "const struct timespec *abstime" .Fc .Sh DESCRIPTION The .Fn pthread_join function suspends execution of the calling thread until the target .Fa thread terminates unless the target .Fa thread has already terminated. .Pp On return from a successful .Fn pthread_join call with a non-NULL .Fa value_ptr argument, the value passed to .Fn pthread_exit by the terminating thread is stored in the location referenced by .Fa value_ptr . When a .Fn pthread_join returns successfully, the target thread has been terminated. The results of multiple simultaneous calls to .Fn pthread_join specifying the same target thread are undefined. If the thread calling .Fn pthread_join is cancelled, then the target thread is not detached. .Pp The .Fn pthread_timedjoin_np function is equivalent to the .Fn pthread_join function except it will return .Er ETIMEDOUT if target thread does not exit before specified absolute time passes. .Pp The .Fn pthread_peekjoin_np only peeks into the exit status of the specified thread. If the thread has not exited, the .Er EBUSY error is returned. Otherwise, zero is returned and the thread exit value is optionally stored into the location of .Fa *value_ptr . The target thread is left unjoined and can be used as an argument for the .Fn pthread_join family of functions again. .Pp A thread that has exited but remains unjoined counts against [_POSIX_THREAD_THREADS_MAX]. .Sh RETURN VALUES If successful, the described functions return zero. Otherwise an error number is returned to indicate the error or special condition. .Sh ERRORS The .Fn pthread_join , .Fn pthread_peekjoin_np , and .Fn pthread_timedjoin_np functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The implementation has detected that the value specified by .Fa thread does not refer to a joinable thread. .It Bq Er ESRCH No thread could be found corresponding to that specified by the given thread ID, .Fa thread . .It Bq Er EDEADLK A deadlock was detected or the value of .Fa thread specifies the calling thread. .It Bq Er EOPNOTSUPP The implementation detected that another caller is already waiting on .Fa thread . .El .Pp Additionally, the .Fn pthread_timedjoin_np function will fail if: .Bl -tag -width Er .It Bq Er ETIMEDOUT The specified absolute time passed while .Fn pthread_timedjoin_np waited for thread exit. .El .Pp The .Fn pthread_peekjoin_np function will also fail if: .Bl -tag -width Er .It Bq Er EBUSY The specified thread has not yet exited. .El .Sh SEE ALSO .Xr wait 2 , -.Xr pthread_create 3 +.Xr pthread 3 , +.Xr pthread_create 3 , +.Xr pthread_np 3 .Sh STANDARDS The .Fn pthread_join function conforms to .St -p1003.1-96 . The .Fn pthread_timedjoin_np function is a .Fx extension which first appeared in .Fx 6.1 . Another extension, the .Fn pthread_peekjoin_np function, first appearead in .Fx 13.0 . diff --git a/share/man/man3/pthread_main_np.3 b/share/man/man3/pthread_main_np.3 index 81669b786094..c386cb224a9b 100644 --- a/share/man/man3/pthread_main_np.3 +++ b/share/man/man3/pthread_main_np.3 @@ -1,60 +1,61 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MAIN_NP 3 .Os .Sh NAME .Nm pthread_main_np .Nd identify the initial thread .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_main_np void .Sh DESCRIPTION The .Fn pthread_main_np function is used in userland threads environment to identify the initial thread. Its semantics is similar to the Solaris's .Fn thr_main function. .Sh RETURN VALUES The .Fn pthread_main_np function returns 1 if the calling thread is the initial thread, 0 if the calling thread is not the initial thread, and \-1 if the thread's initialization has not yet completed. .Sh SEE ALSO .Xr pthread_create 3 , .Xr pthread_equal 3 , +.Xr pthread_np 3 , .Xr pthread_self 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_multi_np.3 b/share/man/man3/pthread_multi_np.3 index c790d358ca3c..065b53c49b1f 100644 --- a/share/man/man3/pthread_multi_np.3 +++ b/share/man/man3/pthread_multi_np.3 @@ -1,66 +1,67 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MULTI_NP 3 .Os .Sh NAME .Nm pthread_multi_np , .Nm pthread_single_np .Nd "switch between multi- and single-threaded scheduling modes" .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_multi_np void .Ft int .Fn pthread_single_np void .Sh DESCRIPTION The .Fn pthread_single_np function switches the process to a single-threaded mode, i.e., suspends all threads except the current. The semantics of this function is similar to .Xr pthread_suspend_all_np 3 . .Pp The .Fn pthread_multi_np function switches the process to a multi-threaded mode. The semantics of this function is similar to .Xr pthread_resume_all_np 3 . .Sh RETURN VALUES The .Fn pthread_multi_np and .Nm pthread_single_np functions always return 0. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_suspend_all_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_mutexattr_getkind_np.3 b/share/man/man3/pthread_mutexattr_getkind_np.3 index fe5435f90c30..cc3cc3df20ae 100644 --- a/share/man/man3/pthread_mutexattr_getkind_np.3 +++ b/share/man/man3/pthread_mutexattr_getkind_np.3 @@ -1,81 +1,82 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_MUTEXATTR_GETKIND_NP 3 .Os .Sh NAME .Nm pthread_mutexattr_getkind_np , .Nm pthread_mutexattr_setkind_np .Nd mutex attribute operations (legacy) .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_mutexattr_getkind_np "pthread_mutexattr_t attr" .Ft int .Fn pthread_mutexattr_setkind_np "pthread_mutexattr_t *attr" "int kind" .Sh DESCRIPTION .Bf -symbolic These functions are deprecated and non-portable implementation of the mutex type manipulation. .Ef .Pp It is recommended to use the .Xr pthread_mutexattr_gettype 3 and .Xr pthread_mutexattr_settype 3 functions instead. .Sh RETURN VALUES The .Fn pthread_mutexattr_getkind_np function returns a positive value representing the .Dq kind of the mutex attribute .Fa attr if successful; otherwise the value \-1 is returned and the global variable .Va errno is set to indicate the error. .Pp .Rv -std pthread_mutexattr_setkind_np .Sh ERRORS The .Fn pthread_mutexattr_getkind_np and .Fn pthread_mutexattr_setkind_np functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Sh SEE ALSO .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , .Xr pthread_mutexattr_gettype 3 , -.Xr pthread_mutexattr_settype 3 +.Xr pthread_mutexattr_settype 3 , +.Xr pthread_np 3 diff --git a/share/man/man3/pthread_np.3 b/share/man/man3/pthread_np.3 new file mode 100644 index 000000000000..caab8cc13209 --- /dev/null +++ b/share/man/man3/pthread_np.3 @@ -0,0 +1,230 @@ +.\" Copyright (c) 2021 Felix Johnson +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd October 12, 2021 +.Dt PTHREAD_NP 3 +.Os +.Sh NAME +.Nm pthread_np +.Nd FreeBSD extensions to POSIX thread functions +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Sh DESCRIPTION +This manual page documents extensions to the POSIX thread functions. +These extensions may or may not be portable to other operating systems. +.Pp +The POSIX thread functions are summarized in this section in the following +groups: +.Pp +.Bl -bullet -offset indent -compact +.It +Thread Routines +.It +Attribute Object Routines +.It +Mutex Routines +.El +.\" .It +.\" Condition Variable Routines +.\" .It +.\" Read/Write Lock Routines +.\" .It +.\" Per-Thread Context Routines +.\" .It +.\" Cleanup Routines +.Ss Thread Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fo pthread_getaffinity_np +.Fa "pthread_t td" "size_t cpusetsize" "cpuset_t *cpusetp" +.Fc +.Xc +Get the CPU affinity of a specified thread. +.It Xo +.Ft int +.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" +.Xc +Get the name of a specified thread. +.It Xo +.Ft int +.Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" +.Xc +Get the name of a specified thread. +.It Xo +.Ft int +.Fn pthread_getthreadid_np void +.Xc +Get the calling thread's integral ID. +.It Xo +.Ft int +.Fn pthread_main_np void +.Xc +Identify the initial thread. +.It Xo +.Ft int +.Fn pthread_multi_np void +.Xc +Sets the thread's scheduling mode to multi-threaded. +.It Xo +.Ft int +.Fn pthread_peekjoin_np "pthread_t thread" "void **value_ptr" +.Xc +Peek into the exit status of a specified thread. +.It Xo +.Ft int +.Fn pthread_resume_all_np void +.Xc +Resume all suspended threads. +.It Xo +.Ft int +.Fo pthread_setaffinity_np +.Fa "pthread_t td" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Fc +.Xc +Set the CPU affinity of a specified thread. +.It Xo +.Ft int +.Fn pthread_set_name_np "pthread_t thread" "char *name" +.Xc +Sets the specified thread's name. +.It Xo +.Ft int +.Fn pthread_setname_np "pthread_t thread" "char *name" +.Xc +Sets the specified thread's name. +.It Xo +.Ft int +.Fn pthread_single_np void +.Xc +Sets the thread's scheduling mode to single-threaded. +.It Xo +.Ft int +.Fn pthread_suspend_np "pthread_t tid" +.Xc +Suspend the specified thread. +.It Xo +.Ft int +.Fn pthread_suspend_all_np void +.Xc +Suspend all active threads. +.It Xo +.Ft int +.Fn pthread_switch_add_np "pthread_switch_routine_t routine" +.Xc +Install a routine that is called every time a thread context switches. +.It Xo +.Ft int +.Fn pthread_switch_delete_np "pthread_switch_routine_t routine" +.Xc +Remove a routine that is called every time a thread context switches. +.It Xo +.Ft int +.Fo pthread_timedjoin_np +.Fa "pthread_t thread" "void **value_ptr" "const struct timespec *abstime" +.Fc +.Xc +A variant of +.Fn pthread_join +with a timeout. +.El +.Ss Attribute Object Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fo pthread_attr_get_np +.Fa "pthread_t pid" "pthread_attr_t *dst" +.Fc +.Xc +Get the attributes of an existent thread. +.It Xo +.Ft int +.Fo pthread_attr_getaffinity_np +.Fa "const pthread_attr_t *pattr" "size_t cpusetsize" "cpuset_t *cpusetp" +.Fc +.Xc +Get the CPU affinity mask from the thread attribute object. +.It Xo +.Ft int +.Fo pthread_attr_setaffinity_np +.Fa "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Fc +.Xc +Set the CPU affinity mask for the thread attribute object. +.It Xo +.Ft int +.Fn pthread_attr_setcreatesuspend_np "pthread_attr_t *attr" +.Xc +Permit creation of suspended threads. +.El +.Ss Mutex Routines +.Bl -tag -width indent +.It Xo +.Ft int +.Fn pthread_mutexattr_getkind_np "pthread_mutexattr_t attr" +.Xc +Deprecated, use +.Xr pthread_mutexattr_gettype 3 +instead. +.It Xo +.Ft int +.Fn pthread_mutexattr_setkind_np "pthread_mutexattr_t *attr" +.Xc +Deprecated, use +.Xr pthread_mutexattr_settype 3 +instead. +.El +.\" .Ss Condition Variable Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Read/Write Lock Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Per-Thread Context Routines +.\" .Bl -tag -width indent +.\" .El +.\" .Ss Cleanup Routines +.\" .Bl -tag -width indent +.\" .El +.Sh SEE ALSO +.Xr libthr 3 , +.Xr pthread 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 , +.Xr pthread_attr_get_np 3 , +.Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_getthreadid_np 3 , +.Xr pthread_join 3 , +.Xr pthread_main_np 3 , +.Xr pthread_multi_np 3 , +.Xr pthread_mutexattr_getkind_np 3 , +.Xr pthread_resume_all_np 3 , +.Xr pthread_resume_np 3 , +.Xr pthread_set_name_np 3 , +.Xr pthread_suspend_all_np 3 , +.Xr pthread_suspend_np 3 , +.Xr pthread_switch_add_np 3 +.Sh STANDARDS +All of these functions are non-portable extensions to POSIX threads. diff --git a/share/man/man3/pthread_resume_all_np.3 b/share/man/man3/pthread_resume_all_np.3 index 0ac6736a9b74..40df03a07af1 100644 --- a/share/man/man3/pthread_resume_all_np.3 +++ b/share/man/man3/pthread_resume_all_np.3 @@ -1,51 +1,52 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_RESUME_ALL_NP 3 .Os .Sh NAME .Nm pthread_resume_all_np .Nd resume all suspended threads .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft void .Fn pthread_resume_all_np void .Sh DESCRIPTION The .Fn pthread_resume_all_np function causes all active threads to be scanned and resumes those which were previously suspended. .Sh SEE ALSO .Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_all_np 3 , .Xr pthread_suspend_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_resume_np.3 b/share/man/man3/pthread_resume_np.3 index 898dbf9c0d11..16833872c010 100644 --- a/share/man/man3/pthread_resume_np.3 +++ b/share/man/man3/pthread_resume_np.3 @@ -1,72 +1,73 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_RESUME_NP 3 .Os .Sh NAME .Nm pthread_resume_np .Nd resume suspended thread .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_resume_np "pthread_t tid" .Sh DESCRIPTION The .Fn pthread_resume_np function, called on a suspended thread, causes it to resume. If a thread specified by the .Fa tid argument is not suspended, no actions will be performed. .Sh RETURN VALUES If successful, .Fn pthread_resume_np function returns 0. Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_resume_np function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by the .Fa tid argument is invalid. .It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. .El .Sh SEE ALSO .Xr pthread_attr_setcreatesuspend_np 3 , +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_suspend_all_np 3 , .Xr pthread_suspend_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_set_name_np.3 b/share/man/man3/pthread_set_name_np.3 index af668165d91a..5fb627a5a182 100644 --- a/share/man/man3/pthread_set_name_np.3 +++ b/share/man/man3/pthread_set_name_np.3 @@ -1,108 +1,109 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd June 3, 2020 +.Dd October 12, 2021 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME .Nm pthread_get_name_np , .Nm pthread_getname_np , .Nm pthread_set_name_np .Nm pthread_setname_np .Nd set and retrieve the thread name .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft void .Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" .Ft int .Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" .Ft void .Fn pthread_set_name_np "pthread_t thread" "const char *name" .Ft int .Fn pthread_setname_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The .Fn pthread_set_name_np and .Fn pthread_setname_np functions apply a copy of the given .Fa name to the given .Fa thread . .Pp The .Fn pthread_get_name_np and .Fn pthread_getname_np functions retrieve the .Fa name associated with .Fa thread . If .Fn pthread_set_name_np was not previously called for .Fa thread , the buffer pointed to by .Fa name will be empty. .Sh ERRORS The .Nm pthread_getname_np and .Nm pthread_setname_np will fail if .Bl -tag -width Er .It Bq Er ESRCH No thread could be found in the current process corresponding to that specified by the given thread ID .Fa thread . .El .Pp Because of the debugging nature of .Nm pthread_get_name_np and .Nm pthread_set_name_np functions, all errors that may appear inside are silently ignored. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr thr_set_name 2 .Sh STANDARDS .Fn pthread_set_name_np and .Fn pthread_get_name_np are non-standard extensions. .Fn pthread_setname_np and .Fn pthread_getname_np are also non-standard, but are implemented by larger number of operating systems so they are in fact more portable. .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org and .An Yuri Pankov Aq Mt yuripv@yuripv.net . diff --git a/share/man/man3/pthread_suspend_all_np.3 b/share/man/man3/pthread_suspend_all_np.3 index ecedca3ee24d..2821c7360786 100644 --- a/share/man/man3/pthread_suspend_all_np.3 +++ b/share/man/man3/pthread_suspend_all_np.3 @@ -1,60 +1,61 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd October 12, 2021 .Dt PTHREAD_SUSPEND_ALL_NP 3 .Os .Sh NAME .Nm pthread_suspend_all_np .Nd suspend all active threads .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft void .Fn pthread_suspend_all_np void .Sh DESCRIPTION The .Fn pthread_suspend_all_np function causes all active threads to be suspended. The only exception is the current thread, the thread that called the .Fn pthread_suspend_all_np function. .Pp It is not safe for the caller of the .Fn pthread_suspend_all_np function to use any non-async signal safe functions, besides .Xr pthread_resume_all_np 3 , until threads are resumed, unless measures are taken to ensure that all threads are suspended at safe points. .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_suspend_np.3 b/share/man/man3/pthread_suspend_np.3 index ca8c72a38c52..58bcf56964b6 100644 --- a/share/man/man3/pthread_suspend_np.3 +++ b/share/man/man3/pthread_suspend_np.3 @@ -1,77 +1,78 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd May 5, 2016 +.Dd October 12, 2021 .Dt PTHREAD_SUSPEND_NP 3 .Os .Sh NAME .Nm pthread_suspend_np .Nd suspend a thread .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_suspend_np "pthread_t tid" .Sh DESCRIPTION The .Fn pthread_suspend_np function, called on an active thread, causes it to suspend. .Pp It is not safe for the caller of the .Fn pthread_suspend_np function to use any non-async signal safe functions, except .Xr pthread_resume_np 3 , until suspended thread is resumed, unless measures are taken to ensure that the thread is suspended at a safe point. .Sh RETURN VALUES If successful, .Fn pthread_suspend_np function returns 0. Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_suspend_np function will fail if: .Bl -tag -width Er .It Bq Er EDEADLK An attempt was made to suspend the current thread. .It Bq Er EINVAL The value specified by the .Fa tid argument is invalid. .It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. .El .Sh SEE ALSO +.Xr pthread_np 3 , .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , .Xr pthread_suspend_all_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . diff --git a/share/man/man3/pthread_switch_add_np.3 b/share/man/man3/pthread_switch_add_np.3 index e3400e790335..ddfa630ffd9a 100644 --- a/share/man/man3/pthread_switch_add_np.3 +++ b/share/man/man3/pthread_switch_add_np.3 @@ -1,87 +1,88 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd October 12, 2021 .Dt PTHREAD_SWITCH_ADD_NP 3 .Os .Sh NAME .Nm pthread_switch_add_np , .Nm pthread_switch_delete_np .Nd thread context switches debugging primitives .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_switch_add_np "pthread_switch_routine_t routine" .Ft int .Fn pthread_switch_delete_np "pthread_switch_routine_t routine" .Sh DESCRIPTION An application is allowed to monitor the thread context switches inside the threading library. An application can install a routine that gets called every time a thread (explicitly created by an application with the .Xr pthread_create 3 function) gets the context switched. The routine is passed the thread IDs of the threads that are being switched in and out. Installation and removal of these hooks may be done using the .Fn pthread_switch_add_np and .Fn pthread_switch_delete_np functions respectively. .Sh RETURN VALUES If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_switch_add_np may fail if: .Bl -tag -width Er .It Bq Er EINVAL .Dv NULL pointer was passed in the .Fa routine argument. .El .Pp The .Fn pthread_switch_delete_np may fail if: .Bl -tag -width Er .It Bq Er EINVAL The .Fa routine argument is different from the argument previously passed to the .Fn pthread_switch_add_np function. .El .Sh SEE ALSO -.Xr pthread_create 3 +.Xr pthread_create 3 , +.Xr pthread_np 3 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org .