Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public ioctl api #132

Merged
merged 7 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/reference/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ version_xml = configure_file(
# HACK: need to find valac'ed umockdev.c for gtk-doc; https://github.com/mesonbuild/meson/issues/3892
# this isn't predictable between meson versions
umockdev_c = run_command('sh', '-ec', 'find -name umockdev.c| xargs dirname').stdout().strip()
umockdev_ioctl_c = run_command('sh', '-ec', 'find -name umockdev-ioctl.c| xargs dirname').stdout().strip()

gnome = import('gnome')
gnome.gtkdoc('umockdev',
main_xml: 'umockdev-docs.xml',
src_dir: [meson.build_root(), umockdev_c],
src_dir: [meson.build_root(), umockdev_c, umockdev_ioctl_c],
content_files: [version_xml],
ignore_headers: ['uevent_sender.h', 'ioctl_tree.h', 'debug.h'],
scan_args: ['--rebuild-types'],
Expand Down
1 change: 1 addition & 0 deletions docs/reference/umockdev-docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<chapter>
<title>API reference</title>
<xi:include href="xml/umockdev.xml"/>
<xi:include href="xml/umockdev-ioctl.xml"/>
<xi:include href="xml/functions.xml"/>
<xi:include href="xml/umockdeverror.xml"/>

Expand Down
27 changes: 27 additions & 0 deletions docs/reference/umockdev-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ umockdev_testbed_get_property
umockdev_testbed_uevent
umockdev_testbed_add_from_string
umockdev_testbed_add_from_file
umockdev_testbed_attach_ioctl
umockdev_testbed_detach_ioctl
umockdev_testbed_load_ioctl
umockdev_testbed_load_pcap
umockdev_testbed_load_script
umockdev_testbed_load_socket_script
umockdev_testbed_load_evemu_events
Expand All @@ -46,6 +49,30 @@ umockdev_testbed_get_type
umockdev_in_mock_environment
</SECTION>

<SECTION>
<FILE>umockdev-ioctl</FILE>
<TITLE>UMockdev Ioctl emulation</TITLE>
UMockdevIoctlBase
UMockdevIoctlBaseClass
umockdev_ioctl_base_new

UMockdevIoctlData
umockdev_ioctl_data_ref
umockdev_ioctl_data_unref
umockdev_ioctl_data_resolve
umockdev_ioctl_data_set_ptr
umockdev_ioctl_data_reload

UMockdevIoctlClient
umockdev_ioctl_client_complete
umockdev_ioctl_client_abort
umockdev_ioctl_client_execute
umockdev_ioctl_client_get_arg
umockdev_ioctl_client_get_connected
umockdev_ioctl_client_get_devnode
umockdev_ioctl_client_get_request
</SECTION>

<SECTION>
<FILE>umockdeverror</FILE>
UMockdevError
Expand Down
8 changes: 4 additions & 4 deletions src/libumockdev-preload.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,25 +645,25 @@ remote_emulate(int fd, int cmd, long arg1, long arg2)
case IOCTL_RES_ABORT:
fprintf(stderr, "ERROR: libumockdev-preload: Server requested abort on device %s, exiting\n",
fdinfo->dev_path);
exit(1);
abort();

default:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, unknown command: %ld (res: %d)\n",
req.cmd, res);
exit(1);
abort();
}
}

con_eof:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, received EOF\n");
pthread_sigmask(SIG_SETMASK, &sig_restore, NULL);
exit(1);
abort();

con_err:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, errno: %d\n",
errno);
pthread_sigmask(SIG_SETMASK, &sig_restore, NULL);
exit(1);
abort();
}

/********************************
Expand Down
Loading