SHA256
1
0
forked from pool/linux32
OBS User unknown 2007-10-10 23:31:11 +00:00 committed by Git OBS Bridge
parent f318205163
commit 7d76cc17d5
3 changed files with 58 additions and 25 deletions

View File

@ -1,7 +1,9 @@
/* Written 2002 by Andi Kleen */ /* Written 2002 by Andi Kleen */
#include <linux/personality.h> #include <sys/personality.h>
#undef personality #include <unistd.h>
#include <string.h> #include <string.h>
#include <libgen.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
@ -20,24 +22,41 @@
int main(int ac, char **av) int main(int ac, char **av)
{ {
int pers = DFL_PER; int pers = DFL_PER;
if (!av[1]) { char *progname;
fprintf(stderr, "usage: %s [--3gb] [--4gb] program args ...\n", av[0]);
#if DFL_PER == PER_LINUX32_3GB progname = basename(av[0]);
fprintf(stderr, "Default is --3gb to limit the address space of the 32bit children to 3GB\n");
#endif
exit(1);
}
if (!strcmp(av[0],"linux64")) pers= PER_LINUX;
else if (!strcmp(av[0],"linux32")) pers = DFL_PER;
if (!strcmp(av[1], "--3gb")) { if (!strcmp(progname, "linux64")) {
pers = PER_LINUX32_3GB; pers= PER_LINUX;
av++;
} /* ignore --3gb or --4gb for linux64 */
if (!strcmp(av[1], "--4gb")) { if (av[1] && (!strcmp(av[1], "--3gb") || !strcmp(av[1], "--4gb")))
pers = PER_LINUX32; av++;
av++; }
} else if (!strcmp(progname,"linux32")) {
pers = DFL_PER;
if (av[1] && !strcmp(av[1], "--3gb")) {
pers = PER_LINUX32_3GB;
av++;
}
if (av[1] && !strcmp(av[1], "--4gb")) {
pers = PER_LINUX32;
av++;
}
}
if (!av[1]) {
if (pers == PER_LINUX) { /* 64 bit, no options */
fprintf(stderr, "usage: %s program args ...\n", progname);
} else {
fprintf(stderr, "usage: %s [--3gb] [--4gb] program args ...\n", progname);
#if DFL_PER == PER_LINUX32_3GB
fprintf(stderr, "Default is --3gb to limit the address space of the 32bit children to 3GB\n");
#endif
}
exit(1);
}
if (personality(pers) < 0) { if (personality(pers) < 0) {
fprintf(stderr, "Cannot set %x personality: %s\n", pers, fprintf(stderr, "Cannot set %x personality: %s\n", pers,

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Oct 10 13:28:18 CEST 2007 - bwalle@suse.de
- fix some problems (#188554)
o make linux64 working even if it's called with the full path
o don't switch magically to linux32 if linux64 is called with
arguments (--3gb/--4gb)
o fix segmentation fault
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 1 11:19:34 CET 2006 - sf@suse.de Wed Mar 1 11:19:34 CET 2006 - sf@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package linux32 (Version 1.0) # spec file for package linux32 (Version 1.0)
# #
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine # This file and all modifications and additions to the pristine
# package are under the same license as the package itself. # package are under the same license as the package itself.
# #
@ -11,12 +11,12 @@
Name: linux32 Name: linux32
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
URL: ftp://ftp.x86-64.org/pub/linux/tools/linux32/ Url: ftp://ftp.x86-64.org/pub/linux/tools/linux32/
License: GPL License: GPL v2 or later
Group: System/Kernel Group: System/Kernel
Summary: 32-Bit Emulation Utility for x86-64 Summary: 32-Bit Emulation Utility for x86-64
Version: 1.0 Version: 1.0
Release: 347 Release: 414
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Recommends: kdebase3 #Recommends: kdebase3
Source0: linux32.c Source0: linux32.c
@ -65,8 +65,13 @@ ln linux32 linux64
/usr/share/man/man1/linux64.1.gz /usr/share/man/man1/linux64.1.gz
/usr/share/applications/* /usr/share/applications/*
/usr/share/pixmaps/* /usr/share/pixmaps/*
%changelog
%changelog -n linux32 * Wed Oct 10 2007 - bwalle@suse.de
- fix some problems (#188554)
o make linux64 working even if it's called with the full path
o don't switch magically to linux32 if linux64 is called with
arguments (--3gb/--4gb)
o fix segmentation fault
* Wed Mar 01 2006 - sf@suse.de * Wed Mar 01 2006 - sf@suse.de
- added -32bit to name and generics name in .desktop file (#52279) - added -32bit to name and generics name in .desktop file (#52279)
* Wed Jan 25 2006 - mls@suse.de * Wed Jan 25 2006 - mls@suse.de