library: c/syscall

This commit is contained in:
xushiwei
2024-07-11 19:11:54 +08:00
parent b81638794f
commit a5ff25b0fe
38 changed files with 46 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ import (
"unsafe"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/internal/lib/internal/oserror"
)
var (
@@ -28,11 +29,11 @@ func (e Errno) Error() string {
func (e Errno) Is(target error) bool {
switch target {
case ErrPermission:
case oserror.ErrPermission:
return e == EACCES || e == EPERM
case ErrExist:
case oserror.ErrExist:
return e == EEXIST || e == ENOTEMPTY
case ErrNotExist:
case oserror.ErrNotExist:
return e == ENOENT
case errors.ErrUnsupported:
return e == ENOSYS || e == ENOTSUP || e == EOPNOTSUPP