SYSV shared memory question# Unix - 噫吁兮,危乎高哉
r*o
1 楼
I have a shared data structure like this:
struct s {
int ...
...
char *text;
}
While creating the shmid, is it possible to dynamically
allocate the shared memory according to the size of the char*?
Or I should change the structure to:
struct s{
int ...
...
char text[MAXLENTH];
}
and shmid = shmget(..., sizeof(s), ...) ???
struct s {
int ...
...
char *text;
}
While creating the shmid, is it possible to dynamically
allocate the shared memory according to the size of the char*?
Or I should change the structure to:
struct s{
int ...
...
char text[MAXLENTH];
}
and shmid = shmget(..., sizeof(s), ...) ???