MCPcopy Create free account
hub / github.com/acl-dev/acl / mmap_addr

Function mmap_addr

lib_acl/samples/xml/xml5/xml.cpp:9–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "lib_acl.h"
8
9static char *mmap_addr(int fd, size_t len)
10{
11 char *ptr;
12
13 if (fd == -1)
14 {
15 printf("open error %s\r\n", acl_last_serror());
16 return NULL;
17 }
18
19 printf(">>fd: %d, len: %ld\r\n", fd, len);
20 ptr = (char*) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
21 if (ptr == NULL) {
22 printf("mmap error %s\r\n", acl_last_serror());
23 return NULL;
24 }
25
26 return ptr;
27}
28
29static void ummap_addr(char *addr, size_t len)
30{

Callers 1

parse_xml_fileFunction · 0.70

Calls 1

acl_last_serrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…