summaryrefslogtreecommitdiff
path: root/tests/sys_stat_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys_stat_test.cpp')
-rw-r--r--tests/sys_stat_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/sys_stat_test.cpp b/tests/sys_stat_test.cpp
index 176d46243..a57a706e5 100644
--- a/tests/sys_stat_test.cpp
+++ b/tests/sys_stat_test.cpp
@@ -17,6 +17,7 @@
#include <gtest/gtest.h>
#include <errno.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
@@ -68,3 +69,12 @@ TEST(sys_stat, mkfifo) {
ASSERT_TRUE(S_ISFIFO(sb.st_mode));
unlink(path.c_str());
}
+
+TEST(sys_stat, stat64_lstat64_fstat64) {
+ struct stat64 sb;
+ ASSERT_EQ(0, stat64("/proc/version", &sb));
+ ASSERT_EQ(0, lstat64("/proc/version", &sb));
+ int fd = open("/proc/version", O_RDONLY);
+ ASSERT_EQ(0, fstat64(fd, &sb));
+ close(fd);
+}