patch library: os/exec
This commit is contained in:
@@ -24,6 +24,34 @@ import (
|
||||
"github.com/goplus/llgo/c/os"
|
||||
)
|
||||
|
||||
// Unix returns the time stored in ts as seconds plus nanoseconds.
|
||||
func (ts *Timespec) Unix() (sec int64, nsec int64) {
|
||||
return int64(ts.Sec), int64(ts.Nsec)
|
||||
}
|
||||
|
||||
// Unix returns the time stored in tv as seconds plus nanoseconds.
|
||||
func (tv *Timeval) Unix() (sec int64, nsec int64) {
|
||||
return int64(tv.Sec), int64(tv.Usec) * 1000
|
||||
}
|
||||
|
||||
// Nano returns the time stored in ts as nanoseconds.
|
||||
func (ts *Timespec) Nano() int64 {
|
||||
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
||||
}
|
||||
|
||||
// Nano returns the time stored in tv as nanoseconds.
|
||||
func (tv *Timeval) Nano() int64 {
|
||||
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
|
||||
}
|
||||
|
||||
func Getpagesize() int {
|
||||
panic("todo: syscall.Getpagesize")
|
||||
}
|
||||
|
||||
func Exit(code int) {
|
||||
os.Exit(c.Int(code))
|
||||
}
|
||||
|
||||
func Getcwd(buf []byte) (n int, err error) {
|
||||
ptr := unsafe.Pointer(unsafe.SliceData(buf))
|
||||
ret := os.Getcwd(ptr, uintptr(len(buf)))
|
||||
|
||||
Reference in New Issue
Block a user