diff mbox series

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

Message ID e25f5cd4-9130-488c-8294-22bd9fbd76ff@suse.com (mailing list archive)
State New, archived
Headers show
Series {PATCH mini-os] mman: correct m{,un}lock() definitions | expand

Commit Message

Jan Beulich June 24, 2024, 1:34 p.m. UTC
From: Charles Arnold <carnold@suse.com>

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

Signed-off-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Samuel Thibault June 24, 2024, 1:36 p.m. UTC | #1
Jan Beulich, le lun. 24 juin 2024 15:34:53 +0200, a ecrit:
> From: Charles Arnold <carnold@suse.com>
> 
> gcc14 no longer (silently) accepts functions with no return type
> specified.
> 
> Signed-off-by: Charles Arnold <carnold@suse.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Thanks!

> 
> --- a/include/posix/sys/mman.h
> +++ b/include/posix/sys/mman.h
> @@ -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 */
diff mbox series

Patch

--- a/include/posix/sys/mman.h
+++ b/include/posix/sys/mman.h
@@ -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 */