New sessiond comm error for kernel version
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.c
1 /*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; only version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 #define _GNU_SOURCE
20 #include <assert.h>
21 #include <limits.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <sys/stat.h>
26 #include <sys/types.h>
27 #include <sys/un.h>
28 #include <unistd.h>
29 #include <errno.h>
30
31 #include <common/defaults.h>
32
33 #include "sessiond-comm.h"
34
35 /*
36 * Human readable error message.
37 */
38 static const char *lttcomm_readable_code[] = {
39 [ LTTCOMM_ERR_INDEX(LTTCOMM_OK) ] = "Success",
40 [ LTTCOMM_ERR_INDEX(LTTCOMM_ERR) ] = "Unknown error",
41 [ LTTCOMM_ERR_INDEX(LTTCOMM_UND) ] = "Undefined command",
42 [ LTTCOMM_ERR_INDEX(LTTCOMM_NOT_IMPLEMENTED) ] = "Not implemented",
43 [ LTTCOMM_ERR_INDEX(LTTCOMM_UNKNOWN_DOMAIN) ] = "Unknown tracing domain",
44 [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_SESSION) ] = "No session found",
45 [ LTTCOMM_ERR_INDEX(LTTCOMM_LIST_FAIL) ] = "Unable to list traceable apps",
46 [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_APPS) ] = "No traceable apps found",
47 [ LTTCOMM_ERR_INDEX(LTTCOMM_SESS_NOT_FOUND) ] = "Session name not found",
48 [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_TRACE) ] = "No trace found",
49 [ LTTCOMM_ERR_INDEX(LTTCOMM_FATAL) ] = "Fatal error of the session daemon",
50 [ LTTCOMM_ERR_INDEX(LTTCOMM_CREATE_FAIL) ] = "Create trace failed",
51 [ LTTCOMM_ERR_INDEX(LTTCOMM_START_FAIL) ] = "Start trace failed",
52 [ LTTCOMM_ERR_INDEX(LTTCOMM_STOP_FAIL) ] = "Stop trace failed",
53 [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_TRACEABLE) ] = "App is not traceable",
54 [ LTTCOMM_ERR_INDEX(LTTCOMM_SELECT_SESS) ] = "A session MUST be selected",
55 [ LTTCOMM_ERR_INDEX(LTTCOMM_EXIST_SESS) ] = "Session name already exist",
56 [ LTTCOMM_ERR_INDEX(LTTCOMM_CONNECT_FAIL) ] = "Unable to connect to Unix socket",
57 [ LTTCOMM_ERR_INDEX(LTTCOMM_APP_NOT_FOUND) ] = "Application not found",
58 [ LTTCOMM_ERR_INDEX(LTTCOMM_EPERM) ] = "Permission denied",
59 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_NA) ] = "Kernel tracer not available",
60 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_VERSION) ] = "Kernel tracer version is not compatible",
61 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_EVENT_EXIST) ] = "Kernel event already exists",
62 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_SESS_FAIL) ] = "Kernel create session failed",
63 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CHAN_FAIL) ] = "Kernel create channel failed",
64 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CHAN_NOT_FOUND) ] = "Kernel channel not found",
65 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CHAN_DISABLE_FAIL) ] = "Disable kernel channel failed",
66 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CHAN_ENABLE_FAIL) ] = "Enable kernel channel failed",
67 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CONTEXT_FAIL) ] = "Add kernel context failed",
68 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_ENABLE_FAIL) ] = "Enable kernel event failed",
69 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_DISABLE_FAIL) ] = "Disable kernel event failed",
70 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_META_FAIL) ] = "Opening metadata failed",
71 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_START_FAIL) ] = "Starting kernel trace failed",
72 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_STOP_FAIL) ] = "Stoping kernel trace failed",
73 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_CONSUMER_FAIL) ] = "Kernel consumer start failed",
74 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_STREAM_FAIL) ] = "Kernel create stream failed",
75 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_DIR_FAIL) ] = "Kernel trace directory creation failed",
76 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_DIR_EXIST) ] = "Kernel trace directory already exist",
77 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_NO_SESSION) ] = "No kernel session found",
78 [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_LIST_FAIL) ] = "Listing kernel events failed",
79 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_SESS_FAIL) ] = "UST create session failed",
80 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CHAN_FAIL) ] = "UST create channel failed",
81 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CHAN_EXIST) ] = "UST channel already exist",
82 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CHAN_NOT_FOUND) ] = "UST channel not found",
83 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CHAN_DISABLE_FAIL) ] = "Disable UST channel failed",
84 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CHAN_ENABLE_FAIL) ] = "Enable UST channel failed",
85 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CONTEXT_FAIL) ] = "Add UST context failed",
86 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_ENABLE_FAIL) ] = "Enable UST event failed",
87 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_DISABLE_FAIL) ] = "Disable UST event failed",
88 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_META_FAIL) ] = "Opening metadata failed",
89 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_START_FAIL) ] = "Starting UST trace failed",
90 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_STOP_FAIL) ] = "Stoping UST trace failed",
91 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CONSUMER64_FAIL) ] = "64-bit UST consumer start failed",
92 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CONSUMER32_FAIL) ] = "32-bit UST consumer start failed",
93 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_STREAM_FAIL) ] = "UST create stream failed",
94 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_DIR_FAIL) ] = "UST trace directory creation failed",
95 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_DIR_EXIST) ] = "UST trace directory already exist",
96 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_NO_SESSION) ] = "No UST session found",
97 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_LIST_FAIL) ] = "Listing UST events failed",
98 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_EVENT_EXIST) ] = "UST event already exist",
99 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_EVENT_NOT_FOUND)] = "UST event not found",
100 [ LTTCOMM_ERR_INDEX(LTTCOMM_UST_CONTEXT_EXIST)] = "UST context already exist",
101 [ LTTCOMM_ERR_INDEX(CONSUMERD_COMMAND_SOCK_READY) ] = "consumerd command socket ready",
102 [ LTTCOMM_ERR_INDEX(CONSUMERD_SUCCESS_RECV_FD) ] = "consumerd success on receiving fds",
103 [ LTTCOMM_ERR_INDEX(CONSUMERD_ERROR_RECV_FD) ] = "consumerd error on receiving fds",
104 [ LTTCOMM_ERR_INDEX(CONSUMERD_ERROR_RECV_CMD) ] = "consumerd error on receiving command",
105 [ LTTCOMM_ERR_INDEX(CONSUMERD_POLL_ERROR) ] = "consumerd error in polling thread",
106 [ LTTCOMM_ERR_INDEX(CONSUMERD_POLL_NVAL) ] = "consumerd polling on closed fd",
107 [ LTTCOMM_ERR_INDEX(CONSUMERD_POLL_HUP) ] = "consumerd all fd hung up",
108 [ LTTCOMM_ERR_INDEX(CONSUMERD_EXIT_SUCCESS) ] = "consumerd exiting normally",
109 [ LTTCOMM_ERR_INDEX(CONSUMERD_EXIT_FAILURE) ] = "consumerd exiting on error",
110 [ LTTCOMM_ERR_INDEX(CONSUMERD_OUTFD_ERROR) ] = "consumerd error opening the tracefile",
111 [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_EBADF) ] = "consumerd splice EBADF",
112 [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_EINVAL) ] = "consumerd splice EINVAL",
113 [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_ENOMEM) ] = "consumerd splice ENOMEM",
114 [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_ESPIPE) ] = "consumerd splice ESPIPE",
115 [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_EVENT) ] = "Event not found",
116 };
117
118 /*
119 * Return ptr to string representing a human readable error code from the
120 * lttcomm_return_code enum.
121 *
122 * These code MUST be negative in other to treat that as an error value.
123 */
124 const char *lttcomm_get_readable_code(enum lttcomm_return_code code)
125 {
126 int tmp_code = -code;
127
128 if (tmp_code >= LTTCOMM_OK && tmp_code < LTTCOMM_NR) {
129 return lttcomm_readable_code[LTTCOMM_ERR_INDEX(tmp_code)];
130 }
131
132 return "Unknown error code";
133 }
134
135 /*
136 * Connect to unix socket using the path name.
137 */
138 int lttcomm_connect_unix_sock(const char *pathname)
139 {
140 struct sockaddr_un sun;
141 int fd;
142 int ret;
143
144 fd = socket(PF_UNIX, SOCK_STREAM, 0);
145 if (fd < 0) {
146 perror("socket");
147 ret = fd;
148 goto error;
149 }
150
151 memset(&sun, 0, sizeof(sun));
152 sun.sun_family = AF_UNIX;
153 strncpy(sun.sun_path, pathname, sizeof(sun.sun_path));
154 sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
155
156 ret = connect(fd, (struct sockaddr *) &sun, sizeof(sun));
157 if (ret < 0) {
158 /*
159 * Don't print message on connect error, because connect is used in
160 * normal execution to detect if sessiond is alive.
161 */
162 goto error_connect;
163 }
164
165 return fd;
166
167 error_connect:
168 close(fd);
169 error:
170 return ret;
171 }
172
173 /*
174 * Do an accept(2) on the sock and return the new file descriptor. The socket
175 * MUST be bind(2) before.
176 */
177 int lttcomm_accept_unix_sock(int sock)
178 {
179 int new_fd;
180 struct sockaddr_un sun;
181 socklen_t len = 0;
182
183 /* Blocking call */
184 new_fd = accept(sock, (struct sockaddr *) &sun, &len);
185 if (new_fd < 0) {
186 perror("accept");
187 }
188
189 return new_fd;
190 }
191
192 /*
193 * Creates a AF_UNIX local socket using pathname bind the socket upon creation
194 * and return the fd.
195 */
196 int lttcomm_create_unix_sock(const char *pathname)
197 {
198 struct sockaddr_un sun;
199 int fd;
200 int ret = -1;
201
202 /* Create server socket */
203 if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
204 perror("socket");
205 goto error;
206 }
207
208 memset(&sun, 0, sizeof(sun));
209 sun.sun_family = AF_UNIX;
210 strncpy(sun.sun_path, pathname, sizeof(sun.sun_path));
211 sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
212
213 /* Unlink the old file if present */
214 (void) unlink(pathname);
215 ret = bind(fd, (struct sockaddr *) &sun, sizeof(sun));
216 if (ret < 0) {
217 perror("bind");
218 goto error;
219 }
220
221 return fd;
222
223 error:
224 return ret;
225 }
226
227 /*
228 * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
229 */
230 int lttcomm_listen_unix_sock(int sock)
231 {
232 int ret;
233
234 ret = listen(sock, LTTNG_SESSIOND_COMM_MAX_LISTEN);
235 if (ret < 0) {
236 perror("listen");
237 }
238
239 return ret;
240 }
241
242 /*
243 * Receive data of size len in put that data into the buf param. Using recvmsg
244 * API.
245 *
246 * Return the size of received data.
247 */
248 ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
249 {
250 struct msghdr msg = { 0 };
251 struct iovec iov[1];
252 ssize_t ret = -1;
253
254 iov[0].iov_base = buf;
255 iov[0].iov_len = len;
256 msg.msg_iov = iov;
257 msg.msg_iovlen = 1;
258
259 ret = recvmsg(sock, &msg, 0);
260 if (ret < 0) {
261 perror("recvmsg");
262 }
263
264 return ret;
265 }
266
267 /*
268 * Send buf data of size len. Using sendmsg API.
269 *
270 * Return the size of sent data.
271 */
272 ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
273 {
274 struct msghdr msg = { 0 };
275 struct iovec iov[1];
276 ssize_t ret = -1;
277
278 iov[0].iov_base = buf;
279 iov[0].iov_len = len;
280 msg.msg_iov = iov;
281 msg.msg_iovlen = 1;
282
283 ret = sendmsg(sock, &msg, 0);
284 if (ret < 0) {
285 perror("sendmsg");
286 }
287
288 return ret;
289 }
290
291 /*
292 * Shutdown cleanly a unix socket.
293 */
294 int lttcomm_close_unix_sock(int sock)
295 {
296 int ret;
297
298 /* Shutdown receptions and transmissions */
299 ret = shutdown(sock, SHUT_RDWR);
300 if (ret < 0) {
301 perror("shutdown");
302 }
303
304 return ret;
305 }
306
307 /*
308 * Send a message accompanied by fd(s) over a unix socket.
309 *
310 * Returns the size of data sent, or negative error value.
311 */
312 ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
313 {
314 struct msghdr msg = { 0 };
315 struct cmsghdr *cmptr;
316 struct iovec iov[1];
317 ssize_t ret = -1;
318 unsigned int sizeof_fds = nb_fd * sizeof(int);
319 char tmp[CMSG_SPACE(sizeof_fds)];
320 char dummy = 0;
321
322 if (nb_fd > LTTCOMM_MAX_SEND_FDS)
323 return -EINVAL;
324
325 msg.msg_control = (caddr_t)tmp;
326 msg.msg_controllen = CMSG_LEN(sizeof_fds);
327
328 cmptr = CMSG_FIRSTHDR(&msg);
329 cmptr->cmsg_level = SOL_SOCKET;
330 cmptr->cmsg_type = SCM_RIGHTS;
331 cmptr->cmsg_len = CMSG_LEN(sizeof_fds);
332 memcpy(CMSG_DATA(cmptr), fds, sizeof_fds);
333 /* Sum of the length of all control messages in the buffer: */
334 msg.msg_controllen = cmptr->cmsg_len;
335
336 iov[0].iov_base = &dummy;
337 iov[0].iov_len = 1;
338 msg.msg_iov = iov;
339 msg.msg_iovlen = 1;
340
341 ret = sendmsg(sock, &msg, 0);
342 if (ret < 0) {
343 perror("sendmsg");
344 }
345 return ret;
346 }
347
348 /*
349 * Recv a message accompanied by fd(s) from a unix socket.
350 *
351 * Returns the size of received data, or negative error value.
352 *
353 * Expect at most "nb_fd" file descriptors. Returns the number of fd
354 * actually received in nb_fd.
355 */
356 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
357 {
358 struct iovec iov[1];
359 ssize_t ret = 0;
360 struct cmsghdr *cmsg;
361 size_t sizeof_fds = nb_fd * sizeof(int);
362 char recv_fd[CMSG_SPACE(sizeof_fds)];
363 struct msghdr msg = { 0 };
364 char dummy;
365
366 /* Prepare to receive the structures */
367 iov[0].iov_base = &dummy;
368 iov[0].iov_len = 1;
369 msg.msg_iov = iov;
370 msg.msg_iovlen = 1;
371 msg.msg_control = recv_fd;
372 msg.msg_controllen = sizeof(recv_fd);
373
374 ret = recvmsg(sock, &msg, 0);
375 if (ret < 0) {
376 perror("recvmsg fds");
377 goto end;
378 }
379 if (ret != 1) {
380 fprintf(stderr, "Error: Received %zd bytes, expected %d\n",
381 ret, 1);
382 goto end;
383 }
384 if (msg.msg_flags & MSG_CTRUNC) {
385 fprintf(stderr, "Error: Control message truncated.\n");
386 ret = -1;
387 goto end;
388 }
389 cmsg = CMSG_FIRSTHDR(&msg);
390 if (!cmsg) {
391 fprintf(stderr, "Error: Invalid control message header\n");
392 ret = -1;
393 goto end;
394 }
395 if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
396 fprintf(stderr, "Didn't received any fd\n");
397 ret = -1;
398 goto end;
399 }
400 if (cmsg->cmsg_len != CMSG_LEN(sizeof_fds)) {
401 fprintf(stderr, "Error: Received %zu bytes of ancillary data, expected %zu\n",
402 cmsg->cmsg_len, CMSG_LEN(sizeof_fds));
403 ret = -1;
404 goto end;
405 }
406 memcpy(fds, CMSG_DATA(cmsg), sizeof_fds);
407 ret = sizeof_fds;
408 end:
409 return ret;
410 }
411
412 /*
413 * Send a message with credentials over a unix socket.
414 *
415 * Returns the size of data sent, or negative error value.
416 */
417 ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
418 {
419 struct msghdr msg = { 0 };
420 struct cmsghdr *cmptr;
421 struct iovec iov[1];
422 ssize_t ret = -1;
423 struct ucred *creds;
424 size_t sizeof_cred = sizeof(struct ucred);
425 char anc_buf[CMSG_SPACE(sizeof_cred)];
426
427 iov[0].iov_base = buf;
428 iov[0].iov_len = len;
429 msg.msg_iov = iov;
430 msg.msg_iovlen = 1;
431
432 msg.msg_control = (caddr_t) anc_buf;
433 msg.msg_controllen = CMSG_LEN(sizeof_cred);
434
435 cmptr = CMSG_FIRSTHDR(&msg);
436 cmptr->cmsg_level = SOL_SOCKET;
437 cmptr->cmsg_type = SCM_CREDENTIALS;
438 cmptr->cmsg_len = CMSG_LEN(sizeof_cred);
439
440 creds = (struct ucred *) CMSG_DATA(cmptr);
441
442 creds->uid = geteuid();
443 creds->gid = getegid();
444 creds->pid = getpid();
445
446 ret = sendmsg(sock, &msg, 0);
447 if (ret < 0) {
448 perror("sendmsg");
449 }
450
451 return ret;
452 }
453
454 /*
455 * Recv a message accompanied with credentials from a unix socket.
456 *
457 * Returns the size of received data, or negative error value.
458 */
459 ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
460 struct ucred *creds)
461 {
462 struct msghdr msg = { 0 };
463 struct cmsghdr *cmptr;
464 struct iovec iov[1];
465 ssize_t ret;
466 size_t sizeof_cred = sizeof(struct ucred);
467 char anc_buf[CMSG_SPACE(sizeof_cred)];
468
469 /* Not allowed */
470 if (creds == NULL) {
471 ret = -1;
472 goto end;
473 }
474
475 /* Prepare to receive the structures */
476 iov[0].iov_base = buf;
477 iov[0].iov_len = len;
478 msg.msg_iov = iov;
479 msg.msg_iovlen = 1;
480
481 msg.msg_control = anc_buf;
482 msg.msg_controllen = sizeof(anc_buf);
483
484 ret = recvmsg(sock, &msg, 0);
485 if (ret < 0) {
486 perror("recvmsg fds");
487 goto end;
488 }
489
490 if (msg.msg_flags & MSG_CTRUNC) {
491 fprintf(stderr, "Error: Control message truncated.\n");
492 ret = -1;
493 goto end;
494 }
495
496 cmptr = CMSG_FIRSTHDR(&msg);
497 if (cmptr == NULL) {
498 fprintf(stderr, "Error: Invalid control message header\n");
499 ret = -1;
500 goto end;
501 }
502
503 if (cmptr->cmsg_level != SOL_SOCKET ||
504 cmptr->cmsg_type != SCM_CREDENTIALS) {
505 fprintf(stderr, "Didn't received any credentials\n");
506 ret = -1;
507 goto end;
508 }
509
510 if (cmptr->cmsg_len != CMSG_LEN(sizeof_cred)) {
511 fprintf(stderr, "Error: Received %zu bytes of ancillary data, expected %zu\n",
512 cmptr->cmsg_len, CMSG_LEN(sizeof_cred));
513 ret = -1;
514 goto end;
515 }
516
517 memcpy(creds, CMSG_DATA(cmptr), sizeof_cred);
518
519 end:
520 return ret;
521 }
522
523 /*
524 * Set socket option to use credentials passing.
525 */
526 int lttcomm_setsockopt_creds_unix_sock(int sock)
527 {
528 int ret, on = 1;
529
530 /* Set socket for credentials retrieval */
531 ret = setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
532 if (ret < 0) {
533 perror("setsockopt creds unix sock");
534 }
535
536 return ret;
537 }
This page took 0.041719 seconds and 5 git commands to generate.