klibc-bot for H. Peter Anvin
2012-May-21 22:42 UTC
[klibc] [klibc:master] Move SEEK_ constants to a common header file
Commit-ID: 4600662f24eeee70ee28bc768cdaebb84bbc3345 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=4600662f24eeee70ee28bc768cdaebb84bbc3345 Author: H. Peter Anvin <hpa at zytor.com> AuthorDate: Mon, 21 May 2012 15:36:26 -0700 Committer: H. Peter Anvin <hpa at zytor.com> CommitDate: Mon, 21 May 2012 15:36:26 -0700 [klibc] Move SEEK_ constants to a common header file POSIX states that the SEEK_ constants should be defined by stdio.h, unistd.h, and fcntl.h. The easiest way to do that without having to worry about duplicate definitions is to move them to their own header file with header guards and #include it in the other files. Signed-off-by: H. Peter Anvin <hpa at zytor.com> --- usr/include/fcntl.h | 1 + usr/include/klibc/seek.h | 14 ++++++++++++++ usr/include/stdio.h | 5 +---- usr/include/unistd.h | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h index 0908e21..bbd6917 100644 --- a/usr/include/fcntl.h +++ b/usr/include/fcntl.h @@ -7,6 +7,7 @@ #include <klibc/extern.h> #include <klibc/compiler.h> +#include <klibc/seek.h> #include <sys/types.h> #if defined(__mips__) && !defined(__mips64__) # include <klibc/archfcntl.h> diff --git a/usr/include/klibc/seek.h b/usr/include/klibc/seek.h new file mode 100644 index 0000000..e8ffe25 --- /dev/null +++ b/usr/include/klibc/seek.h @@ -0,0 +1,14 @@ +/* + * klibc/seek.h + * + * SEEK constants - needed by stdio.h, fcntl.h, and unistd.h + */ + +#ifndef _KLIBC_SEEK_H +#define _KLIBC_SEEK_H + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + +#endif /* _KLIBC_SEEK_H */ diff --git a/usr/include/stdio.h b/usr/include/stdio.h index f0e81e9..f24ab69 100644 --- a/usr/include/stdio.h +++ b/usr/include/stdio.h @@ -7,6 +7,7 @@ #include <klibc/extern.h> #include <klibc/sysconfig.h> +#include <klibc/seek.h> #include <stdarg.h> #include <stddef.h> #include <unistd.h> @@ -26,10 +27,6 @@ typedef struct _IO_file FILE; # define BUFSIZ _KLIBC_BUFSIZ #endif -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 - enum _IO_bufmode { _IONBF, _IOLBF, diff --git a/usr/include/unistd.h b/usr/include/unistd.h index 3af4c8f..0390748 100644 --- a/usr/include/unistd.h +++ b/usr/include/unistd.h @@ -7,6 +7,7 @@ #include <klibc/extern.h> #include <klibc/compiler.h> +#include <klibc/seek.h> #include <stddef.h> #include <sys/types.h> #include <sys/select.h>