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

Re: memstat-0.9 hurd patch (PATH_MAX)



2012/1/24 Richard Braun <rbraun@sceen.net>
Do I really need to check if BUFSIZ is defined?
 > > Yes, as it's a macro usually defined in libc headers.
> >
> "Usually"?!

It may even be forced by POSIX, I didn't look. Keep portability in mind
when coding, as other systems may simply not look a lot like your usual
Linux distro (we Hurd people know that better than many).
Is there an official website to get the specification from? The one I found asked me  to pay for a copy?! :-(

> > #define BUFF_SIZE (sizeof(FORMAT) + (sizeof(int) * 3)) /* sizeof() already
Hm, now that I read that, I'm wondering why you need dynamic allocation
for that case ? It seems to me you could use the stack.
You're perfectly right. The BUFF_SIZE was computed using log10(pid) in a previous version of the path that's why it was dynamically done!

I'll do it this way everywhere I can.

Cheers,
Tanguy



Reply to: