Apologies if this was brought up before, I tried searching through marc
and couldn't find any related threads.

Backstory: I was working on building mrsh[1], a POSIX compliant shell on
OpenBSD, and had build errors regarding the types used to implement
glob_t.

Basically, POSIX.2 states that the gl_pathc and gl_offs fields are of
type size_t, when OpenBSD implements them as ints. I've searched for
other BSD/libc implementations, and the following use size_t:

- FreeBSD, since at most 2009[2]
- NetBSD, since 2006[3]
- solaris/illumos (I couldn't track down a date for this)
- macOS[4] (couldn't find a date for this either)
- OpenServer[5] (old manpage from 2003)
- glibc, since 2.1/1998[6]
- musl, since 0.5.0/2011 (0b44a0315b47dd8eced9f3b7f31580cf14bbfc01)

What documentation I found for AIX and HP-UX didn't show the sizes, but 
they claim to be POSIX.2 conformant.

This basically leaves OpenBSD as the odd one out. I'm unsure if this is
by design, but since everyone else follows the standard types, I think
we should too.

[1] https://git.sr.ht/~emersion/mrsh
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=55112
[3] 
http://cvsweb.netbsd.org/bsdweb.cgi/src/include/glob.h?rev=1.21&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
[4] https://www.unix.com/man-page/mojave/3/glob/
[5] http://osr507doc.xinuos.com/en/man/html.S/glob.S.html
[6] 
https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/glob.h;hb=ee74a442e8b9403f02f7e933260625acf145ad08
-- 
Stephen Gregoratto

Reply via email to