Add README description for new vista branch

This commit is contained in:
Justine Tunney 2022-09-15 12:51:24 -07:00
parent c64e7eaf7c
commit 30140812f0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 4 additions and 53 deletions

View file

@ -1,7 +1,10 @@
![Cosmopolitan Honeybadger](usr/share/img/honeybadger.png) ![Cosmopolitan Honeybadger](usr/share/img/honeybadger.png)
[![build](https://github.com/jart/cosmopolitan/actions/workflows/build.yml/badge.svg)](https://github.com/jart/cosmopolitan/actions/workflows/build.yml) [![build](https://github.com/jart/cosmopolitan/actions/workflows/build.yml/badge.svg)](https://github.com/jart/cosmopolitan/actions/workflows/build.yml)
# Cosmopolitan # Cosmopolitan (Vista Edition)
**This is a community supported legacy branch of Cosmopolitan 2.0 that's
intended to preserve compatibility with Windows Vista and Windows 7.**
[Cosmopolitan Libc](https://justine.lol/cosmopolitan/index.html) makes C [Cosmopolitan Libc](https://justine.lol/cosmopolitan/index.html) makes C
a build-once run-anywhere language, like Java, except it doesn't need an a build-once run-anywhere language, like Java, except it doesn't need an

View file

@ -73,58 +73,6 @@ TEST(fcntl, getfd) {
void OnSig(int sig) { void OnSig(int sig) {
} }
TEST(posixAdvisoryLocks, oneProcess_unlockedFromOwnPerspectiveHuh) {
struct flock lock;
ASSERT_SYS(0, 3, open("foo", O_RDWR | O_CREAT | O_TRUNC, 0644));
ASSERT_SYS(0, 5, write(3, "hello", 5));
// set lock
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 1;
lock.l_len = 3;
lock.l_pid = -2;
ASSERT_SYS(0, 0, fcntl(3, F_SETLK, &lock));
EXPECT_EQ(F_WRLCK, lock.l_type);
EXPECT_EQ(SEEK_SET, lock.l_whence);
EXPECT_EQ(1, lock.l_start);
EXPECT_EQ(3, lock.l_len);
EXPECT_EQ(-2, lock.l_pid);
ASSERT_SYS(0, 4, open("foo", O_RDWR));
// try lock
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
lock.l_pid = -1;
ASSERT_SYS(0, 0, fcntl(4, F_SETLK, &lock));
EXPECT_EQ(F_WRLCK, lock.l_type);
EXPECT_EQ(SEEK_SET, lock.l_whence);
EXPECT_EQ(0, lock.l_start);
EXPECT_EQ(0, lock.l_len);
EXPECT_EQ(-1, lock.l_pid);
// get lock information
if (!IsWindows()) {
lock.l_type = F_RDLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 0;
lock.l_pid = -7;
ASSERT_SYS(0, 0, fcntl(4, F_GETLK, &lock));
EXPECT_EQ(F_UNLCK, lock.l_type);
EXPECT_EQ(SEEK_SET, lock.l_whence);
EXPECT_EQ(0, lock.l_start);
EXPECT_EQ(0, lock.l_len);
EXPECT_EQ(-7, lock.l_pid); // doesn't change due to F_UNLCK
}
ASSERT_SYS(0, 0, close(4));
ASSERT_SYS(0, 0, close(3));
}
TEST(posixAdvisoryLocks, twoProcesses) { TEST(posixAdvisoryLocks, twoProcesses) {
if (IsWindows()) return; // due to signals if (IsWindows()) return; // due to signals