William Vining
2014-01-19 00:50:58 UTC
Hi s48,
integer->errno (in scheme/posix/errno.scm, accessible from the
posix-errnos structure) fails on FreeBSD for any named errno at a
higher index than #{errno nodata} in the named-errno vector.
This happens because ENODATA, as well as ENOSTR, ENOSR, and ETIME are
not defined in FreeBSD. When s48 initializes the named-errnos vector
these four errnos have their os-number field set to #f, which leads to
the error in integer->errno.
The problem can be solved trivially by adding a guard to integer->errno:
(define (integer->errno num)
(let loop ((i 0))
(if (= i (vector-length named-errnos))
(get-unnamed-errno num)
(let* ((e (vector-ref named-errnos i))
(errno-number (named-errno-os-number e)))
(if (and errno-number (= num errno-number))
e
(loop (+ i 1)))))))
I'm new to scheme48, so I wanted to run this by the community for
input. If anybody has any thoughts or comments please let me know.
Also I'm not sure how the development process works WRT
proposing/reviewing/testing/comiting changes.
Cheers,
Will Vining
integer->errno (in scheme/posix/errno.scm, accessible from the
posix-errnos structure) fails on FreeBSD for any named errno at a
higher index than #{errno nodata} in the named-errno vector.
This happens because ENODATA, as well as ENOSTR, ENOSR, and ETIME are
not defined in FreeBSD. When s48 initializes the named-errnos vector
these four errnos have their os-number field set to #f, which leads to
the error in integer->errno.
The problem can be solved trivially by adding a guard to integer->errno:
(define (integer->errno num)
(let loop ((i 0))
(if (= i (vector-length named-errnos))
(get-unnamed-errno num)
(let* ((e (vector-ref named-errnos i))
(errno-number (named-errno-os-number e)))
(if (and errno-number (= num errno-number))
e
(loop (+ i 1)))))))
I'm new to scheme48, so I wanted to run this by the community for
input. If anybody has any thoughts or comments please let me know.
Also I'm not sure how the development process works WRT
proposing/reviewing/testing/comiting changes.
Cheers,
Will Vining