procevent

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package procevent는 process 종료와 directory 변경을 운영체제의 알림으로 기다린다. polling과 기한이 없다: 기다림은 알림이 오면 끝난다. darwin은 kqueue, linux는 pidfd와 inotify를 쓴다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alive

func Alive(pid int) bool

Alive는 pid의 process가 있는지다. 다른 사용자의 process(EPERM)도 있는 것이다.

func WatchDir

func WatchDir(path string) (func() error, func(), error)

WatchDir는 inotify에 directory의 변경(entry가 생기거나 없어지거나 옮겨짐)을 등록하고, 다음 변경을 기다리는 함수와 감시를 닫는 함수를 돌려준다. 등록은 상태를 읽기 전에 해서 그 사이의 변경을 놓치지 않는다.

func WatchExit

func WatchExit(pid int) (func() error, error)

WatchExit는 pid의 pidfd를 열고, process가 끝나 pidfd가 읽을 수 있게 되기를 poll로 기다리는 함수를 돌려준다. 이미 없는 process는 unix.ESRCH다.

Types

This section is empty.

Jump to

Keyboard shortcuts

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