Skip to content

Commit c0fed59

Browse files
committed
add ioctl wrapper header
1 parent e46974b commit c0fed59

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

libc/hdr/sys_ioctl_macros.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Definition of macros from sys/ioctl.h -----------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_HDR_SYS_IOCTL_MACROS_H
10+
#define LLVM_LIBC_HDR_SYS_IOCTL_MACROS_H
11+
12+
#ifdef LIBC_FULL_BUILD
13+
14+
#include "include/llvm-libc-macros/sys-ioctl-macros.h"
15+
16+
#else // Overlay mode
17+
18+
#include <sys/ioctl.h>
19+
20+
#endif // LLVM_LIBC_FULL_BUILD
21+
22+
#endif // LLVM_LIBC_HDR_SYS_IOCTL_MACROS_H

libc/test/src/sys/ioctl/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_libc_unittest(
99
SRCS
1010
ioctl_test.cpp
1111
DEPENDS
12-
libc.include.sys_ioctl
12+
libc.hdr.ioctl_macros
1313
libc.src.sys.ioctl.ioctl
1414
libc.src.errno.errno
1515
libc.src.fcntl.open

libc/test/src/sys/ioctl/linux/ioctl_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8+
89
#include "src/errno/libc_errno.h"
910
#include "src/fcntl/open.h"
1011
#include "src/sys/ioctl/ioctl.h"
1112
#include "src/unistd/close.h"
1213
#include "src/unistd/read.h"
1314
#include "test/UnitTest/ErrnoSetterMatcher.h"
1415

15-
#include <sys/ioctl.h>
16+
#include "hdr/sys_ioctl_macros.h"
1617

1718
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
1819
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;

0 commit comments

Comments
 (0)