*BSD News Article 83912


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!newspump.sol.net!howland.erols.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!venus.sun.com!news2me.EBay.Sun.COM!centralnews1.Central.Sun.COM!smckinty
From: smckinty@sunicnc.France.Sun.COM (Steve McKinty - Sun Microsystems Grenoble)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: Sat, 30 Nov 1996 12:30:47 MET
Organization: SunSoft
Lines: 25
Sender: smckinty@France.Sun.COM (Steve McKinty - Sun Microsystems Grenoble)
Distribution: world
Message-ID: <1996Nov30.123047@France.Sun.COM>
References: <32986299.AC7@mail.esrin.esa.it> <casper.329abb76@mail.fwi.uva.nl> <x7917mx5gx.fsf@dumbcat.codewright.com> <slrn59q566.3s2.dave@pc-damir.srce.hr>
NNTP-Posting-Host: hardy.france.sun.com
X-newsreader: xrn 7.04-beta-2
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:90953 comp.unix.bsd.misc:1632 comp.unix.internals:11378

In article <slrn59q566.3s2.dave@pc-damir.srce.hr>, dave@pc-damir.srce.hr (Drazen Kacar) writes:

>How can I portably manipulate bits in pointers? Sometimes I need to
>find the page boundary, eg.
>
>char *p;
>
>p = (char *)((long)p & -getpagesize());
>
>If long can't hold the pointer, I can change it to long long, but it
>will break on compilers that don't suport it.

I've heard that 64-bit OSes (including future Solaris) will probably
have a type called "uintptr_t" which will be defined as "an integer
large enough to hold a pointer". System header files will appropriately
define it to be int, long, longlong, etc.


Steve

-- 
Steve McKinty                     |
Sun Microsystems ICNC             |
38240 Meylan, France              |
email: smckinty @ france.sun.com  |