shmget argument values n.
Download
Skip this Video
Download Presentation
shmget() : Argument Values

Loading in 2 Seconds...

play fullscreen
1 / 4

shmget() : Argument Values - PowerPoint PPT Presentation


  • 137 Views
  • Uploaded on

shmget() : Argument Values. key same as before; we use getuid() to make it unique size number of bytes to allocate shmflag Creating: IPC_CREAT and permissions 0 for accessing only. Notes on shmat() arguments. shmid is as before

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'shmget() : Argument Values' - lakeisha


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
shmget argument values
shmget(): Argument Values

key

  • same as before; we use getuid() to make it unique

size

  • number of bytes to allocate

shmflag

  • Creating: IPC_CREAT and permissions
  • 0 for accessing only
notes on shmat arguments
Notes on shmat() arguments
  • shmid is as before
  • 2nd and 3rd arguments can be used to attach to a specific address within shmem, but it is an absolute address, requiring knowledge of the address of the shared memory segment
  • Almost always, 2nd and 3rd arguments are 0
shared memory data structure
Shared Memory Data Structure

/* One shmid data structure for each shared memory segment in the system. */

struct shmid_ds {

struct ipc_perm shm_perm; /* operation perms */

int shm_segsz; /* size of segment (bytes) */

time_t shm_atime; /* last attach time */

time_t shm_dtime; /* last detach time */

time_t shm_ctime; /* last change time */

unsigned short shm_cpid; /* pid of creator */

unsigned short shm_lpid; /* pid of last operator */

short shm_nattch; /* no. of current attaches */

/* the following are private */

unsigned short shm_npages; /* size of segment (pages) */

unsigned long *shm_pages; /* array of ptrs to frames -> SHMMAX */

struct vm_area_struct *attaches; /* descriptors for attaches */

};

virtual memory area structure
Virtual Memory Area Structure

vm_area_struct

  • defines a memory VMM memory area. There is one of these per VM-area/task. A VM area is any part of the process virtual memory space that has a special rule for the page-fault handlers (ie a shared library, the executable area etc).

struct vm_area_struct {

struct mm_struct * vm_mm;

unsigned long vm_start;

unsigned long vm_end;

struct vm_area_struct *vm_next;

pgprot_t vm_page_prot;

unsigned long vm_flags;

rb_node_t vm_rb;

struct vm_area_struct *vm_next_share;

struct vm_area_struct **vm_pprev_share;

struct vm_operations_struct * vm_ops;

unsigned long vm_pgoff;

struct file * vm_file;

unsigned long vm_raend;

void * vm_private_data;

};