memlib: add update_shm_size to check shm_size not bigger than shmmax

add a lib function to check the shm_size, make sure it's not
bigger than shmmax.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
2 files changed