hermetic_infra
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled

Reviewed By: jasonwhite

Differential Revision: D64105413

fbshipit-source-id: 0d3a27a9a3d9deeaa545e42b9e2d96ed307d5c18
This commit is contained in:
generatedunixname89002005287564 2024-10-09 17:24:28 -07:00 committed by Facebook GitHub Bot
parent 3bd4cffb7b
commit a455a6b619

View file

@ -22,14 +22,14 @@ import sys
from typing import List, Optional
def dump_vdso() -> Optional[List[ctypes.c_ubyte]]:
def dump_vdso() -> list[ctypes.c_ubyte] | None:
"""
Returns a list containing the VDSO.
"""
with open("/proc/self/maps") as f:
for line in f:
if "[vdso]" in line:
start, end = [int(x, 16) for x in line.split(" ")[0].split("-")]
start, end = (int(x, 16) for x in line.split(" ")[0].split("-"))
length = end - start
return (ctypes.c_ubyte * length).from_address(start)