1 // errstr.go -- Error strings.
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
9 //sysnb strerror_r(errnum int, buf []byte) (err Errno)
10 //strerror_r(errnum _C_int, buf *byte, buflen Size_t) _C_int
12 func Errstr(errnum int) string {
13 for len := 128; ; len *= 2 {
14 b := make([]byte, len)
15 errno := strerror_r(errnum, b)
21 // Lowercase first letter: Bad -> bad, but
23 if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
29 return "errstr failure"