get_arch.c

来自「操作系统SunOS 4.1.3版本的源码」· C语言 代码 · 共 52 行

C
52 行
字号
#ifndef lint#ifdef SunB1static	char		mls_sccsid[] = "@(#)get_arch.c 1.1 92/07/30 SMI; SunOS MLS";#elsestatic	char		sccsid[] = "@(#)get_arch.c 1.1 92/07/30 SMI";#endif /* SunB1 */#endif lint/* *	Copyright (c) 1989 Sun Microsystems, Inc. *//* *	Name:		get_arch() * *	Description:	Return the architecture string for this system. *		Returns NULL if there is an error. */#include <stdio.h>#include "install.h"#include "menu.h"/* *	External functions: */extern	char *		sprintf();char *get_arch(){	FILE *		pp;			/* ptr to arch process */	static	char		buf[MEDIUM_STR]; /* architecture string */	bzero(buf, sizeof(buf));	pp = popen("/bin/arch -k","r");	if (pp) {		(void) fscanf(pp,"%s",buf);		(void) pclose(pp);	}	if (strlen(buf) == 0)		menu_log("%s: invalid system architecture.", progname);	return(buf);} /* end get_arch() */

⌨️ 快捷键说明

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