linux-usb-gadgets / libusbgx

C library encapsulating the Linux kernel USB gadget configfs userspace API functionality
GNU General Public License v2.0
216 stars 72 forks source link

usbg_set_function_attrs returns NO_ACCESS #51

Open yxue2 opened 3 years ago

yxue2 commented 3 years ago

When I followed the example gadget_uac2.c to create UAC2 gadget, usbg_create_function returns NO_ACCESS error. And I found that &f_uac2_attrs causes this error in usbg_set_function_attrs method.

Do you have any idea what causes it?

pabs3 commented 3 years ago

@yxue2 please try running the gadget as root, if that doesn't work then please strace the gadget and see which file is getting which error. NO_ACCESS corresponds to these three errno values:

EACCES 13 Permission denied
EROFS 30 Read-only file system
EPERM 1 Operation not permitted