PTHREAD_GETNAME_NP(3) BSD Library Functions Manual PTHREAD_GETNAME_NP(3)NAME
pthread_getname_np -- get and set descriptive name of a thread
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_getname_np(pthread_t thread, char *name, size_t len);
int
pthread_setname_np(pthread_t thread, const char *name, void *arg);
DESCRIPTION
The pthread_getname_np() function obtains the descriptive name of a thread. It takes the following arguments:
thread The thread whose descriptive name will be obtained.
name The buffer to be filled with the descriptive name of the thread.
len The size of the buffer name in bytes.
The pthread_setname_np() function sets the descriptive name of a thread. It takes the following arguments:
thread The thread whose descriptive name will be set.
name The printf(3) format string to be used to construct the descriptive name of the thread. The resulted descriptive name should
be shorter than PTHREAD_MAX_NAMELEN_NP.
arg The printf(3) argument used with name.
RETURN VALUES
Both functions return 0 on success. Otherwise, an error number is returned to indicate the error.
COMPATIBILITY
Both functions are non-standard extensions.
ERRORS
Both functions may fail if:
[EINVAL] Invalid parameter.
[ESRCH] Non-existent thread.
The pthread_setname_np() function may also fail if:
[ENOMEM] There was insufficient memory for the operation.
SEE ALSO pthread_attr_get_np(3), pthread_attr_getname_np(3)BSD July 9, 2010 BSD
Check Out this Related Man Page
PTHREAD_ATTR_GETNAME_NP(3) BSD Library Functions Manual PTHREAD_ATTR_GETNAME_NP(3)NAME
pthread_attr_getname_np -- get and set descriptive name of an attribute
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_attr_getname_np(const pthread_attr_t attr, char *name, size_t len);
int
pthread_attr_setname_np(pthread_attr_t attr, const char *name, void *arg);
DESCRIPTION
The pthread_attr_getname_np() function gets the descriptive name of a thread attribute. It takes the following arguments:
attr The attribute whose descriptive name will be obtained.
name The buffer to be filled with the descriptive name of the attribute.
len The size of the buffer name in bytes.
The pthread_attr_setname_np() function sets the descriptive name of a thread attribute. It takes the following arguments:
attr The attribute whose descriptive name will be set.
name The printf(3) format string to be used to construct the descriptive name of the attribute. The resulted descriptive name should
be shorter than PTHREAD_MAX_NAMELEN_NP.
arg The printf(3) argument used with name.
RETURN VALUES
Both functions return 0 on success. Otherwise, an error number is returned.
COMPATIBILITY
Both functions are non-standard extensions.
ERRORS
No errors are defined for pthread_attr_getname_np().
The pthread_attr_setname_np() function may fail if:
[EINVAL] The supplied descriptive name was longer than PTHREAD_MAX_NAMELEN_NP.
[ENOMEM] There was insufficient memory for the operation.
SEE ALSO pthread_attr(3), pthread_getname_np(3)BSD July 7, 2010 BSD
I'm studing about thread and sometimes when I run this code i receive a SIGSEV
someone have some idea of wath is occuring?
gcc thread.c -o thread -pthread
#include <stdio.h>
#include <pthread.h>
int xip=0;
int main(){
int *thc;
//pthread_create(PID,thread arguments,Process... (2 Replies)
I posted this already in another thread, but was told that I should create a seperate thread for the following question:
How do I strip the extension when the delimiter might occur multiple times in the filename?
For example:
I have 2 files as input for my script.
test.extension... (8 Replies)
Discussion started by: Nemelis
8 Replies
3. Post Here to Contact Site Administrators and Moderators
I've made the thread title as descriptive as possible since I don't know if the admins can open it.
Well sure, now I can open THIS one. I'm getting it on any other thread I try in What's On Your Mind and High Level Programming.
Okay, it's decided to make a liar of me now. It seems to be... (2 Replies)
This question might be silly but its confusing me a bit:
What is the difference between handle to the thread HANDLE and thread identifier pthread_t?
---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ----------
Sorry I saw details and HANDLE is in windows and... (0 Replies)
How can we debug threaded application in Linux?
If we have some doubt on a thread then how to set the context of that thread and how to check the values of variables for that thread? (1 Reply)
i have file A as below contents
---------------------------
Use descriptive thread titles when posting.
For example, do not post questions with subjects like
"Help Me!", "Urgent!!" or "Doubt".
For example, do not post questions
For example, do not deliminated.
output file as below:... (2 Replies)
Hello, this is my first time on the forum. I seem to not have the ability to start a new thread. However, I have a very simple question. I am trying to write a script I have to use printf to say "My name is myname (pulled from $USER) . it works with echo, but with printf the $USER... (2 Replies)