MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_extattr_set_fd

Function sys_extattr_set_fd

freebsd/kern/vfs_extattr.c:230–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228};
229#endif
230int
231sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap)
232{
233 struct file *fp;
234 char attrname[EXTATTR_MAXNAMELEN + 1];
235 cap_rights_t rights;
236 int error;
237
238 AUDIT_ARG_FD(uap->fd);
239 AUDIT_ARG_VALUE(uap->attrnamespace);
240 error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL);
241 if (error)
242 return (error);
243 AUDIT_ARG_TEXT(attrname);
244
245 error = getvnode(td, uap->fd,
246 cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp);
247 if (error)
248 return (error);
249
250 error = extattr_set_vp(fp->f_vnode, uap->attrnamespace,
251 attrname, uap->data, uap->nbytes, td);
252 fdrop(fp, td);
253
254 return (error);
255}
256
257#ifndef _SYS_SYSPROTO_H_
258struct extattr_set_file_args {

Callers

nothing calls this directly

Calls 3

getvnodeFunction · 0.85
extattr_set_vpFunction · 0.85
copyinstrFunction · 0.50

Tested by

no test coverage detected