I want to develop a network kernel extension on mac os. I got some data with gzip format in function sf_data_in(). I included the header file named <libkern/zlib.h>
, and my mac crashed when it was running the code below after I loading the kext with "kextload".
z_stream strm;
bzero(&strm, sizeof(z_stream));
if (Z_OK != inflateInit2(&strm))
{
printf("inflateInit error.\n");
inflateEnd(&strm);
return 0;
}
who can tell me how to use it in kernel programming. it's much better to give some samples. Thanks very much.