2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; only version 2
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * Send msg containing a command to an UST application via sock and wait for
29 * Return the replied structure or NULL.
31 struct lttcomm_ust_reply
*ustcomm_send_command(int sock
,
32 struct lttcomm_ust_msg
*msg
)
35 struct lttcomm_ust_reply
*reply
;
38 if (msg
== NULL
|| sock
< 0) {
42 DBG("Sending UST command %d to sock %d", msg
->cmd
, sock
);
45 len
= lttcomm_send_unix_sock(sock
, msg
, sizeof(*msg
));
50 reply
= malloc(sizeof(struct lttcomm_ust_reply
));
52 perror("malloc ust reply");
56 DBG("Receiving UST reply on sock %d", sock
);
59 len
= lttcomm_recv_unix_sock(sock
, reply
, sizeof(*reply
));
60 if (len
< 0 || len
< sizeof(*reply
)) {
This page took 0.030606 seconds and 4 git commands to generate.