?? ps_utils.c
字號:
/* * Licensed Materials - Property of IBM * * trousers - An open source TCG Software Stack * * (C) Copyright International Business Machines Corp. 2006 * */#include <stdlib.h>#include <stdio.h>#include <unistd.h>#include <string.h>#include <errno.h>#include "trousers/tss.h"#include "trousers_types.h"#include "tcs_tsp.h"#include "spi_utils.h"#include "tspps.h"#include "tsplog.h"inline TSS_RESULTread_data(int fd, void *data, UINT32 size){ int rc; rc = read(fd, data, size); if (rc == -1) { LogError("read of %d bytes: %s", size, strerror(errno)); return TCSERR(TSS_E_INTERNAL_ERROR); } else if ((unsigned)rc != size) { LogError("read of %d bytes (only %d read)", size, rc); return TCSERR(TSS_E_INTERNAL_ERROR); } return TSS_SUCCESS;}inline TSS_RESULTwrite_data(int fd, void *data, UINT32 size){ int rc; rc = write(fd, data, size); if (rc == -1) { LogError("write of %d bytes: %s", size, strerror(errno)); return TCSERR(TSS_E_INTERNAL_ERROR); } else if ((unsigned)rc != size) { LogError("write of %d bytes (only %d written)", size, rc); return TCSERR(TSS_E_INTERNAL_ERROR); } return TSS_SUCCESS;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -