ipcmaxlen.h 454 B

123456789101112131415161718192021
  1. /*
  2. Platform-independant detection of IPC path max length
  3. Copyright (c) 2012 Godefroid Chapelle
  4. Distributed under the terms of the New BSD License. The full license is in
  5. the file COPYING.BSD, distributed as part of this software.
  6. */
  7. #if defined(HAVE_SYS_UN_H)
  8. #include "sys/un.h"
  9. int get_ipc_path_max_len(void) {
  10. struct sockaddr_un *dummy;
  11. return sizeof(dummy->sun_path) - 1;
  12. }
  13. #else
  14. int get_ipc_path_max_len(void) {
  15. return 0;
  16. }
  17. #endif