header.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Tencent is pleased to support the open source community by making wwsearch
  3. * available.
  4. *
  5. * Copyright (C) 2018-present Tencent. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  8. * use this file except in compliance with the License. You may obtain a copy of
  9. * the License at
  10. *
  11. * https://opensource.org/licenses/Apache-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OF ANY KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations under the License.
  17. */
  18. #pragma once
  19. #include <sys/epoll.h>
  20. #include <sys/mman.h>
  21. #include <sys/poll.h>
  22. #include <sys/prctl.h>
  23. #include <sys/select.h>
  24. #include <sys/socket.h>
  25. #include <sys/stat.h>
  26. #include <sys/syscall.h>
  27. #include <sys/time.h>
  28. #include <sys/types.h>
  29. #include <arpa/inet.h>
  30. #include <netinet/in.h>
  31. #include <netinet/tcp.h>
  32. #include <assert.h>
  33. #include <errno.h>
  34. #include <fcntl.h>
  35. #include <pthread.h>
  36. #include <sched.h>
  37. #include <signal.h>
  38. #include <stdarg.h>
  39. #include <stdint.h>
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #include <time.h>
  44. #include <unistd.h>
  45. #include <atomic>
  46. #include <chrono>
  47. #include <fstream>
  48. #include <iostream>
  49. #include <list>
  50. #include <map>
  51. #include <mutex>
  52. #include <queue>
  53. #include <set>
  54. #include <sstream>
  55. #include <stack>
  56. #include <string>
  57. #include <thread>
  58. #include <unordered_map>
  59. #include <vector>
  60. // #include <algorithm>
  61. #include <sys/stat.h>
  62. #if defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_ANDROID)
  63. #include <sys/statfs.h>
  64. #include <sys/syscall.h>
  65. #include <sys/sysmacros.h>
  66. #endif
  67. #include <sys/time.h>
  68. #include <sys/types.h>
  69. #include <time.h>
  70. // Get nano time includes
  71. #if defined(OS_LINUX) || defined(OS_FREEBSD)
  72. #elif defined(__MACH__)
  73. #include <mach/clock.h>
  74. #include <mach/mach.h>
  75. #else
  76. #include <chrono>
  77. #endif