mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
--------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
13 lines
238 B
Python
13 lines
238 B
Python
import os
|
|
import sys
|
|
|
|
if os.name != "posix":
|
|
sys.exit(0)
|
|
|
|
import _posixshmem
|
|
|
|
name = f"/rp_posixshmem_{os.getpid()}"
|
|
fd = _posixshmem.shm_open(name, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o600)
|
|
os.close(fd)
|
|
_posixshmem.shm_unlink(name)
|