Sponsored Content
Top Forums Programming Dereferencing pointer to a shared memory struct Post 302494150 by arette on Saturday 5th of February 2011 04:45:10 PM
Old 02-05-2011
Wow - no wonder I was Smilie! Sometimes it helps to take a step back lol. Now it compiles and runs fine! Thank you!
 

10 More Discussions You Might Find Interesting

1. Programming

Accesing structure member:Error:dereferencing pointer to incomplete type

$ gcc -Wall -Werror struct.c struct.c: In function `main': struct.c:18: error: dereferencing pointer to incomplete type $ cat struct.c #include <stdio.h> #include <stdlib.h> #include <string.h> /*Declaration of structure*/ struct human { char *first; char gender; int age; } man,... (3 Replies)
Discussion started by: amit4g
3 Replies

2. Programming

Pointer to a struct (with pointers) *** glibc detected *** double free

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)
Discussion started by: jatoo
1 Replies

3. UNIX for Dummies Questions & Answers

Build Error: error: dereferencing pointer to incomplete type

I'm getting the following Error: prepare_pcap.c: In function `prepare_pkts': prepare_pcap.c:127: error: dereferencing pointer to incomplete type prepare_pcap.c:138: error: dereferencing pointer to incomplete type ==================================== This is the part of the relevant... (8 Replies)
Discussion started by: katwala
8 Replies

4. Programming

Dereferencing pointer to incomplete type

// Hello all, I am having this error "Dereferencing pointer to incomplete type " on these 2 lines: xpoint = my_point->x; ypoint = my_point->y; I am having no clue y this is happening. Any help would be greately appreciated!!!! #include<stdio.h> #include<string.h>... (2 Replies)
Discussion started by: mind@work
2 Replies

5. Programming

linked list node with pointer to struct

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)
Discussion started by: Luke Bonham
4 Replies

6. Programming

Compilation Error: dereferencing pointer to incomplete type

I am getting a dereferencing pointer to incomplete type error when i compile the following code on lines highlighted in red. Can anyone help me in identifying what is wrong in the code? #include<stdio.h> #include<stdlib.h> typedef struct{ int info; struct node* link ; } node; void... (3 Replies)
Discussion started by: sreeharshasn
3 Replies

7. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

8. Programming

Check The value a pointer returned by struct s_client != 0

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)
Discussion started by: pooyair
1 Replies

9. Programming

Declare member of struct as a pointer in c

I have a uint8_t *C = malloc(24*sizeof(uint8_t)); I need to send some integers and this *C to another node(in ad hoc network). So I am going to use a struct ` struct fulMsg { int msgType; int msgCount; //uint8_t *CC; } fulMsg_t; typedef struct fulMsg fulMsg_tt;` there is a method... (1 Reply)
Discussion started by: chap
1 Replies

10. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

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
nshmget(3)						     Library Functions Manual							nshmget(3)

NAME
nshmget - Returns (or creates) the ID for a shared memory region (libnuma library) SYNOPSIS
#include <numa.h> #include <sys/shm.h> int nshmget( key_t key, size_t size, int shmflg, memalloc_attr_t *attr ); PARAMETERS
Specifies the key that identifies the shared memory region. The value for the key parameter can be IPC_PRIVATE or a random number other than zero (0). If the value of key is IPC_PRIVATE, it can be used to assure the return of a new, unused shared memory region. Specifies the minimum number of bytes to allocate for the region. Specifies the creation flags. See shmget(2) for a description of these flags. Points to a memory allocation policy and attributes structure. If the specified key does not exist, and a shared memory region is created, these attributes will be assigned to the memory object created to manage the shared memory region. DESCRIPTION
If the attr argument is NULL, the nshmget() function behaves identically to the shmget() function. If the attr argument is non-NULL, it points to a memory allocation policy and attributes structure that specifies where the pages should be allocated for a newly created shared memory region. To change the policy of an existing shared memory region, use the nmadvise()function. If the mattr_policy member of the structure pointed to by attr is MPOL_DIRECTED and the mattr_rad member is RAD_NONE, the system will choose the Resource Affinity Domain (RAD) where the pages of the shared memory region will be allocated from among the RADs specified in the mattr_radset member of *attr. If the mattr_radset member is the empty set, the system will select a RAD for the memory object from among all of the RADs in the caller's partition, and the overflow set will be the empty set. RETURN VALUES
Success. Failure. In this case, errno is set to indicate the error. ERRORS
In addition to the error conditions for the shmget() function, the nshmget()function sets errno to one of the specified values for the specified condition: A non-NULL attr argument points to an invalid address. The structure pointed to by the attr argument contains an invalid memory allocation policy or invalid RAD. The striped allocation was requested with a stride of 0. SEE ALSO
Functions: shmget(2), nmadvise(3), numa_intro(3) Files: numa_types(4), shmid_ds(4) nshmget(3)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy