svr4_stream.c (98124) | svr4_stream.c (102003) |
---|---|
1/* 2 * Copyright (c) 1998 Mark Newton. All rights reserved. 3 * Copyright (c) 1994, 1996 Christos Zoulas. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1998 Mark Newton. All rights reserved. 3 * Copyright (c) 1994, 1996 Christos Zoulas. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/compat/svr4/svr4_stream.c 98124 2002-06-11 21:14:02Z alfred $ | 30 * $FreeBSD: head/sys/compat/svr4/svr4_stream.c 102003 2002-08-17 02:36:16Z rwatson $ |
31 */ 32 33/* 34 * Pretend that we have streams... 35 * Yes, this is gross. 36 * 37 * ToDo: The state machine for getmsg needs re-thinking 38 */ --- 1223 unchanged lines hidden (view full) --- 1262 1263 /* 1264 * We are supposed to return the message length in nread, and the 1265 * number of messages in retval. We don't have the notion of number 1266 * of stream messages, so we just find out if we have any bytes waiting 1267 * for us, and if we do, then we assume that we have at least one 1268 * message waiting for us. 1269 */ | 31 */ 32 33/* 34 * Pretend that we have streams... 35 * Yes, this is gross. 36 * 37 * ToDo: The state machine for getmsg needs re-thinking 38 */ --- 1223 unchanged lines hidden (view full) --- 1262 1263 /* 1264 * We are supposed to return the message length in nread, and the 1265 * number of messages in retval. We don't have the notion of number 1266 * of stream messages, so we just find out if we have any bytes waiting 1267 * for us, and if we do, then we assume that we have at least one 1268 * message waiting for us. 1269 */ |
1270 if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td)) != 0) | 1270 if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td->td_ucred, 1271 td)) != 0) |
1271 return error; 1272 1273 if (nread != 0) 1274 *retval = 1; 1275 else 1276 *retval = 0; 1277 1278 return copyout(&nread, dat, sizeof(nread)); --- 1017 unchanged lines hidden --- | 1272 return error; 1273 1274 if (nread != 0) 1275 *retval = 1; 1276 else 1277 *retval = 0; 1278 1279 return copyout(&nread, dat, sizeof(nread)); --- 1017 unchanged lines hidden --- |