mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-29 05:50:27 +00:00
Make improvements
- Every unit test now passes on Apple Silicon. The final piece of this puzzle was porting our POSIX threads cancelation support, since that works differently on ARM64 XNU vs. AMD64. Our semaphore support on Apple Silicon is also superior now compared to AMD64, thanks to the grand central dispatch library which lets *NSYNC locks go faster. - The Cosmopolitan runtime is now more stable, particularly on Windows. To do this, thread local storage is mandatory at all runtime levels, and the innermost packages of the C library is no longer being built using ASAN. TLS is being bootstrapped with a 128-byte TIB during the process startup phase, and then later on the runtime re-allocates it either statically or dynamically to support code using _Thread_local. fork() and execve() now do a better job cooperating with threads. We can now check how much stack memory is left in the process or thread when functions like kprintf() / execve() etc. call alloca(), so that ENOMEM can be raised, reduce a buffer size, or just print a warning. - POSIX signal emulation is now implemented the same way kernels do it with pthread_kill() and raise(). Any thread can interrupt any other thread, regardless of what it's doing. If it's blocked on read/write then the killer thread will cancel its i/o operation so that EINTR can be returned in the mark thread immediately. If it's doing a tight CPU bound operation, then that's also interrupted by the signal delivery. Signal delivery works now by suspending a thread and pushing context data structures onto its stack, and redirecting its execution to a trampoline function, which calls SetThreadContext(GetCurrentThread()) when it's done. - We're now doing a better job managing locks and handles. On NetBSD we now close semaphore file descriptors in forked children. Semaphores on Windows can now be canceled immediately, which means mutexes/condition variables will now go faster. Apple Silicon semaphores can be canceled too. We're now using Apple's pthread_yield() funciton. Apple _nocancel syscalls are now used on XNU when appropriate to ensure pthread_cancel requests aren't lost. The MbedTLS library has been updated to support POSIX thread cancelations. See tool/build/runitd.c for an example of how it can be used for production multi-threaded tls servers. Handles on Windows now leak less often across processes. All i/o operations on Windows are now overlapped, which means file pointers can no longer be inherited across dup() and fork() for the time being. - We now spawn a thread on Windows to deliver SIGCHLD and wakeup wait4() which means, for example, that posix_spawn() now goes 3x faster. POSIX spawn is also now more correct. Like Musl, it's now able to report the failure code of execve() via a pipe although our approach favors using shared memory to do that on systems that have a true vfork() function. - We now spawn a thread to deliver SIGALRM to threads when setitimer() is used. This enables the most precise wakeups the OS makes possible. - The Cosmopolitan runtime now uses less memory. On NetBSD for example, it turned out the kernel would actually commit the PT_GNU_STACK size which caused RSS to be 6mb for every process. Now it's down to ~4kb. On Apple Silicon, we reduce the mandatory upstream thread size to the smallest possible size to reduce the memory overhead of Cosmo threads. The examples directory has a program called greenbean which can spawn a web server on Linux with 10,000 worker threads and have the memory usage of the process be ~77mb. The 1024 byte overhead of POSIX-style thread-local storage is now optional; it won't be allocated until the pthread_setspecific/getspecific functions are called. On Windows, the threads that get spawned which are internal to the libc implementation use reserve rather than commit memory, which shaves a few hundred kb. - sigaltstack() is now supported on Windows, however it's currently not able to be used to handle stack overflows, since crash signals are still generated by WIN32. However the crash handler will still switch to the alt stack, which is helpful in environments with tiny threads. - Test binaries are now smaller. Many of the mandatory dependencies of the test runner have been removed. This ensures many programs can do a better job only linking the the thing they're testing. This caused the test binaries for LIBC_FMT for example, to decrease from 200kb to 50kb - long double is no longer used in the implementation details of libc, except in the APIs that define it. The old code that used long double for time (instead of struct timespec) has now been thoroughly removed. - ShowCrashReports() is now much tinier in MODE=tiny. Instead of doing backtraces itself, it'll just print a command you can run on the shell using our new `cosmoaddr2line` program to view the backtrace. - Crash report signal handling now works in a much better way. Instead of terminating the process, it now relies on SA_RESETHAND so that the default SIG_IGN behavior can terminate the process if necessary. - Our pledge() functionality has now been fully ported to AARCH64 Linux.
This commit is contained in:
parent
c4eb838516
commit
ec480f5aa0
638 changed files with 7925 additions and 8282 deletions
|
@ -25,8 +25,10 @@
|
|||
#include "dsp/core/illumination.h"
|
||||
#include "dsp/core/q.h"
|
||||
#include "dsp/scale/scale.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/pmulhrsw.h"
|
||||
#include "libc/log/check.h"
|
||||
|
@ -64,7 +66,7 @@ const double kSrgbToXyz[3][3] = {
|
|||
long magikarp_latency_;
|
||||
long gyarados_latency_;
|
||||
long ycbcr2rgb_latency_;
|
||||
long double magikarp_start_;
|
||||
struct timespec magikarp_start_;
|
||||
|
||||
struct YCbCr {
|
||||
bool yonly;
|
||||
|
@ -261,15 +263,14 @@ void YCbCrConvert(struct YCbCr *me, long yn, long xn,
|
|||
const unsigned char Y[restrict yys][yxs], long cys, long cxs,
|
||||
unsigned char Cb[restrict cys][cxs],
|
||||
unsigned char Cr[restrict cys][cxs]) {
|
||||
long double ts;
|
||||
ts = nowl();
|
||||
struct timespec ts = timespec_real();
|
||||
if (!me->yonly) {
|
||||
YCbCr2Rgb(yn, xn, RGB, yys, yxs, Y, cys, cxs, Cb, Cr, me->magnums,
|
||||
me->lighting, me->transfer[pf10_]);
|
||||
} else {
|
||||
Y2Rgb(yn, xn, RGB, yys, yxs, Y, me->magnums, me->transfer[pf10_]);
|
||||
}
|
||||
ycbcr2rgb_latency_ = lroundl((nowl() - ts) * 1e6l);
|
||||
ycbcr2rgb_latency_ = timespec_tomicros(timespec_sub(timespec_real(), ts));
|
||||
}
|
||||
|
||||
void YCbCr2RgbScaler(struct YCbCr *me, long dyn, long dxn,
|
||||
|
@ -279,7 +280,6 @@ void YCbCr2RgbScaler(struct YCbCr *me, long dyn, long dxn,
|
|||
unsigned char Cr[restrict cys][cxs], long yyn, long yxn,
|
||||
long cyn, long cxn, double syn, double sxn, double pry,
|
||||
double prx) {
|
||||
long double ts;
|
||||
long scyn, scxn;
|
||||
double yry, yrx, cry, crx, yoy, yox, coy, cox;
|
||||
scyn = syn * cyn / yyn;
|
||||
|
@ -297,8 +297,8 @@ void YCbCr2RgbScaler(struct YCbCr *me, long dyn, long dxn,
|
|||
Magkern2xY(cys, cxs, Cr, scyn, scxn), HALF(yyn), yxn,
|
||||
HALF(cyn), scxn, syn / 2, sxn, pry, prx);
|
||||
} else {
|
||||
magikarp_latency_ = lroundl((nowl() - magikarp_start_) * 1e6l);
|
||||
ts = nowl();
|
||||
struct timespec ts = timespec_real();
|
||||
magikarp_latency_ = timespec_tomicros(timespec_sub(ts, magikarp_start_));
|
||||
yry = syn / dyn;
|
||||
yrx = sxn / dxn;
|
||||
cry = syn * cyn / yyn / dyn;
|
||||
|
@ -326,7 +326,7 @@ void YCbCr2RgbScaler(struct YCbCr *me, long dyn, long dxn,
|
|||
me->chroma.cy, me->chroma.cx, false);
|
||||
GyaradosUint8(cys, cxs, Cr, cys, cxs, Cr, dyn, dxn, scyn, scxn, 0, 255,
|
||||
me->chroma.cy, me->chroma.cx, false);
|
||||
gyarados_latency_ = lround((nowl() - ts) * 1e6l);
|
||||
gyarados_latency_ = timespec_tomicros(timespec_sub(timespec_real(), ts));
|
||||
YCbCrConvert(me, dyn, dxn, RGB, yys, yxs, Y, cys, cxs, Cb, Cr);
|
||||
INFOF("done");
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ void *YCbCr2RgbScale(long dyn, long dxn,
|
|||
CHECK_LE(cyn, cys);
|
||||
CHECK_LE(cxn, cxs);
|
||||
INFOF("magikarp2x");
|
||||
magikarp_start_ = nowl();
|
||||
magikarp_start_ = timespec_real();
|
||||
minyys = MAX(ceil(syn), MAX(yyn, ceil(dyn * pry)));
|
||||
minyxs = MAX(ceil(sxn), MAX(yxn, ceil(dxn * prx)));
|
||||
mincys = MAX(cyn, ceil(dyn * pry));
|
||||
|
|
|
@ -1094,13 +1094,12 @@ static bool HasPendingInput(void) {
|
|||
}
|
||||
|
||||
static bool ShouldDraw(void) {
|
||||
long double now, rate;
|
||||
static long double next;
|
||||
struct timespec now;
|
||||
static struct timespec next;
|
||||
if (!isdragging) return true;
|
||||
now = nowl();
|
||||
rate = 1. / 24;
|
||||
if (now > next && !HasPendingInput()) {
|
||||
next = now + rate;
|
||||
now = timespec_real();
|
||||
if (timespec_cmp(now, next) > 0 && !HasPendingInput()) {
|
||||
next = timespec_add(now, timespec_frommicros(1. / 24 * 1e6));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -331,12 +331,12 @@ static long Index(long y, long x) {
|
|||
}
|
||||
|
||||
static void PreventBufferbloat(void) {
|
||||
long double now, rate;
|
||||
static long double last;
|
||||
now = nowl();
|
||||
rate = 1. / fps;
|
||||
if (now - last < rate) {
|
||||
dsleep(rate - (now - last));
|
||||
struct timespec now, rate;
|
||||
static struct timespec last;
|
||||
now = timespec_real();
|
||||
rate = timespec_frommicros(1. / fps * 1e6);
|
||||
if (timespec_cmp(timespec_sub(now, last), rate) < 0) {
|
||||
timespec_sleep(timespec_sub(rate, timespec_sub(now, last)));
|
||||
}
|
||||
last = now;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/calls/struct/winsize.h"
|
||||
#include "libc/calls/termios.h"
|
||||
#include "libc/calls/ucontext.h"
|
||||
|
@ -42,6 +43,7 @@
|
|||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/intrin/xchg.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
|
@ -88,6 +90,7 @@
|
|||
#include "libc/sysv/consts/termios.h"
|
||||
#include "libc/sysv/consts/w.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/xsigaction.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
|
@ -174,11 +177,11 @@ mode.\n\
|
|||
*(B) = pvalloc(N); \
|
||||
})
|
||||
|
||||
#define TIMEIT(OUT_NANOS, FORM) \
|
||||
do { \
|
||||
long double Start = nowl(); \
|
||||
FORM; \
|
||||
(OUT_NANOS) = (uint64_t)((nowl() - Start) * 1e9L); \
|
||||
#define TIMEIT(OUT_NANOS, FORM) \
|
||||
do { \
|
||||
struct timespec Start = timespec_real(); \
|
||||
FORM; \
|
||||
(OUT_NANOS) = timespec_tonanos(timespec_sub(timespec_real(), Start)); \
|
||||
} while (0)
|
||||
|
||||
typedef bool (*openspeaker_f)(void);
|
||||
|
@ -278,9 +281,9 @@ static uint64_t t1, t2, t3, t4, t5, t6, t8;
|
|||
static const char *sox_, *ffplay_, *patharg_;
|
||||
static struct VtFrame vtframe_[2], *f1_, *f2_;
|
||||
static struct Graphic graphic_[2], *g1_, *g2_;
|
||||
static long double deadline_, dura_, starttime_;
|
||||
static struct timespec deadline_, dura_, starttime_;
|
||||
static bool yes_, stats_, dither_, ttymode_, istango_;
|
||||
static long double decode_start_, f1_start_, f2_start_;
|
||||
static struct timespec decode_start_, f1_start_, f2_start_;
|
||||
static int16_t pcm_[PLM_AUDIO_SAMPLES_PER_FRAME * 2 / 8][8];
|
||||
static int16_t pcmscale_[PLM_AUDIO_SAMPLES_PER_FRAME * 2 / 8][8];
|
||||
static bool fullclear_, historyclear_, tuned_, yonly_, gotvideo_;
|
||||
|
@ -308,23 +311,18 @@ static void StrikeDownCrapware(int sig) {
|
|||
kill(playpid_, SIGKILL);
|
||||
}
|
||||
|
||||
static long AsMilliseconds(long double ts) {
|
||||
return rintl(ts * 1e3);
|
||||
}
|
||||
|
||||
static long AsNanoseconds(long double ts) {
|
||||
return rintl(ts * 1e9);
|
||||
}
|
||||
|
||||
static long double GetGraceTime(void) {
|
||||
return deadline_ - nowl();
|
||||
static struct timespec GetGraceTime(void) {
|
||||
return timespec_sub(deadline_, timespec_real());
|
||||
}
|
||||
|
||||
static int GetNamedVector(const struct NamedVector *choices, size_t n,
|
||||
const char *s) {
|
||||
int i;
|
||||
char name[sizeof(choices->name)];
|
||||
strlcpy(name, s, sizeof(name));
|
||||
#pragma GCC push_options
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
strncpy(name, s, sizeof(name));
|
||||
#pragma GCC pop_options
|
||||
strntoupper(name, sizeof(name));
|
||||
for (i = 0; i < n; ++i) {
|
||||
if (memcmp(choices[i].name, name, sizeof(name)) == 0) {
|
||||
|
@ -345,7 +343,7 @@ static int GetLighting(const char *s) {
|
|||
static bool CloseSpeaker(void) {
|
||||
int rc, wstatus;
|
||||
rc = 0;
|
||||
sched_yield();
|
||||
pthread_yield();
|
||||
if (playfd_) {
|
||||
rc |= close(playfd_);
|
||||
playfd_ = -1;
|
||||
|
@ -375,8 +373,13 @@ static void ResizeVtFrame(struct VtFrame *f, size_t yn, size_t xn) {
|
|||
f->i = f->n = 0;
|
||||
}
|
||||
|
||||
static float timespec_tofloat(struct timespec ts) {
|
||||
return ts.tv_sec + ts.tv_nsec * 1e-9;
|
||||
}
|
||||
|
||||
static void RecordFactThatFrameWasFullyRendered(void) {
|
||||
fcring_.p[fcring_.i] = nowl() - starttime_;
|
||||
fcring_.p[fcring_.i] =
|
||||
timespec_tofloat(timespec_sub(timespec_real(), starttime_));
|
||||
fcring_.n += 1;
|
||||
fcring_.i += 1;
|
||||
fcring_.i &= ARRAYLEN(fcring_.p) - 1;
|
||||
|
@ -521,7 +524,7 @@ static bool OpenSpeaker(void) {
|
|||
if (ffplay_) tryspeakerfns_[i++] = TryFfplay;
|
||||
if (sox_) tryspeakerfns_[i++] = TrySox;
|
||||
}
|
||||
snprintf(fifopath_, sizeof(fifopath_), "%s%s.%d.%d.wav", kTmpPath,
|
||||
snprintf(fifopath_, sizeof(fifopath_), "%s%s.%d.%d.wav", __get_tmpdir(),
|
||||
firstnonnull(program_invocation_short_name, "unknown"), getpid(),
|
||||
count);
|
||||
for (i = 0; i < ARRAYLEN(tryspeakerfns_); ++i) {
|
||||
|
@ -539,7 +542,7 @@ static bool OpenSpeaker(void) {
|
|||
|
||||
static void OnAudio(plm_t *mpeg, plm_samples_t *samples, void *user) {
|
||||
if (playfd_ != -1) {
|
||||
DEBUGF("OnAudio() [grace=%,ldns]", AsNanoseconds(GetGraceTime()));
|
||||
DEBUGF("OnAudio() [grace=%,ldns]", timespec_tonanos(GetGraceTime()));
|
||||
CHECK_EQ(2, chans_);
|
||||
CHECK_EQ(ARRAYLEN(pcm_) * 8, samples->count * chans_);
|
||||
float2short(ARRAYLEN(pcm_), pcm_, (void *)samples->interleaved);
|
||||
|
@ -549,7 +552,7 @@ static void OnAudio(plm_t *mpeg, plm_samples_t *samples, void *user) {
|
|||
TryAgain:
|
||||
if (WriteAudio(playfd_, pcm_, sizeof(pcm_), 1000) != -1) {
|
||||
DEBUGF("WriteAudio(%d, %zu) ok [grace=%,ldns]", playfd_,
|
||||
samples->count * 2, AsNanoseconds(GetGraceTime()));
|
||||
samples->count * 2, timespec_tonanos(GetGraceTime()));
|
||||
} else {
|
||||
WARNF("WriteAudio(%d, %zu) failed: %s", playfd_, samples->count * 2,
|
||||
strerror(errno));
|
||||
|
@ -765,7 +768,7 @@ static void RasterIt(void) {
|
|||
static void TranscodeVideo(plm_frame_t *pf) {
|
||||
CHECK_EQ(pf->cb.width, pf->cr.width);
|
||||
CHECK_EQ(pf->cb.height, pf->cr.height);
|
||||
DEBUGF("TranscodeVideo() [grace=%,ldns]", AsNanoseconds(GetGraceTime()));
|
||||
DEBUGF("TranscodeVideo() [grace=%,ldns]", timespec_tonanos(GetGraceTime()));
|
||||
g2_ = &graphic_[1];
|
||||
t5 = 0;
|
||||
|
||||
|
@ -879,8 +882,9 @@ static ssize_t WriteVideoCall(void) {
|
|||
if (plm_get_audio_enabled(plm_)) {
|
||||
plm_set_audio_lead_time(
|
||||
plm_,
|
||||
MAX(0, MIN(nowl() - f1_start_, plm_get_samplerate(plm_) /
|
||||
PLM_AUDIO_SAMPLES_PER_FRAME)));
|
||||
max(0,
|
||||
min(timespec_tofloat(timespec_sub(timespec_real(), f1_start_)),
|
||||
plm_get_samplerate(plm_) / PLM_AUDIO_SAMPLES_PER_FRAME)));
|
||||
}
|
||||
f1_start_ = f2_start_;
|
||||
f1_->i = f1_->n = 0;
|
||||
|
@ -904,10 +908,10 @@ static void DrainVideo(void) {
|
|||
|
||||
static void WriteVideo(void) {
|
||||
ssize_t rc;
|
||||
DEBUGF("write(tty) grace=%,ldns", AsNanoseconds(GetGraceTime()));
|
||||
DEBUGF("write(tty) grace=%,ldns", timespec_tonanos(GetGraceTime()));
|
||||
if ((rc = WriteVideoCall()) != -1) {
|
||||
DEBUGF("write(tty) → %zd [grace=%,ldns]", rc,
|
||||
AsNanoseconds(GetGraceTime()));
|
||||
timespec_tonanos(GetGraceTime()));
|
||||
} else if (errno == EAGAIN || errno == EINTR) {
|
||||
DEBUGF("write(tty) → EINTR");
|
||||
longjmp(jbi_, 1);
|
||||
|
@ -1269,11 +1273,11 @@ static void PerformBestEffortIo(void) {
|
|||
{infd_, POLLIN},
|
||||
{outfd_, f1_ && f1_->n ? POLLOUT : 0},
|
||||
};
|
||||
pollms = MAX(0, AsMilliseconds(GetGraceTime()));
|
||||
pollms = MAX(0, timespec_tomillis(GetGraceTime()));
|
||||
DEBUGF("poll() ms=%,d", pollms);
|
||||
if ((toto = poll(fds, ARRAYLEN(fds), pollms)) != -1) {
|
||||
DEBUGF("poll() toto=%d [grace=%,ldns]", toto,
|
||||
AsNanoseconds(GetGraceTime()));
|
||||
timespec_tonanos(GetGraceTime()));
|
||||
if (toto) {
|
||||
if (fds[0].revents & (POLLIN | POLLERR)) ReadKeyboard();
|
||||
if (fds[1].revents & (POLLOUT | POLLERR)) WriteVideo();
|
||||
|
@ -1305,32 +1309,36 @@ static void HandleSignals(void) {
|
|||
}
|
||||
|
||||
static void PrintVideo(void) {
|
||||
long double decode_last, decode_end, next_tick, lag;
|
||||
dura_ = MIN(MAX_FRAMERATE, 1 / plm_get_framerate(plm_));
|
||||
struct timespec decode_last, decode_end, next_tick, lag;
|
||||
dura_ = timespec_frommicros(min(MAX_FRAMERATE, 1 / plm_get_framerate(plm_)) *
|
||||
1e6);
|
||||
INFOF("framerate=%f dura=%f", plm_get_framerate(plm_), dura_);
|
||||
next_tick = deadline_ = decode_last = nowl();
|
||||
next_tick += dura_;
|
||||
deadline_ += dura_;
|
||||
next_tick = deadline_ = decode_last = timespec_real();
|
||||
next_tick = timespec_add(next_tick, dura_);
|
||||
deadline_ = timespec_add(deadline_, dura_);
|
||||
do {
|
||||
DEBUGF("plm_decode [grace=%,ldns]", AsNanoseconds(GetGraceTime()));
|
||||
decode_start_ = nowl();
|
||||
plm_decode(plm_, decode_start_ - decode_last);
|
||||
DEBUGF("plm_decode [grace=%,ldns]", timespec_tonanos(GetGraceTime()));
|
||||
decode_start_ = timespec_real();
|
||||
plm_decode(plm_,
|
||||
timespec_tofloat(timespec_sub(decode_start_, decode_last)));
|
||||
decode_last = decode_start_;
|
||||
decode_end = nowl();
|
||||
lag = decode_end - decode_start_;
|
||||
while (decode_end + lag > next_tick) next_tick += dura_;
|
||||
deadline_ = next_tick - lag;
|
||||
decode_end = timespec_real();
|
||||
lag = timespec_sub(decode_end, decode_start_);
|
||||
while (timespec_cmp(timespec_add(decode_end, lag), next_tick) > 0) {
|
||||
next_tick = timespec_add(next_tick, dura_);
|
||||
}
|
||||
deadline_ = timespec_sub(next_tick, lag);
|
||||
if (gotvideo_ || !plm_get_video_enabled(plm_)) {
|
||||
gotvideo_ = false;
|
||||
INFOF("entering printvideo event loop (lag=%,ldns, grace=%,ldns)",
|
||||
AsNanoseconds(lag), AsNanoseconds(GetGraceTime()));
|
||||
timespec_tonanos(lag), timespec_tonanos(GetGraceTime()));
|
||||
}
|
||||
do {
|
||||
if (!setjmp(jbi_)) {
|
||||
PerformBestEffortIo();
|
||||
}
|
||||
HandleSignals();
|
||||
} while (AsMilliseconds(GetGraceTime()) > 0);
|
||||
} while (timespec_tomillis(GetGraceTime()) > 0);
|
||||
} while (plm_ && !plm_has_ended(plm_));
|
||||
}
|
||||
|
||||
|
@ -1366,7 +1374,7 @@ static void PrintUsage(int rc, FILE *f) {
|
|||
|
||||
static void GetOpts(int argc, char *argv[]) {
|
||||
int opt;
|
||||
snprintf(logpath_, sizeof(logpath_), "%s%s.log", kTmpPath,
|
||||
snprintf(logpath_, sizeof(logpath_), "%s%s.log", __get_tmpdir(),
|
||||
firstnonnull(program_invocation_short_name, "unknown"));
|
||||
while ((opt = getopt(argc, argv, "?34AGSTVYabdfhnpstxyzvL:")) != -1) {
|
||||
switch (opt) {
|
||||
|
@ -1533,6 +1541,7 @@ static void TryToOpenFrameBuffer(void) {
|
|||
int main(int argc, char *argv[]) {
|
||||
sigset_t wut;
|
||||
const char *s;
|
||||
ShowCrashReports();
|
||||
gamma_ = 2.4;
|
||||
volscale_ -= 2;
|
||||
dither_ = true;
|
||||
|
@ -1581,7 +1590,7 @@ int main(int argc, char *argv[]) {
|
|||
if (t2 > t1) longjmp(jb_, 1);
|
||||
OpenVideo();
|
||||
DimensionDisplay();
|
||||
starttime_ = nowl();
|
||||
starttime_ = timespec_real();
|
||||
PrintVideo();
|
||||
}
|
||||
INFOF("jb_ triggered");
|
||||
|
|
|
@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
chopped = j != n;
|
||||
}
|
||||
dsleep(.01);
|
||||
usleep(10000);
|
||||
}
|
||||
close(fd);
|
||||
WriteString("\r\n");
|
||||
|
|
|
@ -31,12 +31,14 @@ TOOL_VIZ_DIRECTDEPS = \
|
|||
LIBC_NT_GDI32 \
|
||||
LIBC_NT_KERNEL32 \
|
||||
LIBC_NT_USER32 \
|
||||
LIBC_PROC \
|
||||
LIBC_RUNTIME \
|
||||
LIBC_SOCK \
|
||||
LIBC_STDIO \
|
||||
LIBC_STR \
|
||||
LIBC_SYSV \
|
||||
LIBC_SYSV_CALLS \
|
||||
LIBC_THREAD \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_X \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue