This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Global constants


On Mon, 2006-02-13 at 12:23 -0800, Martin Hunt wrote:
> On Mon, 2006-02-13 at 20:14 +0000, Mark McLoughlin wrote:
> 
> > > something like
> > > %{ const_O_CREAT = O_CREAT; %}
> > >   instead of
> > > O_CREAT = 64
> > 
> > 	Absolutely, that was my first thought too ... unfortunately, the kernel
> > headers don't seem to have all the values e.g. O_ASYNC is only available
> > as FASYNC ... I didn't take it any further than thinking "uggh, that
> > sucks", though :-)
> 
> I don't understand.
> 
> function get_o_creat:long() %{ THIS->__retvalue = O_CREAT; %}
> 
> probe begin {
> 	printf("O_CREAT = %d\n", get_o_creat())
> }
> 
> > stap -g creat.stp
> O_CREAT = 64

	O_CREAT works fine, but try O_ASYNC (AFAIR)

	What header are you including? Maybe you're including the user-space
header? I think I was including linux/fs.h and O_ASYNC wasn't defined.

Cheers,
Mark.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]