)]}'
{
  "commit": "e36800c91a74b656b4b4c74483863950cf9ec202",
  "tree": "a4490654ca15328ea55eebd6d2f38eb29da443ef",
  "parents": [
    "38a762fec63fd5c035aae29ba9a77d357e21e4a7"
  ],
  "author": {
    "name": "Laurent Vivier",
    "email": "laurent@vivier.eu",
    "time": "Fri Oct 02 14:48:09 2015 +0200"
  },
  "committer": {
    "name": "Riku Voipio",
    "email": "riku.voipio@linaro.org",
    "time": "Fri Jan 08 11:36:12 2016 +0200"
  },
  "message": "linux-user: add signalfd/signalfd4 syscalls\n\nThis patch introduces a system very similar to the one used in the kernel\nto attach specific functions to a given file descriptor.\n\nIn this case, we attach a specific \"host_to_target()\" translator to the fd\nreturned by signalfd() to be able to byte-swap the signalfd_siginfo\nstructure provided by read().\n\nThis patch allows to execute the example program given by\nman signalfd(2):\n\n #include \u003csys/signalfd.h\u003e\n #include \u003csignal.h\u003e\n #include \u003cunistd.h\u003e\n #include \u003cstdlib.h\u003e\n #include \u003cstdio.h\u003e\n\n #define handle_error(msg) \\\n     do { perror(msg); exit(EXIT_FAILURE); } while (0)\n\n int\n main(int argc, char *argv[])\n {\n     sigset_t mask;\n     int sfd;\n     struct signalfd_siginfo fdsi;\n     ssize_t s;\n\n     sigemptyset(\u0026mask);\n     sigaddset(\u0026mask, SIGINT);\n     sigaddset(\u0026mask, SIGQUIT);\n\n     /* Block signals so that they aren\u0027t handled\n        according to their default dispositions */\n\n     if (sigprocmask(SIG_BLOCK, \u0026mask, NULL) \u003d\u003d -1)\n         handle_error(\"sigprocmask\");\n\n     sfd \u003d signalfd(-1, \u0026mask, 0);\n     if (sfd \u003d\u003d -1)\n         handle_error(\"signalfd\");\n\n     for (;;) {\n         s \u003d read(sfd, \u0026fdsi, sizeof(struct signalfd_siginfo));\n         if (s !\u003d sizeof(struct signalfd_siginfo))\n             handle_error(\"read\");\n\n         if (fdsi.ssi_signo \u003d\u003d SIGINT) {\n             printf(\"Got SIGINT\\n\");\n         } else if (fdsi.ssi_signo \u003d\u003d SIGQUIT) {\n             printf(\"Got SIGQUIT\\n\");\n             exit(EXIT_SUCCESS);\n         } else {\n             printf(\"Read unexpected signal\\n\");\n         }\n     }\n }\n\n $ ./signalfd_demo\n ^CGot SIGINT\n ^CGot SIGINT\n ^\\Got SIGQUIT\n\nSigned-off-by: Laurent Vivier \u003claurent@vivier.eu\u003e\nSigned-off-by: Riku Voipio \u003criku.voipio@linaro.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6c64ba63db6437937a40ea154a5ad9afc2ae4f1b",
      "old_mode": 33188,
      "old_path": "linux-user/syscall.c",
      "new_id": "8fa8e0ce14a4e9fc5f70fb30c0c05ff804b55635",
      "new_mode": 33188,
      "new_path": "linux-user/syscall.c"
    }
  ]
}
