diff options
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r-- | usr/src/man/man3c/Makefile | 12 | ||||
-rw-r--r-- | usr/src/man/man3c/pthread_attr_getname_np.3c | 105 | ||||
-rw-r--r-- | usr/src/man/man3c/pthread_getname_np.3c | 124 | ||||
-rw-r--r-- | usr/src/man/man3c/thr_getname.3c | 124 |
4 files changed, 365 insertions, 0 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 2c890a7f47..9d1c679e65 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -307,6 +307,7 @@ MANFILES= __fbufsize.3c \ pthread_attr_getdetachstate.3c \ pthread_attr_getguardsize.3c \ pthread_attr_getinheritsched.3c \ + pthread_attr_getname_np.3c \ pthread_attr_getschedparam.3c \ pthread_attr_getschedpolicy.3c \ pthread_attr_getscope.3c \ @@ -332,6 +333,7 @@ MANFILES= __fbufsize.3c \ pthread_equal.3c \ pthread_exit.3c \ pthread_getconcurrency.3c \ + pthread_getname_np.3c \ pthread_getschedparam.3c \ pthread_getspecific.3c \ pthread_join.3c \ @@ -475,6 +477,7 @@ MANFILES= __fbufsize.3c \ termios.3c \ thr_create.3c \ thr_exit.3c \ + thr_getname.3c \ thr_getconcurrency.3c \ thr_getprio.3c \ thr_join.3c \ @@ -1092,6 +1095,7 @@ MANLINKS= FD_CLR.3c \ pthread_attr_setdetachstate.3c \ pthread_attr_setguardsize.3c \ pthread_attr_setinheritsched.3c \ + pthread_attr_setname_np.3c \ pthread_attr_setschedparam.3c \ pthread_attr_setschedpolicy.3c \ pthread_attr_setscope.3c \ @@ -1128,6 +1132,7 @@ MANLINKS= FD_CLR.3c \ pthread_rwlockattr_destroy.3c \ pthread_rwlockattr_setpshared.3c \ pthread_setconcurrency.3c \ + pthread_setname_np.3c \ pthread_setschedparam.3c \ pthread_setspecific.3c \ pthread_spin_init.3c \ @@ -1291,6 +1296,7 @@ MANLINKS= FD_CLR.3c \ thr_continue.3c \ thr_getspecific.3c \ thr_keycreate_once.3c \ + thr_setname.3c \ thr_setconcurrency.3c \ thr_setprio.3c \ thr_setspecific.3c \ @@ -2140,6 +2146,8 @@ pthread_attr_setguardsize.3c := LINKSRC = pthread_attr_getguardsize.3c pthread_attr_setinheritsched.3c := LINKSRC = pthread_attr_getinheritsched.3c +pthread_attr_setname_np.3c := LINKSRC = pthread_attr_getname_np.3c + pthread_attr_setschedparam.3c := LINKSRC = pthread_attr_getschedparam.3c pthread_attr_setschedpolicy.3c := LINKSRC = pthread_attr_getschedpolicy.3c @@ -2174,6 +2182,8 @@ pthread_condattr_destroy.3c := LINKSRC = pthread_condattr_init.3c pthread_setconcurrency.3c := LINKSRC = pthread_getconcurrency.3c +pthread_setname_np.3c := LINKSRC = pthread_getname_np.3c + pthread_setschedparam.3c := LINKSRC = pthread_getschedparam.3c pthread_setspecific.3c := LINKSRC = pthread_getspecific.3c @@ -2408,6 +2418,8 @@ thr_setspecific.3c := LINKSRC = thr_keycreate.3c thr_continue.3c := LINKSRC = thr_suspend.3c +thr_setname.3c := LINKSRC = thr_getname.3c + timegm.3c := LINKSRC = mktime.3c timer_getoverrun.3c := LINKSRC = timer_settime.3c diff --git a/usr/src/man/man3c/pthread_attr_getname_np.3c b/usr/src/man/man3c/pthread_attr_getname_np.3c new file mode 100644 index 0000000000..fbac370410 --- /dev/null +++ b/usr/src/man/man3c/pthread_attr_getname_np.3c @@ -0,0 +1,105 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2018 Joyent, Inc. +.\" +.Dd "August 22, 2018" +.Dt PTHREAD_ATTR_GETNAME_NP 3C +.Os +.Sh NAME +.Nm pthread_attr_getname_np , +.Nm pthread_attr_setname_np +.Nd get or set thread name attribute +.Sh SYNOPSIS +.In pthread.h +. +.Ft int +.Fo pthread_attr_getname_np +.Fa "pthread_attr_t *restrict attr" +.Fa "char *name" +.Fa "size_t len" +.Fc +. +.Ft int +.Fo pthread_attr_setname_np +.Fa "pthread_attr_t *restrict attr" +.Fa "const char *name" +.Fc +. +.Sh DESCRIPTION +The +.Fn pthread_attr_setname_np +and +.Fn pthread_attr_getname_np +functions, respectively, set and get the thread name attribute in +.Fa attr +to +.Fa name . +For +.Fn pthread_attr_getname_np , +.Fa len +is the size of +.Fa name . +Any threads created with +.Xr pthread_create 3c +using +.Fa attr +will have their name set to +.Fa name +upon creation. +.Pp +Thread names are limited to +.Dv PTHREAD_MAX_NAMELEN_NP +including the terminating NUL. +They may only contain printable ASCII characters. +.Sh RETURN VALUES +Upon successful completion, the +.Fn pthread_attr_getname_np +and +.Fn pthread_attr_setname_np +functions return +.Sy 0 . +Otherwise, an error number is returned to indicate the error. +.Sh ERRORS +The +.Fn pthread_attr_getname_np +function may fail with: +.Bl -tag -width Er +.It Er EINVAL +The +.Fa name +argument is +.Sy NULL . +.It Er ERANGE +The size of +.Fa name +as indicated by +.Fa len +is too small to contain the thread name. +The buffer may be over-written with partial contents of the thread name. +.El +.Pp +The +.Fn pthread_attr_setname_np +function may fail with: +.Bl -tag -width Er +.It Er ERANGE +The length of name given in +.Fa name +exceeds the maximum size allowed. +.El +.Sh INTERFACE STABILITY +.Sy Uncommitted +.Sh MT-LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr pthread_create 3c , +.Xr pthread_getname_np 3c diff --git a/usr/src/man/man3c/pthread_getname_np.3c b/usr/src/man/man3c/pthread_getname_np.3c new file mode 100644 index 0000000000..7404a4abfe --- /dev/null +++ b/usr/src/man/man3c/pthread_getname_np.3c @@ -0,0 +1,124 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2018 Joyent, Inc. +.\" +.Dd "August 22, 2018" +.Dt PTHREAD_GETNAME_NP 3C +.Os +.Sh NAME +.Nm pthread_getname_np , +.Nm pthread_setname_np +.Nd get or set the name of a thread +.Sh SYNOPSIS +.In pthread.h +. +.Ft int +.Fo pthread_getname_np +.Fa "pthread_t tid" +.Fa "char *name" +.Fa "size_t len" +.Fc +. +.Ft int +.Fo pthread_setname_np +.Fa "pthread_t tid" +.Fa "const char *name" +.Fc +. +.Sh DESCRIPTION +The +.Fn pthread_getname_np +and +.Fn pthread_setname_np +functions, respectively, get and set the names of the thread whose id is given +by the +.Fa tid +parameter. +For +.Fn pthread_getname_np , +.Fa len +indicates the size of +.Fa name . +.Pp +Thread names are limited to +.Dv PTHREAD_MAX_NAMELEN_NP +including the terminating NUL. +They may only contain printable ASCII characters. +.Pp +To clear a thread name, call +.Fn pthread_setname_np +with +.Sy NULL . +.Pp +Unlike some other systems, threads do not inherit the process name by default. +.Sh RETURN VALUES +Upon successful completion, the +.Fn pthread_getname_np +and +.Fn pthread_setname_np +functions return +.Sy 0 . +Otherwise, an error number is returned to indicate the error. +If the thread identified by +.Fa tid +does not have a name set, +.Fa pthread_getname_np +will be set to an empty string (length = 0). +.Sh ERRORS +On failure, the contents of the buffer are undefined. +Errors from +.Xr open 2 , +.Xr read 2 , +or +.Xr write 2 +are possible. +In addition, the +.Fn pthread_getname_np +function will fail with: +.Bl -tag -width Er +.It Er EINVAL +The +.Fa name +argument is +.Sy NULL . +.It Er ERANGE +The size of +.Fa name +as given by +.Fa len +was not large enough to contain the name of the thread. +.It Er ESRCH +The thread +.Fa tid +was not found. +.El +.Pp +The +.Fn pthread_setname_np +function will fail with: +.Bl -tag -width Er +.It Er ERANGE +The length of +.Fa name +exceeds the maximum allowed size. +.It Er ESRCH +The thread +.Fa tid +was not found. +.El +.Sh INTERFACE STABILITY +.Sy Uncommitted +.Sh MT-LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr pthread_attr_getname_np 3c , +.Xr pthread_create 3c diff --git a/usr/src/man/man3c/thr_getname.3c b/usr/src/man/man3c/thr_getname.3c new file mode 100644 index 0000000000..551e620d46 --- /dev/null +++ b/usr/src/man/man3c/thr_getname.3c @@ -0,0 +1,124 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2018 Joyent, Inc. +.\" +.Dd "August 22, 2018" +.Dt THR_GETNAME 3C +.Os +.Sh NAME +.Nm thr_getname , +.Nm thr_setname +.Nd get or set the name of a thread +.Sh SYNOPSIS +.In thread.h +. +.Ft int +.Fo thr_getname +.Fa "thread_t tid" +.Fa "char *name" +.Fa "size_t len" +.Fc +. +.Ft int +.Fo thr_setname +.Fa "thread_t tid" +.Fa "const char *name" +.Fc +. +.Sh DESCRIPTION +The +.Fn thr_getname +and +.Fn thr_setname +functions, respectively, get and set the names of the thread whose id is given +by the +.Fa tid +parameter. +For +.Fn thr_getname , +.Fa len +indicates the size of +.Fa name . +.Pp +Thread names are limited to +.Dv THREAD_NAME_MAX +including the terminating NUL. +They may only contain printable ASCII characters. +.Pp +To clear a thread name, call +.Fn thr_setname +with +.Sy NULL . +.Pp +Unlike some other systems, threads do not inherit the process name by default. +.Sh RETURN VALUES +Upon successful completion, the +.Fn thr_getname +and +.Fn thr_setname +functions return +.Sy 0 . +Otherwise, an error number is returned to indicate the error. +If the thread identified by +.Fa tid +does not have a name set, +.Fa thr_getname +will be set to an empty string (length = 0). +.Sh ERRORS +On failure, the contents of the buffer are undefined. +Errors from +.Xr open 2 , +.Xr read 2 , +or +.Xr write 2 +are possible. +In addition, the +.Fn thr_getname +function will fail with: +.Bl -tag -width Er +.It Er EINVAL +The +.Fa name +argument is +.Sy NULL . +.It Er ERANGE +The size of +.Fa name +as given by +.Fa len +was not large enough to contain the name of the thread. +.It Er ESRCH +The thread +.Fa tid +was not found. +.El +.Pp +The +.Fn thr_setname +function will fail with: +.Bl -tag -width Er +.It Er ERANGE +The length of +.Fa name +exceeds the maximum allowed size. +.It Er ESRCH +The thread +.Fa tid +was not found. +.El +.Sh INTERFACE STABILITY +.Sy Uncommitted +.Sh MT-LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr pthread_setname_np 3c , +.Xr thr_create 3c |