2010/3/29 Jérémie Koenig <[email protected]>:
> Now of course, if using PAGE_SIZE is preferable for whatever reason I
> have no problem with your approach, but we need a special case for
> Hurd to include the right header. (see the attached patch)

Applied, thanks.

>>> e8f57a6 libbb: utsname.dommainname is linux-only
>>
>> So, how Hurd reports domain name of the machine?
>
> Through getdomainname(), which is not specified by POSIX either, but
> seems more widespread. (see the attached patch -- I'm not sure whether
> the 'size > 0' safeguard is desirable or just increases code size and
> obscureness for no good reason)

Too big. My version:

        /* We really don't care about people with domain names wider
than most screens */
        char buf[256];
        int r = getdomainname(buf, sizeof(buf));
        buf[sizeof(buf)-1] = '\0';
        return xstrdup(r < 0 ? "?" : buf);

> I have to admit that I was somewhat disturbed by the fact that
> getmntent_r() would silently truncate the record if the buffer was too
> small.

Isn't it a bug in libc?

> This is also why I posted the patch event after I realized that
> umount would never compile on Hurd, which does not have a umount()
> call at all. (Sorry, I should have been more explicit about this.)

How they unmount filesystems?

> Thinking about it, one could initialize a small buffer to some
> non-zero value, and check whether the last byte has been overwritten
> by getmntent_r(). In this case, we could double the buffer size and
> restart parsing the file. Let me know if you would like me to give it
> a try.

I think this is not needed.
-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to