Merge "Set optnone attribute for modify_stack_protector_test"
diff --git a/libc/include/getopt.h b/libc/include/getopt.h
index 014226a..c1c0442 100644
--- a/libc/include/getopt.h
+++ b/libc/include/getopt.h
@@ -49,8 +49,11 @@
#define optional_argument 2
struct option {
- /** Name of long option. */
- const char *name;
+ /**
+ * Name of long option. Options must have a non-NULL name.
+ * A NULL name signals the end of the options array.
+ */
+ const char * _Nullable name;
/**
* One of `no_argument`, `required_argument`, or `optional_argument`.
@@ -58,7 +61,7 @@
int has_arg;
/** If not NULL, set `*flag` to val when option found. */
- int* flag;
+ int* _Nullable flag;
/** If `flag` not NULL, the value to assign to `*flag`; otherwise the return value. */
int val;
@@ -69,12 +72,12 @@
/**
* [getopt_long(3)](http://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
*/
-int getopt_long(int __argc, char* const* __argv, const char* __options, const struct option* __long_options, int* __long_index);
+int getopt_long(int __argc, char* _Nonnull const* _Nonnull __argv, const char* _Nonnull __options, const struct option* _Nonnull __long_options, int* _Nullable __long_index);
/**
* [getopt_long_only(3)](http://man7.org/linux/man-pages/man3/getopt.3.html) parses command-line options.
*/
-int getopt_long_only(int __argc, char* const* __argv, const char* __options, const struct option* __long_options, int* __long_index);
+int getopt_long_only(int __argc, char* _Nonnull const* _Nonnull __argv, const char* _Nonnull __options, const struct option* _Nonnull __long_options, int* _Nullable __long_index);
#ifndef _OPTRESET_DECLARED
#define _OPTRESET_DECLARED
diff --git a/libc/include/mntent.h b/libc/include/mntent.h
index d5987dc..43cab1f 100644
--- a/libc/include/mntent.h
+++ b/libc/include/mntent.h
@@ -47,21 +47,21 @@
#define MNTOPT_SUID "suid"
struct mntent {
- char* mnt_fsname;
- char* mnt_dir;
- char* mnt_type;
- char* mnt_opts;
+ char* _Nullable mnt_fsname;
+ char* _Nullable mnt_dir;
+ char* _Nullable mnt_type;
+ char* _Nullable mnt_opts;
int mnt_freq;
int mnt_passno;
};
__BEGIN_DECLS
-int endmntent(FILE* __fp) __INTRODUCED_IN(21);
-struct mntent* getmntent(FILE* __fp);
-struct mntent* getmntent_r(FILE* __fp, struct mntent* __entry, char* __buf, int __size) __INTRODUCED_IN(21);
-FILE* setmntent(const char* __filename, const char* __type) __INTRODUCED_IN(21);
-char* hasmntopt(const struct mntent* __entry, const char* __option) __INTRODUCED_IN(26);
+int endmntent(FILE* _Nullable __fp) __INTRODUCED_IN(21);
+struct mntent* _Nullable getmntent(FILE* _Nonnull __fp);
+struct mntent* _Nullable getmntent_r(FILE* _Nonnull __fp, struct mntent* _Nonnull __entry, char* _Nonnull __buf, int __size) __INTRODUCED_IN(21);
+FILE* _Nullable setmntent(const char* _Nonnull __filename, const char* _Nonnull __type) __INTRODUCED_IN(21);
+char* _Nullable hasmntopt(const struct mntent* _Nonnull __entry, const char* _Nonnull __option) __INTRODUCED_IN(26);
__END_DECLS
diff --git a/libc/include/sys/signalfd.h b/libc/include/sys/signalfd.h
index bd911f7..f669cc8 100644
--- a/libc/include/sys/signalfd.h
+++ b/libc/include/sys/signalfd.h
@@ -48,11 +48,11 @@
*
* Available since API level 18.
*/
-int signalfd(int __fd, const sigset_t* __mask, int __flags) __INTRODUCED_IN(18);
+int signalfd(int __fd, const sigset_t* _Nonnull __mask, int __flags) __INTRODUCED_IN(18);
/**
* Like signalfd() but allows setting a signal mask with RT signals even from a 32-bit process.
*/
-int signalfd64(int __fd, const sigset64_t* __mask, int __flags) __INTRODUCED_IN(28);
+int signalfd64(int __fd, const sigset64_t* _Nonnull __mask, int __flags) __INTRODUCED_IN(28);
__END_DECLS