negativity in kern control
negativity in kern control
- Subject: negativity in kern control
- From: David A Rowland <email@hidden>
- Date: Wed, 19 Jul 2006 09:23:45 -0700
Title: negativity in kern control
My application uses setsockopt calls (and getsockopt) to
communicate with my kernel extension. Depending on the opt parameter
the kernel extension does something and returns an error code to the
application.
The code looks, in part, like this:
int error
= 0;
switch ( opt )
{
case
nullCommand:
//error
error = ESRCH;
break;
case
ResetAccumulator:
initAccumulator();
break;
case
toggleOffOn:
if (active)
active = 0;
else
active = 1;
break;
case sendFExKey:
error = Fancy_Routine(&(fancyStruct));
break;
...........
return error;
I find that if error is set
to -1, as it may be by Fancy_Routine, control never returns to the
application. Rather, the setsockopt mechanism calls this routine
again, and continues to do so as long as error ==
-1.
I don't find this documented
anywhere, and it seems damaging to the point of being a bug. Anyone
know anything about this?
thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden