basic: use _nonnull_if_nonzero_ where appropriate

This commit is contained in:
Mike Yuan
2025-02-16 12:37:10 +09:00
committed by Yu Watanabe
parent 6bdbfb7eb6
commit 6da2ea9fa9
11 changed files with 34 additions and 30 deletions
+3 -1
View File
@@ -6,6 +6,8 @@
#include <stdint.h>
#include <sys/types.h>
#include "macro.h"
int memfd_create_wrapper(const char *name, unsigned mode);
int memfd_new_full(const char *name, unsigned extra_flags);
@@ -13,7 +15,7 @@ static inline int memfd_new(const char *name) {
return memfd_new_full(name, 0);
}
int memfd_new_and_seal(const char *name, const void *data, size_t sz);
int memfd_new_and_seal(const char *name, const void *data, size_t sz) _nonnull_if_nonzero_(2, 3);
static inline int memfd_new_and_seal_string(const char *name, const char *s) {
return memfd_new_and_seal(name, s, SIZE_MAX);
}