⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysctl1.c

📁 gdb-6.8 Linux下的调试程序 最新版本
💻 C
字号:
/*#notarget: cris*-*-elf*/#include <unistd.h>#include <sys/syscall.h>#include <stdio.h>#include <stdlib.h>#include <errno.h>/* I can't seem to include the right things, so we do it brute force.  */int main (void){  static int sysctl_args[] = { 1, 4 };  size_t x = 8;  struct __sysctl_args {    int *name;    int nlen;    void *oldval;    size_t *oldlenp;    void *newval;    size_t newlen;    unsigned long __unused[4];  } scargs      =    {     sysctl_args,     sizeof (sysctl_args) / sizeof (sysctl_args[0]),     (void *) -1, &x, NULL, 0    };  if (syscall (SYS__sysctl, &scargs) != -1      || errno != EFAULT)    abort ();  printf ("pass\n");  exit (0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -