1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 17:27:31 +00:00

Merge pull request #2431 from enkore/issue/2430

platform.linux: get rid of "resource" module
This commit is contained in:
enkore 2017-04-19 11:51:19 +02:00 committed by GitHub
commit b32b7b4475

View file

@ -1,6 +1,5 @@
import os import os
import re import re
import resource
import stat import stat
import subprocess import subprocess
@ -54,6 +53,10 @@ cdef extern from "linux/fs.h":
cdef extern from "sys/ioctl.h": cdef extern from "sys/ioctl.h":
int ioctl(int fildes, int request, ...) int ioctl(int fildes, int request, ...)
cdef extern from "unistd.h":
int _SC_PAGESIZE
long sysconf(int name)
cdef extern from "string.h": cdef extern from "string.h":
char *strerror(int errnum) char *strerror(int errnum)
@ -219,7 +222,7 @@ cdef _sync_file_range(fd, offset, length, flags):
raise OSError(errno.errno, os.strerror(errno.errno)) raise OSError(errno.errno, os.strerror(errno.errno))
safe_fadvise(fd, offset, length, 'DONTNEED') safe_fadvise(fd, offset, length, 'DONTNEED')
cdef unsigned PAGE_MASK = resource.getpagesize() - 1 cdef unsigned PAGE_MASK = sysconf(_SC_PAGESIZE) - 1
class SyncFile(BaseSyncFile): class SyncFile(BaseSyncFile):