memguard: Index | Files

package memcall

import ""


Package Files

memcall_symbols.go memcall_unix.go


var ErrInvalidFlag = errors.New("<memguard::memcall> memory protection flag is undefined")

ErrInvalidFlag indicates that a given memory protection flag is undefined.

var NoAccess = MemoryProtectionFlag{1}

NoAccess specifies that the memory should be marked unreadable and immutable.

var ReadOnly = MemoryProtectionFlag{2}

ReadOnly specifies that the memory should be marked read-only (immutable).

var ReadWrite = MemoryProtectionFlag{6}

ReadWrite specifies that the memory should be made readable and writable.

func Alloc Uses

func Alloc(n int) ([]byte, error)

Alloc allocates a byte slice of length n and returns it.

func DisableCoreDumps Uses

func DisableCoreDumps() error

DisableCoreDumps disables core dumps on Unix systems.

func Free Uses

func Free(b []byte) error

Free deallocates the byte slice specified.

func Lock Uses

func Lock(b []byte) error

Lock is a wrapper for mlock(2), with extra precautions.

func Protect Uses

func Protect(b []byte, mpf MemoryProtectionFlag) error

Protect modifies the protection state for a specified byte slice.

func Unlock Uses

func Unlock(b []byte) error

Unlock is a wrapper for munlock(2).

type MemoryProtectionFlag Uses

type MemoryProtectionFlag struct {
    // contains filtered or unexported fields

MemoryProtectionFlag specifies some particular memory protection flag.

Package memcall imports 3 packages (graph) and is imported by 6 packages. Updated 2019-07-19. Refresh now. Tools for package owners.