Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_getname_np(3) [netbsd man page]

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
Man Page

9 More Discussions You Might Find Interesting

1. Programming

Threads = SIGSEV ?

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)
Discussion started by: sendai
2 Replies

2. Shell Programming and Scripting

Stripping out extensions when file has multiple dots in name

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

Open any thread, get a zero-byte blank page

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)
Discussion started by: Corona688
2 Replies

4. Programming

Thread parameter in ANSI C makes a segmentation fault

The creation of thread. void Client_Constructor ( const char* IPAddr ) { pthread_t tid; pthread_attr_t rx; /* Create separate memory for client argument */ struct ThreadArgs *threadArgs; if ( ( threadArgs = ( struct ThreadArgs* ) malloc( sizeof( struct ThreadArgs )... (14 Replies)
Discussion started by: sehang
14 Replies

5. UNIX for Dummies Questions & Answers

Difference between handle to the thread HANDLE and thread identifier pthread_t

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)
Discussion started by: rupeshkp728
0 Replies

6. Programming

Debug Threads

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)
Discussion started by: rupeshkp728
1 Replies

7. UNIX for Dummies Questions & Answers

Invalid back reference

The thread can be closed now :D. (3 Replies)
Discussion started by: vaz0r
3 Replies

8. Shell Programming and Scripting

Get last field specific record

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)
Discussion started by: ANSHUMAN1983
2 Replies

9. UNIX for Beginners Questions & Answers

How to use printf in bash

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)
Discussion started by: sheltie042
2 Replies