Deleted Added
full compact
sys_generic.c (38864) sys_generic.c (41086)
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.40 1998/08/24 08:39:38 dfr Exp $
39 * $Id: sys_generic.c,v 1.41 1998/09/05 14:30:11 bde Exp $
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>
47#include <sys/filedesc.h>

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

464 case FIOASYNC:
465 if ((tmp = *(int *)data))
466 fp->f_flag |= FASYNC;
467 else
468 fp->f_flag &= ~FASYNC;
469 error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p);
470 break;
471
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>
47#include <sys/filedesc.h>

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

464 case FIOASYNC:
465 if ((tmp = *(int *)data))
466 fp->f_flag |= FASYNC;
467 else
468 fp->f_flag &= ~FASYNC;
469 error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p);
470 break;
471
472 case FIOSETOWN:
473 tmp = *(int *)data;
474 if (fp->f_type == DTYPE_SOCKET) {
475 ((struct socket *)fp->f_data)->so_pgid = tmp;
476 error = 0;
477 break;
478 }
479 if (tmp <= 0) {
480 tmp = -tmp;
481 } else {
482 struct proc *p1 = pfind(tmp);
483 if (p1 == 0) {
484 error = ESRCH;
485 break;
486 }
487 tmp = p1->p_pgrp->pg_id;
488 }
489 error = (*fp->f_ops->fo_ioctl)
490 (fp, (int)TIOCSPGRP, (caddr_t)&tmp, p);
491 break;
492
493 case FIOGETOWN:
494 if (fp->f_type == DTYPE_SOCKET) {
495 error = 0;
496 *(int *)data = ((struct socket *)fp->f_data)->so_pgid;
497 break;
498 }
499 error = (*fp->f_ops->fo_ioctl)(fp, (int)TIOCGPGRP, data, p);
500 *(int *)data = -*(int *)data;
501 break;
502
503 default:
504 error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
505 /*
506 * Copy any data to user, size was
507 * already set and checked above.
508 */
509 if (error == 0 && (com&IOC_OUT) && size)
510 error = copyout(data, uap->data, (u_int)size);

--- 391 unchanged lines hidden ---
472 default:
473 error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
474 /*
475 * Copy any data to user, size was
476 * already set and checked above.
477 */
478 if (error == 0 && (com&IOC_OUT) && size)
479 error = copyout(data, uap->data, (u_int)size);

--- 391 unchanged lines hidden ---