Upgrade more functions to the current upstream NetBSD copy.

Change-Id: Ie0b3f8b3fccef28609eb210434413ebd51d6ef45
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index e78e7c5..b008812 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -42,7 +42,7 @@
 extern char*         inet_ntoa(struct in_addr);
 
 extern int           inet_pton(int, const char *, void *);
-extern const char*   inet_ntop(int, const void *, char *, size_t);
+extern const char*   inet_ntop(int, const void *, char *, socklen_t);
 
 extern unsigned int  inet_nsap_addr(const char *, unsigned char *, int);
 extern char*         inet_nsap_ntoa(int, const unsigned char *, char *);
diff --git a/libc/include/sha1.h b/libc/include/sha1.h
index f7ada46..7f6cf5d 100644
--- a/libc/include/sha1.h
+++ b/libc/include/sha1.h
@@ -1,31 +1,23 @@
-/*	$NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $	*/
-
 /*
- * SHA-1 in C
- * By Steve Reid <steve@edmweb.com>
- * 100% Public Domain
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
-#ifndef _SYS_SHA1_H_
-#define	_SYS_SHA1_H_
+#ifndef _SHA1_H_
+#define _SHA1_H_
 
-#include <sys/cdefs.h>
-#include <sys/types.h>
+#warning "include <sys/sha1.h> instead for better portability"
+#include <sys/sha1.h>
 
-#define SHA1_DIGEST_LENGTH		20
-#define SHA1_DIGEST_STRING_LENGTH	41
-
-typedef struct {
-	uint32_t state[5];
-	uint32_t count[2];
-	u_char buffer[64];
-} SHA1_CTX;
-
-__BEGIN_DECLS
-void	SHA1Transform(uint32_t[5], const u_char[64]);
-void	SHA1Init(SHA1_CTX *);
-void	SHA1Update(SHA1_CTX *, const u_char *, u_int);
-void	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
-__END_DECLS
-
-#endif /* _SYS_SHA1_H_ */
+#endif
diff --git a/libc/include/sys/sha1.h b/libc/include/sys/sha1.h
new file mode 100644
index 0000000..f7ada46
--- /dev/null
+++ b/libc/include/sys/sha1.h
@@ -0,0 +1,31 @@
+/*	$NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $	*/
+
+/*
+ * SHA-1 in C
+ * By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ */
+
+#ifndef _SYS_SHA1_H_
+#define	_SYS_SHA1_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define SHA1_DIGEST_LENGTH		20
+#define SHA1_DIGEST_STRING_LENGTH	41
+
+typedef struct {
+	uint32_t state[5];
+	uint32_t count[2];
+	u_char buffer[64];
+} SHA1_CTX;
+
+__BEGIN_DECLS
+void	SHA1Transform(uint32_t[5], const u_char[64]);
+void	SHA1Init(SHA1_CTX *);
+void	SHA1Update(SHA1_CTX *, const u_char *, u_int);
+void	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
+__END_DECLS
+
+#endif /* _SYS_SHA1_H_ */