GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — locks/xattr_posix.go at master · asciimoth/locks Expand file tree/ Copy pathxattr_posix.goMore file actions 62 lines (58 loc) · 1.16 KB / Copy pathxattr_posix.goFile metadata and controls62 lines (58 loc) · 1.16 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 //go:build darwin || linux package locks import ( "errors" "os" "strings" "golang.org/x/sys/unix" ) func copyXattrs(src, dst *os.File, dir bool) error { n, e := xattrs.Flistxattr(int(src.Fd()), nil) if errors.Is(e, unix.ENOTSUP) { return nil } if e != nil { return e } if n < 0 { return ErrFormat } if n == 0 { return nil } names := make([]byte, n) n, e = xattrs.Flistxattr(int(src.Fd()), names) if e != nil { return e } if n < 0 || n > len(names) { return ErrFormat } for _, name := range strings.Split(string(names[:n]), "\x00") { if name == "" || skipXattr(name) { continue } size, e := xattrs.Fgetxattr(int(src.Fd()), name, nil) if e != nil { return e } if size < 0 { return ErrFormat } v := make([]byte, size) size, e = xattrs.Fgetxattr(int(src.Fd()), name, v) if e != nil { return e } // A zero-length buffer asks for the size again. The attribute can // grow between calls without the kernel returning ERANGE. if size < 0 || size > len(v) { return ErrFormat } prepareXattr(name, v[:size], dir) if e = xattrs.Fsetxattr(int(dst.Fd()), name, v[:size], 0); e != nil { return e } } return nil } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |