mirror of https://github.com/joan2937/pigpio
Merge pull request #342 from hazuki0x0/fix-initPeripherals
Fix initPeripherals on Ubuntu 20.04 For security reasons, newer distros mount /dev with 'noexec' so mmap with PROT_EXEC will no longer work (Operation not permitted).
This commit is contained in:
commit
8a49a4b078
2
pigpio.c
2
pigpio.c
|
@ -7335,7 +7335,7 @@ static int initGrabLockFile(void)
|
||||||
static uint32_t * initMapMem(int fd, uint32_t addr, uint32_t len)
|
static uint32_t * initMapMem(int fd, uint32_t addr, uint32_t len)
|
||||||
{
|
{
|
||||||
return (uint32_t *) mmap(0, len,
|
return (uint32_t *) mmap(0, len,
|
||||||
PROT_READ|PROT_WRITE|PROT_EXEC,
|
PROT_READ|PROT_WRITE,
|
||||||
MAP_SHARED|MAP_LOCKED,
|
MAP_SHARED|MAP_LOCKED,
|
||||||
fd, addr);
|
fd, addr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue