preliminary FreeBSD support

classic Classic list List threaded Threaded
2 messages Options
Alexander Botero-Lowry Alexander Botero-Lowry
Reply | Threaded
Open this post in threaded view
|

preliminary FreeBSD support

I saw the announcement this morning, and was very excited, as I had been hoping sup would be turned into a library,
since I like the concept more than the UI (I'd rather an emacs interface).

I did a preliminary compile which worked out fine, but sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on
FreeBSD, so notmuch_config_open segfaulted.

Attached is a patch that supplies a default buffer size of 64 in cases where -1 is returned.

http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this is acceptable behavior,
and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.html specifically uses 64 as the
buffer size.



0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch (1K) Download Attachment
Carl Worth-2 Carl Worth-2
Reply | Threaded
Open this post in threaded view
|

Re: preliminary FreeBSD support

On Tue, 17 Nov 2009 11:36:14 -0800, Alex Botero-Lowry <[hidden email]> wrote:
> I saw the announcement this morning, and was very excited, as I had been
> hoping sup would be turned into a library,
> since I like the concept more than the UI (I'd rather an emacs interface).

Hi Alex,

That's great! It's good to hear that there are like-minded people out
there. I hope that Notmuch will be useful for you.

> I did a preliminary compile which worked out fine, but
> sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on
> FreeBSD, so notmuch_config_open segfaulted.
>
> Attached is a patch that supplies a default buffer size of 64 in cases where
> -1 is returned.

Thanks for the patch. As we discussed in IRC[*], we should probably
do the correct thing and check for ERANGE and loop as necessary (even if
sysconf returns a positive value). Example code here:

http://www.opengroup.org/austin/docs/austin_328.txt

-Carl

[*] #notmuch on irc.freenode.net for those who didn't just guess that
already, (and I'll add that to the website soon).