Make SHMMAXPGS an unsigned long
This is used to calculate sizes that are then stored in unsigned long fields. Make this unsigned long so the calculations use this type and not an int that can lead to an integer overflow with a large PAGE_SIZE. This allows building this on arm64 with PAGE_SIZE of 16k. Further work will be needed if a 32-bit architecture tries to use a similar sized page. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
7819a911ff
commit
cab496e16c
@ -155,7 +155,7 @@ static void shm_prison_cleanup(struct prison *);
|
||||
* Tuneable values.
|
||||
*/
|
||||
#ifndef SHMMAXPGS
|
||||
#define SHMMAXPGS 131072 /* Note: sysv shared memory is swap backed. */
|
||||
#define SHMMAXPGS 131072ul /* Note: sysv shared memory is swap backed. */
|
||||
#endif
|
||||
#ifndef SHMMAX
|
||||
#define SHMMAX (SHMMAXPGS*PAGE_SIZE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user