Skip to contentSkip to conversation

{PATCH mini-os] mman: correct m{,un}lock() definitions

PATCH Jan Beulich 2 participants 2 messages Jun 24, 2024

lore
Share & tools
lore
#0 lore raw

From: Charles Arnold <[email protected]>

gcc14 no longer (silently) accepts functions with no return type specified.

include/posix/sys/mman.h +2 -2
@@ -16,7 +16,7 @@
 
 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) asm("mmap64");
 int munmap(void *start, size_t length);
-static inline mlock(const void *addr, size_t len) { return 0; }
-static inline munlock(const void *addr, size_t len) { return 0; }
+static inline int mlock(const void *addr, size_t len) { return 0; }
+static inline int munlock(const void *addr, size_t len) { return 0; }
 
 #endif /* _POSIX_SYS_MMAN_H */
Reviewed-by
#1 lore raw

Jan Beulich, le lun. 24 juin 2024 15:34:53 +0200, a ecrit:

Quoted 7 lines

From: Charles Arnold <[email protected]>

gcc14 no longer (silently) accepts functions with no return type specified.

Thanks!

Quoted 13 lines
include/posix/sys/mman.h +2 -2
@@ -16,7 +16,7 @@
 
 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) asm("mmap64");
 int munmap(void *start, size_t length);
-static inline mlock(const void *addr, size_t len) { return 0; }
-static inline munlock(const void *addr, size_t len) { return 0; }
+static inline int mlock(const void *addr, size_t len) { return 0; }
+static inline int munlock(const void *addr, size_t len) { return 0; }
 
 #endif /* _POSIX_SYS_MMAN_H */