⬢ DragonFlyBSD Kernel Audit
DF-5582 / trigger.c
← back to finding ↓ download raw
/* DF-5582: signal the rig ctl thread to tear down the fake ig4iic
 * (running smbus_acpi_detach underneath the parked handler).
 * DF5582_IOC_DETACH = _IOW('d',1,int) = 0x80046401 on x86_64. */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int
main(void)
{
	int fd, arg = 1;

	fd = open("/dev/df5582", O_RDWR);
	if (fd < 0) {
		perror("open /dev/df5582");
		return (1);
	}
	if (ioctl(fd, 0x80046401, &arg) < 0) {
		perror("ioctl DF5582_IOC_DETACH");
		return (1);
	}
	printf("df5582: detach signaled\n");
	return (0);
}