Skip to content

Instantly share code, notes, and snippets.

@hiboma
Created February 12, 2010 10:23
Show Gist options
  • Save hiboma/302459 to your computer and use it in GitHub Desktop.
Save hiboma/302459 to your computer and use it in GitHub Desktop.
#include <sys/ioctl.h>
#include <error.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
int main(int argc, const char *argv[]) {
int fd;
fd = open("/sys/kernel/security/rootconn/server", O_NONBLOCK|O_WRONLY);
if(fd < 0) {
perror("open");
return 1;
}
printf("FD is %d\n", fd);
if(ioctl(fd, 0, "hogehoge") < 0) {
perror("ioctl");
return 1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment