hotei <
ravens...@cox.net> wrote:
> My point is that programs other than syscalls might want to return
> os.Error values. Since OS.X is based on FreeBSD I don't think
> there's much chance of a name-space conflict but Apple does do some
> strange things now and then.
At the risk of straying off topic, _parts_ of OS X are based
on FreeBSD, and Apple have been quite willing to generate
conflicts between open source software and the versions of
same that they ship: look at rsync's -E option, as one I
remember off the top of my head.
I have no idea why Apple added the errno values for XSI
STREAMS, unless someone in marketing thought they might want
Unix branding one day.
Back on topic:
> The comment thing is a real problem for some of us. I
> remember what EINVAL is, but right off the top I have no
> idea what EROFS stands for.
OK, now I understand. Sadly I remember most of the errno
names and a goodly percentage of their values.
For a quick solution that'll work today (outside of Go) grep
whatever C include file contains those definitions on your
platform(s), for example on OS X:
$ grep EROFS /usr/include/sys/errno.h
#define EROFS 30 /* Read-only file system */
Or even use your favourite search engine. :-)
For Go, I suppose godefs could be updated to include the
comment in the generated syscall/zerrors_$GOOS_$ARCH.go files,
but I doubt that it's worth it on the Unix-like platforms when
you'd still end up using grep anyway ... you might as well
jump straight to the C include files.
Regards,
Giles