Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
9dc6c659
Commit
9dc6c659
authored
Aug 06, 2021
by
Antoine Kaufmann
Browse files
lib/nicif: add SHM_ROUND_UP to round up shm size
Useful for huge pages.
parent
652c75c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
lib/simbricks/nicif/utils.c
lib/simbricks/nicif/utils.c
+5
-0
No files found.
lib/simbricks/nicif/utils.c
View file @
9dc6c659
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment