unix_util.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // This file is part of BOINC.
  2. // http://boinc.berkeley.edu
  3. // Copyright (C) 2008 University of California
  4. //
  5. // BOINC is free software; you can redistribute it and/or modify it
  6. // under the terms of the GNU Lesser General Public License
  7. // as published by the Free Software Foundation,
  8. // either version 3 of the License, or (at your option) any later version.
  9. //
  10. // BOINC is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. // See the GNU Lesser General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU Lesser General Public License
  16. // along with BOINC. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef BOINC_UNIX_UTIL_H
  18. #define BOINC_UNIX_UTIL_H
  19. // Nothing in this file is needed on WIN32
  20. #ifndef _WIN32
  21. #include "config.h"
  22. // Notice that this has an ifndef around it. If it is causing you problem,
  23. // then try defining HAVE_SETENV in your configuration file.
  24. #ifndef HAVE_SETENV
  25. extern "C" int setenv(const char *name, const char *value, int overwrite);
  26. #endif
  27. // Notice that this has an ifndef around it. If it is causing you problem,
  28. // then try defining HAVE_DAEMON in your configuration file.
  29. #ifndef HAVE_DAEMON
  30. extern "C" int daemon(int nochdir, int noclose);
  31. #endif /* HAVE_DAEMON */
  32. // Notice that this has an ifndef around it. If it is causing you problem,
  33. // then try defining HAVE_ETHER_NTOA in your configuration file.
  34. #ifndef HAVE_ETHER_NTOA
  35. #if HAVE_SYS_TYPES_H
  36. #include <sys/types.h>
  37. #endif
  38. #if HAVE_SYS_SOCKET_H
  39. #include <sys/socket.h>
  40. #endif
  41. #if HAVE_NETINET_IN_H
  42. #include <netinet/in.h>
  43. #endif
  44. #if HAVE_ARPA_INET_H
  45. #include <arpa/inet.h>
  46. #endif
  47. #if HAVE_NET_IF_H
  48. #include <net/if.h>
  49. #endif
  50. #if HAVE_NETINET_IF_ETHER_H
  51. #include <netinet/if_ether.h>
  52. #endif
  53. #if HAVE_NETINET_ETHER_H
  54. #include <netinet/ether.h>
  55. #endif
  56. // Notice that this has an ifndef around it. If it is causing you problem,
  57. // then try defining HAVE_STRUCT_ETHER_ADDR in your configuration file.
  58. #ifndef HAVE_STRUCT_ETHER_ADDR
  59. struct ether_addr {
  60. unsigned char ether_addr_octet[6];
  61. };
  62. #endif
  63. extern "C" char *ether_ntoa(const struct ether_addr *addr);
  64. #endif
  65. #endif /* _WIN32 */
  66. #endif // BOINC_UNIX_UTIL_H