[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: how to detect a 32 bit process on 64 bit kernel
From:       Bongani Hlope <bhlope () mweb ! co ! za>
Date:       2004-12-12 23:30:45
Message-ID: 200412130130.51647.bhlope () mweb ! co ! za
[Download RAW message or body]

On Monday 13 December 2004 00:37, Willy Tarreau wrote:
> On Sun, Dec 12, 2004 at 11:51:10PM +0200, Michael S. Tsirkin wrote:
> > Hello!
> > Is there a reliable way e.g. on x86-64 (or ia64, or any other
> > 64-bit system), from the char device driver,
> > to find out that I am running an operation in the context of a 32-bit
> > task?
>
> aren't there informations in /proc/$$/maps or other things which will
> change their format or contents in 32 or 64 bits addressing, which would
> help you detect the mode you're currently running ?
>

ugly bash script

ps -A | file `awk '{print "file /proc/"$1"/exe"}'` | grep "symbolic link to" | 
sed s%\`%% | sed s%\'%% | awk '{print "file "$5}' | sh | grep 32

[Attachment #3 (application/pgp-signature)]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic