Skip to content

sahne/eventfd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Eventfd

A wrapper around eventfd().

Installation

Download and install eventfd

go get github.com/sahne/eventfd

Usage

package main

import (
	"log"
	"github.com/sahne/eventfd"
)

func main() {
	efd, err := eventfd.New()
	if err != nil {
		log.Fatalf("Could not create EventFD: %v", err)
	}
	/* TODO: register fd at kernel interface (for example cgroups memory watcher) */
	/* listen for new events */
	for {
		val, err := efd.ReadEvents()
		if err != nil {
			log.Printf("Error while reading from eventfd: %v", err)
			break
		}
	}
}

About

golang bindings for eventfd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages