Skip to content

Instantly share code, notes, and snippets.

@smallnest
smallnest / fork_and_daemon.go
Created April 20, 2020 06:52 — forked from wrfly/fork_and_daemon.go
golang fork and exec and handle signals
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
)
@wrfly
wrfly / fork_and_daemon.go
Last active March 22, 2023 08:08
golang fork and exec and handle signals
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
)
@jedy
jedy / reader.go
Created August 7, 2012 07:20
processes communicate with shared memory in golang
package main
// #include <stdlib.h>
// #include "wrapper.c"
import "C"
import "unsafe"
import "fmt"
func read(filename string) string {
f := C.CString(filename)