Skip to content

Commit e513005

Browse files
committed
Fix build failures in full build mode
1 parent ee519c2 commit e513005

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

libc/include/llvm-libc-macros/linux/fcntl-macros.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#define O_RDWR 00000002
4747
#define O_WRONLY 00000001
4848

49+
#define F_RDLCK 0
50+
#define F_WRLCK 1
51+
#define F_UNLCK 2
52+
4953
// Special directory FD to indicate that the path argument to
5054
// openat is relative to the current directory.
5155
#define AT_FDCWD -100

libc/test/src/fcntl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ add_libc_unittest(
2929
libc.src.fcntl.fcntl
3030
libc.src.fcntl.open
3131
libc.src.unistd.close
32+
libc.hdr.types.struct_flock
33+
libc.hdr.fcntl_macros
3234
libc.test.UnitTest.ErrnoSetterMatcher
3335
)
3436

libc/test/src/fcntl/fcntl_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "hdr/fcntl_macros.h"
10+
#include "hdr/types/struct_flock.h"
911
#include "src/errno/libc_errno.h"
1012
#include "src/fcntl/fcntl.h"
1113
#include "src/fcntl/open.h"
1214
#include "src/unistd/close.h"
1315
#include "test/UnitTest/ErrnoSetterMatcher.h"
1416
#include "test/UnitTest/Test.h"
1517

18+
#include <stdio.h>
19+
#include <sys/stat.h> // For S_IRWXU
20+
1621
TEST(LlvmLibcFcntlTest, FcntlDupfd) {
1722
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
1823
constexpr const char *TEST_FILE_NAME = "testdata/fcntl_dup.test";

0 commit comments

Comments
 (0)