Using Linux ioctl with Mono

I am trying to execute the ioctl command through the Mono environment, but I cannot find what I am looking for.

I am trying to send a command to a DVB card with a kernel module. Hope someone can clearly explain or explain how this can be done. Any Mono example using kernel modules would be helpful, I think.

+5
source share
4 answers

Mono does not contain a wrapper for ioctl in Mono.Unix, since the parameters of the ioctl call are very different, and such a shell will be almost useless. You must declare DllImport for every ioctl you need.

, , , C, , , C. , C:

#define FE_GET_INFO                _IOR('o', 61, struct dvb_frontend_info)

:

#include <linux/dvb/frontend.h>
#include <stdio.h>

int main()
{
  printf("const int FE_GET_INFO = %d;\n", FE_GET_INFO);
  return 0;
}

- .

+3

ioctl Mono AFAIK. . DLLImport

+2

. , Mono.Unix syscalls (google codesearch Mono.Unix Syscall.cs), . ioctl, .

- DLLImport ioctl.

+2

, . Videl4Linux, .

.

+1

All Articles