#include "localerr.h"
#include "ustcomm.h"
#include "relay.h" /* FIXME: remove */
+#include "marker-control.h"
//#define USE_CLONE
DBG("LISTENER");
for(;;) {
- uint32_t size;
- struct sockaddr_un addr;
- socklen_t addrlen = sizeof(addr);
char trace_name[] = "auto";
char trace_type[] = "ustrelay";
char *recvbuf;
struct rchan *rchan = trace->channels[i].trans_channel_data;
struct rchan_buf *rbuf = rchan->buf;
struct ltt_channel_struct *ltt_channel = (struct ltt_channel_struct *)rchan->private_data;
- struct ltt_channel_buf_struct *ltt_buf = ltt_channel->buf;
if(!strcmp(trace->channels[i].channel_name, channel_name)) {
char *reply;
if(!strcmp(trace->channels[i].channel_name, channel_name)) {
struct rchan_buf *rbuf = rchan->buf;
struct ltt_channel_buf_struct *lttbuf = trace->channels[i].buf;
- char *reply;
- long consumed_old=0;
- int fd;
struct blocked_consumer *bc;
bc = (struct blocked_consumer *) malloc(sizeof(struct blocked_consumer));
char *channel_slash_name = nth_token(recvbuf, 1);
char channel_name[256]="";
char marker_name[256]="";
- struct marker_iter iter;
result = sscanf(channel_slash_name, "%255[^/]/%255s", channel_name, marker_name);
char *channel_slash_name = nth_token(recvbuf, 1);
char *marker_name;
char *channel_name;
- struct marker_iter iter;
result = sscanf(channel_slash_name, "%a[^/]/%as", &channel_name, &marker_name);
}
}
-static char listener_stack[16384];
-
void create_listener(void)
{
- int result;
+#ifdef USE_CLONE
static char listener_stack[16384];
- //char *listener_stack = malloc(16384);
+#endif
#ifdef USE_CLONE
result = clone(listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
return ustcomm_init_app(getpid(), &ustcomm_app);
}
+/* FIXME: reenable this to delete socket file. */
+
+#if 0
static void destroy_socket(void)
{
-// int result;
-//
-// if(mysocketfile[0] == '\0')
-// return;
-//
-// result = unlink(mysocketfile);
-// if(result == -1) {
-// PERROR("unlink");
-// }
+ int result;
+
+ if(mysocketfile[0] == '\0')
+ return;
+
+ result = unlink(mysocketfile);
+ if(result == -1) {
+ PERROR("unlink");
+ }
}
+#endif
static int init_signal_handler(void)
{
}
}
-static void fini(void);
-
static void __attribute__((constructor(1000))) init()
{
int result;
char *strdup_malloc(const char *s);
//int send_message_pid(pid_t pid, const char *msg, char **reply);
+int ustcomm_request_consumer(pid_t pid, const char *channel);
int ustcomm_ustd_recv_message(struct ustcomm_ustd *ustd, char **msg, struct ustcomm_source *src, int timeout);
int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm_source *src, int timeout);
int ustcomm_connect_app(pid_t pid, struct ustcomm_connection *conn);
int ustcomm_send_request(struct ustcomm_connection *conn, char *req, char **reply);
+int ustcomm_send_reply(struct ustcomm_server *server, char *msg, struct ustcomm_source *src);
int nth_token_is(char *str, char *token, int tok_no);