aboutsummaryrefslogtreecommitdiff
path: root/libc/include/unistd.h
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-08-10 15:18:29 -0700
committerJosh Gao <jmgao@google.com>2016-08-10 15:26:41 -0700
commitd80a52eb656042b98f519025e52b06c3010ae174 (patch)
treee18f4302a3807baad24077c43053127aa621fd28 /libc/include/unistd.h
parent6ba5f07e3f6dbc487eb2cd341a9a4e804afafd51 (diff)
downloadbionic-d80a52eb656042b98f519025e52b06c3010ae174.tar.gz
Add __attribute__((sentinel)) tags to execl and friends.
Give a compile time diagnostic when the nullptr sentinel is missing from an execl family call, instead of just pulling arbitrary values. Bug: http://b/30793878 Change-Id: I1c49005c58b7ad4a5b04f0435b722d4c744e8f0e Test: Built bullhead
Diffstat (limited to 'libc/include/unistd.h')
-rw-r--r--libc/include/unistd.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index c7922895c..86949de8e 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -97,9 +97,10 @@ int execv(const char* __path, char* const* __argv);
int execvp(const char* __file, char* const* __argv);
int execvpe(const char* __file, char* const* __argv, char* const* __envp) __INTRODUCED_IN(21);
int execve(const char* __file, char* const* __argv, char* const* __envp);
-int execl(const char* __path, const char* __arg0, ...);
-int execlp(const char* __file, const char* __arg0, ...);
-int execle(const char* __path, const char* __arg0, ...);
+int execl(const char* __path, const char* __arg0, ...) __attribute__((__sentinel__));
+int execlp(const char* __file, const char* __arg0, ...) __attribute__((__sentinel__));
+int execle(const char* __path, const char* __arg0, ... /*, char* const* __envp */)
+ __attribute__((__sentinel__(1)));
int nice(int __incr);