MCPcopy
hub / github.com/google/gvisor / copyInXattrValue

Function copyInXattrValue

pkg/sentry/syscalls/linux/sys_xattr.go:337–346  ·  view source on GitHub ↗
(t *kernel.Task, valueAddr hostarch.Addr, size uint)

Source from the content-addressed store, hash-verified

335}
336
337func copyInXattrValue(t *kernel.Task, valueAddr hostarch.Addr, size uint) (string, error) {
338 if size > linux.XATTR_SIZE_MAX {
339 return "", linuxerr.E2BIG
340 }
341 buf := make([]byte, size)
342 if _, err := t.CopyInBytes(valueAddr, buf); err != nil {
343 return "", err
344 }
345 return gohacks.StringFromImmutableBytes(buf), nil
346}
347
348func copyOutXattrValue(t *kernel.Task, valueAddr hostarch.Addr, size uint, value string) (int, error) {
349 if size == 0 {

Callers 2

setxattrFunction · 0.85
FsetxattrFunction · 0.85

Calls 2

StringFromImmutableBytesFunction · 0.92
CopyInBytesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…