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

📄 debug.c

📁 一个Windows下的Linux专用虚拟机
💻 C
字号:
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. * */ #include <stdio.h>#include <stdarg.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <colinux/common/libc.h>#include <colinux/user/debug.h>void co_daemon_trace_point(co_trace_point_info_t *info){#ifdef COLINUX_DEBUG	/*	 * This code sends UDP packet per debug line.	 *	 * Proves useful for investigating hard crashes.	 *	 * Make sure you have a fast Ethernet.	 */	static int sock = -1;    /* We only need one global socket */	if (sock == -1) {		struct sockaddr_in server;		int ret;		sock = socket(AF_INET, SOCK_DGRAM, 0);		co_bzero((char *) &server, sizeof(server));		server.sin_family = AF_INET;		/* 		 * Hardcoded for the meanwhile.		 * 		 * If someone actually uses this, please send a patch		 * to make this more configurable.		 */		server.sin_addr.s_addr = inet_addr("192.168.1.1");		server.sin_port = htons(5555);				ret = connect(sock, (struct sockaddr *)&server, sizeof(server));	}	send(sock, info, sizeof(*info), 0);#endif}

⌨️ 快捷键说明

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