ContainerTracer  0.1
Functions
tr-mq.c File Reference

This has the contents of creating and using Message Queue. More...

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <fcntl.h>
#include <trace_replay.h>
#include <log.h>
#include <driver/tr-driver.h>
Include dependency graph for tr-mq.c:

Functions

static int __tr_mq_init (const pid_t pid)
 Initialize the Message Queue. More...
 
int tr_mq_init (struct tr_info *info)
 Wrapping function of __tr_mq_init() More...
 
int tr_mq_get (const struct tr_info *info, void *buffer)
 Retrieve the data from Message Queue. More...
 
void tr_mq_free (struct tr_info *info, int flags)
 Deallocate the Message Queue resources. More...
 

Detailed Description

This has the contents of creating and using Message Queue.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Author
BlaCkinkGJ (ss5ki.nosp@m.jun@.nosp@m.gmail.nosp@m..com)
Version
0.1
Date
2020-08-10

Function Documentation

◆ __tr_mq_init()

static int __tr_mq_init ( const pid_t  pid)
static

Initialize the Message Queue.

Parameters
[in]pidProcess' ID of using this Message Queue.
Returns
Message ID for success to init, negative value for fail to init.

◆ tr_mq_free()

void tr_mq_free ( struct tr_info info,
int  flags 
)

Deallocate the Message Queue resources.

Parameters
[in]infotr_info structure which wants to deallocate.
[in]flagsSet a range of deallocation.

◆ tr_mq_get()

int tr_mq_get ( const struct tr_info info,
void *  buffer 
)

Retrieve the data from Message Queue.

Parameters
[in]infotr_info structure which wants to get data.
[out]bufferDestination of data will be stored
Returns
0 for success to init, negative value for fail to init.

◆ tr_mq_init()

int tr_mq_init ( struct tr_info info)

Wrapping function of __tr_mq_init()

Parameters
[in]infotr_info structure which wants to init.
Returns
0 for success to init, negative value for fail to init.
Here is the call graph for this function: