fd_share.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef FD_SHARE_H_
  15. #define FD_SHARE_H_
  16. namespace isc {
  17. namespace xfr {
  18. /// Failed to receive xfr socket descriptor "fd" on unix domain socket 'sock'
  19. const int XFR_FD_RECEIVE_FAIL = -2;
  20. // Receive socket descriptor on unix domain socket 'sock'.
  21. // Returned value is the socket descriptor received.
  22. // Returned XFR_FD_RECEIVE_FAIL if failed to receive xfr socket descriptor
  23. // Errors are indicated by a return value of -1.
  24. int recv_fd(const int sock);
  25. // Send socket descriptor "fd" to server over unix domain socket 'sock',
  26. // the connection from socket 'sock' to unix domain server should be established first.
  27. // Errors are indicated by a return value of -1.
  28. int send_fd(const int sock, const int fd);
  29. } // End for namespace xfr
  30. } // End for namespace isc
  31. #endif
  32. // Local Variables:
  33. // mode: c++
  34. // End: