summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/dev.cc
diff options
context:
space:
mode:
authorKevin <kevinkrakauer@gmail.com>2019-07-11 21:24:27 -0700
committerKevin <kevinkrakauer@gmail.com>2019-07-11 21:24:27 -0700
commit44427d8e267b4c4445c1c217637d802f71e9bf52 (patch)
tree46c6a306d7508f4e7551e0eeb0c3da4455b2b51e /test/syscalls/linux/dev.cc
parent2eeca68900eeb57a679eccc08fe172b1d9ddf97f (diff)
Add a stub for /dev/tty.
Actual implementation to follow, but this will satisfy applications that want it to just exist.
Diffstat (limited to 'test/syscalls/linux/dev.cc')
-rw-r--r--test/syscalls/linux/dev.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/syscalls/linux/dev.cc b/test/syscalls/linux/dev.cc
index b86ebe233..7b1dd14ef 100644
--- a/test/syscalls/linux/dev.cc
+++ b/test/syscalls/linux/dev.cc
@@ -13,6 +13,8 @@
// limitations under the License.
#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <vector>
@@ -143,6 +145,11 @@ TEST(DevTest, WriteDevFull) {
EXPECT_THAT(WriteFd(fd.get(), "a", 1), SyscallFailsWithErrno(ENOSPC));
}
+TEST(DevTest, TTYExists) {
+ struct stat statbuf = {};
+ ASSERT_THAT(stat("/dev/tty", &statbuf), SyscallSucceeds());
+}
+
} // namespace
} // namespace testing