I was looking at catching a signal using usbfs to tell when a device has
been detached. I used an ioctl call with USBDEVFS_DISCSIGNAL to set a
signal handler, and I was able to detect the detachment. However, I can't
figure out that the context field of the struct usbdevfs_disconnectsignal
does. I'm using the code below to catch the signal, and that works,
but can't interpret what the context is telling me.
void action (int s, siginfo_t * x, struct ucontext * y)
{
printf ("caught signal %d\n" , s );
printf ("context is\n\tflags=%lx\n\tlink=%p\n",
y->uc_flags, (void *)y->uc_link );
exit (1);
}
..... and later ....
sig.signr = SIGRTMIN;
// sig.context = (void *)NULL;
ret = ioctl ( fd, USBDEVFS_DISCSIGNAL, &sig );
ret = sigaction( sig.signr, NULL, &oldact);
oldact.sa_sigaction = action;
oldact.sa_flags = SA_SIGINFO;
ret = sigaction( sig.signr, &oldact, NULL );
What should I put in sig.context?
Ken
----
Ken Hughes
([EMAIL PROTECTED])
Electrical and Computer Engr
University of the Pacific
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel