summaryrefslogtreecommitdiff
path: root/src/pkg/os/user/lookup_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/os/user/lookup_unix.go')
-rw-r--r--src/pkg/os/user/lookup_unix.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/os/user/lookup_unix.go b/src/pkg/os/user/lookup_unix.go
index 609542263..5459268fa 100644
--- a/src/pkg/os/user/lookup_unix.go
+++ b/src/pkg/os/user/lookup_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux netbsd openbsd
// +build cgo
package user
@@ -50,10 +50,10 @@ func lookupUnix(uid int, username string, lookupByName bool) (*User, error) {
var result *C.struct_passwd
var bufSize C.long
- if runtime.GOOS == "freebsd" {
- // FreeBSD doesn't have _SC_GETPW_R_SIZE_MAX
- // and just returns -1. So just use the same
- // size that Linux returns
+ if runtime.GOOS == "dragonfly" || runtime.GOOS == "freebsd" {
+ // DragonFly and FreeBSD do not have _SC_GETPW_R_SIZE_MAX
+ // and just return -1. So just use the same
+ // size that Linux returns.
bufSize = 1024
} else {
bufSize = C.sysconf(C._SC_GETPW_R_SIZE_MAX)