mm/shm/shmget: Zero allocated shared memory pages when created.
Modification based on opengroup's description for shmget: "When the shared memory segment is created, it shall be initialized with all zero values." Link to documentation page for shmget: https://pubs.opengroup.org/onlinepubs/9699919799/
This commit is contained in:
parent
890dd87a4a
commit
531e5c2011
|
@ -188,6 +188,10 @@ static int shm_extend(int shmid, size_t size)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Zero the allocated page. */
|
||||
|
||||
memset((void *)region->sr_pages[pgalloc], 0, MM_PGSIZE);
|
||||
|
||||
/* Increment the number of pages successfully allocated */
|
||||
|
||||
pgalloc++;
|
||||
|
|
Loading…
Reference in New Issue