unix: use strconv.Itoa instead of local implementation

This was originally copied over from package syscall where it was
replaced by internal/itoa in CL 301549.

For golang.org/x/sys/unix we may import strconv, so use strconv.Itoa
instead.

Change-Id: Iac125fbd0f64c385f9f0c02d4a7af762364b67aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/425304
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/unix/export_test.go b/unix/export_test.go
deleted file mode 100644
index a2bf67d..0000000
--- a/unix/export_test.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-var Itoa = itoa
diff --git a/unix/str.go b/unix/str.go
deleted file mode 100644
index 8ba89ed..0000000
--- a/unix/str.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-func itoa(val int) string { // do it here rather than with fmt to avoid dependency
-	if val < 0 {
-		return "-" + uitoa(uint(-val))
-	}
-	return uitoa(uint(val))
-}
-
-func uitoa(val uint) string {
-	var buf [32]byte // big enough for int64
-	i := len(buf) - 1
-	for val >= 10 {
-		buf[i] = byte(val%10 + '0')
-		i--
-		val /= 10
-	}
-	buf[i] = byte(val + '0')
-	return string(buf[i:])
-}
diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go
index ecb0f27..eecb58d 100644
--- a/unix/syscall_linux.go
+++ b/unix/syscall_linux.go
@@ -13,6 +13,7 @@
 
 import (
 	"encoding/binary"
+	"strconv"
 	"syscall"
 	"time"
 	"unsafe"
@@ -233,7 +234,7 @@
 func Futimes(fd int, tv []Timeval) (err error) {
 	// Believe it or not, this is the best we can do on Linux
 	// (and is what glibc does).
-	return Utimes("/proc/self/fd/"+itoa(fd), tv)
+	return Utimes("/proc/self/fd/"+strconv.Itoa(fd), tv)
 }
 
 const ImplementsGetwd = true
diff --git a/unix/syscall_test.go b/unix/syscall_test.go
index 7f80134..bc2a088 100644
--- a/unix/syscall_test.go
+++ b/unix/syscall_test.go
@@ -8,7 +8,6 @@
 package unix_test
 
 import (
-	"fmt"
 	"testing"
 
 	"golang.org/x/sys/unix"
@@ -34,22 +33,6 @@
 	testSetGetenv(t, "TESTENV", "")
 }
 
-func TestItoa(t *testing.T) {
-	// Make most negative integer: 0x8000...
-	i := 1
-	for i<<1 != 0 {
-		i <<= 1
-	}
-	if i >= 0 {
-		t.Fatal("bad math")
-	}
-	s := unix.Itoa(i)
-	f := fmt.Sprint(i)
-	if s != f {
-		t.Fatalf("itoa(%d) = %s, want %s", i, s, f)
-	}
-}
-
 func TestUname(t *testing.T) {
 	var utsname unix.Utsname
 	err := unix.Uname(&utsname)