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