epoc32/include/stdapis/sys/uio.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*-
williamr@2
     2
 * Copyright (c) 1982, 1986, 1993, 1994
williamr@2
     3
 *	The Regents of the University of California.  All rights reserved.
williamr@2
     4
 *
williamr@2
     5
 * Redistribution and use in source and binary forms, with or without
williamr@2
     6
 * modification, are permitted provided that the following conditions
williamr@2
     7
 * are met:
williamr@2
     8
 * 1. Redistributions of source code must retain the above copyright
williamr@2
     9
 *    notice, this list of conditions and the following disclaimer.
williamr@2
    10
 * 2. Redistributions in binary form must reproduce the above copyright
williamr@2
    11
 *    notice, this list of conditions and the following disclaimer in the
williamr@2
    12
 *    documentation and/or other materials provided with the distribution.
williamr@2
    13
 * 4. Neither the name of the University nor the names of its contributors
williamr@2
    14
 *    may be used to endorse or promote products derived from this software
williamr@2
    15
 *    without specific prior written permission.
williamr@2
    16
 *
williamr@2
    17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
williamr@2
    18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
williamr@2
    19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
williamr@2
    20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
williamr@2
    21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
williamr@2
    22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
williamr@2
    23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
williamr@2
    24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
williamr@2
    25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
williamr@2
    26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
williamr@2
    27
 * SUCH DAMAGE.
williamr@2
    28
 * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
williamr@2
    29
 *	@(#)uio.h	8.5 (Berkeley) 2/22/94
williamr@2
    30
 * $FreeBSD: src/sys/sys/uio.h,v 1.39 2005/07/07 18:17:55 jhb Exp $
williamr@2
    31
 */
williamr@2
    32
williamr@2
    33
#ifndef _SYS_UIO_H_
williamr@2
    34
#define	_SYS_UIO_H_
williamr@2
    35
williamr@2
    36
#include <sys/cdefs.h>
williamr@2
    37
#include <sys/_types.h>
williamr@2
    38
#include <sys/_iovec.h>
williamr@2
    39
williamr@2
    40
#ifndef _SSIZE_T_DECLARED
williamr@2
    41
typedef	__ssize_t	ssize_t;
williamr@2
    42
#define	_SSIZE_T_DECLARED
williamr@2
    43
#endif
williamr@2
    44
williamr@2
    45
#ifndef _OFF_T_DECLARED
williamr@2
    46
typedef	__off_t	off_t;
williamr@2
    47
#define	_OFF_T_DECLARED
williamr@2
    48
#endif
williamr@2
    49
williamr@2
    50
#if __BSD_VISIBLE
williamr@2
    51
enum	uio_rw { UIO_READ, UIO_WRITE };
williamr@2
    52
williamr@2
    53
/* Segment flag values. */
williamr@2
    54
enum uio_seg {
williamr@2
    55
	UIO_USERSPACE,		/* from user data space */
williamr@2
    56
	UIO_SYSSPACE,		/* from system space */
williamr@2
    57
	UIO_NOCOPY		/* don't copy, already in object */
williamr@2
    58
};
williamr@2
    59
#endif
williamr@2
    60
williamr@2
    61
#ifdef _KERNEL
williamr@2
    62
williamr@2
    63
struct uio {
williamr@2
    64
	struct	iovec *uio_iov;
williamr@2
    65
	int	uio_iovcnt;
williamr@2
    66
	off_t	uio_offset;
williamr@2
    67
	int	uio_resid;
williamr@2
    68
	enum	uio_seg uio_segflg;
williamr@2
    69
	enum	uio_rw uio_rw;
williamr@2
    70
	struct	thread *uio_td;
williamr@2
    71
};
williamr@2
    72
williamr@2
    73
/*
williamr@2
    74
 * Limits
williamr@2
    75
 *
williamr@2
    76
 * N.B.: UIO_MAXIOV must be no less than IOV_MAX from <sys/syslimits.h>
williamr@2
    77
 * which in turn must be no less than _XOPEN_IOV_MAX from <limits.h>.  If
williamr@2
    78
 * we ever make this tunable (probably pointless), then IOV_MAX should be
williamr@2
    79
 * removed from <sys/syslimits.h> and applications would be expected to use
williamr@2
    80
 * sysconf(3) to find out the correct value, or else assume the worst
williamr@2
    81
 * (_XOPEN_IOV_MAX).  Perhaps UIO_MAXIOV should be simply defined as
williamr@2
    82
 * IOV_MAX.
williamr@2
    83
 */
williamr@2
    84
#define UIO_MAXIOV	1024		/* max 1K of iov's */
williamr@2
    85
williamr@2
    86
struct vm_object;
williamr@2
    87
struct vm_page;
williamr@2
    88
williamr@2
    89
#else /* !_KERNEL */
williamr@2
    90
williamr@2
    91
__BEGIN_DECLS
williamr@2
    92
IMPORT_C
williamr@2
    93
ssize_t	readv(int, const struct iovec *, int);
williamr@2
    94
IMPORT_C
williamr@2
    95
ssize_t	writev(int, const struct iovec *, int);
williamr@2
    96
__END_DECLS
williamr@2
    97
williamr@2
    98
#endif /* _KERNEL */
williamr@2
    99
williamr@2
   100
#endif /* !_SYS_UIO_H_ */