rw.c revision c8343062f6e25afd9c2a31b65df357030e69fa55
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CDDL HEADER START
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The contents of this file are subject to the terms of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Common Development and Distribution License, Version 1.0 only
199767f8919635c4928607450d9e0abb932109ceToomas Soome * (the "License"). You may not use this file except in compliance
199767f8919635c4928607450d9e0abb932109ceToomas Soome * with the License.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * See the License for the specific language governing permissions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * and limitations under the License.
e547e4e8adbc4f31e3fac2e9d89d20e99911227cAndrew Stormont * When distributing Covered Code, include this CDDL HEADER in each
199767f8919635c4928607450d9e0abb932109ceToomas Soome * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * If applicable, add the following below this CDDL HEADER, with the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * fields enclosed by brackets "[]" replaced with your own identifying
199767f8919635c4928607450d9e0abb932109ceToomas Soome * information: Portions Copyright [yyyy] [name of copyright owner]
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CDDL HEADER END
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Use is subject to license terms.
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* All Rights Reserved */
f9227b3195a9c18631fd7189f610528ced15121aYuri Pankov * Portions of this source code were derived from Berkeley 4.3 BSD
199767f8919635c4928607450d9e0abb932109ceToomas Soome * under license from the Regents of the University of California.
2de8d7230f771f0640dc41231b6f4743c3f1afadToomas Soome#pragma ident "%Z%%M% %I% %E% SMI"
e547e4e8adbc4f31e3fac2e9d89d20e99911227cAndrew Stormontstatic size_t copyout_min_size = COPYOUT_MIN_SIZE;
199767f8919635c4928607450d9e0abb932109ceToomas Soome * read, write, pread, pwrite, readv, and writev syscalls.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 64-bit open: all open's are large file opens.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Large Files: the behaviour of read depends on whether the fd
199767f8919635c4928607450d9e0abb932109ceToomas Soome * corresponds to large open or not.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 32-bit open: FOFFMAX flag not set.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * read until MAXOFF32_T - 1 and read at MAXOFF32_T returns
199767f8919635c4928607450d9e0abb932109ceToomas Soome * EOVERFLOW if count is non-zero and if size of file
199767f8919635c4928607450d9e0abb932109ceToomas Soome * is > MAXOFF32_T. If size of file is <= MAXOFF32_T read
199767f8919635c4928607450d9e0abb932109ceToomas Soome * at >= MAXOFF32_T returns EOF.
int error = 0;
int in_crit = 0;
goto out;
goto out;
rwflag = 0;
int svmand;
if (error != 0)
goto out;
goto out;
goto out;
cnt = 0;
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (cnt);
int error = 0;
int in_crit = 0;
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (cnt);
int error = 0;
#ifdef _SYSCALL32_IMPL
int in_crit = 0;
goto out;
rwflag = 0;
if (bcount == 0)
goto out;
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
goto out;
bcount = 0;
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (bcount);
int error = 0;
#ifdef _SYSCALL32_IMPL
int in_crit = 0;
goto out;
if (bcount == 0)
goto out;
goto out;
goto out;
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (bcount);
int error = 0;
int in_crit = 0;
#ifdef _SYSCALL32_IMPL
count32 = 0;
for (i = 0; i < iovcnt; i++) {
count = 0;
for (i = 0; i < iovcnt; i++) {
goto out;
goto out;
rwflag = 0;
int svmand;
if (error != 0)
goto out;
goto out;
goto out;
count = 0;
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (count);
int error = 0;
int in_crit = 0;
#ifdef _SYSCALL32_IMPL
count32 = 0;
for (i = 0; i < iovcnt; i++) {
count = 0;
for (i = 0; i < iovcnt; i++) {
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (count);
int error = 0;
int in_crit = 0;
#if defined(_LITTLE_ENDIAN)
goto out;
rwflag = 0;
if (bcount == 0)
goto out;
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (bcount);
int error = 0;
int in_crit = 0;
#if defined(_LITTLE_ENDIAN)
goto out;
if (bcount == 0)
goto out;
goto out;
goto out;
goto out;
goto out;
int svmand;
if (error != 0)
goto out;
goto out;
error = 0;
out:
if (in_crit)
if (error)
return (bcount);
#ifdef _SYSCALL32_IMPL
* rw.c: read32, write32, pread32, pwrite32, readv32, writev32.
* socksyscall.c: recv32, recvfrom32, send32, sendto32.
* readlink.c: readlink32.