aboutsummaryrefslogtreecommitdiff
path: root/sys/posix4
diff options
context:
space:
mode:
authorPeter Dufault <dufault@FreeBSD.org>1998-03-08 17:25:38 +0000
committerPeter Dufault <dufault@FreeBSD.org>1998-03-08 17:25:38 +0000
commitaac4ad2c994742defc0623bd489206743241552c (patch)
tree0dff9523762d4433c9265778cf79490f9378d188 /sys/posix4
parentaac18d035f1c8256522613d417dc9ae2731641ec (diff)
downloadsrc-aac4ad2c994742defc0623bd489206743241552c.tar.gz
src-aac4ad2c994742defc0623bd489206743241552c.zip
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.
Notes
Notes: svn path=/head/; revision=34319
Diffstat (limited to 'sys/posix4')
-rw-r--r--sys/posix4/aio.h10
-rw-r--r--sys/posix4/mqueue.h5
-rw-r--r--sys/posix4/posix4.h18
-rw-r--r--sys/posix4/semaphore.h4
4 files changed, 18 insertions, 19 deletions
diff --git a/sys/posix4/aio.h b/sys/posix4/aio.h
index 6cd47bc70e9e..678dc0f4e340 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 0872ddf6266d..6fcf4409ed33 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 5037b03bbd7e..99ba8822a2b0 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 fbcab1312593..a24ac35180e5 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 */