When you send a pointer you are NOT sending data. You are sending an address.
You are passing a reference, not the string of characters or binary data array you are pointing to. The reference on the other node is pointing to nothing. That is why you segfault. Unless your method is smart enough to create storage on the remote side and copy the array over there.
This User Gave Thanks to jim mcnamara For This Post:
I have a struct as follows...
struct A
{
int a;
ucontext_t X; //ucontext_t is another structure
}
How do I define a pointer to the above structure variable X of the type ucontext_t from within another function?
eg. void foo()
{
struct A a;
/////WHAT COMES IN... (1 Reply)
I am using a structure defined as follows
struct gene_square
{
double *x;
double *y;
};I have class, with a member function which is a pointer of this type:
gene_square* m_Genes;I am allocating memory in the constructors like this:
m_Genes = new gene_square;
for (ii=0;... (1 Reply)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Suppose to have:
struct Tstudent
{
string name, surname;
int matriculation_num;
};
struct Tnode
{
Tstudent* student;
Tnodo* next;
} L;I want to deference that "student" pointer. For example, I tried with:
*(L->student).matriculation_numbut it not worked, as terminal... (4 Replies)
Hi,
Can any one tell me why my following program is crashing?
#include <iostream>
using namespace std;
class CA {
public:
const static int i;
};
const int CA::i = 10;
int main() {
int* pi = const_cast<int*>(&CA::i);
*pi = 9;
cout << CA::i << endl;
} (6 Replies)
I have what should be a relatively simple program (fadec.c) that maps a struct from an included header file (fadec.h) to a shared memory region, but I’m struggling accessing members in the struct from the pointer returned by shmat. Ultimately, I want to access members in the shared memory structure... (2 Replies)
Hi,
I have received an application that stores some properties in a file. The existing struct looks like this:
struct TData
{
UINT uSizeIncludingStrings;
// copy of Telnet data struct
UINT uSize;
// basic properties:
TCHAR szHost; //defined in Sshconfig
UINT iPortNr;
TCHAR... (2 Replies)
Hi guys ,
i got segment fault , and when i trace , found it happens since the value of pointer which is returned by Struct S_client (*ptr) is zero
if (ptr !=0)i know , adding above line of code is not the solution and not correct for the case since above line only check for the pointer... (1 Reply)
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
LEARN ABOUT DEBIAN
umad_set_grh
UMAD_SET_GRH(3) OpenIB Programmer's Manual UMAD_SET_GRH(3)NAME
umad_set_grh - set GRH fields within umad buffer using host ordering
SYNOPSIS
#include <infiniband/umad.h>
int umad_set_grh(void *umad, void *mad_addr);
DESCRIPTION
umad_set_grh() sets the GRH fields (grh_present, gid, hop_limit, traffic_class, flow_label) within the specified umad buffer based on the
mad_addr supplied. The provided mad_addr fields are expected to be in host order. If the mad_addr pointer supplied is NULL, no GRH is set.
The argument mad_addr is a pointer to an ib_mad_addr_t struct, as specified in <infiniband/umad.h>. The argument umad is a pointer to an
ib_user_mad_t struct, as specified in <infiniband/umad.h>.
typedef struct ib_mad_addr {
uint32_t qpn;
uint32_t qkey;
uint16_t lid;
uint8_t sl;
uint8_t path_bits;
uint8_t grh_present;
uint8_t gid_index;
uint8_t hop_limit;
uint8_t traffic_class;
uint8_t gid[16];
uint32_t flow_label;
} ib_mad_addr_t;
typedef struct ib_user_mad {
uint32_t agent_id;
uint32_t status;
uint32_t timeout_ms;
uint32_t retries;
uint32_t length;
ib_mad_addr_t addr;
uint8_t data[0];
} ib_user_mad_t;
RETURN VALUE
umad_set_grh() returns 0 on success, and a negative value on errors. Currently, there are no errors indicated.
SEE ALSO umad_set_grh_net(3)AUTHOR
Hal Rosenstock <halr@voltaire.com>
OpenIB May 24, 2007 UMAD_SET_GRH(3)