mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Make fixes and improvements
- Polyfill UTIME_OMIT on XNU - Refactor Lua build code so it's better - Add unix module to lua.com (Discord request) - Add unix.utimensat() and unix.futimens() to redbean - Avoid creating double slash path in linenoise (#428) - Remove double slashes in NT paths automatically (#428) - Make strerror() smarter about showing NT errors (#428) Fixes #428
This commit is contained in:
parent
67b28b9af1
commit
c1cfca8ae1
18 changed files with 569 additions and 194 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/utime.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
|
@ -59,3 +60,20 @@ TEST(futimens, test) {
|
|||
EXPECT_EQ(1655455857, st.st_atim.tv_sec);
|
||||
EXPECT_EQ(827727928, st.st_mtim.tv_sec);
|
||||
}
|
||||
|
||||
TEST(utimensat, testOmit) {
|
||||
if (IsLinux() && !__is_linux_2_6_23()) {
|
||||
// TODO(jart): Ugh.
|
||||
return;
|
||||
}
|
||||
struct stat st;
|
||||
struct timespec ts[2] = {
|
||||
{123, UTIME_OMIT},
|
||||
{123, UTIME_OMIT},
|
||||
};
|
||||
EXPECT_SYS(0, 0, touch("boop", 0644));
|
||||
EXPECT_SYS(0, 0, utimensat(AT_FDCWD, "boop", ts, 0));
|
||||
EXPECT_SYS(0, 0, stat("boop", &st));
|
||||
EXPECT_NE(123, st.st_atim.tv_sec);
|
||||
EXPECT_NE(123, st.st_mtim.tv_sec);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue