summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-10-12 14:49:31 +0200
committerAndreas Kling <kling@serenityos.org>2020-10-12 19:53:25 +0200
commit65cdac1a5b8c383494b1f8d708f5bc8c0455cdbe (patch)
treec00fb648a4241c5eaeb9b48274ea502b41dff35b /Libraries/LibC
parent583bfa04e271ed37e246746481dfeec7ad402d94 (diff)
downloadserenity-65cdac1a5b8c383494b1f8d708f5bc8c0455cdbe.zip
Kernel+LibC: Use uintptr_t as the main type in the syscall interface
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/mman.cpp4
-rw-r--r--Libraries/LibC/serenity.cpp2
-rw-r--r--Libraries/LibC/serenity.h6
-rw-r--r--Libraries/LibC/sys/socket.cpp2
4 files changed, 10 insertions, 4 deletions
diff --git a/Libraries/LibC/mman.cpp b/Libraries/LibC/mman.cpp
index f496582ae5..5a0074fd68 100644
--- a/Libraries/LibC/mman.cpp
+++ b/Libraries/LibC/mman.cpp
@@ -34,8 +34,8 @@ extern "C" {
void* serenity_mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset, size_t alignment, const char* name)
{
- Syscall::SC_mmap_params params { (u32)addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } };
- int rc = syscall(SC_mmap, &params);
+ Syscall::SC_mmap_params params { (uintptr_t)addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } };
+ ssize_t rc = syscall(SC_mmap, &params);
if (rc < 0 && -rc < EMAXERRNO) {
errno = -rc;
return MAP_FAILED;
diff --git a/Libraries/LibC/serenity.cpp b/Libraries/LibC/serenity.cpp
index 8c357d0828..626a464ee8 100644
--- a/Libraries/LibC/serenity.cpp
+++ b/Libraries/LibC/serenity.cpp
@@ -93,7 +93,7 @@ int perf_event(int type, uintptr_t arg1, FlatPtr arg2)
void* shbuf_get(int shbuf_id, size_t* size)
{
- int rc = syscall(SC_shbuf_get, shbuf_id, size);
+ ssize_t rc = syscall(SC_shbuf_get, shbuf_id, size);
if (rc < 0 && -rc < EMAXERRNO) {
errno = -rc;
return (void*)-1;
diff --git a/Libraries/LibC/serenity.h b/Libraries/LibC/serenity.h
index 396cd34f8d..e68b391d31 100644
--- a/Libraries/LibC/serenity.h
+++ b/Libraries/LibC/serenity.h
@@ -72,6 +72,7 @@ int perf_event(int type, uintptr_t arg1, uintptr_t arg2);
int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size);
+#ifdef __i386__
ALWAYS_INLINE void send_secret_data_to_userspace_emulator(uintptr_t data1, uintptr_t data2, uintptr_t data3)
{
asm volatile(
@@ -88,5 +89,10 @@ ALWAYS_INLINE void send_secret_data_to_userspace_emulator(uintptr_t data1, uintp
"c"(data2), "d"(data3)
: "memory");
}
+#elif __x86_64__
+ALWAYS_INLINE void send_secret_data_to_userspace_emulator(uintptr_t, uintptr_t, uintptr_t)
+{
+}
+#endif
__END_DECLS
diff --git a/Libraries/LibC/sys/socket.cpp b/Libraries/LibC/sys/socket.cpp
index 55c754b32e..95d2a015a7 100644
--- a/Libraries/LibC/sys/socket.cpp
+++ b/Libraries/LibC/sys/socket.cpp
@@ -103,7 +103,7 @@ ssize_t recvfrom(int sockfd, void* buffer, size_t buffer_length, int flags, stru
sockaddr_storage internal_addr;
iovec iov = { buffer, buffer_length };
- msghdr msg = { addr ? &internal_addr : nullptr, addr ? sizeof(internal_addr) : 0, &iov, 1, nullptr, 0, 0 };
+ msghdr msg = { addr ? &internal_addr : nullptr, addr ? (socklen_t)sizeof(internal_addr) : 0, &iov, 1, nullptr, 0, 0 };
ssize_t rc = recvmsg(sockfd, &msg, flags);
if (rc >= 0 && addr) {
memcpy(addr, &internal_addr, min(*addr_length, msg.msg_namelen));