Skip to content

Commit d18b58c

Browse files
committed
Merge pull request #4 from pombreda/patch-1
Portable way to get pagesize, fixes #2
2 parents 5c81dfa + f45613e commit d18b58c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libarchive/ffi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77

88
from ctypes import (
99
c_char_p, c_int, c_longlong, c_size_t, c_ssize_t, c_void_p, c_wchar_p,
10-
pythonapi, CFUNCTYPE, POINTER,
10+
CFUNCTYPE, POINTER,
1111
)
1212
import ctypes
1313
import ctypes.util
1414
import logging
15+
import mmap
1516

1617
from .exception import ArchiveError
1718

1819

1920
logger = logging.getLogger('libarchive')
2021

21-
page_size = pythonapi.getpagesize()
22+
page_size = mmap.PAGESIZE
2223

2324
_LIB_FILEPATH = ctypes.util.find_library('libarchive') or 'libarchive.so'
2425
libarchive = ctypes.cdll.LoadLibrary(_LIB_FILEPATH)

0 commit comments

Comments
 (0)