Clean up deleted files.
This commit is contained in:
parent
6f353db960
commit
b7c9fb174f
|
@ -1,7 +0,0 @@
|
|||
# $Id: Makefile,v 1.1 1994/05/23 08:04:11 mycroft Exp $
|
||||
|
||||
hpux_sysent.c hpux_syscalls.c hpux_syscall.h: makesyscalls.sh syscalls.master
|
||||
-mv -f hpux_sysent.c hpux_sysent.c.bak
|
||||
-mv -f hpux_syscalls.c hpux_syscalls.c.bak
|
||||
-mv -f hpux_syscall.h hpux_syscall.h.bak
|
||||
sh makesyscalls.sh syscalls.master
|
|
@ -1,287 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: hpux.h 1.33 93/08/05$
|
||||
*
|
||||
* from: @(#)hpux.h 8.4 (Berkeley) 2/13/94
|
||||
* $Id: hpux.h,v 1.6 1994/05/23 08:04:13 mycroft Exp $
|
||||
*/
|
||||
|
||||
#include <hp300/hpux/hpux_exec.h>
|
||||
|
||||
/* HP-UX style UTSNAME struct used by uname syscall */
|
||||
|
||||
struct hpux_utsname {
|
||||
char sysname[9];
|
||||
char nodename[9];
|
||||
char release[9];
|
||||
char version[9];
|
||||
char machine[9];
|
||||
char idnumber[15];
|
||||
};
|
||||
|
||||
/* HP-UX style "old" IOCTLs */
|
||||
|
||||
struct hpux_sgttyb {
|
||||
char sg_ispeed;
|
||||
char sg_ospeed;
|
||||
char sg_erase;
|
||||
char sg_kill;
|
||||
int sg_flags; /* only a short in BSD */
|
||||
};
|
||||
|
||||
#define V7_HUPCL 00001
|
||||
#define V7_XTABS 00002
|
||||
#define V7_NOAL 04000
|
||||
|
||||
#define HPUXTIOCGETP _IOR('t', 8, struct hpux_sgttyb)
|
||||
#define HPUXTIOCSETP _IOW('t', 9, struct hpux_sgttyb)
|
||||
|
||||
/* 6.5 job control related ioctls which need to be mapped */
|
||||
|
||||
#define HPUXTIOCSLTC _IOW('T', 23, struct ltchars)
|
||||
#define HPUXTIOCGLTC _IOR('T', 24, struct ltchars)
|
||||
#define HPUXTIOCLBIS _IOW('T', 25, int)
|
||||
#define HPUXTIOCLBIC _IOW('T', 26, int)
|
||||
#define HPUXTIOCLSET _IOW('T', 27, int)
|
||||
#define HPUXTIOCLGET _IOR('T', 28, int)
|
||||
# define HPUXLTOSTOP 0000001
|
||||
#define HPUXTIOCSPGRP _IOW('T', 29, int)
|
||||
#define HPUXTIOCGPGRP _IOR('T', 30, int)
|
||||
#define HPUXTIOCCONS _IO('t', 104)
|
||||
#define HPUXTIOCSWINSZ _IOW('t', 106, struct winsize)
|
||||
#define HPUXTIOCGWINSZ _IOR('t', 107, struct winsize)
|
||||
|
||||
/* non-blocking IO--doesn't interfere with O_NDELAY */
|
||||
#define HPUXFIOSNBIO _IOW('f', 126, int)
|
||||
|
||||
/* HP-UX stat structure */
|
||||
|
||||
#define bsdtohpuxdev(d) ((major(d) << 24) | minor(d))
|
||||
|
||||
struct hpux_stat {
|
||||
long hst_dev;
|
||||
u_long hst_ino;
|
||||
u_short hst_mode;
|
||||
short hst_nlink;
|
||||
u_short hst_uid;
|
||||
u_short hst_gid;
|
||||
long hst_rdev;
|
||||
long hst_size;
|
||||
time_t hst_atime;
|
||||
int hst_spare1;
|
||||
time_t hst_mtime;
|
||||
int hst_spare2;
|
||||
time_t hst_ctime;
|
||||
int hst_spare3;
|
||||
long hst_blksize;
|
||||
long hst_blocks;
|
||||
u_int hst_remote;
|
||||
long hst_netdev;
|
||||
u_long hst_netino;
|
||||
long hst_spare4[9];
|
||||
};
|
||||
|
||||
/*
|
||||
* Skeletal 6.X HP-UX user structure info for ptrace() mapping.
|
||||
* Yes, this is as bogus as it gets...
|
||||
*/
|
||||
|
||||
/* 6.0/6.2 offsets */
|
||||
#define ooHU_AROFF 0x004
|
||||
#define ooHU_TSOFF 0x092
|
||||
#define ooHU_EDOFF 0x91E
|
||||
#define ooHU_FPOFF 0xA66
|
||||
|
||||
/* 6.5 offsets */
|
||||
#define oHU_AROFF 0x004
|
||||
#define oHU_TSOFF 0x0B2
|
||||
#define oHU_EDOFF 0x93A
|
||||
#define oHU_FPOFF 0xA86
|
||||
|
||||
/* 7.X offsets */
|
||||
#define HU_AROFF 0x004
|
||||
#define HU_TSOFF 0x0B4
|
||||
#define HU_EDOFF 0x8C8
|
||||
#define HU_FPOFF 0xA28
|
||||
|
||||
#define HU_PAD1 (HU_AROFF)
|
||||
#define HU_PAD2 (HU_TSOFF-HU_AROFF-4)
|
||||
#define HU_PAD3 (HU_EDOFF-HU_TSOFF-12)
|
||||
#define HU_PAD4 (HU_FPOFF-HU_EDOFF-sizeof(struct hpux_exec))
|
||||
|
||||
struct hpux_user {
|
||||
u_char whocares1[HU_PAD1]; /* +0x000 */
|
||||
int *hpuxu_ar0; /* +0x004 */
|
||||
u_char whocares2[HU_PAD2]; /* +0x008 */
|
||||
int hpuxu_tsize; /* +0x0B2 */
|
||||
int hpuxu_dsize; /* +0x0B6 */
|
||||
int hpuxu_ssize; /* +0x0BA */
|
||||
u_char whocares3[HU_PAD3]; /* +0x0BE */
|
||||
struct hpux_exec hpuxu_exdata; /* +0x93A */
|
||||
u_char whocares4[HU_PAD4]; /* +0x95E */
|
||||
struct hpux_fp { /* +0xA66 */
|
||||
int hpfp_save[54];
|
||||
int hpfp_ctrl[3];
|
||||
int hpfp_reg[24];
|
||||
} hpuxu_fp;
|
||||
short hpuxu_dragon; /* +0xBCA */
|
||||
};
|
||||
|
||||
/* HP-UX compat file flags */
|
||||
#define HPUXNDELAY 00000004
|
||||
#define HPUXFCREAT 00000400
|
||||
#define HPUXFTRUNC 00001000
|
||||
#define HPUXFEXCL 00002000
|
||||
#define HPUXFSYNCIO 00100000
|
||||
#define HPUXNONBLOCK 00200000
|
||||
#define HPUXFREMOTE 01000000
|
||||
|
||||
/* HP-UX fcntl file locking */
|
||||
struct hpux_flock {
|
||||
short hl_type;
|
||||
short hl_whence;
|
||||
long hl_start;
|
||||
long hl_len;
|
||||
long hl_pid;
|
||||
};
|
||||
|
||||
#define HPUXF_GETLK 7
|
||||
#define HPUXF_SETLK 8
|
||||
#define HPUXF_SETLKW 9
|
||||
|
||||
#define HPUXF_RDLCK 1
|
||||
#define HPUXF_WRLCK 2
|
||||
#define HPUXF_UNLCK 3
|
||||
|
||||
/* HP-UX only sysV shmctl() commands */
|
||||
#define SHM_LOCK 3 /* Lock segment in core */
|
||||
#define SHM_UNLOCK 4 /* Unlock segment */
|
||||
|
||||
/* SHM stuff reflecting POSIX types */
|
||||
struct hpux_ipc_perm {
|
||||
long uid; /* owner's user id */
|
||||
long gid; /* owner's group id */
|
||||
long cuid; /* creator's user id */
|
||||
long cgid; /* creator's group id */
|
||||
u_short mode; /* access modes */
|
||||
u_short seq; /* slot usage sequence number */
|
||||
long key; /* key */
|
||||
};
|
||||
|
||||
struct hpux_shmid_ds {
|
||||
struct hpux_ipc_perm shm_perm; /* operation permission struct */
|
||||
int shm_segsz; /* segment size (bytes) */
|
||||
struct pte *shm_ptbl; /* ptr to associated page table */
|
||||
long shm_lpid; /* pid of last shmop */
|
||||
long shm_cpid; /* pid of creator */
|
||||
u_short shm_nattch; /* current # attached */
|
||||
u_short shm_cnattch; /* in memory # attached */
|
||||
time_t shm_atime; /* last shmat time */
|
||||
time_t shm_dtime; /* last shmdt time */
|
||||
time_t shm_ctime; /* last change time */
|
||||
/* actually longer */
|
||||
};
|
||||
|
||||
/* HP-UX rtprio values */
|
||||
#define RTPRIO_MIN 0
|
||||
#define RTPRIO_MAX 127
|
||||
#define RTPRIO_NOCHG 1000
|
||||
#define RTPRIO_RTOFF 1001
|
||||
|
||||
/* HP-UX only sigvec sv_flags values */
|
||||
#define HPUXSV_RESET 000000004
|
||||
|
||||
/*
|
||||
* HP-UX returns SIGILL instead of SIGFPE for the CHK and TRAPV exceptions.
|
||||
* It also returns different u_code values for certain illegal instruction
|
||||
* and floating point exceptions. Here are the proper HP-UX u_code values
|
||||
* (numbers from hpux 6.2 manual pages).
|
||||
*/
|
||||
|
||||
/* SIGILL codes */
|
||||
#define HPUX_ILL_ILLINST_TRAP 0 /* T_ILLINST+USER */
|
||||
#define HPUX_ILL_CHK_TRAP 6 /* T_CHKINST+USER */
|
||||
#define HPUX_ILL_TRAPV_TRAP 7 /* T_TRAPVINST+USER */
|
||||
#define HPUX_ILL_PRIV_TRAP 8 /* T_PRIVINST+USER */
|
||||
|
||||
/* SIGFPE codes */
|
||||
#define HPUX_FPE_INTDIV_TRAP 5 /* T_ZERODIV+USER */
|
||||
|
||||
/* HP-UX POSIX signal stuff implementation */
|
||||
typedef struct __hpux_sigset_t { long sigset[8]; } hpux_sigset_t;
|
||||
struct hpux_sigaction {
|
||||
void (*sa_handler)();
|
||||
hpux_sigset_t sa_mask;
|
||||
int sa_flags;
|
||||
};
|
||||
#define HPUXSA_ONSTACK 1
|
||||
#define HPUXSA_RESETHAND 4
|
||||
#define HPUXSA_NOCLDSTOP 8
|
||||
|
||||
#define HPUXSIG_BLOCK 0 /* block specified signal set */
|
||||
#define HPUXSIG_UNBLOCK 1 /* unblock specified signal set */
|
||||
#define HPUXSIG_SETMASK 2 /* set specified signal set */
|
||||
|
||||
/* sysconf stuff */
|
||||
#define HPUX_SYSCONF_CLKTICK 2
|
||||
#define HPUX_SYSCONF_OPENMAX 4
|
||||
#define HPUX_SYSCONF_CPUTYPE 10001
|
||||
#define HPUX_SYSCONF_CPUM020 0x20C
|
||||
#define HPUX_SYSCONF_CPUM030 0x20D
|
||||
#define HPUX_SYSCONF_CPUM040 0x20E
|
||||
#define HPUX_SYSCONF_CPUPA10 0x20B
|
||||
#define HPUX_SYSCONF_CPUPA11 0x210
|
||||
|
||||
/* mmap stuff */
|
||||
#define HPUXMAP_FIXED 0x04
|
||||
#define HPUXMAP_REPLACE 0x08
|
||||
#define HPUXMAP_ANON 0x10
|
||||
|
||||
/* rlimit stuff */
|
||||
#define HPUXRLIMIT_NOFILE 6
|
||||
|
||||
/*
|
||||
* In BSD EAGAIN and EWOULDBLOCK are the same error code.
|
||||
* However, for HP-UX we must split them out to seperate codes.
|
||||
* The easiest way to do this was to check the return value of
|
||||
* BSD routines which are known to return EAGAIN (but never
|
||||
* EWOULDBLOCK) and change it to the pseudo-code OEAGAIN when
|
||||
* we see it. The error translation table will them map that
|
||||
* code to the HP-UX EAGAIN value.
|
||||
*/
|
||||
#define OEAGAIN 82
|
File diff suppressed because it is too large
Load Diff
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: hpux_exec.h 1.6 92/01/20$
|
||||
*
|
||||
* from: @(#)hpux_exec.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: hpux_exec.h,v 1.4 1994/05/23 08:04:17 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* HPUX a.out header format
|
||||
*/
|
||||
struct hpux_exec {
|
||||
long ha_magic; /* magic number */
|
||||
short ha_version; /* version ID */
|
||||
short ha_pad0; /* doesn't matter */
|
||||
long ha_misc; /* misc. info */
|
||||
unsigned long ha_text; /* size of text segment */
|
||||
unsigned long ha_data; /* size of initialized data */
|
||||
unsigned long ha_bss; /* size of uninitialized data */
|
||||
unsigned long ha_pad2[5]; /* doesn't matter */
|
||||
unsigned long ha_entry; /* entry point */
|
||||
unsigned long ha_pad3[4]; /* doesn't matter */
|
||||
};
|
||||
|
||||
#define HPUXM_VALID 0x00000001
|
||||
#define HPUXM_STKWT 0x02000000
|
||||
#define HPUXM_DATAWT 0x04000000
|
|
@ -1,291 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: hpux_net.c 1.8 93/08/02$
|
||||
*
|
||||
* from: @(#)hpux_net.c 8.2 (Berkeley) 9/9/93
|
||||
* $Id: hpux_net.c,v 1.6 1994/05/23 08:04:18 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Network related HP-UX compatibility routines
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/ktrace.h>
|
||||
|
||||
#include <hp300/hpux/hpux.h>
|
||||
|
||||
#define MINBSDIPCCODE 0x3EE
|
||||
#define NUMBSDIPC 32
|
||||
|
||||
/*
|
||||
* HPUX netioctl() to BSD syscall map.
|
||||
* Indexed by callno - MINBSDIPCCODE
|
||||
*/
|
||||
extern int socket(), listen(), bind(), oaccept(), connect(), orecv();
|
||||
extern int osend(), shutdown(), ogetsockname(), sendto();
|
||||
extern int orecvfrom(), ogetpeername();
|
||||
int hpux_getsockopt(), hpux_setsockopt();
|
||||
|
||||
struct hpuxtobsdipc {
|
||||
int (*rout)();
|
||||
int nargs;
|
||||
} hpuxtobsdipc[NUMBSDIPC] = {
|
||||
socket, 3, /* 3ee */ listen, 2, /* 3ef */
|
||||
bind, 3, /* 3f0 */ oaccept, 3, /* 3f1 */
|
||||
connect, 3, /* 3f2 */ orecv, 4, /* 3f3 */
|
||||
osend, 4, /* 3f4 */ shutdown, 2, /* 3f5 */
|
||||
ogetsockname, 3, /* 3f6 */ hpux_setsockopt,5, /* 3f7 */
|
||||
sendto, 6, /* 3f8 */ orecvfrom, 6, /* 3f9 */
|
||||
ogetpeername, 3, /* 3fa */ NULL, 0, /* 3fb */
|
||||
NULL, 0, /* 3fc */ NULL, 0, /* 3fd */
|
||||
NULL, 0, /* 3fe */ NULL, 0, /* 3ff */
|
||||
NULL, 0, /* 400 */ NULL, 0, /* 401 */
|
||||
NULL, 0, /* 402 */ NULL, 0, /* 403 */
|
||||
NULL, 0, /* 404 */ NULL, 0, /* 405 */
|
||||
NULL, 0, /* 406 */ NULL, 0, /* 407 */
|
||||
NULL, 0, /* 408 */ NULL, 0, /* 409 */
|
||||
NULL, 0, /* 40a */ hpux_getsockopt,5, /* 40b */
|
||||
NULL, 0, /* 40c */ NULL, 0, /* 40d */
|
||||
};
|
||||
|
||||
/*
|
||||
* Single system call entry to BSD style IPC.
|
||||
* Gleened from disassembled libbsdipc.a syscall entries.
|
||||
*/
|
||||
struct hpux_netioctl_args {
|
||||
int call;
|
||||
int *args;
|
||||
};
|
||||
hpux_netioctl(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct hpux_netioctl_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int *args, i;
|
||||
register int code;
|
||||
int error;
|
||||
|
||||
args = uap->args;
|
||||
code = uap->call - MINBSDIPCCODE;
|
||||
if (code < 0 || code >= NUMBSDIPC || hpuxtobsdipc[code].rout == NULL)
|
||||
return (EINVAL);
|
||||
if ((i = hpuxtobsdipc[code].nargs * sizeof (int)) &&
|
||||
(error = copyin((caddr_t)args, (caddr_t)uap, (u_int)i))) {
|
||||
#ifdef KTRACE
|
||||
if (KTRPOINT(p, KTR_SYSCALL))
|
||||
ktrsyscall(p->p_tracep, code + MINBSDIPCCODE,
|
||||
hpuxtobsdipc[code].nargs, (int *)uap);
|
||||
#endif
|
||||
return (error);
|
||||
}
|
||||
#ifdef KTRACE
|
||||
if (KTRPOINT(p, KTR_SYSCALL))
|
||||
ktrsyscall(p->p_tracep, code + MINBSDIPCCODE,
|
||||
hpuxtobsdipc[code].nargs, (int *)uap);
|
||||
#endif
|
||||
return ((*hpuxtobsdipc[code].rout)(p, uap, retval));
|
||||
}
|
||||
|
||||
socksetsize(size, m)
|
||||
int size;
|
||||
struct mbuf *m;
|
||||
{
|
||||
register int tmp;
|
||||
|
||||
if (size < sizeof(int)) {
|
||||
switch(size) {
|
||||
case 1:
|
||||
tmp = (int) *mtod(m, char *);
|
||||
break;
|
||||
case 2:
|
||||
tmp = (int) *mtod(m, short *);
|
||||
break;
|
||||
case 3:
|
||||
tmp = (((int) *mtod(m, int *)) >> 8) & 0xffffff;
|
||||
break;
|
||||
}
|
||||
*mtod(m, int *) = tmp;
|
||||
m->m_len = sizeof(int);
|
||||
} else {
|
||||
m->m_len = size;
|
||||
}
|
||||
}
|
||||
|
||||
struct hpux_setsockopt_args {
|
||||
int s;
|
||||
int level;
|
||||
int name;
|
||||
caddr_t val;
|
||||
int valsize;
|
||||
};
|
||||
/* ARGSUSED */
|
||||
hpux_setsockopt(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct hpux_setsockopt_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct file *fp;
|
||||
struct mbuf *m = NULL;
|
||||
int tmp, error;
|
||||
|
||||
if (error = getsock(p->p_fd, uap->s, &fp))
|
||||
return (error);
|
||||
if (uap->valsize > MLEN)
|
||||
return (EINVAL);
|
||||
if (uap->val) {
|
||||
m = m_get(M_WAIT, MT_SOOPTS);
|
||||
if (m == NULL)
|
||||
return (ENOBUFS);
|
||||
if (error = copyin(uap->val, mtod(m, caddr_t),
|
||||
(u_int)uap->valsize)) {
|
||||
(void) m_free(m);
|
||||
return (error);
|
||||
}
|
||||
if (uap->name == SO_LINGER) {
|
||||
tmp = *mtod(m, int *);
|
||||
mtod(m, struct linger *)->l_onoff = 1;
|
||||
mtod(m, struct linger *)->l_linger = tmp;
|
||||
m->m_len = sizeof(struct linger);
|
||||
} else
|
||||
socksetsize(uap->valsize, m);
|
||||
} else if (uap->name == ~SO_LINGER) {
|
||||
m = m_get(M_WAIT, MT_SOOPTS);
|
||||
if (m) {
|
||||
uap->name = SO_LINGER;
|
||||
mtod(m, struct linger *)->l_onoff = 0;
|
||||
m->m_len = sizeof(struct linger);
|
||||
}
|
||||
}
|
||||
return (sosetopt((struct socket *)fp->f_data, uap->level,
|
||||
uap->name, m));
|
||||
}
|
||||
|
||||
struct hpux_setsockopt2_args {
|
||||
int s;
|
||||
int level;
|
||||
int name;
|
||||
caddr_t val;
|
||||
int valsize;
|
||||
};
|
||||
/* ARGSUSED */
|
||||
hpux_setsockopt2(p, uap, retval)
|
||||
struct proc *p;
|
||||
register struct hpux_setsockopt2_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct file *fp;
|
||||
struct mbuf *m = NULL;
|
||||
int error;
|
||||
|
||||
if (error = getsock(p->p_fd, uap->s, &fp))
|
||||
return (error);
|
||||
if (uap->valsize > MLEN)
|
||||
return (EINVAL);
|
||||
if (uap->val) {
|
||||
m = m_get(M_WAIT, MT_SOOPTS);
|
||||
if (m == NULL)
|
||||
return (ENOBUFS);
|
||||
if (error = copyin(uap->val, mtod(m, caddr_t),
|
||||
(u_int)uap->valsize)) {
|
||||
(void) m_free(m);
|
||||
return (error);
|
||||
}
|
||||
socksetsize(uap->valsize, m);
|
||||
}
|
||||
return (sosetopt((struct socket *)fp->f_data, uap->level,
|
||||
uap->name, m));
|
||||
}
|
||||
|
||||
struct hpux_getsockopt_args {
|
||||
int s;
|
||||
int level;
|
||||
int name;
|
||||
caddr_t val;
|
||||
int *avalsize;
|
||||
};
|
||||
hpux_getsockopt(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct hpux_getsockopt_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct file *fp;
|
||||
struct mbuf *m = NULL;
|
||||
int valsize, error;
|
||||
|
||||
if (error = getsock(p->p_fd, uap->s, &fp))
|
||||
return (error);
|
||||
if (uap->val) {
|
||||
if (error = copyin((caddr_t)uap->avalsize, (caddr_t)&valsize,
|
||||
sizeof (valsize)))
|
||||
return (error);
|
||||
} else
|
||||
valsize = 0;
|
||||
if (error = sogetopt((struct socket *)fp->f_data, uap->level,
|
||||
uap->name, &m))
|
||||
goto bad;
|
||||
if (uap->val && valsize && m != NULL) {
|
||||
if (uap->name == SO_LINGER) {
|
||||
if (mtod(m, struct linger *)->l_onoff)
|
||||
*mtod(m, int *) = mtod(m, struct linger *)->l_linger;
|
||||
else
|
||||
*mtod(m, int *) = 0;
|
||||
m->m_len = sizeof(int);
|
||||
}
|
||||
if (valsize > m->m_len)
|
||||
valsize = m->m_len;
|
||||
error = copyout(mtod(m, caddr_t), uap->val, (u_int)valsize);
|
||||
if (error == 0)
|
||||
error = copyout((caddr_t)&valsize,
|
||||
(caddr_t)uap->avalsize, sizeof (valsize));
|
||||
}
|
||||
bad:
|
||||
if (m != NULL)
|
||||
(void) m_free(m);
|
||||
return (error);
|
||||
}
|
Loading…
Reference in New Issue