mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Do some work on redbean
- Rewrite Slurp() API to be like string.sub() - Introduce a new Barf() API for creating files - Update Redbean `-S` sandbox flag to do unveiling
This commit is contained in:
parent
742251dd92
commit
48ce3ad7cc
9 changed files with 296 additions and 33 deletions
|
@ -29,13 +29,13 @@ __attribute__((__constructor__)) static void init(void) {
|
|||
errno = 0;
|
||||
}
|
||||
|
||||
TEST(dog, testReadPastEof_returnsZero) {
|
||||
TEST(pread, testReadPastEof_returnsZero) {
|
||||
EXPECT_NE(-1, (fd = open("a", O_RDWR | O_CREAT | O_TRUNC, 0644)));
|
||||
EXPECT_EQ(0, pread(fd, buf, 8, 0));
|
||||
EXPECT_EQ(0, close(fd));
|
||||
}
|
||||
|
||||
TEST(dog, testReadOverlapsEof_returnsShortNumber) {
|
||||
TEST(pread, testReadOverlapsEof_returnsShortNumber) {
|
||||
EXPECT_NE(-1, (fd = open("b", O_RDWR | O_CREAT | O_TRUNC, 0644)));
|
||||
EXPECT_EQ(4, pwrite(fd, buf, 4, 0));
|
||||
EXPECT_EQ(4, pread(fd, buf, 8, 0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue