337 *len = (ssize_t)bufsize; |
337 *len = (ssize_t)bufsize; |
338 return buf; |
338 return buf; |
339 } |
339 } |
340 |
340 |
341 int xattr_set(const char *path, const char *name, const void *value, size_t len) { |
341 int xattr_set(const char *path, const char *name, const void *value, size_t len) { |
342 int attrfile = open_attrfile(path, name, O_CREAT|O_WRONLY|O_XATTR); |
342 int attrfile = open_attrfile(path, name, O_CREAT|O_WRONLY|O_XATTR|O_TRUNC); |
343 if(attrfile == -1) { |
343 if(attrfile == -1) { |
344 return -1; |
344 return -1; |
345 } |
345 } |
346 |
346 |
347 const char *p = value; |
347 const char *p = value; |