mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 10:18:31 +00:00
Improve synchronization
- Fix bugs in kDos2Errno definition - malloc() should now be thread safe - Fix bug in rollup.com header generator - Fix open(O_APPEND) on the New Technology - Fix select() on the New Technology and test it - Work towards refactoring i/o for thread safety - Socket reads and writes on NT now poll for signals - Work towards i/o completion ports on the New Technology - Make read() and write() intermittently check for signals - Blinkenlights keyboard i/o so much better on NT w/ poll() - You can now poll() files and sockets at the same time on NT - Fix bug in appendr() that manifests with dlmalloc footers off
This commit is contained in:
parent
233144b19d
commit
933411ba99
266 changed files with 8761 additions and 4344 deletions
|
@ -20,10 +20,13 @@
|
|||
#include "libc/calls/sigbits.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/io.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
@ -61,8 +64,9 @@ void SetUpOnce(void) {
|
|||
}
|
||||
|
||||
TEST(plinko, worksOrPrintsNiceError) {
|
||||
ssize_t rc;
|
||||
char buf[16], drain[64];
|
||||
size_t n;
|
||||
ssize_t rc, got;
|
||||
char buf[1024], drain[64];
|
||||
sigset_t chldmask, savemask;
|
||||
int i, pid, fdin, wstatus, pfds[2][2];
|
||||
struct sigaction ignore, saveint, savequit, savepipe;
|
||||
|
@ -100,7 +104,8 @@ TEST(plinko, worksOrPrintsNiceError) {
|
|||
EXPECT_NE(-1, close(fdin));
|
||||
}
|
||||
EXPECT_NE(-1, close(pfds[0][1]));
|
||||
EXPECT_NE(-1, read(pfds[1][0], buf, sizeof(buf) - 1));
|
||||
EXPECT_NE(-1, (got = read(pfds[1][0], buf, sizeof(buf) - 1)));
|
||||
EXPECT_NE(0, got);
|
||||
while (read(pfds[1][0], drain, sizeof(drain)) > 0) donothing;
|
||||
EXPECT_NE(-1, close(pfds[1][0]));
|
||||
EXPECT_NE(-1, waitpid(pid, &wstatus, 0));
|
||||
|
@ -115,4 +120,7 @@ TEST(plinko, worksOrPrintsNiceError) {
|
|||
EXPECT_EQ(0, sigaction(SIGQUIT, &savequit, 0));
|
||||
EXPECT_EQ(0, sigaction(SIGPIPE, &savepipe, 0));
|
||||
EXPECT_EQ(0, sigprocmask(SIG_SETMASK, &savemask, 0));
|
||||
if (g_testlib_failed) {
|
||||
kprintf("note: got the following in pipe: %s%n", buf);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue