Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0329/5

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


uname: changes to be more configure-friendly
 [rsc] --rw-rw-r-- M 22963 glenda sys 533 Mar 29 17:45 sys/src/ape/lib/ap/plan9/uname.c
	/n/sourcesdump/2006/0329/plan9/sys/src/ape/lib/ap/plan9/uname.c:1,10 - 
	/n/sourcesdump/2006/0330/plan9/sys/src/ape/lib/ap/plan9/uname.c:1,15
	  #include <stdlib.h>
	+ #include <string.h>
	  #include <sys/utsname.h>
	  
	  int
	  uname(struct utsname *n)
	  {
	- 	n->sysname = "Plan9";
	+ 	char *osname;
	+ 	
	+ 	n->sysname = getenv("osname");
	+ 	if(!n->sysname)
	+ 		osname = "Plan9";
	  	n->nodename = getenv("sysname");
	  	if(!n->nodename){
	  		n->nodename = getenv("site");
	/n/sourcesdump/2006/0329/plan9/sys/src/ape/lib/ap/plan9/uname.c:11,23 - 
	/n/sourcesdump/2006/0330/plan9/sys/src/ape/lib/ap/plan9/uname.c:16,27
	  		if(!n->nodename)
	  			n->nodename = "?";
	  	}
	- 	n->release = "1";
	+ 	n->release = "4";			/* edition */
	  	n->version = "0";
	- 	n->machine = getenv("terminal");
	- 	if(!n->machine){
	- 		n->machine = getenv("cputype");
	- 		if(!n->machine)
	- 			n->machine = "?";
	- 	}
	+ 	n->machine = getenv("cputype");
	+ 	if(!n->machine)
	+ 		n->machine = "?";
	+ 	if(strcmp(n->machine, "386") == 0)
	+ 		n->machine = "i386";		/* for gnu configure */
	  	return 0;
	  }


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.