Update system/xattrs_linux.go

- Add Llistxattr() support
- Additionally cleanup Lgetxattr() and implement it properly
  in accordance with getxattr() syscall behavior.

Signed-off-by: Harshavardhana <fharshav@redhat.com>
Cool :)

Sent from my iPhone

> On Sep 25, 2014, at 5:07 PM, Harshavardhana <notifications@github.com> wrote:
> 
> In system/xattrs_linux.go:
> 
> > -		return nil, nil
> > -	}
> > -	if errno == syscall.ERANGE {
> > +
> > +	switch {
> > +	case errno == syscall.ENODATA:
> > +		return nil, errno
> > +	case errno == syscall.ENOTSUP:
> > +		return nil, errno
> > +	case errno == syscall.ERANGE:
> > +		// 128 byte array might just not be good enough,
> > +		// A dummy buffer uintptr(0) is necessary here to get real
> > +		// size of the on-disk xattr which would subsequently help
> > +		// us get the large size xattrs
> > +		sz, _, errno = syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(unsafe.Pointer(nil)), uintptr(0), 0, 0)
> > +		if sz < 0 {
> Yes i was doing just that :-)
> 
> —
> Reply to this email directly or view it on GitHub.