flask_op.c
来自「xen虚拟机源代码安装包」· C语言 代码 · 共 73 行
C
73 行
/* * * Authors: Michael LeMay, <mdlemay@epoch.ncsc.mil> * George Coker, <gscoker@alpha.ncsc.mil> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. */#include <unistd.h>#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <string.h>#include <sys/mman.h>#include <sys/types.h>#include <sys/stat.h>#include <stdlib.h>#include <stdint.h>#include <sys/ioctl.h>#include <flask.h>#include <xenctrl.h>int flask_load(int xc_handle, char *buf, uint32_t size){ int err; flask_op_t op; op.cmd = FLASK_LOAD; op.buf = buf; op.size = size; if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; return 0;}int flask_context_to_sid(int xc_handle, char *buf, uint32_t size, uint32_t *sid){ int err; flask_op_t op; op.cmd = FLASK_CONTEXT_TO_SID; op.buf = buf; op.size = size; if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; sscanf(buf, "%u", sid); return 0;}int flask_sid_to_context(int xc_handle, int sid, char *buf, uint32_t size){ int err; flask_op_t op; op.cmd = FLASK_SID_TO_CONTEXT; op.buf = buf; op.size = size; snprintf(buf, size, "%u", sid); if ( (err = xc_flask_op(xc_handle, &op)) != 0 ) return err; return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?