summaryrefslogtreecommitdiff
path: root/include/unistd.h
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-08-01 17:38:34 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-08-01 17:38:34 +0000
commitd68eb8fee6d53373bd6305628015b381d50e5a81 (patch)
tree1a024d606a1af2da709084dc790f2510d6665ae6 /include/unistd.h
parent594ac08ee4888800f45f3229059b0bcb5d56b45f (diff)
add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/unistd.h b/include/unistd.h
index f448a955796..55e2f345908 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.49 2003/06/26 19:34:17 avsm Exp $ */
+/* $OpenBSD: unistd.h,v 1.50 2003/08/01 17:38:33 avsm Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -58,7 +58,8 @@ unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
-size_t confstr(int, char *, size_t);
+size_t confstr(int, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
char *cuserid(char *);
int dup(int);
int dup2(int, int);
@@ -73,13 +74,17 @@ int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
-char *getcwd(char *, size_t);
+char *getcwd(char *, size_t)
+ __attribute__((__bounded__(__string__,1,2)))
+ __attribute__((__bounded__(__minbytes__,1,1024)));
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t *);
char *getlogin(void);
-int getlogin_r(char *, size_t);
+int getlogin_r(char *, size_t)
+ __attribute__((__bounded__(__string__,1,2)))
+ __attribute__((__bounded__(__minbytes__,1,32)));
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getpgid(pid_t);
@@ -92,7 +97,8 @@ off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void);
int pipe(int *);
-ssize_t read(int, void *, size_t);
+ssize_t read(int, void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
@@ -103,9 +109,11 @@ long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
-int ttyname_r(int, char *, size_t);
+int ttyname_r(int, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
int unlink(const char *);
-ssize_t write(int, const void *, size_t);
+ssize_t write(int, const void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
#ifndef _POSIX_SOURCE
@@ -135,18 +143,21 @@ int fchown(int, uid_t, gid_t);
char *fflagstostr(u_int32_t);
int fsync(int);
int ftruncate(int, off_t);
-int getdomainname(char *, size_t);
+int getdomainname(char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,2)));
int getdtablesize(void);
int getgrouplist(const char *, gid_t, gid_t *, int *);
long gethostid(void);
-int gethostname(char *, size_t);
+int gethostname(char *, size_t)
+ __attribute__ ((__bounded__(__string__,1,2)));
mode_t getmode(const void *, mode_t);
int getpagesize(void);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getpass(const char *);
char *getusershell(void);
-char *getwd(char *); /* obsoleted by getcwd() */
+char *getwd(char *)
+ __attribute__ ((__bounded__(__minbytes__,1,1024)));
int initgroups(const char *, gid_t);
int iruserok(u_int32_t, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
@@ -159,7 +170,8 @@ int nfssvc(int, void *);
int nice(int);
void psignal(unsigned int, const char *);
extern __const char *__const sys_siglist[];
-int profil(char *, size_t, unsigned long, unsigned int);
+int profil(char *, size_t, unsigned long, unsigned int)
+ __attribute__ ((__bounded__(__string__,1,2)));
int rcmd(char **, int, const char *,
const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
@@ -168,7 +180,8 @@ int rcmdsh(char **, int, const char *,
const char *, const char *, char *);
char *re_comp(const char *);
int re_exec(const char *);
-int readlink(const char *, char *, size_t);
+int readlink(const char *, char *, size_t)
+ __attribute__ ((__bounded__(__string__,2,3)));
int reboot(int);
int revoke(const char *);
int rfork(int opts);