2 * ust-multi-test.c - single-proces, multi-session, multi-channel, multi-event UST tracing
4 * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; only version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307, USA.
21 #define _LARGEFILE64_SOURCE
29 #include <sys/types.h>
34 #include <urcu/futex.h>
35 #include <urcu/uatomic.h>
37 #include <sys/socket.h>
39 #include "lttng-ust-comm.h"
40 #include <../../libringbuffer/backend.h>
41 #include <../../libringbuffer/frontend.h>
45 #define MAX_NR_STREAMS 64
48 const char *evname
[] = {
49 "ust_tests_hello_tptest",
50 "ust_tests_hello_tptest_sighandler",
51 "ust_tests_hello_dontexist",
58 uint64_t memory_map_size
;
61 static int session_handle
[NR_SESSIONS
];
62 static struct object_data metadata_stream_data
[NR_SESSIONS
];
63 static struct object_data metadata_data
[NR_SESSIONS
];
64 static struct object_data channel_data
[NR_SESSIONS
][NR_CHANNELS
];
65 static struct object_data stream_data
[NR_SESSIONS
][NR_CHANNELS
][MAX_NR_STREAMS
];
66 static int event_handle
[NR_SESSIONS
][NR_CHANNELS
][NR_EVENTS
];
68 static int apps_socket
= -1;
69 static char apps_sock_path
[PATH_MAX
];
70 static char local_apps_wait_shm_path
[PATH_MAX
];
72 static volatile int quit_program
;
74 static void handle_signals(int signo
)
79 static int send_app_msg(int sock
, struct lttcomm_ust_msg
*lum
)
83 len
= lttcomm_send_unix_sock(sock
, lum
, sizeof(*lum
));
86 printf("message successfully sent\n");
89 if (errno
== ECONNRESET
) {
90 printf("remote end closed connection\n");
95 printf("incorrect message size: %zd\n", len
);
101 static int recv_app_reply(int sock
, struct lttcomm_ust_reply
*lur
,
102 uint32_t expected_handle
, uint32_t expected_cmd
)
106 memset(lur
, 0, sizeof(*lur
));
107 len
= lttcomm_recv_unix_sock(sock
, lur
, sizeof(*lur
));
109 case 0: /* orderly shutdown */
110 printf("Application has performed an orderly shutdown\n");
113 printf("result message received\n");
114 if (lur
->handle
!= expected_handle
) {
115 printf("Unexpected result message handle\n");
119 if (lur
->cmd
!= expected_cmd
) {
120 printf("Unexpected result message command\n");
123 if (lur
->ret_code
!= LTTCOMM_OK
) {
124 printf("remote operation failed with code %d.\n",
126 return lur
->ret_code
;
130 if (errno
== ECONNRESET
) {
131 printf("remote end closed connection\n");
136 printf("incorrect message size: %zd\n", len
);
137 return len
> 0 ? -1 : len
;
141 static int send_app_cmd(int sock
,
142 struct lttcomm_ust_msg
*lum
,
143 struct lttcomm_ust_reply
*lur
)
147 ret
= send_app_msg(sock
, lum
);
150 ret
= recv_app_reply(sock
, lur
, lum
->handle
, lum
->cmd
);
158 * Receives a single fd from socket.
160 * Returns the size of received data
162 static int lttcomm_recv_fd(int sock
)
167 struct cmsghdr
*cmsg
;
168 char recv_fd
[CMSG_SPACE(sizeof(int))];
169 struct msghdr msg
= { 0 };
171 /* Prepare to receive the structures */
172 iov
[0].iov_base
= &data_fd
;
173 iov
[0].iov_len
= sizeof(data_fd
);
176 msg
.msg_control
= recv_fd
;
177 msg
.msg_controllen
= sizeof(recv_fd
);
179 printf("Waiting to receive fd\n");
180 if ((ret
= recvmsg(sock
, &msg
, 0)) < 0) {
184 if (ret
!= sizeof(data_fd
)) {
185 printf("Received %d bytes, expected %ld", ret
, sizeof(data_fd
));
188 cmsg
= CMSG_FIRSTHDR(&msg
);
190 printf("Invalid control message header\n");
194 if (cmsg
->cmsg_level
!= SOL_SOCKET
|| cmsg
->cmsg_type
!= SCM_RIGHTS
) {
195 printf("Didn't received any fd\n");
200 ret
= ((int *) CMSG_DATA(cmsg
))[0];
201 printf("received fd %d\n", ret
);
208 int open_streams(int sock
, int channel_handle
, struct object_data
*stream_datas
,
214 struct lttcomm_ust_msg lum
;
215 struct lttcomm_ust_reply lur
;
217 memset(&lum
, 0, sizeof(lum
));
218 lum
.handle
= channel_handle
;
219 lum
.cmd
= LTTNG_UST_STREAM
;
220 ret
= send_app_cmd(sock
, &lum
, &lur
);
222 assert(k
< nr_check
);
223 stream_datas
[k
].handle
= lur
.ret_val
;
224 printf("received stream handle %u\n",
225 stream_datas
[k
].handle
);
226 if (lur
.ret_code
== LTTCOMM_OK
) {
229 stream_datas
[k
].memory_map_size
= lur
.u
.stream
.memory_map_size
;
231 len
= lttcomm_recv_fd(sock
);
234 stream_datas
[k
].shm_fd
= len
;
236 len
= lttcomm_recv_fd(sock
);
239 stream_datas
[k
].wait_fd
= len
;
252 int close_streams(int sock
, struct object_data
*stream_datas
, int nr_check
)
256 for (k
= 0; k
< nr_check
; k
++) {
257 struct lttcomm_ust_msg lum
;
258 struct lttcomm_ust_reply lur
;
260 if (!stream_datas
[k
].handle
)
262 memset(&lum
, 0, sizeof(lum
));
263 lum
.handle
= stream_datas
[k
].handle
;
264 lum
.cmd
= LTTNG_UST_RELEASE
;
265 ret
= send_app_cmd(sock
, &lum
, &lur
);
267 printf("Error closing stream\n");
270 if (stream_datas
[k
].shm_fd
>= 0) {
271 ret
= close(stream_datas
[k
].shm_fd
);
273 printf("Error closing stream shm_fd\n");
277 if (stream_datas
[k
].wait_fd
>= 0) {
278 ret
= close(stream_datas
[k
].wait_fd
);
280 printf("Error closing stream wait_fd\n");
289 struct shm_handle
*map_channel(struct object_data
*chan_data
,
290 struct object_data
*stream_datas
, int nr_check
)
292 struct shm_handle
*handle
;
293 struct channel
*chan
;
296 /* map metadata channel */
297 handle
= channel_handle_create(chan_data
->shm_fd
,
299 chan_data
->memory_map_size
);
301 printf("create handle error\n");
304 chan_data
->shm_fd
= -1;
305 chan_data
->wait_fd
= -1;
306 chan
= shmp(handle
, handle
->chan
);
308 for (k
= 0; k
< nr_check
; k
++) {
309 struct object_data
*stream_data
= &stream_datas
[k
];
311 if (!stream_data
->handle
)
314 ret
= channel_handle_add_stream(handle
,
316 stream_data
->wait_fd
,
317 stream_data
->memory_map_size
);
319 printf("add stream error\n");
322 stream_data
->shm_fd
= -1;
323 stream_data
->wait_fd
= -1;
328 channel_destroy(chan
, handle
, 1);
333 void unmap_channel(struct shm_handle
*handle
)
335 struct channel
*chan
;
337 chan
= shmp(handle
, handle
->chan
);
339 channel_destroy(chan
, handle
, 1);
343 int consume_stream(struct shm_handle
*handle
, int cpu
, char *outfile
)
345 struct channel
*chan
;
346 struct lib_ring_buffer
*buf
;
349 uint64_t memory_map_size
;
351 chan
= shmp(handle
, handle
->chan
);
354 buf
= channel_get_ring_buffer(&chan
->backend
.config
,
355 chan
, cpu
, handle
, &shm_fd
, &wait_fd
, &memory_map_size
);
358 ret
= lib_ring_buffer_open_read(buf
, handle
, 1);
364 outfd
= open(outfile
, O_WRONLY
| O_CREAT
| O_LARGEFILE
| O_TRUNC
,
365 S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
);
367 perror("open output");
371 printf("Waiting for buffer data for %s\n", outfile
);
373 unsigned long read_size
;
374 unsigned long copy_size
;
377 ret
= lib_ring_buffer_get_next_subbuf(buf
, handle
);
378 printf("get next ret %d\n", ret
);
381 if (ret
== -EAGAIN
) {
386 printf("Error %d in lib_ring_buffer_get_next_subbuf\n", ret
);
389 read_size
= lib_ring_buffer_get_read_data_size(
390 &chan
->backend
.config
, buf
, handle
);
391 read_size
= PAGE_ALIGN(read_size
);
392 ptr
= lib_ring_buffer_read_offset_address(
393 &buf
->backend
, 0, handle
);
394 printf("WRITE: copy %lu bytes\n", read_size
);
395 copy_size
= write(outfd
, ptr
, read_size
);
396 if (copy_size
< read_size
) {
397 printf("write issue: copied %zd, expected %lu\n", copy_size
, read_size
);
399 lib_ring_buffer_put_next_subbuf(buf
, handle
);
409 lib_ring_buffer_release_read(buf
, handle
, 1);
414 int consume_buffers(void)
419 for (i
= 0; i
< NR_SESSIONS
; i
++) {
420 char pathname
[PATH_MAX
];
421 struct shm_handle
*handle
;
423 snprintf(pathname
, PATH_MAX
- 1, "/tmp/testtrace%u", i
);
424 old_umask
= umask(0);
425 ret
= mkdir(pathname
, S_IRWXU
| S_IRWXG
);
426 if (ret
&& errno
!= EEXIST
) {
434 handle
= map_channel(&metadata_data
[i
],
435 &metadata_stream_data
[i
], 1);
438 snprintf(pathname
, PATH_MAX
- 1,
439 "/tmp/testtrace%u/metadata", i
);
440 ret
= consume_stream(handle
, -1, pathname
);
441 if (ret
&& ret
!= -ENOENT
) {
442 printf("Error in consume_stream\n");
445 unmap_channel(handle
);
447 /* copy binary data */
448 for (j
= 0; j
< NR_CHANNELS
; j
++) {
449 handle
= map_channel(&channel_data
[i
][j
],
450 stream_data
[i
][j
], MAX_NR_STREAMS
);
453 for (k
= 0; k
< MAX_NR_STREAMS
; k
++) {
454 snprintf(pathname
, PATH_MAX
- 1,
455 "/tmp/testtrace%u/data_%u", i
, k
);
456 ret
= consume_stream(handle
, k
, pathname
);
457 if (ret
&& ret
!= -ENOENT
) {
458 printf("Error in consume_stream\n");
462 unmap_channel(handle
);
469 int send_app_msgs(int sock
)
471 struct lttcomm_ust_msg lum
;
472 struct lttcomm_ust_reply lur
;
475 for (i
= 0; i
< NR_SESSIONS
; i
++) {
477 memset(&lum
, 0, sizeof(lum
));
478 lum
.handle
= LTTNG_UST_ROOT_HANDLE
;
479 lum
.cmd
= LTTNG_UST_SESSION
;
480 ret
= send_app_cmd(sock
, &lum
, &lur
);
483 session_handle
[i
] = lur
.ret_val
;
484 printf("received session handle %u\n", session_handle
[i
]);
486 /* Create metadata channel */
487 memset(&lum
, 0, sizeof(lum
));
488 lum
.handle
= session_handle
[i
];
489 lum
.cmd
= LTTNG_UST_METADATA
;
490 lum
.u
.channel
.overwrite
= 0;
491 lum
.u
.channel
.subbuf_size
= 32768;
492 lum
.u
.channel
.num_subbuf
= 4;
493 lum
.u
.channel
.switch_timer_interval
= 0;
494 lum
.u
.channel
.read_timer_interval
= 0;
495 lum
.u
.channel
.output
= LTTNG_UST_MMAP
;
496 ret
= send_app_cmd(sock
, &lum
, &lur
);
499 metadata_data
[i
].handle
= lur
.ret_val
;
500 printf("received metadata handle %u\n", metadata_data
[i
].handle
);
501 if (lur
.ret_code
== LTTCOMM_OK
) {
504 metadata_data
[i
].memory_map_size
= lur
.u
.channel
.memory_map_size
;
506 len
= lttcomm_recv_fd(sock
);
509 metadata_data
[i
].shm_fd
= len
;
511 len
= lttcomm_recv_fd(sock
);
514 metadata_data
[i
].wait_fd
= len
;
517 ret
= open_streams(sock
, metadata_data
[i
].handle
,
518 &metadata_stream_data
[i
], 1);
520 printf("Error in open_streams\n");
524 /* Create channels */
525 for (j
= 0; j
< NR_CHANNELS
; j
++) {
526 memset(&lum
, 0, sizeof(lum
));
527 lum
.handle
= session_handle
[i
];
528 lum
.cmd
= LTTNG_UST_CHANNEL
;
529 //lum.u.channel.overwrite = 0;
530 lum
.u
.channel
.overwrite
= 1;
531 lum
.u
.channel
.subbuf_size
= 32768;
532 lum
.u
.channel
.num_subbuf
= 8;
533 //lum.u.channel.num_subbuf = 4;
534 //lum.u.channel.num_subbuf = 2;
535 lum
.u
.channel
.switch_timer_interval
= 0;
536 lum
.u
.channel
.read_timer_interval
= 0;
537 lum
.u
.channel
.output
= LTTNG_UST_MMAP
;
538 ret
= send_app_cmd(sock
, &lum
, &lur
);
541 channel_data
[i
][j
].handle
= lur
.ret_val
;
542 printf("received channel handle %u\n", channel_data
[i
][j
].handle
);
543 if (lur
.ret_code
== LTTCOMM_OK
) {
546 channel_data
[i
][j
].memory_map_size
= lur
.u
.channel
.memory_map_size
;
548 len
= lttcomm_recv_fd(sock
);
551 channel_data
[i
][j
].shm_fd
= len
;
553 len
= lttcomm_recv_fd(sock
);
556 channel_data
[i
][j
].wait_fd
= len
;
560 for (k
= 0; k
< NR_EVENTS
; k
++) {
561 memset(&lum
, 0, sizeof(lum
));
562 lum
.handle
= channel_data
[i
][j
].handle
;
563 lum
.cmd
= LTTNG_UST_EVENT
;
564 strncpy(lum
.u
.event
.name
, evname
[k
],
565 LTTNG_UST_SYM_NAME_LEN
);
566 lum
.u
.event
.instrumentation
= LTTNG_UST_TRACEPOINT
;
567 ret
= send_app_cmd(sock
, &lum
, &lur
);
570 event_handle
[i
][j
][k
] = lur
.ret_val
;
571 printf("received event handle %u\n", event_handle
[i
][j
][k
]);
574 /* Get references to channel streams */
575 ret
= open_streams(sock
, channel_data
[i
][j
].handle
,
576 stream_data
[i
][j
], MAX_NR_STREAMS
);
578 printf("Error in open_streams\n");
583 memset(&lum
, 0, sizeof(lum
));
584 lum
.handle
= session_handle
[i
];
585 lum
.cmd
= LTTNG_UST_SESSION_START
;
586 ret
= send_app_cmd(sock
, &lum
, &lur
);
589 printf("Session handle %u started.\n", session_handle
[i
]);
592 /* Tell application registration is done */
593 memset(&lum
, 0, sizeof(lum
));
594 lum
.handle
= LTTNG_UST_ROOT_HANDLE
;
595 lum
.cmd
= LTTNG_UST_REGISTER_DONE
;
596 ret
= send_app_cmd(sock
, &lum
, &lur
);
599 printf("Registration done acknowledged.\n");
603 ret
= consume_buffers();
605 printf("Error in consume_buffers\n");
609 for (i
= 0; i
< NR_SESSIONS
; i
++) {
610 /* Release channels */
611 for (j
= 0; j
< NR_CHANNELS
; j
++) {
612 /* Release streams */
613 ret
= close_streams(sock
, stream_data
[i
][j
],
619 for (k
= 0; k
< NR_EVENTS
; k
++) {
620 memset(&lum
, 0, sizeof(lum
));
621 lum
.handle
= event_handle
[i
][j
][k
];
622 lum
.cmd
= LTTNG_UST_RELEASE
;
623 ret
= send_app_cmd(sock
, &lum
, &lur
);
627 memset(&lum
, 0, sizeof(lum
));
628 lum
.handle
= channel_data
[i
][j
].handle
;
629 lum
.cmd
= LTTNG_UST_RELEASE
;
630 ret
= send_app_cmd(sock
, &lum
, &lur
);
633 if (channel_data
[i
][j
].shm_fd
>= 0) {
634 ret
= close(channel_data
[i
][j
].shm_fd
);
638 if (channel_data
[i
][j
].wait_fd
>= 0) {
639 ret
= close(channel_data
[i
][j
].wait_fd
);
645 /* Release metadata channel */
646 ret
= close_streams(sock
, &metadata_stream_data
[i
], 1);
650 memset(&lum
, 0, sizeof(lum
));
651 lum
.handle
= metadata_data
[i
].handle
;
652 lum
.cmd
= LTTNG_UST_RELEASE
;
653 ret
= send_app_cmd(sock
, &lum
, &lur
);
656 if (metadata_data
[i
].shm_fd
>= 0) {
657 ret
= close(metadata_data
[i
].shm_fd
);
661 if (metadata_data
[i
].wait_fd
>= 0) {
662 ret
= close(metadata_data
[i
].wait_fd
);
667 /* Release session */
668 memset(&lum
, 0, sizeof(lum
));
669 lum
.handle
= session_handle
[i
];
670 lum
.cmd
= LTTNG_UST_RELEASE
;
671 ret
= send_app_cmd(sock
, &lum
, &lur
);
680 * Using fork to set umask in the child process (not multi-thread safe). We
681 * deal with the shm_open vs ftruncate race (happening when the sessiond owns
682 * the shm and does not let everybody modify it, to ensure safety against
683 * shm_unlink) by simply letting the mmap fail and retrying after a few
684 * seconds. For global shm, everybody has rw access to it until the sessiond
687 static int get_wait_shm(char *shm_path
, size_t mmap_size
, int global
)
689 int wait_shm_fd
, ret
;
692 /* Default permissions */
693 mode
= S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
;
695 /* Change owner of the shm path */
697 ret
= chown(shm_path
, 0, 0);
699 if (errno
!= ENOENT
) {
700 perror("chown wait shm");
706 * If global session daemon, any application can register so the shm
707 * needs to be set in read-only mode for others.
711 ret
= chown(shm_path
, getuid(), getgid());
713 if (errno
!= ENOENT
) {
714 perror("chown wait shm");
721 * Set permissions to the shm even if we did not create the shm.
723 ret
= chmod(shm_path
, mode
);
725 if (errno
!= ENOENT
) {
726 perror("chmod wait shm");
732 * We're alone in a child process, so we can modify the process-wide
738 * Try creating shm (or get rw access). We don't do an exclusive open,
739 * because we allow other processes to create+ftruncate it concurrently.
741 wait_shm_fd
= shm_open(shm_path
, O_RDWR
| O_CREAT
, mode
);
742 if (wait_shm_fd
< 0) {
743 perror("shm_open wait shm");
747 ret
= ftruncate(wait_shm_fd
, mmap_size
);
749 perror("ftruncate wait shm");
753 ret
= fchmod(wait_shm_fd
, mode
);
759 printf("Got the wait shm fd %d\n", wait_shm_fd
);
764 printf("Failing to get the wait shm fd\n");
769 int update_futex(int fd
, int active
)
771 size_t mmap_size
= sysconf(_SC_PAGE_SIZE
);
775 wait_shm_mmap
= mmap(NULL
, mmap_size
, PROT_READ
| PROT_WRITE
,
777 if (wait_shm_mmap
== MAP_FAILED
) {
783 uatomic_set((int32_t *) wait_shm_mmap
, 1);
784 futex_async((int32_t *) wait_shm_mmap
, FUTEX_WAKE
,
785 INT_MAX
, NULL
, NULL
, 0);
787 uatomic_set((int32_t *) wait_shm_mmap
, 0);
789 ret
= munmap(wait_shm_mmap
, mmap_size
);
791 perror("Error unmapping wait shm");
800 * Set open files limit to unlimited. This daemon can open a large number of
801 * file descriptors in order to consumer multiple kernel traces.
803 static void set_ulimit(void)
809 * If not root, we cannot increase our max open files. But our
810 * scope is then limited to processes from a single user.
814 /* The kernel does not allowed an infinite limit for open files */
815 lim
.rlim_cur
= 65535;
816 lim
.rlim_max
= 65535;
818 ret
= setrlimit(RLIMIT_NOFILE
, &lim
);
820 perror("failed to set open files limit");
824 int main(int argc
, char **argv
)
826 const char *home_dir
;
827 int ret
, wait_shm_fd
;
828 struct sigaction act
;
834 memset(&act
, 0, sizeof(act
));
835 ret
= sigemptyset(&act
.sa_mask
);
837 perror("sigemptyset");
841 act
.sa_handler
= SIG_IGN
;
842 ret
= sigaction(SIGPIPE
, &act
, NULL
);
849 act
.sa_handler
= handle_signals
;
850 ret
= sigaction(SIGTERM
, &act
, NULL
);
856 ret
= sigaction(SIGINT
, &act
, NULL
);
862 if (geteuid() == 0) {
863 ret
= mkdir(LTTNG_RUNDIR
, S_IRWXU
| S_IRWXG
| S_IROTH
| S_IXOTH
);
864 if (ret
&& errno
!= EEXIST
) {
868 wait_shm_fd
= get_wait_shm(DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH
,
869 sysconf(_SC_PAGE_SIZE
), 1);
870 if (wait_shm_fd
< 0) {
871 perror("global wait shm error");
874 strcpy(apps_sock_path
, DEFAULT_GLOBAL_APPS_UNIX_SOCK
);
875 old_umask
= umask(0);
877 snprintf(local_apps_wait_shm_path
, PATH_MAX
,
878 DEFAULT_HOME_APPS_WAIT_SHM_PATH
, getuid());
879 wait_shm_fd
= get_wait_shm(local_apps_wait_shm_path
,
880 sysconf(_SC_PAGE_SIZE
), 0);
881 if (wait_shm_fd
< 0) {
882 perror("local wait shm error");
885 home_dir
= (const char *) getenv("HOME");
887 perror("getenv error");
890 snprintf(apps_sock_path
, PATH_MAX
,
891 DEFAULT_HOME_APPS_UNIX_SOCK
, home_dir
);
894 ret
= lttcomm_create_unix_sock(apps_sock_path
);
896 perror("create error");
902 /* File permission MUST be 666 */
903 ret
= chmod(apps_sock_path
,
904 S_IRUSR
| S_IWUSR
| S_IRGRP
| S_IWGRP
| S_IROTH
| S_IWOTH
);
906 printf("Set file permissions failed: %s\n", apps_sock_path
);
912 ret
= lttcomm_listen_unix_sock(apps_socket
);
914 perror("listen error");
918 /* wake up futexes */
919 ret
= update_futex(wait_shm_fd
, 1);
921 fprintf(stderr
, "Error wakeup futex\n");
935 char name
[16]; /* Process name */
942 printf("Accepting application registration\n");
943 sock
= lttcomm_accept_unix_sock(apps_socket
);
945 perror("accept error");
950 * Basic recv here to handle the very simple data
951 * that the libust send to register (reg_msg).
953 len
= lttcomm_recv_unix_sock(sock
, ®_msg
, sizeof(reg_msg
));
954 if (len
< 0 || len
!= sizeof(reg_msg
)) {
955 perror("lttcomm_recv_unix_sock");
958 memcpy(bufname
, reg_msg
.name
, 16);
960 printf("Application %s pid %u ppid %u uid %u gid %u has registered (version : %u.%u)\n",
961 bufname
, reg_msg
.pid
, reg_msg
.ppid
, reg_msg
.uid
,
962 reg_msg
.gid
, reg_msg
.major
, reg_msg
.minor
);
963 ret
= send_app_msgs(sock
);
965 printf("Error in send_app_msgs.\n");
972 printf("quitting.\n");
973 /* Let applications know we are not responding anymore */
974 ret
= update_futex(wait_shm_fd
, 0);
976 fprintf(stderr
, "Error wakeup futex\n");