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

📄 diag_os_windows.c

📁 Freediag contains various drivers (ISO9141, ISO14230, SAEJ1850-VPW, SAEJ1850-PWM) for different adap
💻 C
字号:
/*
 *	freediag - Vehicle Diagnostic Utility
 *
 *
 * Copyright (C) 2001 Andy Whittaker obdii@andywhittaker.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *************************************************************************
 *
 *
 * WIN32 specific stuff
 *
 *
 * This "stuff" tweaks the Windows to behave how we want it to, and does
 * very Win32 specific stuff
 *
 * We run the process in
 *	(1) Real time mode , as we need to do some very accurate sleeps
 *		for fast init purposes
 *	(2) As root in order to establish (1)
 *	(3) The os specific and IO driver code allows "interruptible syscalls"
 *
 */

static char *cvsid = "$Id: diag_os_windows.c,v 1.3 2002/04/03 04:56:40 bjorn_helgaas Exp $";

#include <stdlib.h>
#include <stdio.h>

#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <time.h>

#include <signal.h>

#include <sys/types.h>

#include "diag_os.h" /* includes for this file */
#include "diag.h"
#include "diag_err.h"

static char *rcsid = "$Id: diag_os_windows.c,v 1.3 2002/04/03 04:56:40 bjorn_helgaas Exp $";

/*
 * Like alarm, but shorter
 */
int
diag_os_millialarm(int ms)
{
	return (0);
}

/*
 * SIGALRM handler
 */
void
diag_os_sigalrm()
{
/*	diag_l3_timer();	 Call L3 Timer */
/*	diag_l2_timer();	 Call L2 timers, which will call L1 timer */

}

int
diag_os_init()
{
	return(0);
}


/*
 * Microsleep for N milliseconds
 *
 * This is aimed at small waits as it does very accurate "busy wait"
 * sleeping 2ms at a time (nanosleep does busy wait sleeps for <=2ms requests)
 */
int
diag_os_millisleep(int ms)
{
	return(0);
}

/*
 * Non interruptible, sleeping posix like read() with a timeout
 * timeout is in ms. If timeout is 0, this acts as a non-blocking
 * read
 */
ssize_t
diag_os_read(int fd, void *buf, size_t count, int timeout)
{
	return (DIAG_ERR_GENERAL);
}

⌨️ 快捷键说明

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