Merge "Implement load at fixed address feature"
diff --git a/libc/include/byteswap.h b/libc/include/byteswap.h
index 74b0e91..628fb7f 100644
--- a/libc/include/byteswap.h
+++ b/libc/include/byteswap.h
@@ -28,11 +28,10 @@
#ifndef _BYTESWAP_H_
#define _BYTESWAP_H_
-/* endian.h rather than sys/endian.h so we get the machine-specific file. */
-#include <endian.h>
+#include <sys/endian.h>
-#define bswap_16(x) swap16(x)
-#define bswap_32(x) swap32(x)
-#define bswap_64(x) swap64(x)
+#define bswap_16(x) __swap16(x)
+#define bswap_32(x) __swap32(x)
+#define bswap_64(x) __swap64(x)
#endif /* _BYTESWAP_H_ */
diff --git a/libc/include/sys/endian.h b/libc/include/sys/endian.h
index 2fd480d..60cc030 100644
--- a/libc/include/sys/endian.h
+++ b/libc/include/sys/endian.h
@@ -75,10 +75,6 @@
#define HTONL(x) (x) = htonl((u_int32_t)(x))
#define HTONS(x) (x) = htons((u_int16_t)(x))
-#define swap16 __swap16
-#define swap32 __swap32
-#define swap64 __swap64
-
#define htobe16 __swap16
#define htobe32 __swap32
#define htobe64 __swap64
diff --git a/libc/include/utmp.h b/libc/include/utmp.h
index 7eeea41..c6f22a5 100644
--- a/libc/include/utmp.h
+++ b/libc/include/utmp.h
@@ -97,8 +97,9 @@
__BEGIN_DECLS
int utmpname(const char*);
-void setutent();
-struct utmp* getutent();
+void setutent(void);
+struct utmp* getutent(void);
+void endutent(void);
int login_tty(int);
diff --git a/tests/utmp_test.cpp b/tests/utmp_test.cpp
index b61110d..0fa55c7 100644
--- a/tests/utmp_test.cpp
+++ b/tests/utmp_test.cpp
@@ -23,3 +23,9 @@
// This test just checks that we're exporting the symbol independently.
ASSERT_EQ(-1, login_tty(-1));
}
+
+TEST(utmp, setutent_getutent_endutent) {
+ setutent();
+ getutent();
+ endutent();
+}