sys_generic.c (7147b19de56d9d97400fd916b2ce65eb3f84f50a) sys_generic.c (d2d3e8751c3b7831f7064ccf400978b75b696547)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
39 * $Id: sys_generic.c,v 1.14 1995/10/10 08:08:54 swallace Exp $
39 * $Id: sys_generic.c,v 1.15 1995/11/11 06:57:34 bde Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/sysproto.h>
44#include <sys/filedesc.h>
45#include <sys/ioctl.h>
46#include <sys/file.h>
47#include <sys/proc.h>
48#include <sys/stat.h>
49#include <sys/signalvar.h>
50#include <sys/socket.h>
51#include <sys/socketvar.h>

--- 6 unchanged lines hidden (view full) ---

58#endif
59#include <vm/vm.h>
60
61int selscan __P((struct proc *, fd_set *, fd_set *, int, int *));
62
63/*
64 * Read system call.
65 */
45#include <sys/filedesc.h>
46#include <sys/ioctl.h>
47#include <sys/file.h>
48#include <sys/proc.h>
49#include <sys/stat.h>
50#include <sys/signalvar.h>
51#include <sys/socket.h>
52#include <sys/socketvar.h>

--- 6 unchanged lines hidden (view full) ---

59#endif
60#include <vm/vm.h>
61
62int selscan __P((struct proc *, fd_set *, fd_set *, int, int *));
63
64/*
65 * Read system call.
66 */
67#ifndef _SYS_SYSPROTO_H_
66struct read_args {
67 int fd;
68 char *buf;
69 u_int nbyte;
70};
68struct read_args {
69 int fd;
70 char *buf;
71 u_int nbyte;
72};
73#endif
71/* ARGSUSED */
72int
73read(p, uap, retval)
74 struct proc *p;
75 register struct read_args *uap;
76 int *retval;
77{
78 register struct file *fp;

--- 40 unchanged lines hidden (view full) ---

119#endif
120 *retval = cnt;
121 return (error);
122}
123
124/*
125 * Scatter read system call.
126 */
74/* ARGSUSED */
75int
76read(p, uap, retval)
77 struct proc *p;
78 register struct read_args *uap;
79 int *retval;
80{
81 register struct file *fp;

--- 40 unchanged lines hidden (view full) ---

122#endif
123 *retval = cnt;
124 return (error);
125}
126
127/*
128 * Scatter read system call.
129 */
130#ifndef _SYS_SYSPROTO_H_
127struct readv_args {
128 int fd;
129 struct iovec *iovp;
130 u_int iovcnt;
131};
131struct readv_args {
132 int fd;
133 struct iovec *iovp;
134 u_int iovcnt;
135};
136#endif
132int
133readv(p, uap, retval)
134 struct proc *p;
135 register struct readv_args *uap;
136 int *retval;
137{
138 register struct file *fp;
139 register struct filedesc *fdp = p->p_fd;

--- 66 unchanged lines hidden (view full) ---

206 if (needfree)
207 FREE(needfree, M_IOV);
208 return (error);
209}
210
211/*
212 * Write system call
213 */
137int
138readv(p, uap, retval)
139 struct proc *p;
140 register struct readv_args *uap;
141 int *retval;
142{
143 register struct file *fp;
144 register struct filedesc *fdp = p->p_fd;

--- 66 unchanged lines hidden (view full) ---

211 if (needfree)
212 FREE(needfree, M_IOV);
213 return (error);
214}
215
216/*
217 * Write system call
218 */
219#ifndef _SYS_SYSPROTO_H_
214struct write_args {
215 int fd;
216 char *buf;
217 u_int nbyte;
218};
220struct write_args {
221 int fd;
222 char *buf;
223 u_int nbyte;
224};
225#endif
219int
220write(p, uap, retval)
221 struct proc *p;
222 register struct write_args *uap;
223 int *retval;
224{
225 register struct file *fp;
226 register struct filedesc *fdp = p->p_fd;

--- 39 unchanged lines hidden (view full) ---

266#endif
267 *retval = cnt;
268 return (error);
269}
270
271/*
272 * Gather write system call
273 */
226int
227write(p, uap, retval)
228 struct proc *p;
229 register struct write_args *uap;
230 int *retval;
231{
232 register struct file *fp;
233 register struct filedesc *fdp = p->p_fd;

--- 39 unchanged lines hidden (view full) ---

273#endif
274 *retval = cnt;
275 return (error);
276}
277
278/*
279 * Gather write system call
280 */
281#ifndef _SYS_SYSPROTO_H_
274struct writev_args {
275 int fd;
276 struct iovec *iovp;
277 u_int iovcnt;
278};
282struct writev_args {
283 int fd;
284 struct iovec *iovp;
285 u_int iovcnt;
286};
287#endif
279int
280writev(p, uap, retval)
281 struct proc *p;
282 register struct writev_args *uap;
283 int *retval;
284{
285 register struct file *fp;
286 register struct filedesc *fdp = p->p_fd;

--- 69 unchanged lines hidden (view full) ---

356 if (needfree)
357 FREE(needfree, M_IOV);
358 return (error);
359}
360
361/*
362 * Ioctl system call
363 */
288int
289writev(p, uap, retval)
290 struct proc *p;
291 register struct writev_args *uap;
292 int *retval;
293{
294 register struct file *fp;
295 register struct filedesc *fdp = p->p_fd;

--- 69 unchanged lines hidden (view full) ---

365 if (needfree)
366 FREE(needfree, M_IOV);
367 return (error);
368}
369
370/*
371 * Ioctl system call
372 */
373#ifndef _SYS_SYSPROTO_H_
364struct ioctl_args {
365 int fd;
366 int com;
367 caddr_t data;
368};
374struct ioctl_args {
375 int fd;
376 int com;
377 caddr_t data;
378};
379#endif
369/* ARGSUSED */
370int
371ioctl(p, uap, retval)
372 struct proc *p;
373 register struct ioctl_args *uap;
374 int *retval;
375{
376 register struct file *fp;

--- 118 unchanged lines hidden (view full) ---

495 return (error);
496}
497
498int selwait, nselcoll;
499
500/*
501 * Select system call.
502 */
380/* ARGSUSED */
381int
382ioctl(p, uap, retval)
383 struct proc *p;
384 register struct ioctl_args *uap;
385 int *retval;
386{
387 register struct file *fp;

--- 118 unchanged lines hidden (view full) ---

506 return (error);
507}
508
509int selwait, nselcoll;
510
511/*
512 * Select system call.
513 */
514#ifndef _SYS_SYSPROTO_H_
503struct select_args {
504 u_int nd;
505 fd_set *in, *ou, *ex;
506 struct timeval *tv;
507};
515struct select_args {
516 u_int nd;
517 fd_set *in, *ou, *ex;
518 struct timeval *tv;
519};
520#endif
508int
509select(p, uap, retval)
510 register struct proc *p;
511 register struct select_args *uap;
512 int *retval;
513{
514 fd_set ibits[3], obits[3];
515 struct timeval atv;

--- 179 unchanged lines hidden ---
521int
522select(p, uap, retval)
523 register struct proc *p;
524 register struct select_args *uap;
525 int *retval;
526{
527 fd_set ibits[3], obits[3];
528 struct timeval atv;

--- 179 unchanged lines hidden ---