-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use *const pointer for NetBSD's pthread_setname_np #1608
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@lzutao did you run the libc-test suite on NetBSD ? |
@gnzlbg I didn't because I don't have NetBSD machines. int
pthread_setname_np(pthread_t thread, const char *name, void *arg)
{
char *oldname, *cp, newname[PTHREAD_MAX_NAMELEN_NP];
int namelen;
if (pthread__find(thread) != 0)
return ESRCH;
if (thread->pt_magic != PT_MAGIC)
return EINVAL;
namelen = snprintf(newname, sizeof(newname), name, arg);
if (namelen >= PTHREAD_MAX_NAMELEN_NP)
return EINVAL;
cp = strdup(newname);
if (cp == NULL)
return ENOMEM;
pthread_mutex_lock(&thread->pt_lock);
oldname = thread->pt_name;
thread->pt_name = cp;
(void)_lwp_setname(thread->pt_lid, cp);
pthread_mutex_unlock(&thread->pt_lock);
if (oldname != NULL)
free(oldname);
return 0;
} |
📌 Commit f851312 has been approved by |
use *const pointer for NetBSD's pthread_setname_np
💔 Test failed - status-azure |
@bors: retry |
use *const pointer for NetBSD's pthread_setname_np
☀️ Test successful - checks-cirrus-freebsd-10, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, status-azure |
No description provided.