llgo.string; c string library

This commit is contained in:
xushiwei
2024-06-19 23:40:05 +08:00
parent 3c0e321538
commit 3ead4b4d4b
9 changed files with 125 additions and 26 deletions

View File

@@ -86,12 +86,12 @@ func toMode(mode FileMode) os.ModeT {
panic("todo")
}
func toPathErr(op, path string, errno c.Int) error {
func toSyscallErr(errno c.Int) error {
panic("todo")
}
func toSyscallErr(errno c.Int) error {
panic("todo")
func toPathErr(op, path string, errno c.Int) error {
return &PathError{Op: op, Path: path, Err: toSyscallErr(errno)}
}
func Chdir(dir string) error {
@@ -255,7 +255,7 @@ func Setenv(key, value string) error {
if ret == 0 {
return nil
}
return &SyscallError{Syscall: "setenv", Err: toSyscallErr(ret)}
return &SyscallError{"setenv", toSyscallErr(ret)}
}
func Symlink(oldname, newname string) error {