File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 9
9
#ifndef LLVM_LIBC_TYPES_SUSECONDS_T_H
10
10
#define LLVM_LIBC_TYPES_SUSECONDS_T_H
11
11
12
- typedef __INT32_TYPE__ suseconds_t ;
12
+ // Per posix: suseconds_t shall be a signed integer type capable of storing
13
+ // values at least in the range [-1, 1000000]. [...] the widths of [other
14
+ // types...] and suseconds_t are no greater than the width of type long.
15
+
16
+ // The kernel expects 64 bit suseconds_t at least on x86_64.
17
+ typedef long suseconds_t ;
13
18
14
19
#endif // LLVM_LIBC_TYPES_SUSECONDS_T_H
Original file line number Diff line number Diff line change 17
17
#include " test/UnitTest/ErrnoSetterMatcher.h"
18
18
#include " test/UnitTest/Test.h"
19
19
20
+ #include < sys/stat.h>
21
+
20
22
// SUCCESS: Takes a file and successfully updates
21
23
// its last access and modified times.
22
24
TEST (LlvmLibcUtimesTest, ChangeTimesSpecific) {
23
25
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
24
26
25
27
constexpr const char *FILE_PATH = " utimes_pass.test" ;
26
28
auto TEST_FILE = libc_make_test_file_path (FILE_PATH);
27
- int fd = LIBC_NAMESPACE::open (TEST_FILE, O_WRONLY | O_CREAT);
29
+ int fd = LIBC_NAMESPACE::open (TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
30
+ ASSERT_ERRNO_SUCCESS ();
28
31
ASSERT_GT (fd, 0 );
29
32
ASSERT_THAT (LIBC_NAMESPACE::close (fd), Succeeds (0 ));
30
33
@@ -63,7 +66,7 @@ TEST(LlvmLibcUtimesTest, InvalidMicroseconds) {
63
66
64
67
constexpr const char *FILE_PATH = " utimes_fail.test" ;
65
68
auto TEST_FILE = libc_make_test_file_path (FILE_PATH);
66
- int fd = LIBC_NAMESPACE::open (TEST_FILE, O_WRONLY | O_CREAT);
69
+ int fd = LIBC_NAMESPACE::open (TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU );
67
70
ASSERT_GT (fd, 0 );
68
71
ASSERT_THAT (LIBC_NAMESPACE::close (fd), Succeeds (0 ));
69
72
You can’t perform that action at this time.
0 commit comments