un.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*++
  2. Copyright (c) 2015 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. un.h
  8. Abstract:
  9. This header contains definitions for managing Unix socket addresses.
  10. Author:
  11. Evan Green 19-Jan-2015
  12. --*/
  13. #ifndef _SYS_UN_H
  14. #define _SYS_UN_H
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. #include <sys/socket.h>
  19. //
  20. // ---------------------------------------------------------------- Definitions
  21. //
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. //
  26. // Define the maximum length of a Unix socket path.
  27. //
  28. #define UNIX_PATH_MAX 108
  29. //
  30. // ------------------------------------------------------ Data Type Definitions
  31. //
  32. /*++
  33. Structure Description:
  34. This structure defines a Unix socket address.
  35. Members:
  36. sun_family - Stores the address family, AF_UNIX in this case.
  37. sun_path - Stores the null-terminated path string. The size of the socket
  38. address passed around should include the length of this string plus the
  39. null terminator.
  40. --*/
  41. struct sockaddr_un {
  42. sa_family_t sun_family;
  43. char sun_path[UNIX_PATH_MAX];
  44. };
  45. //
  46. // -------------------------------------------------------------------- Globals
  47. //
  48. //
  49. // -------------------------------------------------------- Function Prototypes
  50. //
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif