tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: netbsd32 emulation in driver open() or read()



On Mon, 29 Aug 2011, Manuel Bouyer wrote:

> So: is there a way to know if the emulation used by a userland program
> doing an open() is 32 or 64bit ?

sys/proc.h:

1.233     ad        343: /*
1.273     ad        344:  * These flags are kept in p_flag and are 
protected by p_lock.  Access from
1.233     ad        345:  * process context only.
                    346:  */
...
                    353: #define        PK_32           0x00040000 /* 
32-bit process (used on 64-bit kernels) */

So you can check if that bit is set in the current proc's p_flag member.


Eduardo


Home | Main Index | Thread Index | Old Index