sys

package
v0.0.0-...-c7fba9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const FlagID = 1<<32 - 1

FlagID can be passed to chown-ish functions to mean "no change", and can be returned from getuid-ish functions to mean "not found".

View Source
const O_PATH = 0x200000

As of Go 1.9, the O_PATH constant does not seem to be declared uniformly over all archtiectures.

Variables

This section is empty.

Functions

func Chown

func Chown(f *os.File, uid UserID, gid GroupID) error

func ChownPath

func ChownPath(path string, uid UserID, gid GroupID) error

func Fchown

func Fchown(fd int, uid UserID, gid GroupID) error

func FchownAt

func FchownAt(dirfd uintptr, path string, uid UserID, gid GroupID, flags int) error

func FcntlGetFl

func FcntlGetFl(fd int) (int, error)

Types

type GroupID

type GroupID uint32

GroupID is the type of the system's group identifiers (in C, gid_t).

func Getegid

func Getegid() GroupID

func Getgid

func Getgid() GroupID

type UserID

type UserID uint32

UserID is the type of the system's user identifiers (in C, uid_t).

We give it its own explicit type so you don't have to remember that it's a uint32 (which lead to the bug this package fixes in the first place)

func Geteuid

func Geteuid() UserID

func Getuid

func Getuid() UserID

uid_t is an unsigned 32-bit integer in linux right now. so syscall.Gete?[ug]id are wrong, and break in 32 bits (see https://github.com/golang/go/issues/22739)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL