Commit 9dc6c659 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

lib/nicif: add SHM_ROUND_UP to round up shm size

Useful for huge pages.
parent 652c75c6
......@@ -107,6 +107,11 @@ int shm_create(const char *path, size_t size, void **addr) {
int fd;
void *p;
#ifdef SHM_ROUND_UP
if (size % SHM_ROUND_UP != 0)
size += SHM_ROUND_UP - (size % SHM_ROUND_UP);
#endif
if ((fd = open(path, O_CREAT | O_RDWR, 0666)) == -1) {
perror("util_create_shmsiszed: open failed");
goto error_out;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment