diff options
author | dufault <dufault@FreeBSD.org> | 1998-03-08 17:25:38 +0000 |
---|---|---|
committer | dufault <dufault@FreeBSD.org> | 1998-03-08 17:25:38 +0000 |
commit | d3dd91fcbc3fdd38db7fa5e2a844a103e8090a00 (patch) | |
tree | 01a8747d7362e70e0f5e23b70dbcda75cf6092e8 /sys/posix4 | |
parent | 84b7fbfa292269f69d459cbb4ecf1c921bb167c3 (diff) | |
download | FreeBSD-src-d3dd91fcbc3fdd38db7fa5e2a844a103e8090a00.zip FreeBSD-src-d3dd91fcbc3fdd38db7fa5e2a844a103e8090a00.tar.gz |
Reviewed by: bde
Changes to support building with _POSIX_SOURCE set to 199309L:
1. Add sys/_posix.h to handle those preprocessor defs that POSIX
says have effects when defined before including any header files;
2. Change POSIX4_VISIBLE back to _POSIX4_VISIBLE
3. Add _POSIX4_VISIBLE_HISTORICALLY for pre-existing BSD features now
defined in POSIX. These show up when:
_POSIX_SOURCE and _POSIX_C_SOURCE are not set or
_POSIX_C_SOURCE is set >= 199309L
and vanish when:
_POSIX_SOURCE is set or _POSIX_C_SOURCE is < 199309L.
4. Explain these in man 9 posix4;
5. Include _posix.h and conditionalize on new feature test.
Diffstat (limited to 'sys/posix4')
-rw-r--r-- | sys/posix4/aio.h | 10 | ||||
-rw-r--r-- | sys/posix4/mqueue.h | 5 | ||||
-rw-r--r-- | sys/posix4/posix4.h | 18 | ||||
-rw-r--r-- | sys/posix4/semaphore.h | 4 |
4 files changed, 18 insertions, 19 deletions
diff --git a/sys/posix4/aio.h b/sys/posix4/aio.h index 6cd47bc..678dc0f 100644 --- a/sys/posix4/aio.h +++ b/sys/posix4/aio.h @@ -31,15 +31,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id:$ + * $Id: aio.h,v 1.1 1998/03/04 10:26:10 dufault Exp $ */ /* aio.h: P1003.1B-1993 Asynchronous I/O */ -#ifndef _POSIX4_AIO_H_ -#define _POSIX4_AIO_H_ +#ifndef _AIO_H_ +#define _AIO_H_ -#ifdef POSIX4_INCLUDE_MAYBES +#ifdef _POSIX4_INCLUDE_MAYBES #include <sys/types.h> #include <signal.h> #include <time.h> @@ -87,6 +87,7 @@ struct aiocb { #ifndef KERNEL #include <sys/cdefs.h> +__BEGIN_DECLS int aio_read __P((struct aiocb *)); int aio_write __P((struct aiocb *)); @@ -101,6 +102,7 @@ int aio_suspend __P((caio_listio_ctl [_POSIX_AIO_LISTIO_MAX], int, const struct timespec *)); int aio_fsync __P((int, struct aiocb *)); +__END_DECLS #endif /* KERNEL */ diff --git a/sys/posix4/mqueue.h b/sys/posix4/mqueue.h index 0872ddf..6fcf440 100644 --- a/sys/posix4/mqueue.h +++ b/sys/posix4/mqueue.h @@ -36,7 +36,7 @@ * */ -#ifdef POSIX4_INCLUDE_MAYBES +#ifdef _POSIX4_INCLUDE_MAYBES #include <sys/types.h> #include <fcntl.h> #include <time.h> @@ -55,8 +55,10 @@ struct mq_attr { }; #ifndef KERNEL + #include <sys/cdefs.h> +__BEGIN_DECLS mqd_t mq_open __P((const char *, int oflag, ...)); int mq_close __P((mqd_t)); int mq_unlink __P((const char *)); @@ -65,6 +67,7 @@ ssize_t mq_receive __P((mqd_t, char *, size_t, unsigned int *)); int mq_notify __P((mqd_t, const struct sigevent *)); int mq_setattr __P((mqd_t, const struct mq_attr *, struct mq_attr *)); int mq_getattr __P((mqd_t, struct mq_attr *)); +__END_DECLS #endif /* KERNEL */ diff --git a/sys/posix4/posix4.h b/sys/posix4/posix4.h index 5037b03..99ba882 100644 --- a/sys/posix4/posix4.h +++ b/sys/posix4/posix4.h @@ -33,22 +33,14 @@ * */ -#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 199309L +#include <sys/_posix.h> + +#ifdef _POSIX4_VISIBLE + #include <sys/param.h> #include <sys/ioccom.h> #include <sched.h> -/* - * This defines POSIX4_VISIBLE to indicate posix4 extensions should show up. - * You should test this when you add a posix4 extension to a header - * that exists in POSIX.1. Try "man 9 posix4". - */ - -#if !defined(_POSIX_C_SOURCE) || \ - defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L -#define POSIX4_VISIBLE -#endif - /* * * March 1, 1998: Details from here on change and this header file @@ -296,5 +288,5 @@ int kmunlock(int *, void *, const void *, size_t ); { "timer_max", CTLTYPE_INT }, \ } -#endif /* _POSIX_VERSION >= 199309L */ +#endif /* _POSIX4_VISIBLE */ #endif /* _POSIX4_POSIX4_H_ */ diff --git a/sys/posix4/semaphore.h b/sys/posix4/semaphore.h index fbcab13..a24ac35 100644 --- a/sys/posix4/semaphore.h +++ b/sys/posix4/semaphore.h @@ -36,7 +36,7 @@ * */ -#ifdef POSIX4_INCLUDE_MAYBES +#ifdef _POSIX4_INCLUDE_MAYBES #include <sys/types.h> #include <fcntl.h> #endif @@ -46,6 +46,7 @@ typedef int sem_t; #ifndef KERNEL #include <sys/cdefs.h> +__BEGIN_DECLS int sem_init __P(sem_t *, int, unsigned int)); int sem_destroy __P((sem_t *)); sem_t sem_open __P((const char *, int, ...)); @@ -55,6 +56,7 @@ int sem_wait((sem_t *)); int sem_trywait((sem_t *)); int sem_post((sem_t *)); int sem_getvalue((sem_t *, int *)); +__END_DECLS #endif /* KERNEL */ |