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

Function sys_extattr_get_fd

freebsd/kern/vfs_extattr.c:397–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395};
396#endif
397int
398sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap)
399{
400 struct file *fp;
401 char attrname[EXTATTR_MAXNAMELEN + 1];
402 cap_rights_t rights;
403 int error;
404
405 AUDIT_ARG_FD(uap->fd);
406 AUDIT_ARG_VALUE(uap->attrnamespace);
407 error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL);
408 if (error)
409 return (error);
410 AUDIT_ARG_TEXT(attrname);
411
412 error = getvnode(td, uap->fd,
413 cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp);
414 if (error)
415 return (error);
416
417 error = extattr_get_vp(fp->f_vnode, uap->attrnamespace,
418 attrname, uap->data, uap->nbytes, td);
419
420 fdrop(fp, td);
421 return (error);
422}
423
424#ifndef _SYS_SYSPROTO_H_
425struct extattr_get_file_args {

Callers

nothing calls this directly

Calls 3

getvnodeFunction · 0.85
extattr_get_vpFunction · 0.85
copyinstrFunction · 0.50

Tested by

no test coverage detected