15ac20c9cSChih-Hung Hsieh //===--- CloexecAccept4Check.h - clang-tidy----------------------*- C++ -*-===// 25ac20c9cSChih-Hung Hsieh // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65ac20c9cSChih-Hung Hsieh // 75ac20c9cSChih-Hung Hsieh //===----------------------------------------------------------------------===// 85ac20c9cSChih-Hung Hsieh 95ac20c9cSChih-Hung Hsieh #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H 105ac20c9cSChih-Hung Hsieh #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H 115ac20c9cSChih-Hung Hsieh 125ac20c9cSChih-Hung Hsieh #include "CloexecCheck.h" 135ac20c9cSChih-Hung Hsieh 14*4718da50SCarlos Galvez namespace clang::tidy::android { 155ac20c9cSChih-Hung Hsieh 165ac20c9cSChih-Hung Hsieh /// Finds code that uses accept4() without using the SOCK_CLOEXEC flag. 175ac20c9cSChih-Hung Hsieh /// 185ac20c9cSChih-Hung Hsieh /// For the user-facing documentation see: 196e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-accept4.html 205ac20c9cSChih-Hung Hsieh class CloexecAccept4Check : public CloexecCheck { 215ac20c9cSChih-Hung Hsieh public: CloexecAccept4Check(StringRef Name,ClangTidyContext * Context)225ac20c9cSChih-Hung Hsieh CloexecAccept4Check(StringRef Name, ClangTidyContext *Context) 235ac20c9cSChih-Hung Hsieh : CloexecCheck(Name, Context) {} 245ac20c9cSChih-Hung Hsieh void registerMatchers(ast_matchers::MatchFinder *Finder) override; 255ac20c9cSChih-Hung Hsieh void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 265ac20c9cSChih-Hung Hsieh }; 275ac20c9cSChih-Hung Hsieh 28*4718da50SCarlos Galvez } // namespace clang::tidy::android 295ac20c9cSChih-Hung Hsieh 305ac20c9cSChih-Hung Hsieh #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H 31