Skip to content

Commit

Permalink
Fix for bsd based oss (freebsd, openbsd, ...) where 'fd' argument
Browse files Browse the repository at this point in the history
on mmap() is required to be -1 when MAP_ANON is requested.
  • Loading branch information
Nenad Vukicevic committed Jun 25, 2014
1 parent f533917 commit 364debf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/libupc/portals4/gupcr_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ gupcr_mem_private (size_t size)
{
char *memaddr;
memaddr = mmap (NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, OFFSET_ZERO);
MAP_PRIVATE | MAP_ANONYMOUS, -1, OFFSET_ZERO);
if (!memaddr || memaddr == MAP_ERROR)
gupcr_fatal_error
("cannot mmap 0x%lx bytes of node's private shared memory (%s)",
Expand Down
2 changes: 1 addition & 1 deletion runtime/libupc/smp/upc_sysdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ __upc_runtime_alloc (size_t size, os_heap_p *ARG_UNUSED (heap),
#else
alloc = mmap ((void *) 0, size,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, 0, OFFSET_ZERO);
MAP_SHARED | MAP_ANONYMOUS, -1, OFFSET_ZERO);
if (!alloc || alloc == MAP_ERROR)
{ *err_msg = strerror(errno); return 0; }
#endif
Expand Down

0 comments on commit 364debf

Please sign in to comment.