/*
- * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define _SYS_AIO_H_
#include <sys/signal.h>
+#include <sys/_types.h>
#include <sys/cdefs.h>
+/*
+ * [XSI] Inclusion of the <aio.h> header may make visible symbols defined
+ * in the headers <fcntl.h>, <signal.h>, <sys/types.h>, and <time.h>.
+ *
+ * In our case, this is limited to struct timespec, off_t and ssize_t.
+ */
+#define __need_struct_timespec
+#include <sys/_structs.h>
+
+#ifndef _OFF_T
+typedef __darwin_off_t off_t;
+#define _OFF_T
+#endif
+
+#ifndef _SSIZE_T
+#define _SSIZE_T
+typedef __darwin_ssize_t ssize_t;
+#endif
+
+
struct aiocb {
- int aio_fildes; /* File descriptor */
- off_t aio_offset; /* File offset */
- volatile void *aio_buf; /* Location of buffer */
- size_t aio_nbytes; /* Length of transfer */
- int aio_reqprio; /* Request priority offset */
- struct sigevent aio_sigevent; /* Signal number and value */
- int aio_lio_opcode; /* Operation to be performed */
+ int aio_fildes; /* File descriptor */
+ off_t aio_offset; /* File offset */
+ volatile void *aio_buf; /* Location of buffer */
+ size_t aio_nbytes; /* Length of transfer */
+ int aio_reqprio; /* Request priority offset */
+ struct sigevent aio_sigevent; /* Signal number and value */
+ int aio_lio_opcode; /* Operation to be performed */
};
-// LP64todo - should this move?
#ifdef KERNEL
-#if __DARWIN_ALIGN_NATURAL
-#pragma options align=natural
-#endif
-
struct user_aiocb {
- int aio_fildes; /* File descriptor */
- off_t aio_offset; /* File offset */
- user_addr_t aio_buf; /* Location of buffer */
- user_size_t aio_nbytes; /* Length of transfer */
- int aio_reqprio; /* Request priority offset */
- struct user_sigevent aio_sigevent; /* Signal number and value */
- int aio_lio_opcode; /* Operation to be performed */
+ int aio_fildes; /* File descriptor */
+ off_t aio_offset __attribute((aligned(8))); /* File offset */
+ user_addr_t aio_buf __attribute((aligned(8))); /* Location of buffer */
+ user_size_t aio_nbytes; /* Length of transfer */
+ int aio_reqprio; /* Request priority offset */
+ struct user_sigevent aio_sigevent __attribute((aligned(8))); /* Signal number and value */
+ int aio_lio_opcode; /* Operation to be performed */
};
-#if __DARWIN_ALIGN_NATURAL
-#pragma options align=reset
-#endif
-
#endif // KERNEL
/*
*/
int aio_suspend( const struct aiocb *const aiocblist[],
int nent,
- const struct timespec * timeoutp );
+ const struct timespec * timeoutp ) __DARWIN_ALIAS_C(aio_suspend);
/*
* Write aiocbp->aio_nbytes to the file associated with aiocbp->aio_fildes from