17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*34709573Sraf * Common Development and Distribution License (the "License"). 6*34709573Sraf * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21*34709573Sraf 227c478bd9Sstevel@tonic-gate /* 23*34709573Sraf * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_AIOCB_H 287c478bd9Sstevel@tonic-gate #define _SYS_AIOCB_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #include <sys/types.h> 337c478bd9Sstevel@tonic-gate #include <sys/fcntl.h> 347c478bd9Sstevel@tonic-gate #include <sys/siginfo.h> 357c478bd9Sstevel@tonic-gate #include <sys/aio.h> 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #ifdef __cplusplus 387c478bd9Sstevel@tonic-gate extern "C" { 397c478bd9Sstevel@tonic-gate #endif 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate typedef struct aiocb { 427c478bd9Sstevel@tonic-gate int aio_fildes; 437c478bd9Sstevel@tonic-gate #if defined(__STDC__) 447c478bd9Sstevel@tonic-gate volatile void *aio_buf; /* buffer location */ 457c478bd9Sstevel@tonic-gate #else 467c478bd9Sstevel@tonic-gate void *aio_buf; /* buffer location */ 477c478bd9Sstevel@tonic-gate #endif 487c478bd9Sstevel@tonic-gate size_t aio_nbytes; /* length of transfer */ 497c478bd9Sstevel@tonic-gate off_t aio_offset; /* file offset */ 507c478bd9Sstevel@tonic-gate int aio_reqprio; /* request priority offset */ 51*34709573Sraf struct sigevent aio_sigevent; /* notification type */ 527c478bd9Sstevel@tonic-gate int aio_lio_opcode; /* listio operation */ 537c478bd9Sstevel@tonic-gate aio_result_t aio_resultp; /* results */ 547c478bd9Sstevel@tonic-gate int aio_state; /* state flag for List I/O */ 557c478bd9Sstevel@tonic-gate int aio__pad[1]; /* extension padding */ 567c478bd9Sstevel@tonic-gate } aiocb_t; 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate #ifdef _LARGEFILE64_SOURCE 597c478bd9Sstevel@tonic-gate #if !defined(_KERNEL) 607c478bd9Sstevel@tonic-gate typedef struct aiocb64 { 617c478bd9Sstevel@tonic-gate int aio_fildes; 627c478bd9Sstevel@tonic-gate #if defined(__STDC__) 637c478bd9Sstevel@tonic-gate volatile void *aio_buf; /* buffer location */ 647c478bd9Sstevel@tonic-gate #else 657c478bd9Sstevel@tonic-gate void *aio_buf; /* buffer location */ 667c478bd9Sstevel@tonic-gate #endif 677c478bd9Sstevel@tonic-gate size_t aio_nbytes; /* length of transfer */ 687c478bd9Sstevel@tonic-gate off64_t aio_offset; /* file offset */ 697c478bd9Sstevel@tonic-gate int aio_reqprio; /* request priority offset */ 70*34709573Sraf struct sigevent aio_sigevent; /* notification type */ 717c478bd9Sstevel@tonic-gate int aio_lio_opcode; /* listio operation */ 727c478bd9Sstevel@tonic-gate aio_result_t aio_resultp; /* results */ 737c478bd9Sstevel@tonic-gate int aio_state; /* state flag for List I/O */ 747c478bd9Sstevel@tonic-gate int aio__pad[1]; /* extension padding */ 757c478bd9Sstevel@tonic-gate } aiocb64_t; 767c478bd9Sstevel@tonic-gate #else 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4 797c478bd9Sstevel@tonic-gate #pragma pack(4) 807c478bd9Sstevel@tonic-gate #endif 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate typedef struct aiocb64_32 { 837c478bd9Sstevel@tonic-gate int aio_fildes; 847c478bd9Sstevel@tonic-gate caddr32_t aio_buf; /* buffer location */ 857c478bd9Sstevel@tonic-gate uint32_t aio_nbytes; /* length of transfer */ 867c478bd9Sstevel@tonic-gate off64_t aio_offset; /* file offset */ 877c478bd9Sstevel@tonic-gate int aio_reqprio; /* request priority offset */ 88*34709573Sraf struct sigevent32 aio_sigevent; /* notification type */ 897c478bd9Sstevel@tonic-gate int aio_lio_opcode; /* listio operation */ 907c478bd9Sstevel@tonic-gate aio_result32_t aio_resultp; /* results */ 917c478bd9Sstevel@tonic-gate int aio_state; /* state flag for List I/O */ 927c478bd9Sstevel@tonic-gate int aio__pad[1]; /* extension padding */ 937c478bd9Sstevel@tonic-gate } aiocb64_32_t; 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4 967c478bd9Sstevel@tonic-gate #pragma pack() 977c478bd9Sstevel@tonic-gate #endif 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate #endif /* !defined(_KERNEL) */ 1007c478bd9Sstevel@tonic-gate #endif /* _LARGEFILE64_SOURCE */ 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32 1037c478bd9Sstevel@tonic-gate typedef struct aiocb32 { 1047c478bd9Sstevel@tonic-gate int aio_fildes; 1057c478bd9Sstevel@tonic-gate caddr32_t aio_buf; /* buffer location */ 1067c478bd9Sstevel@tonic-gate uint32_t aio_nbytes; /* length of transfer */ 1077c478bd9Sstevel@tonic-gate uint32_t aio_offset; /* file offset */ 1087c478bd9Sstevel@tonic-gate int aio_reqprio; /* request priority offset */ 109*34709573Sraf struct sigevent32 aio_sigevent; /* notification type */ 1107c478bd9Sstevel@tonic-gate int aio_lio_opcode; /* listio operation */ 1117c478bd9Sstevel@tonic-gate aio_result32_t aio_resultp; /* results */ 1127c478bd9Sstevel@tonic-gate int aio_state; /* state flag for List I/O */ 1137c478bd9Sstevel@tonic-gate int aio__pad[1]; /* extension padding */ 1147c478bd9Sstevel@tonic-gate } aiocb32_t; 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1177c478bd9Sstevel@tonic-gate /* 1187c478bd9Sstevel@tonic-gate * return values for aiocancel() 1197c478bd9Sstevel@tonic-gate */ 1207c478bd9Sstevel@tonic-gate #define AIO_CANCELED 0 1217c478bd9Sstevel@tonic-gate #define AIO_ALLDONE 1 1227c478bd9Sstevel@tonic-gate #define AIO_NOTCANCELED 2 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* 1257c478bd9Sstevel@tonic-gate * mode values for lio_listio() 1267c478bd9Sstevel@tonic-gate */ 1277c478bd9Sstevel@tonic-gate #define LIO_NOWAIT 0 1287c478bd9Sstevel@tonic-gate #define LIO_WAIT 1 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gate /* 1327c478bd9Sstevel@tonic-gate * listio operation codes 1337c478bd9Sstevel@tonic-gate * 1347c478bd9Sstevel@tonic-gate * LIO_READ and LIO_WRITE were previously defined as FREAD and FWRITE as 1357c478bd9Sstevel@tonic-gate * defined in <sys/file.h>. However, inclusion of <sys/file.h> results 1367c478bd9Sstevel@tonic-gate * in X/Open namespace pollution and as such is no longer included in 1377c478bd9Sstevel@tonic-gate * this header. The values of LIO_READ and LIO_WRITE must be identical 1387c478bd9Sstevel@tonic-gate * to the values of FREAD and FWRITE in <sys/file.h>. Any change to one 1397c478bd9Sstevel@tonic-gate * will require a change to the other. 1407c478bd9Sstevel@tonic-gate */ 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gate #define LIO_NOP 0 1437c478bd9Sstevel@tonic-gate #define LIO_READ 0x01 /* Must match value of FREAD in sys/file.h */ 1447c478bd9Sstevel@tonic-gate #define LIO_WRITE 0x02 /* Must match value of FWRITE in sys/file.h */ 1457c478bd9Sstevel@tonic-gate 1467c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1477c478bd9Sstevel@tonic-gate } 1487c478bd9Sstevel@tonic-gate #endif 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate #endif /* _SYS_AIOCB_H */ 151