mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Introduce clock_nanosleep()
This commit is contained in:
parent
fe3216e961
commit
b75a4654cf
33 changed files with 553 additions and 100 deletions
|
@ -111,10 +111,10 @@ privileged void __enable_tls(void) {
|
|||
// malloc() being linked, which links _mapanon(). otherwise
|
||||
// if you exceed this, you need to STATIC_YOINK("_mapanon").
|
||||
// please note that it's probably too early to call calloc()
|
||||
assert(_weaken(_mapanon));
|
||||
_npassert(_weaken(_mapanon));
|
||||
siz = ROUNDUP(siz, FRAMESIZE);
|
||||
mem = _weaken(_mapanon)(siz);
|
||||
assert(mem);
|
||||
_npassert(mem);
|
||||
}
|
||||
if (IsAsan()) {
|
||||
// poison the space between .tdata and .tbss
|
||||
|
@ -140,7 +140,7 @@ privileged void __enable_tls(void) {
|
|||
int ax, dx;
|
||||
if (IsWindows()) {
|
||||
__tls_index = __imp_TlsAlloc();
|
||||
assert(0 <= __tls_index && __tls_index < 64);
|
||||
_npassert(0 <= __tls_index && __tls_index < 64);
|
||||
asm("mov\t%1,%%gs:%0" : "=m"(*((long *)0x1480 + __tls_index)) : "r"(tib));
|
||||
} else if (IsFreebsd()) {
|
||||
sys_enable_tls(AMD64_SET_FSBASE, tib);
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
* @raise EPERM if terminal is already controlling another sid
|
||||
*/
|
||||
int login_tty(int fd) {
|
||||
int rc;
|
||||
int i, rc;
|
||||
if (IsLinux() || IsBsd()) {
|
||||
setsid();
|
||||
if (!sys_ioctl(fd, TIOCSCTTY, 0)) {
|
||||
for (int i = 0; i < 3; ++i) dup2(fd, i);
|
||||
for (i = 0; i < 3; ++i) dup2(fd, i);
|
||||
if (fd > 2) close(fd);
|
||||
rc = 0;
|
||||
} else {
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define ShouldUseMsabiAttribute() 1
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/asmflag.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/enum/pageflags.h"
|
||||
#include "libc/nt/memory.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue