File: util.c

package info (click to toggle)
busybox-cvs 20040623-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,292 kB
  • ctags: 11,454
  • sloc: ansic: 107,671; sh: 3,093; makefile: 1,022; yacc: 575; lex: 366; perl: 252
file content (26 lines) | stat: -rw-r--r-- 539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>

int
sys_init_module(const char *name, const struct module *info)
{
	return init_module(name, info);
}

int arch64(void)
{
	struct utsname uts;
	char *uname_m;
	if (uname(&uts))
		return(0);
	if ((uname_m = getenv("UNAME_MACHINE"))) {
		int l = strlen(uname_m);
		if (l >= sizeof(uts.machine))
			l = sizeof(uts.machine)-1;
		memcpy(uts.machine, uname_m, l);
		uts.machine[l] = '\0';
	}
	return(strstr(uts.machine, "64") != NULL || strstr(uts.machine, "s390x") != NULL);
}