diff --git a/README.md b/README.md index 0e514a34c..e4f2323c4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ ![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) -# 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 a build-once run-anywhere language, like Java, except it doesn't need an diff --git a/test/libc/calls/fcntl_test.c b/test/libc/calls/fcntl_test.c index e4c4a4ce6..dee11c127 100644 --- a/test/libc/calls/fcntl_test.c +++ b/test/libc/calls/fcntl_test.c @@ -73,58 +73,6 @@ TEST(fcntl, getfd) { 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) { if (IsWindows()) return; // due to signals