mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +00:00
Make fixes and improvements
- clock_nanosleep() is now much faster on OpenBSD and NetBSD - Thread joining is now much faster on NetBSD - FreeBSD timestamps are now more accurate - Thread spawning now goes faster on XNU - Clean up the clone() code
This commit is contained in:
parent
aee50b1327
commit
b407327972
47 changed files with 645 additions and 306 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/asmflag.h"
|
||||
#include "libc/intrin/atomic.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/pr.h"
|
||||
|
@ -31,12 +32,13 @@
|
|||
|
||||
static errno_t pthread_setname_impl(pthread_t thread, const char *name) {
|
||||
char path[128], *p;
|
||||
int fd, rc, tid, len, e = errno;
|
||||
int e, fd, rc, tid, len;
|
||||
|
||||
tid = ((struct PosixThread *)thread)->tid;
|
||||
if ((rc = pthread_getunique_np(thread, &tid))) return rc;
|
||||
len = strlen(name);
|
||||
|
||||
if (IsLinux()) {
|
||||
e = errno;
|
||||
if (tid == gettid()) {
|
||||
if (prctl(PR_SET_NAME, name) == -1) {
|
||||
rc = errno;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue