x_ns.c,v

来自「关于SHELL方面的」· C,V 代码 · 共 54 行

C,V
54
字号
head	1.1;access;symbols;locks	dls:1.1; strict;comment	@ * @;1.1date	97.09.21.19.29.03;	author dls;	state Dist;branches;next	;desc@@1.1log@pre-3e code@text@/* x_ns.c - x_ns */#include <conf.h>#include <kernel.h>#include <proc.h>#include <network.h>/*------------------------------------------------------------------------ *  x_ns  -  (command ns) interact with the host name server cache *------------------------------------------------------------------------ */COMMAND	x_ns(stdin, stdout, stderr, nargs, args)int	stdin, stdout, stderr, nargs;char	*args[];{	char	str[128], ipstr[64];	IPaddr	ip;	int	ac;	for (ac=1; ac < nargs; ++ac) {		if ((ip = name2ip(args[ac])) == SYSERR)			strcpy(ipstr, "not resolved");		else			ip2dot(ipstr, ip);		sprintf(str, "\"%s\": %s\n", args[ac], ipstr);		write(stdout, str, strlen(str));	}	return OK;}@

⌨️ 快捷键说明

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