Add openbsd and dragonfly support to shm

This commit is contained in:
Kovid Goyal
2022-12-20 20:53:52 +05:30
parent 7e161ea94b
commit 6ace082bc2
6 changed files with 47 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
package shm
import (
"fmt"
)
var _ = fmt.Print
const SHM_DIR = "/tmp"
func modify_pattern(pattern string) string {
// https://github.com/openbsd/src/blob/master/lib/libc/gen/shm_open.c
if strings.Contains(pattern, "*") {
pattern += ".shm"
} else {
pattern += "*.shm"
}
return pattern
}