mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 00:19:24 +02:00
* NetBSD first rtl. Still not 100%, but close
This commit is contained in:
parent
2478552240
commit
e48ed0daea
176
rtl/netbsd/signal.inc
Normal file
176
rtl/netbsd/signal.inc
Normal file
@ -0,0 +1,176 @@
|
||||
{
|
||||
$Id$
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 1999-2000 by Jonas Maebe,
|
||||
member of the Free Pascal development team.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
|
||||
Const { For sending a signal }
|
||||
|
||||
SA_NOCLDSTOP = 8;
|
||||
SA_ONSTACK = $001; { take signal on signal stack }
|
||||
SA_RESTART = $002; { restart system call on signal return }
|
||||
SA_RESETHAND = $004; { reset to SIG_DFL when taking signal }
|
||||
SA_NODEFER = $010; { don't mask the signal we're delivering }
|
||||
SA_NOCLDWAIT = $020; { don't keep zombies around }
|
||||
SA_SIGINFO = $040; { signal handler with SA_SIGINFO args }
|
||||
SA_USERTRAMP = $100; { SUNOS compat: Do not bounce off kernel's sigtramp }
|
||||
|
||||
SIG_BLOCK = 1;
|
||||
SIG_UNBLOCK = 2;
|
||||
SIG_SETMASK = 3;
|
||||
|
||||
{BSD Checked}
|
||||
SIG_DFL = 0 ;
|
||||
SIG_IGN = 1 ;
|
||||
SIG_ERR = -1 ;
|
||||
|
||||
SIGHUP = 1;
|
||||
SIGINT = 2;
|
||||
SIGQUIT = 3;
|
||||
SIGILL = 4;
|
||||
SIGTRAP = 5;
|
||||
SIGABRT = 6;
|
||||
SIGIOT = 6;
|
||||
SIGEMT = 7;
|
||||
SIGFPE = 8;
|
||||
SIGKILL = 9;
|
||||
SIGBUS = 10;
|
||||
SIGSEGV = 11;
|
||||
SIGSYS = 12;
|
||||
SIGPIPE = 13;
|
||||
SIGALRM = 14;
|
||||
SIGTERM = 15;
|
||||
SIGURG = 16;
|
||||
SIGSTOP = 17;
|
||||
SIGTSTP = 18;
|
||||
SIGCONT = 19;
|
||||
SIGCHLD = 20;
|
||||
SIGTTIN = 21;
|
||||
SIGTTOU = 22;
|
||||
SIGIO = 23;
|
||||
SIGXCPU = 24;
|
||||
SIGXFSZ = 25;
|
||||
SIGVTALRM = 26;
|
||||
SIGPROF = 27;
|
||||
SIGWINCH = 28;
|
||||
SIGINFO = 29;
|
||||
SIGUSR1 = 30;
|
||||
SIGUSR2 = 31;
|
||||
|
||||
|
||||
{$packrecords C}
|
||||
const
|
||||
SI_PAD_SIZE = ((128/sizeof(longint)) - 3);
|
||||
|
||||
{
|
||||
* The sequence of the fields/registers in struct sigcontext should match
|
||||
* those in mcontext_t.
|
||||
}
|
||||
|
||||
type sigset_t = array[0..3] of cardinal;
|
||||
|
||||
PSigContextRec = ^SigContextRec;
|
||||
SigContextRec = record
|
||||
sc_mask : sigset_t; { signal mask to restore }
|
||||
sc_onstack : longint; { sigstack state to restore }
|
||||
|
||||
sc_gs : longint; { machine state (struct trapframe): }
|
||||
sc_fs : longint;
|
||||
sc_es : longint;
|
||||
sc_ds : longint;
|
||||
sc_edi : longint;
|
||||
sc_esi : longint;
|
||||
sc_ebp : longint;
|
||||
sc_isp : longint;
|
||||
sc_ebx : longint;
|
||||
sc_edx : longint;
|
||||
sc_ecx : longint;
|
||||
sc_eax : longint;
|
||||
sc_trapno : longint;
|
||||
sc_err : longint;
|
||||
sc_eip : longint;
|
||||
sc_cs : longint;
|
||||
sc_efl : longint;
|
||||
sc_esp : longint;
|
||||
sc_ss : longint;
|
||||
{
|
||||
* XXX FPU state is 27 * 4 bytes h/w, 1 * 4 bytes s/w (probably not
|
||||
* needed here), or that + 16 * 4 bytes for emulators (probably all
|
||||
* needed here). The "spare" bytes are mostly not spare.
|
||||
}
|
||||
en_cw : cardinal; { control word (16bits used) }
|
||||
en_sw : cardinal; { status word (16bits) }
|
||||
en_tw : cardinal; { tag word (16bits) }
|
||||
en_fip : cardinal; { floating point instruction pointer }
|
||||
en_fcs : word; { floating code segment selector }
|
||||
en_opcode : word; { opcode last executed (11 bits ) }
|
||||
en_foo : cardinal; { floating operand offset }
|
||||
en_fos : cardinal; { floating operand segment selector }
|
||||
fpr_acc : array[0..79] of char;
|
||||
fpr_ex_sw : cardinal;
|
||||
fpr_pad : array[0..63] of char;
|
||||
end;
|
||||
|
||||
SignalHandler = Procedure(Sig : Longint);cdecl;
|
||||
PSignalHandler = ^SignalHandler;
|
||||
SignalRestorer = Procedure;cdecl;
|
||||
PSignalRestorer = ^SignalRestorer;
|
||||
TSigAction = procedure(Sig: Longint; SigContext: SigContextRec;someptr:pointer);cdecl;
|
||||
|
||||
Sigset=sigset_t;
|
||||
TSigset=sigset_t;
|
||||
PSigSet = ^SigSet;
|
||||
|
||||
SigActionRec = packed record
|
||||
// Handler : record
|
||||
sa_handler : SignalHandler;
|
||||
// case byte of
|
||||
// 0: (Sh: SignalHandler);
|
||||
// 1: (Sa: TSigAction);
|
||||
// end;
|
||||
Sa_Flags : Longint;
|
||||
Sa_Mask : SigSet;
|
||||
end;
|
||||
|
||||
PSigActionRec = ^SigActionRec;
|
||||
|
||||
{
|
||||
Change action of process upon receipt of a signal.
|
||||
Signum specifies the signal (all except SigKill and SigStop).
|
||||
If Act is non-nil, it is used to specify the new action.
|
||||
If OldAct is non-nil the previous action is saved there.
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.1.2.1 2001/08/10 11:07:17 pierre
|
||||
New NetBSD files taken and adapted from FreeBSD
|
||||
|
||||
Revision 1.1.2.1 2000/09/16 11:19:08 marco
|
||||
* Moved files from BSD to FreeBSD directory, with some small changes
|
||||
|
||||
Revision 1.1.2.1 2000/09/10 16:18:41 marco
|
||||
initial version
|
||||
|
||||
Revision 1.2 2000/03/31 23:11:23 pierre
|
||||
* TSigAction Context param is the full record not a pointer
|
||||
|
||||
Revision 1.1 2000/03/31 13:24:28 jonas
|
||||
* signal handling using sigaction when compiled with -dnewsignal
|
||||
(allows multiple signals to be received in one run)
|
||||
|
||||
}
|
@ -172,7 +172,7 @@ begin
|
||||
{ Is it a dir ? }
|
||||
if not((st.mode and $f000)=$4000)then
|
||||
begin
|
||||
errno:=sys_enotdir;
|
||||
errno:=Esysenotdir;
|
||||
exit
|
||||
end;
|
||||
{ Open it}
|
||||
@ -343,7 +343,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-17 22:13:47 marco
|
||||
Revision 1.3 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.2 2003/01/17 22:13:47 marco
|
||||
* some updates
|
||||
|
||||
Revision 1.1.2.4 2002/09/20 07:04:44 pierre
|
||||
|
@ -92,9 +92,17 @@ Const
|
||||
{Constansts Termios/Ioctl (used in Do_IsDevice) }
|
||||
IOCtl_TCGETS=$5401; // TCGETS is also in termios.inc, but the sysunix needs only this
|
||||
|
||||
// a type, and a wrong one. only for quick port atm.
|
||||
type
|
||||
TCloneFunc=function(args:pointer):longint;cdecl;
|
||||
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-17 22:13:47 marco
|
||||
Revision 1.3 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.2 2003/01/17 22:13:47 marco
|
||||
* some updates
|
||||
|
||||
Revision 1.1.2.1 2001/08/10 11:07:17 pierre
|
||||
|
893
rtl/netbsd/sysctlh.inc
Normal file
893
rtl/netbsd/sysctlh.inc
Normal file
@ -0,0 +1,893 @@
|
||||
{
|
||||
$Id$
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 2001 by Marco van de Voort
|
||||
|
||||
The OS dependant sysctl constants.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
|
||||
CONST
|
||||
|
||||
{
|
||||
* Definitions for sysctl call. The sysctl call uses a hierarchical name
|
||||
* for objects that can be examined or modified. The name is expressed as
|
||||
* a sequence of integers. Like a file path name, the meaning of each
|
||||
* component depends on its place in the hierarchy. The top-level and kern
|
||||
* identifiers are defined here, and other identifiers are defined in the
|
||||
* respective subsystem header files.
|
||||
}
|
||||
|
||||
CTL_MAXNAME = 12; { largest number of components supported }
|
||||
|
||||
{
|
||||
* Each subsystem defined by sysctl defines a list of variables
|
||||
* for that subsystem. Each name is either a node with further
|
||||
* levels defined below it, or it is a leaf of some particular
|
||||
* type given below. Each sysctl level defines a set of name/type
|
||||
* pairs to be used by sysctl(1) in manipulating the subsystem.
|
||||
}
|
||||
|
||||
Type
|
||||
ctlname = record
|
||||
ctl_name : pchar; { subsystem name }
|
||||
ctl_type : cint { type of name }
|
||||
End;
|
||||
|
||||
Const
|
||||
CTLTYPE = $f; { Mask for the type }
|
||||
CTLTYPE_NODE = 1; { name is a node }
|
||||
CTLTYPE_INT = 2; { name describes an integer }
|
||||
CTLTYPE_STRING = 3; { name describes a string }
|
||||
CTLTYPE_QUAD = 4; { name describes a 64-bit number }
|
||||
CTLTYPE_OPAQUE = 5; { name describes a structure }
|
||||
CTLTYPE_STRUCT = CTLTYPE_OPAQUE; { name describes a structure }
|
||||
CTLTYPE_UINT = 6; { name describes an unsigned integer }
|
||||
CTLTYPE_LONG = 7; { name describes a long }
|
||||
CTLTYPE_ULONG = 8; { name describes an unsigned long }
|
||||
|
||||
CTLFLAG_RD = $80000000; { Allow reads of variable }
|
||||
CTLFLAG_WR = $40000000; { Allow writes to the variable }
|
||||
CTLFLAG_RW = (CTLFLAG_RD OR CTLFLAG_WR);
|
||||
CTLFLAG_NOLOCK = $20000000; { XXX Don't Lock }
|
||||
CTLFLAG_ANYBODY = $10000000; { All users can set this var }
|
||||
CTLFLAG_SECURE = $8000000; { Permit set only if securelevel<=0 }
|
||||
CTLFLAG_PRISON = $4000000; { Prisoned roots can fiddle }
|
||||
CTLFLAG_DYN = $2000000; { Dynamic oid - can be freed }
|
||||
|
||||
{
|
||||
* USE THIS instead of a hardwired number from the categories below
|
||||
* to get dynamically assigned sysctl entries using the linker-set
|
||||
* technology. This is the way nearly all new sysctl variables should
|
||||
* be implemented.
|
||||
* e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
|
||||
}
|
||||
OID_AUTO = (-1);
|
||||
|
||||
{
|
||||
* Top-level identifiers
|
||||
}
|
||||
CTL_UNSPEC = 0;
|
||||
CTL_KERN = 1; { "high kernel": proc, limits }
|
||||
CTL_VM = 2; { virtual memory }
|
||||
CTL_VFS = 3; { file system, mount type is next }
|
||||
CTL_NET = 4; { network, see socket.h }
|
||||
CTL_DEBUG = 5; { debugging parameters }
|
||||
CTL_HW = 6; { generic cpu/io }
|
||||
CTL_MACHDEP = 7; { machine dependent }
|
||||
CTL_USER = 8; { user-level }
|
||||
CTL_P1003_1B = 9; { POSIX 1003.1B }
|
||||
CTL_MAXID = 10; { number of valid top-level ids }
|
||||
|
||||
|
||||
{
|
||||
* CTL_KERN identifiers
|
||||
}
|
||||
KERN_OSTYPE = 1; { string: system version }
|
||||
KERN_OSRELEASE = 2; { string: system release }
|
||||
KERN_OSREV = 3; { int: system revision }
|
||||
KERN_VERSION = 4; { string: compile time info }
|
||||
KERN_MAXVNODES = 5; { int: max vnodes }
|
||||
KERN_MAXPROC = 6; { int: max processes }
|
||||
KERN_MAXFILES = 7; { int: max open files }
|
||||
KERN_ARGMAX = 8; { int: max arguments to exec }
|
||||
KERN_SECURELVL = 9; { int: system security level }
|
||||
KERN_HOSTNAME = 10; { string: hostname }
|
||||
KERN_HOSTID = 11; { int: host identifier }
|
||||
KERN_CLOCKRATE = 12; { struct: struct clockrate }
|
||||
KERN_VNODE = 13; { struct: vnode structures }
|
||||
KERN_PROC = 14; { struct: process entries }
|
||||
KERN_FILE = 15; { struct: file entries }
|
||||
KERN_PROF = 16; { node: kernel profiling info }
|
||||
KERN_POSIX1 = 17; { int: POSIX.1 version }
|
||||
KERN_NGROUPS = 18; { int: # of supplemental group ids }
|
||||
KERN_JOB_CONTROL = 19; { int: is job control available }
|
||||
KERN_SAVED_IDS = 20; { int: saved set-user/group-ID }
|
||||
KERN_BOOTTIME = 21; { struct: time kernel was booted }
|
||||
KERN_NISDOMAINNAME = 22; { string: YP domain name }
|
||||
KERN_UPDATEINTERVAL = 23; { int: update process sleep time }
|
||||
KERN_OSRELDATE = 24; { int: OS release date }
|
||||
KERN_NTP_PLL = 25; { node: NTP PLL control }
|
||||
KERN_BOOTFILE = 26; { string: name of booted kernel }
|
||||
KERN_MAXFILESPERPROC = 27; { int: max open files per proc }
|
||||
KERN_MAXPROCPERUID = 28; { int: max processes per uid }
|
||||
KERN_DUMPDEV = 29; { dev_t: device to dump on }
|
||||
KERN_IPC = 30; { node: anything related to IPC }
|
||||
KERN_DUMMY = 31; { unused }
|
||||
KERN_PS_STRINGS = 32; { int: address of PS_STRINGS }
|
||||
KERN_USRSTACK = 33; { int: address of USRSTACK }
|
||||
KERN_LOGSIGEXIT = 34; { int: do we log sigexit procs? }
|
||||
KERN_MAXID = 35; { number of valid kern ids }
|
||||
|
||||
|
||||
|
||||
{
|
||||
* KERN_PROC subtypes
|
||||
}
|
||||
KERN_PROC_ALL = 0; { everything }
|
||||
KERN_PROC_PID = 1; { by process id }
|
||||
KERN_PROC_PGRP = 2; { by process group id }
|
||||
KERN_PROC_SESSION = 3; { by session of pid }
|
||||
KERN_PROC_TTY = 4; { by controlling tty }
|
||||
KERN_PROC_UID = 5; { by effective uid }
|
||||
KERN_PROC_RUID = 6; { by real uid }
|
||||
KERN_PROC_ARGS = 7; { get/set arguments/proctitle }
|
||||
|
||||
{
|
||||
* KERN_IPC identifiers
|
||||
}
|
||||
KIPC_MAXSOCKBUF = 1; { int: max size of a socket buffer }
|
||||
KIPC_SOCKBUF_WASTE = 2; { int: wastage factor in sockbuf }
|
||||
KIPC_SOMAXCONN = 3; { int: max length of connection q }
|
||||
KIPC_MAX_LINKHDR = 4; { int: max length of link header }
|
||||
KIPC_MAX_PROTOHDR = 5; { int: max length of network header }
|
||||
KIPC_MAX_HDR = 6; { int: max total length of headers }
|
||||
KIPC_MAX_DATALEN = 7; { int: max length of data? }
|
||||
KIPC_MBSTAT = 8; { struct: mbuf usage statistics }
|
||||
KIPC_NMBCLUSTERS = 9; { int: maximum mbuf clusters }
|
||||
|
||||
{
|
||||
* CTL_HW identifiers
|
||||
}
|
||||
HW_MACHINE = 1; { string: machine class }
|
||||
HW_MODEL = 2; { string: specific machine model }
|
||||
HW_NCPU = 3; { int: number of cpus }
|
||||
HW_BYTEORDER = 4; { int: machine byte order }
|
||||
HW_PHYSMEM = 5; { int: total memory }
|
||||
HW_USERMEM = 6; { int: non-kernel memory }
|
||||
HW_PAGESIZE = 7; { int: software page size }
|
||||
HW_DISKNAMES = 8; { strings: disk drive names }
|
||||
HW_DISKSTATS = 9; { struct: diskstats[] }
|
||||
HW_FLOATINGPT = 10; { int: has HW floating point? }
|
||||
HW_MACHINE_ARCH = 11; { string: machine architecture }
|
||||
HW_MAXID = 12; { number of valid hw ids }
|
||||
|
||||
|
||||
{
|
||||
* CTL_USER definitions
|
||||
}
|
||||
USER_CS_PATH = 1; { string: _CS_PATH }
|
||||
USER_BC_BASE_MAX = 2; { int: BC_BASE_MAX }
|
||||
USER_BC_DIM_MAX = 3; { int: BC_DIM_MAX }
|
||||
USER_BC_SCALE_MAX = 4; { int: BC_SCALE_MAX }
|
||||
USER_BC_STRING_MAX = 5; { int: BC_STRING_MAX }
|
||||
USER_COLL_WEIGHTS_MAX = 6; { int: COLL_WEIGHTS_MAX }
|
||||
USER_EXPR_NEST_MAX = 7; { int: EXPR_NEST_MAX }
|
||||
USER_LINE_MAX = 8; { int: LINE_MAX }
|
||||
USER_RE_DUP_MAX = 9; { int: RE_DUP_MAX }
|
||||
USER_POSIX2_VERSION = 10; { int: POSIX2_VERSION }
|
||||
USER_POSIX2_C_BIND = 11; { int: POSIX2_C_BIND }
|
||||
USER_POSIX2_C_DEV = 12; { int: POSIX2_C_DEV }
|
||||
USER_POSIX2_CHAR_TERM = 13; { int: POSIX2_CHAR_TERM }
|
||||
USER_POSIX2_FORT_DEV = 14; { int: POSIX2_FORT_DEV }
|
||||
USER_POSIX2_FORT_RUN = 15; { int: POSIX2_FORT_RUN }
|
||||
USER_POSIX2_LOCALEDEF = 16; { int: POSIX2_LOCALEDEF }
|
||||
USER_POSIX2_SW_DEV = 17; { int: POSIX2_SW_DEV }
|
||||
USER_POSIX2_UPE = 18; { int: POSIX2_UPE }
|
||||
USER_STREAM_MAX = 19; { int: POSIX2_STREAM_MAX }
|
||||
USER_TZNAME_MAX = 20; { int: POSIX2_TZNAME_MAX }
|
||||
USER_MAXID = 21; { number of valid user ids }
|
||||
|
||||
|
||||
CTL_P1003_1B_ASYNCHRONOUS_IO = 1 ; { boolean }
|
||||
CTL_P1003_1B_MAPPED_FILES = 2 ; { boolean }
|
||||
CTL_P1003_1B_MEMLOCK = 3 ; { boolean }
|
||||
CTL_P1003_1B_MEMLOCK_RANGE = 4 ; { boolean }
|
||||
CTL_P1003_1B_MEMORY_PROTECTION = 5 ; { boolean }
|
||||
CTL_P1003_1B_MESSAGE_PASSING = 6 ; { boolean }
|
||||
CTL_P1003_1B_PRIORITIZED_IO = 7 ; { boolean }
|
||||
CTL_P1003_1B_PRIORITY_SCHEDULING = 8 ; { boolean }
|
||||
CTL_P1003_1B_REALTIME_SIGNALS = 9 ; { boolean }
|
||||
CTL_P1003_1B_SEMAPHORES = 10; { boolean }
|
||||
CTL_P1003_1B_FSYNC = 11; { boolean }
|
||||
CTL_P1003_1B_SHARED_MEMORY_OBJECTS = 12; { boolean }
|
||||
CTL_P1003_1B_SYNCHRONIZED_IO = 13; { boolean }
|
||||
CTL_P1003_1B_TIMERS = 14; { boolean }
|
||||
CTL_P1003_1B_AIO_LISTIO_MAX = 15; { int }
|
||||
CTL_P1003_1B_AIO_MAX = 16; { int }
|
||||
CTL_P1003_1B_AIO_PRIO_DELTA_MAX = 17; { int }
|
||||
CTL_P1003_1B_DELAYTIMER_MAX = 18; { int }
|
||||
CTL_P1003_1B_MQ_OPEN_MAX = 19; { int }
|
||||
CTL_P1003_1B_PAGESIZE = 20; { int }
|
||||
CTL_P1003_1B_RTSIG_MAX = 21; { int }
|
||||
CTL_P1003_1B_SEM_NSEMS_MAX = 22; { int }
|
||||
CTL_P1003_1B_SEM_VALUE_MAX = 23; { int }
|
||||
CTL_P1003_1B_SIGQUEUE_MAX = 24; { int }
|
||||
CTL_P1003_1B_TIMER_MAX = 25; { int }
|
||||
|
||||
CTL_P1003_1B_MAXID = 26;
|
||||
|
||||
{ LongestStringInCtlNames = 21;}
|
||||
|
||||
|
||||
Const
|
||||
|
||||
CTL_NAMES : Array[0..9] OF CtlNameRec = (
|
||||
( Name: ''; CtlType: 0 ),
|
||||
( Name: 'kern'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'vm'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'vfs'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'net'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'debug'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'hw'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'machdep'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'user'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'p1003_1b'; CtlType : CTLTYPE_NODE ));
|
||||
|
||||
CTL_KERN_NAME : Array[0..34] OF CtlNameRec = (
|
||||
( Name: ''; CtlType: 0 ),
|
||||
( Name: 'ostype'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'osrelease'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'osrevision'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'version'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'maxvnodes'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'maxproc'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'maxfiles'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'argmax'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'securelevel'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'hostname'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'hostid'; CtlType : CTLTYPE_UINT ),
|
||||
( Name: 'clockrate'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'vnode'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'proc'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'file'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'profiling'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'posix1version'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'ngroups'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'job_control'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'saved_ids'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'boottime'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'nisdomainname'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'update'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'osreldate'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'ntp_pll'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'bootfile'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'maxfilesperproc'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'maxprocperuid'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'dumpdev'; CtlType : CTLTYPE_STRUCT ), { we lie; don't print as int }
|
||||
( Name: 'ipc'; CtlType : CTLTYPE_NODE ),
|
||||
( Name: 'dummy'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'ps_strings'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'usrstack'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'logsigexit'; CtlType : CTLTYPE_INT ));
|
||||
|
||||
{
|
||||
* CTL_VFS identifiers
|
||||
}
|
||||
CTL_VFS_NAMES : array[0..0] of CTLNameRec = (
|
||||
( Name: 'vfsconf'; CtlType : CTLTYPE_STRUCT ));
|
||||
|
||||
|
||||
CTL_HW_NAMES : array[0..10] of CTLNameRec = (
|
||||
( Name: ''; CtlType: 0 ),
|
||||
( Name: 'machine'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'model'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'ncpu'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'byteorder'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'physmem'; CtlType : CTLTYPE_UINT ),
|
||||
( Name: 'usermem'; CtlType : CTLTYPE_UINT ),
|
||||
( Name: 'pagesize'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'disknames'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'diskstats'; CtlType : CTLTYPE_STRUCT ),
|
||||
( Name: 'floatingpoint'; CtlType : CTLTYPE_INT ));
|
||||
|
||||
|
||||
CTL_USER_NAMES : array[0..20] of CTLNameRec = (
|
||||
( Name :''; CtlType: 0 ),
|
||||
( Name: 'cs_path'; CtlType : CTLTYPE_STRING ),
|
||||
( Name: 'bc_base_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'bc_dim_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'bc_scale_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'bc_string_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'coll_weights_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'expr_nest_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'line_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 're_dup_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_version'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_c_bind'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_c_dev'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_char_term'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_fort_dev'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_fort_run'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_localedef'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_sw_dev'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'posix2_upe'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'stream_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'tzname_max'; CtlType : CTLTYPE_INT ));
|
||||
|
||||
CTL_P1003_1B_NAMES : array[0..25] of CTLNameRec = (
|
||||
( Name: ''; CtlType: 0 ),
|
||||
( Name: 'asynchronous_io'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'mapped_files'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'memlock'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'memlock_range'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'memory_protection'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'message_passing'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'prioritized_io'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'priority_scheduling'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'realtime_signals'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'semaphores'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'fsync'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'shared_memory_objects'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'synchronized_io'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'timers'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'aio_listio_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'aio_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'aio_prio_delta_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'delaytimer_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'mq_open_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'pagesize'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'rtsig_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'nsems_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'sem_value_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'sigqueue_max'; CtlType : CTLTYPE_INT ),
|
||||
( Name: 'timer_max'; CtlType : CTLTYPE_INT ));
|
||||
|
||||
|
||||
const
|
||||
{
|
||||
* Types
|
||||
}
|
||||
SOCK_STREAM = 1; { stream socket }
|
||||
SOCK_DGRAM = 2; { datagram socket }
|
||||
SOCK_RAW = 3; { raw-protocol interface }
|
||||
SOCK_RDM = 4; { reliably-delivered message }
|
||||
SOCK_SEQPACKET = 5; { sequenced packet stream }
|
||||
|
||||
{
|
||||
* Address families.
|
||||
}
|
||||
AF_UNSPEC = 0; { unspecified }
|
||||
AF_LOCAL = 1; { local to host (Name:pipes;CtlType: portals) }
|
||||
AF_UNIX = AF_LOCAL; { backward compatibility }
|
||||
AF_INET = 2; { internetwork: UDP, TCP, etc. }
|
||||
AF_IMPLINK = 3; { arpanet imp addresses }
|
||||
AF_PUP = 4; { pup protocols: e.g. BSP }
|
||||
AF_CHAOS = 5; { mit CHAOS protocols }
|
||||
AF_NS = 6; { XEROX NS protocols }
|
||||
AF_ISO = 7; { ISO protocols }
|
||||
AF_OSI = AF_ISO;
|
||||
AF_ECMA = 8; { European computer manufacturers }
|
||||
AF_DATAKIT = 9; { datakit protocols }
|
||||
AF_CCITT = 10; { CCITT protocols, X.25 etc }
|
||||
AF_SNA = 11; { IBM SNA }
|
||||
AF_DECnet = 12; { DECnet }
|
||||
AF_DLI = 13; { DEC Direct data link interface }
|
||||
AF_LAT = 14; { LAT }
|
||||
AF_HYLINK = 15; { NSC Hyperchannel }
|
||||
AF_APPLETALK = 16; { Apple Talk }
|
||||
AF_ROUTE = 17; { Internal Routing Protocol }
|
||||
AF_LINK = 18; { Link layer interface }
|
||||
pseudo_AF_XTP = 19; { eXpress Transfer Protocol (Name:no AF) }
|
||||
AF_COIP = 20; { connection-oriented IP, aka ST II }
|
||||
AF_CNT = 21; { Computer Network Technology }
|
||||
pseudo_AF_RTIP = 22; { Help Identify RTIP packets }
|
||||
AF_IPX = 23; { Novell Internet Protocol }
|
||||
AF_SIP = 24; { Simple Internet Protocol }
|
||||
pseudo_AF_PIP = 25; { Help Identify PIP packets }
|
||||
AF_ISDN = 26; { Integrated Services Digital Network}
|
||||
AF_E164 = AF_ISDN; { CCITT E.164 recommendation }
|
||||
pseudo_AF_KEY = 27; { Internal key-management function }
|
||||
AF_INET6 = 28; { IPv6 }
|
||||
AF_NATM = 29; { native ATM access }
|
||||
AF_ATM = 30; { ATM }
|
||||
pseudo_AF_HDRCMPLT = 31; { Used by BPF to not rewrite headers
|
||||
* in interface output routine
|
||||
}
|
||||
AF_NETGRAPH = 32; { Netgraph sockets }
|
||||
|
||||
AF_MAX = 33;
|
||||
|
||||
{
|
||||
* Protocol families, same as address families for now.
|
||||
}
|
||||
|
||||
{
|
||||
* Definitions for network related sysctl, CTL_NET.
|
||||
*
|
||||
* Second level is protocol family.
|
||||
* Third level is protocol number.
|
||||
*
|
||||
* Further levels are defined by the individual families below.
|
||||
}
|
||||
NET_MAXID = AF_MAX;
|
||||
|
||||
CTL_NET_NAMES : Array[0..32] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'unix';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'inet';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'implink';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'pup';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'chaos';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'xerox_ns';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'iso';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'emca';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'datakit';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'ccitt';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'ibm_sna';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'decnet';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'dec_dli';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'lat';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'hylink';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'appletalk';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'route';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'link_layer';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'xtp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'coip';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'cnt';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'rtip';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'ipx';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'sip';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'pip';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'isdn';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'key';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'inet6';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'natm';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'atm';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'hdrcomplete';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'netgraph';CtlType: CTLTYPE_NODE ));
|
||||
|
||||
{
|
||||
* PF_ROUTE - Routing table
|
||||
*
|
||||
* Three additional levels are defined:
|
||||
* Fourth: address family, 0 is wildcard
|
||||
* Fifth: type of info, defined below
|
||||
* Sixth: flag(Name:s) to mask with for NET_RT_FLAGS
|
||||
}
|
||||
NET_RT_DUMP = 1; { dump; may limit to a.f. }
|
||||
NET_RT_FLAGS = 2; { by flags, e.g. RESOLVING }
|
||||
NET_RT_IFLIST = 3; { survey interface list }
|
||||
NET_RT_MAXID = 4;
|
||||
|
||||
CTL_NET_RT_NAMES : Array[0..3] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'dump';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'flags';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'iflist';CtlType: CTLTYPE_STRUCT ));
|
||||
|
||||
{
|
||||
* Possible states of profiling.
|
||||
}
|
||||
GMON_PROF_ON = 0;
|
||||
GMON_PROF_BUSY = 1;
|
||||
GMON_PROF_ERROR = 2;
|
||||
GMON_PROF_OFF = 3;
|
||||
GMON_PROF_HIRES = 4;
|
||||
|
||||
{
|
||||
* Sysctl definitions for extracting profiling information from the kernel.
|
||||
}
|
||||
GPROF_STATE = 0; { int: profiling enabling variable }
|
||||
GPROF_COUNT = 1; { struct: profile tick count buffer }
|
||||
GPROF_FROMS = 2; { struct: from location hash bucket }
|
||||
GPROF_TOS = 3; { struct: destination/count structure }
|
||||
GPROF_GMONPARAM = 4; { struct: profiling parameters (Name:see above) }
|
||||
|
||||
{
|
||||
* CTL_VM identifiers
|
||||
}
|
||||
VM_METER = 1; { struct vmmeter }
|
||||
VM_LOADAVG = 2; { struct loadavg }
|
||||
VM_V_FREE_MIN = 3; { cnt.v_free_min }
|
||||
VM_V_FREE_TARGET = 4; { cnt.v_free_target }
|
||||
VM_V_FREE_RESERVED = 5; { cnt.v_free_reserved }
|
||||
VM_V_INACTIVE_TARGET = 6; { cnt.v_inactive_target }
|
||||
VM_V_CACHE_MIN = 7; { cnt.v_cache_max }
|
||||
VM_V_CACHE_MAX = 8; { cnt.v_cache_min }
|
||||
VM_V_PAGEOUT_FREE_MIN = 9; { cnt.v_pageout_free_min }
|
||||
VM_PAGEOUT_ALGORITHM = 10; { pageout algorithm }
|
||||
VM_SWAPPING_ENABLED = 11; { swapping enabled }
|
||||
VM_MAXID = 12; { number of valid vm ids }
|
||||
|
||||
CTL_VM_NAMES : Array[0..11] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'vmmeter';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'loadavg';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'v_free_min';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_free_target';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_free_reserved';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_inactive_target';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_cache_min';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_cache_max';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'v_pageout_free_min';CtlType: CTLTYPE_INT),
|
||||
(Name: 'pageout_algorithm';CtlType: CTLTYPE_INT),
|
||||
(Name: 'swapping_enabled';CtlType: CTLTYPE_INT));
|
||||
|
||||
{
|
||||
* Protocols (Name:RFC 1700)
|
||||
}
|
||||
IPPROTO_IP = 0; { dummy for IP }
|
||||
IPPROTO_HOPOPTS = 0; { IP6 hop-by-hop options }
|
||||
IPPROTO_ICMP = 1; { control message protocol }
|
||||
IPPROTO_IGMP = 2; { group mgmt protocol }
|
||||
IPPROTO_GGP = 3; { gateway^2 (Name:deprecated) }
|
||||
IPPROTO_IPV4 = 4; { IPv4 encapsulation }
|
||||
IPPROTO_IPIP = IPPROTO_IPV4; { for compatibility }
|
||||
IPPROTO_TCP = 6; { tcp }
|
||||
IPPROTO_ST = 7; { Stream protocol II }
|
||||
IPPROTO_EGP = 8; { exterior gateway protocol }
|
||||
IPPROTO_PIGP = 9; { private interior gateway }
|
||||
IPPROTO_RCCMON = 10; { BBN RCC Monitoring }
|
||||
IPPROTO_NVPII = 11; { network voice protocol}
|
||||
IPPROTO_PUP = 12; { pup }
|
||||
IPPROTO_ARGUS = 13; { Argus }
|
||||
IPPROTO_EMCON = 14; { EMCON }
|
||||
IPPROTO_XNET = 15; { Cross Net Debugger }
|
||||
IPPROTO_CHAOS = 16; { Chaos}
|
||||
IPPROTO_UDP = 17; { user datagram protocol }
|
||||
IPPROTO_MUX = 18; { Multiplexing }
|
||||
IPPROTO_MEAS = 19; { DCN Measurement Subsystems }
|
||||
IPPROTO_HMP = 20; { Host Monitoring }
|
||||
IPPROTO_PRM = 21; { Packet Radio Measurement }
|
||||
IPPROTO_IDP = 22; { xns idp }
|
||||
IPPROTO_TRUNK1 = 23; { Trunk-1 }
|
||||
IPPROTO_TRUNK2 = 24; { Trunk-2 }
|
||||
IPPROTO_LEAF1 = 25; { Leaf-1 }
|
||||
IPPROTO_LEAF2 = 26; { Leaf-2 }
|
||||
IPPROTO_RDP = 27; { Reliable Data }
|
||||
IPPROTO_IRTP = 28; { Reliable Transaction }
|
||||
IPPROTO_TP = 29; { tp-4 w/ class negotiation }
|
||||
IPPROTO_BLT = 30; { Bulk Data Transfer }
|
||||
IPPROTO_NSP = 31; { Network Services }
|
||||
IPPROTO_INP = 32; { Merit Internodal }
|
||||
IPPROTO_SEP = 33; { Sequential Exchange }
|
||||
IPPROTO_3PC = 34; { Third Party Connect }
|
||||
IPPROTO_IDPR = 35; { InterDomain Policy Routing }
|
||||
IPPROTO_XTP = 36; { XTP }
|
||||
IPPROTO_DDP = 37; { Datagram Delivery }
|
||||
IPPROTO_CMTP = 38; { Control Message Transport }
|
||||
IPPROTO_TPXX = 39; { TP++ Transport }
|
||||
IPPROTO_IL = 40; { IL transport protocol }
|
||||
IPPROTO_IPV6 = 41; { IP6 header }
|
||||
IPPROTO_SDRP = 42; { Source Demand Routing }
|
||||
IPPROTO_ROUTING = 43; { IP6 routing header }
|
||||
IPPROTO_FRAGMENT = 44; { IP6 fragmentation header }
|
||||
IPPROTO_IDRP = 45; { InterDomain Routing}
|
||||
IPPROTO_RSVP = 46; { resource reservation }
|
||||
IPPROTO_GRE = 47; { General Routing Encap. }
|
||||
IPPROTO_MHRP = 48; { Mobile Host Routing }
|
||||
IPPROTO_BHA = 49; { BHA }
|
||||
IPPROTO_ESP = 50; { IP6 Encap Sec. Payload }
|
||||
IPPROTO_AH = 51; { IP6 Auth Header }
|
||||
IPPROTO_INLSP = 52; { Integ. Net Layer Security }
|
||||
IPPROTO_SWIPE = 53; { IP with encryption }
|
||||
IPPROTO_NHRP = 54; { Next Hop Resolution }
|
||||
{ 55-57: Unassigned }
|
||||
IPPROTO_ICMPV6 = 58; { ICMP6 }
|
||||
IPPROTO_NONE = 59; { IP6 no next header }
|
||||
IPPROTO_DSTOPTS = 60; { IP6 destination option }
|
||||
IPPROTO_AHIP = 61; { any host internal protocol }
|
||||
IPPROTO_CFTP = 62; { CFTP }
|
||||
IPPROTO_HELLO = 63; { 'hello' routing protocol }
|
||||
IPPROTO_SATEXPAK = 64; { SATNET/Backroom EXPAK }
|
||||
IPPROTO_KRYPTOLAN = 65; { Kryptolan }
|
||||
IPPROTO_RVD = 66; { Remote Virtual Disk }
|
||||
IPPROTO_IPPC = 67; { Pluribus Packet Core }
|
||||
IPPROTO_ADFS = 68; { Any distributed FS }
|
||||
IPPROTO_SATMON = 69; { Satnet Monitoring }
|
||||
IPPROTO_VISA = 70; { VISA Protocol }
|
||||
IPPROTO_IPCV = 71; { Packet Core Utility }
|
||||
IPPROTO_CPNX = 72; { Comp. Prot. Net. Executive }
|
||||
IPPROTO_CPHB = 73; { Comp. Prot. HeartBeat }
|
||||
IPPROTO_WSN = 74; { Wang Span Network }
|
||||
IPPROTO_PVP = 75; { Packet Video Protocol }
|
||||
IPPROTO_BRSATMON = 76; { BackRoom SATNET Monitoring }
|
||||
IPPROTO_ND = 77; { Sun net disk proto (Name:temp.) }
|
||||
IPPROTO_WBMON = 78; { WIDEBAND Monitoring }
|
||||
IPPROTO_WBEXPAK = 79; { WIDEBAND EXPAK }
|
||||
IPPROTO_EON = 80; { ISO cnlp }
|
||||
IPPROTO_VMTP = 81; { VMTP }
|
||||
IPPROTO_SVMTP = 82; { Secure VMTP }
|
||||
IPPROTO_VINES = 83; { Banyon VINES }
|
||||
IPPROTO_TTP = 84; { TTP }
|
||||
IPPROTO_IGP = 85; { NSFNET-IGP }
|
||||
IPPROTO_DGP = 86; { dissimilar gateway prot. }
|
||||
IPPROTO_TCF = 87; { TCF }
|
||||
IPPROTO_IGRP = 88; { Cisco/GXS IGRP }
|
||||
IPPROTO_OSPFIGP = 89; { OSPFIGP }
|
||||
IPPROTO_SRPC = 90; { Strite RPC protocol }
|
||||
IPPROTO_LARP = 91; { Locus Address Resoloution }
|
||||
IPPROTO_MTP = 92; { Multicast Transport }
|
||||
IPPROTO_AX25 = 93; { AX.25 Frames }
|
||||
IPPROTO_IPEIP = 94; { IP encapsulated in IP }
|
||||
IPPROTO_MICP = 95; { Mobile Int.ing control }
|
||||
IPPROTO_SCCSP = 96; { Semaphore Comm. security }
|
||||
IPPROTO_ETHERIP = 97; { Ethernet IP encapsulation }
|
||||
IPPROTO_ENCAP = 98; { encapsulation header }
|
||||
IPPROTO_APES = 99; { any private encr. scheme }
|
||||
IPPROTO_GMTP = 100; { GMTP}
|
||||
IPPROTO_IPCOMP = 108; { payload compression (Name:IPComp) }
|
||||
{ 101-254: Partly Unassigned }
|
||||
IPPROTO_PIM = 103; { Protocol Independent Mcast }
|
||||
IPPROTO_PGM = 113; { PGM }
|
||||
{ 255: Reserved }
|
||||
{ BSD Private, local use, namespace incursion }
|
||||
IPPROTO_DIVERT = 254; { divert pseudo-protocol }
|
||||
IPPROTO_RAW = 255; { raw IP packet }
|
||||
IPPROTO_MAX = 256;
|
||||
|
||||
{ last return value of *_input(Name:);CtlType: meaning 'all job for this pkt is done'. }
|
||||
IPPROTO_DONE = 257;
|
||||
|
||||
|
||||
{
|
||||
* Options for use with [gs]etsockopt at the IP level.
|
||||
* First word of comment is data type; bool is stored in int.
|
||||
}
|
||||
IP_OPTIONS = 1; { buf/ip_opts; set/get IP options }
|
||||
IP_HDRINCL = 2; { int; header is included with data }
|
||||
IP_TOS = 3; { int; IP type of service and preced. }
|
||||
IP_TTL = 4; { int; IP time to live }
|
||||
IP_RECVOPTS = 5; { bool; receive all IP opts w/dgram }
|
||||
IP_RECVRETOPTS = 6; { bool; receive IP opts for response }
|
||||
IP_RECVDSTADDR = 7; { bool; receive IP dst addr w/dgram }
|
||||
IP_RETOPTS = 8; { ip_opts; set/get IP options }
|
||||
IP_MULTICAST_IF = 9; { u_char; set/get IP multicast i/f }
|
||||
IP_MULTICAST_TTL = 10; { u_char; set/get IP multicast ttl }
|
||||
IP_MULTICAST_LOOP = 11; { u_char; set/get IP multicast loopback }
|
||||
IP_ADD_MEMBERSHIP = 12; { ip_mreq; add an IP group membership }
|
||||
IP_DROP_MEMBERSHIP = 13; { ip_mreq; drop an IP group membership }
|
||||
IP_MULTICAST_VIF = 14; { set/get IP mcast virt. iface }
|
||||
IP_RSVP_ON = 15; { enable RSVP in kernel }
|
||||
IP_RSVP_OFF = 16; { disable RSVP in kernel }
|
||||
IP_RSVP_VIF_ON = 17; { set RSVP per-vif socket }
|
||||
IP_RSVP_VIF_OFF = 18; { unset RSVP per-vif socket }
|
||||
IP_PORTRANGE = 19; { int; range to choose for unspec port }
|
||||
IP_RECVIF = 20; { bool; receive reception if w/dgram }
|
||||
{ for IPSEC }
|
||||
IP_IPSEC_POLICY = 21; { int; set/get security policy }
|
||||
IP_FAITH = 22; { bool; accept FAITH'ed connections }
|
||||
|
||||
IP_FW_ADD = 50; { add a firewall rule to chain }
|
||||
IP_FW_DEL = 51; { delete a firewall rule from chain }
|
||||
IP_FW_FLUSH = 52; { flush firewall rule chain }
|
||||
IP_FW_ZERO = 53; { clear single/all firewall counter(Name:s) }
|
||||
IP_FW_GET = 54; { get entire firewall rule chain }
|
||||
IP_FW_RESETLOG = 55; { reset logging counters }
|
||||
|
||||
IP_DUMMYNET_CONFIGURE = 60; { add/configure a dummynet pipe }
|
||||
IP_DUMMYNET_DEL = 61; { delete a dummynet pipe from chain }
|
||||
IP_DUMMYNET_FLUSH = 62; { flush dummynet }
|
||||
IP_DUMMYNET_GET = 64; { get entire dummynet pipes }
|
||||
|
||||
{
|
||||
* Defaults and limits for options
|
||||
}
|
||||
IP_DEFAULT_MULTICAST_TTL = 1; { normally limit m'casts to 1 hop }
|
||||
IP_DEFAULT_MULTICAST_LOOP = 1; { normally hear sends if a member }
|
||||
IP_MAX_MEMBERSHIPS = 20; { per socket }
|
||||
|
||||
{
|
||||
* Argument for IP_PORTRANGE:
|
||||
* - which range to search when port is unspecified at bind(Name:) or connect()
|
||||
}
|
||||
IP_PORTRANGE_DEFAULT = 0; { default range }
|
||||
IP_PORTRANGE_HIGH = 1; { 'high' - request firewall bypass }
|
||||
IP_PORTRANGE_LOW = 2; { 'low' - vouchsafe security }
|
||||
|
||||
{
|
||||
* Definitions for inet sysctl operations.
|
||||
*
|
||||
* Third level is protocol number.
|
||||
* Fourth level is desired variable within that protocol.
|
||||
}
|
||||
IPPROTO_MAXID = (IPPROTO_AH + 1); { don't list to IPPROTO_MAX }
|
||||
|
||||
CTL_IPPROTO_NAMES : Array[0..51] OF CtlNameRec = (
|
||||
(Name: 'ip';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'icmp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'igmp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: 'ggp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'tcp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'egp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'pup';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'udp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'idp';CtlType: CTLTYPE_NODE ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'ipsec';CtlType: CTLTYPE_NODE ));
|
||||
|
||||
{
|
||||
* Names for IP sysctl objects
|
||||
}
|
||||
IPCTL_FORWARDING = 1; { act as router }
|
||||
IPCTL_SENDREDIRECTS = 2; { may send redirects when forwarding }
|
||||
IPCTL_DEFTTL = 3; { default TTL }
|
||||
{$ifdef notyettunable}
|
||||
IPCTL_DEFMTU = 4; { default MTU }
|
||||
{$endif}
|
||||
IPCTL_RTEXPIRE = 5; { cloned route expiration time }
|
||||
IPCTL_RTMINEXPIRE = 6; { min value for expiration time }
|
||||
IPCTL_RTMAXCACHE = 7; { trigger level for dynamic expire }
|
||||
IPCTL_SOURCEROUTE = 8; { may perform source routes }
|
||||
IPCTL_DIRECTEDBROADCAST = 9; { may re-broadcast received packets }
|
||||
IPCTL_INTRQMAXLEN = 10; { max length of netisr queue }
|
||||
IPCTL_INTRQDROPS = 11; { number of netisr q drops }
|
||||
IPCTL_STATS = 12; { ipstat structure }
|
||||
IPCTL_ACCEPTSOURCEROUTE = 13; { may accept source routed packets }
|
||||
IPCTL_FASTFORWARDING = 14; { use fast IP forwarding code }
|
||||
IPCTL_KEEPFAITH = 15; { FAITH IPv4->IPv6 translater ctl }
|
||||
IPCTL_GIF_TTL = 16; { default TTL for gif encap packet }
|
||||
IPCTL_MAXID = 17;
|
||||
|
||||
IPCTL_NAMES : Array[0..14] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'forwarding';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'redirect';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'ttl';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'mtu';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'rtexpire';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'rtminexpire';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'rtmaxcache';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'sourceroute';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'directed-broadcast';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'intr-queue-maxlen';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'intr-queue-drops';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'stats';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'accept_sourceroute';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'fastforwarding';CtlType: CTLTYPE_INT ));
|
||||
|
||||
{
|
||||
* Names for ICMP sysctl objects
|
||||
}
|
||||
ICMPCTL_MASKREPL = 1; { allow replies to netmask requests }
|
||||
ICMPCTL_STATS = 2; { statistics (Name:read-only) }
|
||||
ICMPCTL_ICMPLIM = 3;
|
||||
ICMPCTL_MAXID = 4;
|
||||
|
||||
ICMPCTL_NAMES : Array[0..3] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'maskrepl';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'stats';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'icmplim';CtlType: CTLTYPE_INT ));
|
||||
|
||||
{
|
||||
* Names for ICMP sysctl objects
|
||||
}
|
||||
ICMPV6CTL_STATS = 1;
|
||||
ICMPV6CTL_REDIRACCEPT = 2; { accept/process redirects }
|
||||
ICMPV6CTL_REDIRTIMEOUT = 3; { redirect cache time }
|
||||
{$ifdef obsolete} {obsoleted}
|
||||
ICMPV6CTL_ERRRATELIMIT = 5; { ICMPv6 error rate limitation }
|
||||
{$endif}
|
||||
ICMPV6CTL_ND6_PRUNE = 6;
|
||||
ICMPV6CTL_ND6_DELAY = 8;
|
||||
ICMPV6CTL_ND6_UMAXTRIES = 9;
|
||||
ICMPV6CTL_ND6_MMAXTRIES = 10;
|
||||
ICMPV6CTL_ND6_USELOOPBACK = 11;
|
||||
//define ICMPV6CTL_ND6_PROXYALL = 12; obsoleted, do not reuse here
|
||||
ICMPV6CTL_NODEINFO = 13;
|
||||
ICMPV6CTL_ERRPPSLIMIT = 14; { ICMPv6 error pps limitation }
|
||||
ICMPV6CTL_ND6_MAXNUDHINT= 15;
|
||||
ICMPV6CTL_MTUDISC_HIWAT = 16;
|
||||
ICMPV6CTL_MTUDISC_LOWAT = 17;
|
||||
ICMPV6CTL_ND6_DEBUG = 18;
|
||||
ICMPV6CTL_ND6_DRLIST = 19;
|
||||
ICMPV6CTL_ND6_PRLIST = 20;
|
||||
ICMPV6CTL_MAXID = 21;
|
||||
|
||||
ICMPV6CTL_NAMES : Array[0..20] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'rediraccept';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'redirtimeout';CtlType: CTLTYPE_INT ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'nd6_prune';CtlType: CTLTYPE_INT ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'nd6_delay';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'nd6_umaxtries';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'nd6_mmaxtries';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'nd6_useloopback';CtlType: CTLTYPE_INT ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'nodeinfo';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'errppslimit';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'nd6_maxnudhint';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'mtudisc_hiwat';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'mtudisc_lowat';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'nd6_debug';CtlType: CTLTYPE_INT ),
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: '';CtlType: 0 ));
|
||||
|
||||
|
||||
{
|
||||
* Names for UDP sysctl objects
|
||||
}
|
||||
UDPCTL_CHECKSUM = 1; { checksum UDP packets }
|
||||
UDPCTL_STATS = 2; { statistics (Name:read-only) }
|
||||
UDPCTL_MAXDGRAM = 3; { max datagram size }
|
||||
UDPCTL_RECVSPACE = 4; { default receive buffer space }
|
||||
UDPCTL_PCBLIST = 5; { list of PCBs for UDP sockets }
|
||||
UDPCTL_MAXID = 6;
|
||||
|
||||
UDPCTL_NAMES : Array[0..5] OF CtlNameRec = (
|
||||
(Name: '';CtlType: 0 ),
|
||||
(Name: 'checksum';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'stats';CtlType: CTLTYPE_STRUCT ),
|
||||
(Name: 'maxdgram';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'recvspace';CtlType: CTLTYPE_INT ),
|
||||
(Name: 'pcblist';CtlType: CTLTYPE_STRUCT ));
|
||||
|
||||
{
|
||||
|
||||
$Log$
|
||||
Revision 1.1 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.2 2002/09/07 16:01:17 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.1 2002/08/08 11:40:05 marco
|
||||
* Initial versions.
|
||||
|
||||
|
||||
}
|
578
rtl/netbsd/sysnr.inc
Normal file
578
rtl/netbsd/sysnr.inc
Normal file
@ -0,0 +1,578 @@
|
||||
{
|
||||
$Id$
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 1999-2000 by Michael Van Canneyt,
|
||||
member of the Free Pascal development team.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
const
|
||||
|
||||
{
|
||||
Converted from NetBSD CVS tree:
|
||||
syscall.h,v 1.120 2001/07/01 18:07:33
|
||||
}
|
||||
|
||||
syscall_nr_syscall = 0;
|
||||
{ syscall: "exit" ret: "void" args: "int" }
|
||||
syscall_nr_exit = 1;
|
||||
{ syscall: "fork" ret: "int" args: }
|
||||
syscall_nr_fork = 2;
|
||||
{ syscall: "read" ret: "ssize_t" args: "int" "void " "size_t" }
|
||||
syscall_nr_read = 3;
|
||||
{ syscall: "write" ret: "ssize_t" args: "int" "const void " "size_t" }
|
||||
syscall_nr_write = 4;
|
||||
{ syscall: "open" ret: "int" args: "const char " "int" "..." }
|
||||
syscall_nr_open = 5;
|
||||
{ syscall: "close" ret: "int" args: "int" }
|
||||
syscall_nr_close = 6;
|
||||
{ syscall: "wait4" ret: "int" args: "int" "int " "int" "struct rusage " }
|
||||
syscall_nr_wait4 = 7;
|
||||
syscall_nr_compat_43_ocreat = 8;
|
||||
{ syscall: "link" ret: "int" args: "const char " "const char " }
|
||||
syscall_nr_link = 9;
|
||||
{ syscall: "unlink" ret: "int" args: "const char " }
|
||||
syscall_nr_unlink = 10;
|
||||
{ 11 is obsolete execv }
|
||||
{ syscall: "chdir" ret: "int" args: "const char " }
|
||||
syscall_nr_chdir = 12;
|
||||
{ syscall: "fchdir" ret: "int" args: "int" }
|
||||
syscall_nr_fchdir = 13;
|
||||
{ syscall: "mknod" ret: "int" args: "const char " "mode_t" "dev_t" }
|
||||
syscall_nr_mknod = 14;
|
||||
{ syscall: "chmod" ret: "int" args: "const char " "mode_t" }
|
||||
syscall_nr_chmod = 15;
|
||||
{ syscall: "chown" ret: "int" args: "const char " "uid_t" "gid_t" }
|
||||
syscall_nr_chown = 16;
|
||||
{ syscall: "break" ret: "int" args: "char " }
|
||||
syscall_nr_break = 17;
|
||||
{ syscall: "getfsstat" ret: "int" args: "struct statfs " "long" "int" }
|
||||
syscall_nr_getfsstat = 18;
|
||||
syscall_nr_compat_43_olseek = 19;
|
||||
{ syscall: "getpid" ret: "pid_t" args: }
|
||||
syscall_nr_getpid = 20;
|
||||
{ syscall: "mount" ret: "int" args: "const char " "const char " "int" "void " }
|
||||
syscall_nr_mount = 21;
|
||||
{ syscall: "unmount" ret: "int" args: "const char " "int" }
|
||||
syscall_nr_unmount = 22;
|
||||
{ syscall: "setuid" ret: "int" args: "uid_t" }
|
||||
syscall_nr_setuid = 23;
|
||||
{ syscall: "getuid" ret: "uid_t" args: }
|
||||
syscall_nr_getuid = 24;
|
||||
{ syscall: "geteuid" ret: "uid_t" args: }
|
||||
syscall_nr_geteuid = 25;
|
||||
{ syscall: "ptrace" ret: "int" args: "int" "pid_t" "caddr_t" "int" }
|
||||
syscall_nr_ptrace = 26;
|
||||
{ syscall: "recvmsg" ret: "ssize_t" args: "int" "struct msghdr " "int" }
|
||||
syscall_nr_recvmsg = 27;
|
||||
{ syscall: "sendmsg" ret: "ssize_t" args: "int" "const struct msghdr " "int" }
|
||||
syscall_nr_sendmsg = 28;
|
||||
{ syscall: "recvfrom" ret: "ssize_t" args: "int" "void " "size_t" "int" "struct sockaddr " "unsigned int " }
|
||||
syscall_nr_recvfrom = 29;
|
||||
{ syscall: "accept" ret: "int" args: "int" "struct sockaddr " "unsigned int " }
|
||||
syscall_nr_accept = 30;
|
||||
{ syscall: "getpeername" ret: "int" args: "int" "struct sockaddr " "unsigned int " }
|
||||
syscall_nr_getpeername = 31;
|
||||
{ syscall: "getsockname" ret: "int" args: "int" "struct sockaddr " "unsigned int " }
|
||||
syscall_nr_getsockname = 32;
|
||||
{ syscall: "access" ret: "int" args: "const char " "int" }
|
||||
syscall_nr_access = 33;
|
||||
{ syscall: "chflags" ret: "int" args: "const char " "u_long" }
|
||||
syscall_nr_chflags = 34;
|
||||
{ syscall: "fchflags" ret: "int" args: "int" "u_long" }
|
||||
syscall_nr_fchflags = 35;
|
||||
{ syscall: "sync" ret: "void" args: }
|
||||
syscall_nr_sync = 36;
|
||||
{ syscall: "kill" ret: "int" args: "int" "int" }
|
||||
syscall_nr_kill = 37;
|
||||
syscall_nr_compat_43_stat43 = 38;
|
||||
{ syscall: "getppid" ret: "pid_t" args: }
|
||||
syscall_nr_getppid = 39;
|
||||
syscall_nr_compat_43_lstat43 = 40;
|
||||
{ syscall: "dup" ret: "int" args: "int" }
|
||||
syscall_nr_dup = 41;
|
||||
{ syscall: "pipe" ret: "int" args: }
|
||||
syscall_nr_pipe = 42;
|
||||
{ syscall: "getegid" ret: "gid_t" args: }
|
||||
syscall_nr_getegid = 43;
|
||||
{ syscall: "profil" ret: "int" args: "caddr_t" "size_t" "u_long" "u_int" }
|
||||
syscall_nr_profil = 44;
|
||||
{ syscall: "ktrace" ret: "int" args: "const char " "int" "int" "int" }
|
||||
syscall_nr_ktrace = 45;
|
||||
{ 45 is excluded ktrace }
|
||||
syscall_nr_compat_13_sigaction13 = 46;
|
||||
{ syscall: "getgid" ret: "gid_t" args: }
|
||||
syscall_nr_getgid = 47;
|
||||
syscall_nr_compat_13_sigprocmask13 = 48;
|
||||
{ syscall: "__getlogin" ret: "int" args: "char " "size_t" }
|
||||
syscall_nr___getlogin = 49;
|
||||
{ syscall: "setlogin" ret: "int" args: "const char " }
|
||||
syscall_nr_setlogin = 50;
|
||||
{ syscall: "acct" ret: "int" args: "const char " }
|
||||
syscall_nr_acct = 51;
|
||||
syscall_nr_compat_13_sigpending13 = 52;
|
||||
syscall_nr_compat_13_sigaltstack13 = 53;
|
||||
{ syscall: "ioctl" ret: "int" args: "int" "u_long" "..." }
|
||||
syscall_nr_ioctl = 54;
|
||||
syscall_nr_compat_12_oreboot = 55;
|
||||
{ syscall: "revoke" ret: "int" args: "const char " }
|
||||
syscall_nr_revoke = 56;
|
||||
{ syscall: "symlink" ret: "int" args: "const char " "const char " }
|
||||
syscall_nr_symlink = 57;
|
||||
{ syscall: "readlink" ret: "int" args: "const char " "char " "size_t" }
|
||||
syscall_nr_readlink = 58;
|
||||
{ syscall: "execve" ret: "int" args: "const char " "char const " "char const " }
|
||||
syscall_nr_execve = 59;
|
||||
{ syscall: "umask" ret: "mode_t" args: "mode_t" }
|
||||
syscall_nr_umask = 60;
|
||||
{ syscall: "chroot" ret: "int" args: "const char " }
|
||||
syscall_nr_chroot = 61;
|
||||
syscall_nr_compat_43_fstat43 = 62;
|
||||
syscall_nr_compat_43_ogetkerninfo = 63;
|
||||
syscall_nr_compat_43_ogetpagesize = 64;
|
||||
syscall_nr_compat_12_msync = 65;
|
||||
{ syscall: "vfork" ret: "int" args: }
|
||||
syscall_nr_vfork = 66;
|
||||
{ 67 is obsolete vread }
|
||||
{ 68 is obsolete vwrite }
|
||||
{ syscall: "sbrk" ret: "int" args: "intptr_t" }
|
||||
syscall_nr_sbrk = 69;
|
||||
{ syscall: "sstk" ret: "int" args: "int" }
|
||||
syscall_nr_sstk = 70;
|
||||
syscall_nr_compat_43_ommap = 71;
|
||||
{ syscall: "vadvise" ret: "int" args: "int" }
|
||||
syscall_nr_vadvise = 72;
|
||||
{ syscall: "munmap" ret: "int" args: "void " "size_t" }
|
||||
syscall_nr_munmap = 73;
|
||||
{ syscall: "mprotect" ret: "int" args: "void " "size_t" "int" }
|
||||
syscall_nr_mprotect = 74;
|
||||
{ syscall: "madvise" ret: "int" args: "void " "size_t" "int" }
|
||||
syscall_nr_madvise = 75;
|
||||
{ 76 is obsolete vhangup }
|
||||
{ 77 is obsolete vlimit }
|
||||
{ syscall: "mincore" ret: "int" args: "void " "size_t" "char " }
|
||||
syscall_nr_mincore = 78;
|
||||
{ syscall: "getgroups" ret: "int" args: "int" "gid_t " }
|
||||
syscall_nr_getgroups = 79;
|
||||
{ syscall: "setgroups" ret: "int" args: "int" "const gid_t " }
|
||||
syscall_nr_setgroups = 80;
|
||||
{ syscall: "getpgrp" ret: "int" args: }
|
||||
syscall_nr_getpgrp = 81;
|
||||
{ syscall: "setpgid" ret: "int" args: "int" "int" }
|
||||
syscall_nr_setpgid = 82;
|
||||
{ syscall: "setitimer" ret: "int" args: "int" "const struct itimerval " "struct itimerval " }
|
||||
syscall_nr_setitimer = 83;
|
||||
syscall_nr_compat_43_owait = 84;
|
||||
syscall_nr_compat_12_oswapon = 85;
|
||||
{ syscall: "getitimer" ret: "int" args: "int" "struct itimerval " }
|
||||
syscall_nr_getitimer = 86;
|
||||
syscall_nr_compat_43_ogethostname = 87;
|
||||
syscall_nr_compat_43_osethostname = 88;
|
||||
syscall_nr_compat_43_ogetdtablesize = 89;
|
||||
{ syscall: "dup2" ret: "int" args: "int" "int" }
|
||||
syscall_nr_dup2 = 90;
|
||||
{ syscall: "fcntl" ret: "int" args: "int" "int" "..." }
|
||||
syscall_nr_fcntl = 92;
|
||||
{ syscall: "select" ret: "int" args: "int" "fd_set " "fd_set " "fd_set " "struct timeval " }
|
||||
syscall_nr_select = 93;
|
||||
{ syscall: "fsync" ret: "int" args: "int" }
|
||||
syscall_nr_fsync = 95;
|
||||
{ syscall: "setpriority" ret: "int" args: "int" "int" "int" }
|
||||
syscall_nr_setpriority = 96;
|
||||
{ syscall: "socket" ret: "int" args: "int" "int" "int" }
|
||||
syscall_nr_socket = 97;
|
||||
{ syscall: "connect" ret: "int" args: "int" "const struct sockaddr " "unsigned int" }
|
||||
syscall_nr_connect = 98;
|
||||
syscall_nr_compat_43_oaccept = 99;
|
||||
{ syscall: "getpriority" ret: "int" args: "int" "int" }
|
||||
syscall_nr_getpriority = 100;
|
||||
syscall_nr_compat_43_osend = 101;
|
||||
syscall_nr_compat_43_orecv = 102;
|
||||
syscall_nr_compat_13_sigreturn13 = 103;
|
||||
{ syscall: "bind" ret: "int" args: "int" "const struct sockaddr " "unsigned int" }
|
||||
syscall_nr_bind = 104;
|
||||
{ syscall: "setsockopt" ret: "int" args: "int" "int" "int" "const void " "unsigned int" }
|
||||
syscall_nr_setsockopt = 105;
|
||||
{ syscall: "listen" ret: "int" args: "int" "int" }
|
||||
syscall_nr_listen = 106;
|
||||
{ 107 is obsolete vtimes }
|
||||
syscall_nr_compat_43_osigvec = 108;
|
||||
syscall_nr_compat_43_osigblock = 109;
|
||||
syscall_nr_compat_43_osigsetmask = 110;
|
||||
syscall_nr_compat_13_sigsuspend13 = 111;
|
||||
syscall_nr_compat_43_osigstack = 112;
|
||||
syscall_nr_compat_43_orecvmsg = 113;
|
||||
syscall_nr_compat_43_osendmsg = 114;
|
||||
{ 115 is obsolete vtrace }
|
||||
{ syscall: "gettimeofday" ret: "int" args: "struct timeval " "struct timezone " }
|
||||
syscall_nr_gettimeofday = 116;
|
||||
{ syscall: "getrusage" ret: "int" args: "int" "struct rusage " }
|
||||
syscall_nr_getrusage = 117;
|
||||
{ syscall: "getsockopt" ret: "int" args: "int" "int" "int" "void " "unsigned int " }
|
||||
syscall_nr_getsockopt = 118;
|
||||
{ 119 is obsolete resuba }
|
||||
{ syscall: "readv" ret: "ssize_t" args: "int" "const struct iovec " "int" }
|
||||
syscall_nr_readv = 120;
|
||||
{ syscall: "writev" ret: "ssize_t" args: "int" "const struct iovec " "int" }
|
||||
syscall_nr_writev = 121;
|
||||
{ syscall: "settimeofday" ret: "int" args: "const struct timeval " "const struct timezone " }
|
||||
syscall_nr_settimeofday = 122;
|
||||
{ syscall: "fchown" ret: "int" args: "int" "uid_t" "gid_t" }
|
||||
syscall_nr_fchown = 123;
|
||||
{ syscall: "fchmod" ret: "int" args: "int" "mode_t" }
|
||||
syscall_nr_fchmod = 124;
|
||||
syscall_nr_compat_43_orecvfrom = 125;
|
||||
{ syscall: "setreuid" ret: "int" args: "uid_t" "uid_t" }
|
||||
syscall_nr_setreuid = 126;
|
||||
{ syscall: "setregid" ret: "int" args: "gid_t" "gid_t" }
|
||||
syscall_nr_setregid = 127;
|
||||
{ syscall: "rename" ret: "int" args: "const char " "const char " }
|
||||
syscall_nr_rename = 128;
|
||||
syscall_nr_compat_43_otruncate = 129;
|
||||
syscall_nr_compat_43_oftruncate = 130;
|
||||
{ syscall: "flock" ret: "int" args: "int" "int" }
|
||||
syscall_nr_flock = 131;
|
||||
{ syscall: "mkfifo" ret: "int" args: "const char " "mode_t" }
|
||||
syscall_nr_mkfifo = 132;
|
||||
{ syscall: "sendto" ret: "ssize_t" args: "int" "const void " "size_t" "int" "const struct sockaddr " "unsigned int" }
|
||||
syscall_nr_sendto = 133;
|
||||
{ syscall: "shutdown" ret: "int" args: "int" "int" }
|
||||
syscall_nr_shutdown = 134;
|
||||
{ syscall: "socketpair" ret: "int" args: "int" "int" "int" "int " }
|
||||
syscall_nr_socketpair = 135;
|
||||
{ syscall: "mkdir" ret: "int" args: "const char " "mode_t" }
|
||||
syscall_nr_mkdir = 136;
|
||||
{ syscall: "rmdir" ret: "int" args: "const char " }
|
||||
syscall_nr_rmdir = 137;
|
||||
{ syscall: "utimes" ret: "int" args: "const char " "const struct timeval " }
|
||||
syscall_nr_utimes = 138;
|
||||
{ 139 is obsolete 4.2 sigreturn }
|
||||
{ syscall: "adjtime" ret: "int" args: "const struct timeval " "struct timeval " }
|
||||
syscall_nr_adjtime = 140;
|
||||
syscall_nr_compat_43_ogetpeername = 141;
|
||||
syscall_nr_compat_43_ogethostid = 142;
|
||||
syscall_nr_compat_43_osethostid = 143;
|
||||
syscall_nr_compat_43_ogetrlimit = 144;
|
||||
syscall_nr_compat_43_osetrlimit = 145;
|
||||
syscall_nr_compat_43_okillpg = 146;
|
||||
{ syscall: "setsid" ret: "int" args: }
|
||||
syscall_nr_setsid = 147;
|
||||
{ syscall: "quotactl" ret: "int" args: "const char " "int" "int" "caddr_t" }
|
||||
syscall_nr_quotactl = 148;
|
||||
syscall_nr_compat_43_oquota = 149;
|
||||
syscall_nr_compat_43_ogetsockname = 150;
|
||||
{ syscall: "nfssvc" ret: "int" args: "int" "void " }
|
||||
syscall_nr_nfssvc = 155;
|
||||
{ 155 is excluded nfssvc }
|
||||
syscall_nr_compat_43_ogetdirentries = 156;
|
||||
{ syscall: "statfs" ret: "int" args: "const char " "struct statfs " }
|
||||
syscall_nr_statfs = 157;
|
||||
{ syscall: "fstatfs" ret: "int" args: "int" "struct statfs " }
|
||||
syscall_nr_fstatfs = 158;
|
||||
{ syscall: "getfh" ret: "int" args: "const char " "fhandle_t " }
|
||||
syscall_nr_getfh = 161;
|
||||
syscall_nr_compat_09_ogetdomainname = 162;
|
||||
syscall_nr_compat_09_osetdomainname = 163;
|
||||
syscall_nr_compat_09_ouname = 164;
|
||||
{ syscall: "sysarch" ret: "int" args: "int" "void " }
|
||||
syscall_nr_sysarch = 165;
|
||||
syscall_nr_compat_10_osemsys = 169;
|
||||
{ 169 is excluded 1.0 semsys }
|
||||
syscall_nr_compat_10_omsgsys = 170;
|
||||
{ 170 is excluded 1.0 msgsys }
|
||||
syscall_nr_compat_10_oshmsys = 171;
|
||||
{ 171 is excluded 1.0 shmsys }
|
||||
{ syscall: "pread" ret: "ssize_t" args: "int" "void " "size_t" "int" "off_t" }
|
||||
syscall_nr_pread = 173;
|
||||
{ syscall: "pwrite" ret: "ssize_t" args: "int" "const void " "size_t" "int" "off_t" }
|
||||
syscall_nr_pwrite = 174;
|
||||
{ syscall: "ntp_gettime" ret: "int" args: "struct ntptimeval " }
|
||||
syscall_nr_ntp_gettime = 175;
|
||||
{ syscall: "ntp_adjtime" ret: "int" args: "struct timex " }
|
||||
syscall_nr_ntp_adjtime = 176;
|
||||
{ 176 is excluded ntp_adjtime }
|
||||
{ syscall: "setgid" ret: "int" args: "gid_t" }
|
||||
syscall_nr_setgid = 181;
|
||||
{ syscall: "setegid" ret: "int" args: "gid_t" }
|
||||
syscall_nr_setegid = 182;
|
||||
{ syscall: "seteuid" ret: "int" args: "uid_t" }
|
||||
syscall_nr_seteuid = 183;
|
||||
{ syscall: "lfs_bmapv" ret: "int" args: "fsid_t " "struct block_info " "int" }
|
||||
syscall_nr_lfs_bmapv = 184;
|
||||
{ syscall: "lfs_markv" ret: "int" args: "fsid_t " "struct block_info " "int" }
|
||||
syscall_nr_lfs_markv = 185;
|
||||
{ syscall: "lfs_segclean" ret: "int" args: "fsid_t " "u_long" }
|
||||
syscall_nr_lfs_segclean = 186;
|
||||
{ syscall: "lfs_segwait" ret: "int" args: "fsid_t " "struct timeval " }
|
||||
syscall_nr_lfs_segwait = 187;
|
||||
{ 184 is excluded lfs_bmapv }
|
||||
{ 185 is excluded lfs_markv }
|
||||
{ 186 is excluded lfs_segclean }
|
||||
{ 187 is excluded lfs_segwait }
|
||||
syscall_nr_compat_12_stat12 = 188;
|
||||
syscall_nr_compat_12_fstat12 = 189;
|
||||
syscall_nr_compat_12_lstat12 = 190;
|
||||
{ syscall: "pathconf" ret: "long" args: "const char " "int" }
|
||||
syscall_nr_pathconf = 191;
|
||||
{ syscall: "fpathconf" ret: "long" args: "int" "int" }
|
||||
syscall_nr_fpathconf = 192;
|
||||
{ syscall: "getrlimit" ret: "int" args: "int" "struct rlimit " }
|
||||
syscall_nr_getrlimit = 194;
|
||||
{ syscall: "setrlimit" ret: "int" args: "int" "const struct rlimit " }
|
||||
syscall_nr_setrlimit = 195;
|
||||
syscall_nr_compat_12_getdirentries = 196;
|
||||
{ syscall: "mmap" ret: "void " args: "void " "size_t" "int" "int" "int" "long" "off_t" }
|
||||
syscall_nr_mmap = 197;
|
||||
{ syscall: "__syscall" ret: "quad_t" args: "quad_t" "..." }
|
||||
syscall_nr___syscall = 198;
|
||||
{ syscall: "lseek" ret: "off_t" args: "int" "int" "off_t" "int" }
|
||||
syscall_nr_lseek = 199;
|
||||
{ syscall: "truncate" ret: "int" args: "const char " "int" "off_t" }
|
||||
syscall_nr_truncate = 200;
|
||||
{ syscall: "ftruncate" ret: "int" args: "int" "int" "off_t" }
|
||||
syscall_nr_ftruncate = 201;
|
||||
{ syscall: "__sysctl" ret: "int" args: "int " "u_int" "void " "size_t " "void " "size_t" }
|
||||
syscall_nr___sysctl = 202;
|
||||
{ syscall: "mlock" ret: "int" args: "const void " "size_t" }
|
||||
syscall_nr_mlock = 203;
|
||||
{ syscall: "munlock" ret: "int" args: "const void " "size_t" }
|
||||
syscall_nr_munlock = 204;
|
||||
{ syscall: "undelete" ret: "int" args: "const char " }
|
||||
syscall_nr_undelete = 205;
|
||||
{ syscall: "futimes" ret: "int" args: "int" "const struct timeval " }
|
||||
syscall_nr_futimes = 206;
|
||||
{ syscall: "getpgid" ret: "pid_t" args: "pid_t" }
|
||||
syscall_nr_getpgid = 207;
|
||||
{ syscall: "reboot" ret: "int" args: "int" "char " }
|
||||
syscall_nr_reboot = 208;
|
||||
{ syscall: "poll" ret: "int" args: "struct pollfd " "u_int" "int" }
|
||||
syscall_nr_poll = 209;
|
||||
{ 210 is excluded lkmnosys }
|
||||
{ 211 is excluded lkmnosys }
|
||||
{ 212 is excluded lkmnosys }
|
||||
{ 213 is excluded lkmnosys }
|
||||
{ 214 is excluded lkmnosys }
|
||||
{ 215 is excluded lkmnosys }
|
||||
{ 216 is excluded lkmnosys }
|
||||
{ 217 is excluded lkmnosys }
|
||||
{ 218 is excluded lkmnosys }
|
||||
{ 219 is excluded lkmnosys }
|
||||
syscall_nr_compat_14___semctl = 220;
|
||||
{ syscall: "semget" ret: "int" args: "key_t" "int" "int" }
|
||||
syscall_nr_semget = 221;
|
||||
{ syscall: "semop" ret: "int" args: "int" "struct sembuf " "size_t" }
|
||||
syscall_nr_semop = 222;
|
||||
{ syscall: "semconfig" ret: "int" args: "int" }
|
||||
syscall_nr_semconfig = 223;
|
||||
{ 220 is excluded compat_14_semctl }
|
||||
{ 221 is excluded semget }
|
||||
{ 222 is excluded semop }
|
||||
{ 223 is excluded semconfig }
|
||||
syscall_nr_compat_14_msgctl = 224;
|
||||
{ syscall: "msgget" ret: "int" args: "key_t" "int" }
|
||||
syscall_nr_msgget = 225;
|
||||
{ syscall: "msgsnd" ret: "int" args: "int" "const void " "size_t" "int" }
|
||||
syscall_nr_msgsnd = 226;
|
||||
{ syscall: "msgrcv" ret: "ssize_t" args: "int" "void " "size_t" "long" "int" }
|
||||
syscall_nr_msgrcv = 227;
|
||||
{ 224 is excluded compat_14_msgctl }
|
||||
{ 225 is excluded msgget }
|
||||
{ 226 is excluded msgsnd }
|
||||
{ 227 is excluded msgrcv }
|
||||
{ syscall: "shmat" ret: "void " args: "int" "const void " "int" }
|
||||
syscall_nr_shmat = 228;
|
||||
syscall_nr_compat_14_shmctl = 229;
|
||||
{ syscall: "shmdt" ret: "int" args: "const void " }
|
||||
syscall_nr_shmdt = 230;
|
||||
{ syscall: "shmget" ret: "int" args: "key_t" "size_t" "int" }
|
||||
syscall_nr_shmget = 231;
|
||||
{ 228 is excluded shmat }
|
||||
{ 229 is excluded compat_14_shmctl }
|
||||
{ 230 is excluded shmdt }
|
||||
{ 231 is excluded shmget }
|
||||
{ syscall: "clock_gettime" ret: "int" args: "clockid_t" "struct timespec " }
|
||||
syscall_nr_clock_gettime = 232;
|
||||
{ syscall: "clock_settime" ret: "int" args: "clockid_t" "const struct timespec " }
|
||||
syscall_nr_clock_settime = 233;
|
||||
{ syscall: "clock_getres" ret: "int" args: "clockid_t" "struct timespec " }
|
||||
syscall_nr_clock_getres = 234;
|
||||
{ syscall: "nanosleep" ret: "int" args: "const struct timespec " "struct timespec " }
|
||||
syscall_nr_nanosleep = 240;
|
||||
{ syscall: "fdatasync" ret: "int" args: "int" }
|
||||
syscall_nr_fdatasync = 241;
|
||||
{ syscall: "mlockall" ret: "int" args: "int" }
|
||||
syscall_nr_mlockall = 242;
|
||||
{ syscall: "munlockall" ret: "int" args: }
|
||||
syscall_nr_munlockall = 243;
|
||||
{ syscall: "__posix_rename" ret: "int" args: "const char " "const char " }
|
||||
syscall_nr___posix_rename = 270;
|
||||
{ syscall: "swapctl" ret: "int" args: "int" "const void " "int" }
|
||||
syscall_nr_swapctl = 271;
|
||||
{ syscall: "getdents" ret: "int" args: "int" "char " "size_t" }
|
||||
syscall_nr_getdents = 272;
|
||||
{ syscall: "minherit" ret: "int" args: "void " "size_t" "int" }
|
||||
syscall_nr_minherit = 273;
|
||||
{ syscall: "lchmod" ret: "int" args: "const char " "mode_t" }
|
||||
syscall_nr_lchmod = 274;
|
||||
{ syscall: "lchown" ret: "int" args: "const char " "uid_t" "gid_t" }
|
||||
syscall_nr_lchown = 275;
|
||||
{ syscall: "lutimes" ret: "int" args: "const char " "const struct timeval " }
|
||||
syscall_nr_lutimes = 276;
|
||||
{ syscall: "__msync13" ret: "int" args: "void " "size_t" "int" }
|
||||
syscall_nr___msync13 = 277;
|
||||
{ syscall: "__stat13" ret: "int" args: "const char " "struct stat " }
|
||||
syscall_nr___stat13 = 278;
|
||||
{ syscall: "__fstat13" ret: "int" args: "int" "struct stat " }
|
||||
syscall_nr___fstat13 = 279;
|
||||
{ syscall: "__lstat13" ret: "int" args: "const char " "struct stat " }
|
||||
syscall_nr___lstat13 = 280;
|
||||
{ syscall: "__sigaltstack14" ret: "int" args: "const struct sigaltstack " "struct sigaltstack " }
|
||||
syscall_nr___sigaltstack14 = 281;
|
||||
{ syscall: "__vfork14" ret: "int" args: }
|
||||
syscall_nr___vfork14 = 282;
|
||||
{ syscall: "__posix_chown" ret: "int" args: "const char " "uid_t" "gid_t" }
|
||||
syscall_nr___posix_chown = 283;
|
||||
{ syscall: "__posix_fchown" ret: "int" args: "int" "uid_t" "gid_t" }
|
||||
syscall_nr___posix_fchown = 284;
|
||||
{ syscall: "__posix_lchown" ret: "int" args: "const char " "uid_t" "gid_t" }
|
||||
syscall_nr___posix_lchown = 285;
|
||||
{ syscall: "getsid" ret: "pid_t" args: "pid_t" }
|
||||
syscall_nr_getsid = 286;
|
||||
{ syscall: "__clone" ret: "pid_t" args: "int" "void " }
|
||||
syscall_nr___clone = 287;
|
||||
{ syscall: "fktrace" ret: "int" args: "const int" "int" "int" "int" }
|
||||
syscall_nr_fktrace = 288;
|
||||
{ 288 is excluded ktrace }
|
||||
{ syscall: "preadv" ret: "ssize_t" args: "int" "const struct iovec " "int" "int" "off_t" }
|
||||
syscall_nr_preadv = 289;
|
||||
{ syscall: "pwritev" ret: "ssize_t" args: "int" "const struct iovec " "int" "int" "off_t" }
|
||||
syscall_nr_pwritev = 290;
|
||||
{ syscall: "__sigaction14" ret: "int" args: "int" "const struct sigaction " "struct sigaction " }
|
||||
syscall_nr___sigaction14 = 291;
|
||||
{ syscall: "__sigpending14" ret: "int" args: "sigset_t " }
|
||||
syscall_nr___sigpending14 = 292;
|
||||
{ syscall: "__sigprocmask14" ret: "int" args: "int" "const sigset_t " "sigset_t " }
|
||||
syscall_nr___sigprocmask14 = 293;
|
||||
{ syscall: "__sigsuspend14" ret: "int" args: "const sigset_t " }
|
||||
syscall_nr___sigsuspend14 = 294;
|
||||
{ syscall: "__sigreturn14" ret: "int" args: "struct sigcontext " }
|
||||
syscall_nr___sigreturn14 = 295;
|
||||
{ syscall: "__getcwd" ret: "int" args: "char " "size_t" }
|
||||
syscall_nr___getcwd = 296;
|
||||
{ syscall: "fchroot" ret: "int" args: "int" }
|
||||
syscall_nr_fchroot = 297;
|
||||
{ syscall: "fhopen" ret: "int" args: "const fhandle_t " "int" }
|
||||
syscall_nr_fhopen = 298;
|
||||
{ syscall: "fhstat" ret: "int" args: "const fhandle_t " "struct stat " }
|
||||
syscall_nr_fhstat = 299;
|
||||
{ syscall: "fhstatfs" ret: "int" args: "const fhandle_t " "struct statfs " }
|
||||
syscall_nr_fhstatfs = 300;
|
||||
{ syscall: "____semctl13" ret: "int" args: "int" "int" "int" "..." }
|
||||
syscall_nr_____semctl13 = 301;
|
||||
{ 301 is excluded ____semctl13 }
|
||||
{ syscall: "__msgctl13" ret: "int" args: "int" "int" "struct msqid_ds " }
|
||||
syscall_nr___msgctl13 = 302;
|
||||
{ 302 is excluded __msgctl13 }
|
||||
{ syscall: "__shmctl13" ret: "int" args: "int" "int" "struct shmid_ds " }
|
||||
syscall_nr___shmctl13 = 303;
|
||||
{ 303 is excluded __shmctl13 }
|
||||
{ syscall: "lchflags" ret: "int" args: "const char " "u_long" }
|
||||
syscall_nr_lchflags = 304;
|
||||
{ syscall: "issetugid" ret: "int" args: }
|
||||
syscall_nr_issetugid = 305;
|
||||
{ syscall: "utrace" ret: "int" args: "const char " "void " "size_t" }
|
||||
syscall_nr_utrace = 306;
|
||||
syscall_nr_MAXSYSCALL = 340;
|
||||
syscall_nr_NSYSENT = 512;
|
||||
|
||||
|
||||
{ More or less checked BSD syscalls }
|
||||
{ I checked the values of these constant
|
||||
and removed those who are equal
|
||||
and added some equivalents, unchecked PM }
|
||||
|
||||
{ syscall_nr_compat_12_fstat12 = 189 }
|
||||
{ syscall_nr___fstat13 = 279 }
|
||||
syscall_nr_fstat = syscall_nr___fstat13;
|
||||
{ syscall_nr_compat_12_lstat12 = 190 }
|
||||
{ syscall_nr___lstat13 = 280 }
|
||||
syscall_nr_lstat = syscall_nr___lstat13;
|
||||
{ syscall_nr_sigaction = 342; MISSING }
|
||||
{ syscall: "__sigaction14" ret: "int" args: "int" "const struct sigaction " "struct sigaction " }
|
||||
syscall_nr_sigaction = syscall_nr___sigaction14;
|
||||
{ syscall_nr_sigpending = 343; MISSING }
|
||||
{ syscall: "__sigpending14" ret: "int" args: "sigset_t " }
|
||||
syscall_nr_sigpending = syscall_nr___sigpending14;
|
||||
{ syscall_nr_sigprocmask = 340; MISSING }
|
||||
{ syscall: "__sigprocmask14" ret: "int" args: "int" "const sigset_t " "sigset_t " }
|
||||
syscall_nr_sigprocmask = syscall_nr___sigprocmask14;
|
||||
{ syscall_nr_sigsuspend = 341; MISSING }
|
||||
{ syscall: "__sigsuspend14" ret: "int" args: "const sigset_t " }
|
||||
syscall_nr_sigsuspend = syscall_nr___sigsuspend14;
|
||||
{ syscall: "__sigreturn14" ret: "int" args: "struct sigcontext " }
|
||||
syscall_nr_sigreturn = syscall_nr___sigreturn14;
|
||||
{ Note: syscall_nr_sigreturn was not on the checked list for FreeBSD }
|
||||
|
||||
{ syscall_nr_compat_12_stat12 = 188; }
|
||||
{ syscall_nr___stat13 = 278 }
|
||||
syscall_nr_stat = syscall_nr___stat13;
|
||||
{ syscall_nr_wait4 = 7 }
|
||||
syscall_nr_waitpid = syscall_nr_wait4;
|
||||
{ This one seems to be missing !!!!
|
||||
syscall_nr_rfork = 251;}
|
||||
{$define FPC_HAS_NO_SYSCALL_NR_RFORK }
|
||||
{ syscall_nr_compat_12_getdirentries = 196 }
|
||||
syscall_nr_getdirentries = syscall_nr_compat_12_getdirentries;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.1.2.1 2001/08/10 11:07:17 pierre
|
||||
New NetBSD files taken and adapted from FreeBSD
|
||||
|
||||
Revision 1.1.2.4 2001/03/14 17:19:10 marco
|
||||
* Readdir compiles (some conflicts in Linux). Untested. Use NewReaddir to enable
|
||||
|
||||
Revision 1.1.2.3 2001/01/23 06:38:50 marco
|
||||
* ioperm for FreeBSD. I/O back to Linux
|
||||
|
||||
Revision 1.1.2.2 2000/10/24 12:13:22 pierre
|
||||
+ syscall_nr_nanosleep
|
||||
|
||||
Revision 1.1.2.1 2000/09/16 11:19:08 marco
|
||||
* Moved files from BSD to FreeBSD directory, with some small changes
|
||||
|
||||
Revision 1.1.2.1 2000/09/10 16:12:14 marco
|
||||
Initial signals, sockets and clone
|
||||
|
||||
Revision 1.1 2000/07/13 06:30:33 michael
|
||||
+ Initial import
|
||||
|
||||
Revision 1.4 2000/04/10 15:46:52 marco
|
||||
* worked all day. probably a lot changed
|
||||
|
||||
Revision 1.2 2000/04/05 13:59:10 marco
|
||||
* added constants for syscall.inc
|
||||
|
||||
Revision 1.1 2000/04/05 13:06:24 marco
|
||||
* Initial version. (copied from linux.) Patch for BSD not ready yeT
|
||||
|
||||
Revision 1.5 2000/02/09 16:59:32 peter
|
||||
* truncated log
|
||||
|
||||
Revision 1.4 2000/01/07 16:41:41 daniel
|
||||
* copyright 2000
|
||||
|
||||
Revision 1.3 2000/01/07 16:32:28 daniel
|
||||
* copyright 2000 added
|
||||
|
||||
}
|
@ -105,7 +105,7 @@ type
|
||||
PStat=^Stat;
|
||||
TStat=Stat;
|
||||
|
||||
Statfs = packed record
|
||||
TStatfs = packed record
|
||||
spare2, { place holder}
|
||||
bsize, { fundamental block size}
|
||||
iosize, { optimal block size }
|
||||
@ -123,8 +123,7 @@ type
|
||||
mountpoint : array[0..89] of char;
|
||||
mnfromname : array[0..89] of char;
|
||||
end;
|
||||
PStatFS=^StatFS;
|
||||
TStatFS=StatFS;
|
||||
PStatFS=^TStatFS;
|
||||
|
||||
fdSet=array[0..7] of longint;{=256 bits}
|
||||
pfdset=^fdset;
|
||||
@ -159,7 +158,10 @@ type
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-17 22:13:47 marco
|
||||
Revision 1.3 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.2 2003/01/17 22:13:47 marco
|
||||
* some updates
|
||||
|
||||
Revision 1.1.2.2 2001/08/30 23:00:18 marco
|
||||
|
351
rtl/netbsd/termios.inc
Normal file
351
rtl/netbsd/termios.inc
Normal file
@ -0,0 +1,351 @@
|
||||
|
||||
CONST
|
||||
|
||||
{
|
||||
* Special Control Characters
|
||||
*
|
||||
* Index into c_cc[] character array.
|
||||
*
|
||||
* Name Subscript Enabled by
|
||||
}
|
||||
VEOF =0;
|
||||
VEOL =1;
|
||||
VEOL2 =2;
|
||||
VERASE =3;
|
||||
VWERASE =4;
|
||||
VKILL =5;
|
||||
VREPRINT =6;
|
||||
{ =7; spare 1 }
|
||||
VINTR =8;
|
||||
VQUIT =9;
|
||||
VSUSP =10;
|
||||
VDSUSP =11;
|
||||
VSTART =12;
|
||||
VSTOP =13;
|
||||
VLNEXT =14;
|
||||
VDISCARD =15;
|
||||
VMIN =16;
|
||||
VTIME =17;
|
||||
VSTATUS =18;
|
||||
{ =19 spare 2 }
|
||||
NCCS =20;
|
||||
|
||||
Type
|
||||
winsize = packed record
|
||||
ws_row,
|
||||
ws_col,
|
||||
ws_xpixel,
|
||||
ws_ypixel : word;
|
||||
end;
|
||||
TWinSize=winsize;
|
||||
|
||||
|
||||
type
|
||||
Termios = packed record
|
||||
c_iflag,
|
||||
c_oflag,
|
||||
c_cflag,
|
||||
c_lflag : longint;
|
||||
c_line : char;
|
||||
c_cc : array[0..NCCS-1] of byte;
|
||||
{$IFDEF BSD}
|
||||
c_ispeed,
|
||||
c_ospeed : longint;
|
||||
{$endif}
|
||||
end;
|
||||
TTermios=Termios;
|
||||
|
||||
CONST
|
||||
|
||||
|
||||
POSIX_VDISABLE=Chr($ff);
|
||||
{
|
||||
|
||||
#define CCEQ(val, c) ((c) == (val) ? (val) != _POSIX_VDISABLE : 0)
|
||||
}
|
||||
|
||||
{ * Input flags - software input processing}
|
||||
|
||||
IGNBRK = $1; { ignore BREAK condition }
|
||||
BRKINT = $2; { map BREAK to SIGINTR }
|
||||
IGNPAR = $4; { ignore (discard) parity errors }
|
||||
PARMRK = $8; { mark parity and framing errors }
|
||||
INPCK = $10; { enable checking of parity errors }
|
||||
ISTRIP = $20; { strip 8th bit off chars }
|
||||
INLCR = $40; { map NL into CR }
|
||||
IGNCR = $80; { ignore CR }
|
||||
ICRNL = $100; { map CR to NL (ala CRMOD) }
|
||||
IXON = $200; { enable output flow control }
|
||||
IXOFF = $400; { enable input flow control }
|
||||
IXANY = $800; { any char will restart after stop }
|
||||
IMAXBEL = $2000; { ring bell on input queue full }
|
||||
|
||||
{
|
||||
* Output flags - software output processing
|
||||
}
|
||||
OPOST = $1; { enable following output processing }
|
||||
ONLCR = $2; { map NL to CR-NL (ala CRMOD) }
|
||||
OXTABS = $4; { expand tabs to spaces }
|
||||
ONOEOT = $8; { discard EOT's (^D) on output) }
|
||||
|
||||
{
|
||||
* Control flags - hardware control of terminal
|
||||
}
|
||||
CIGNORE = $1; { ignore control flags }
|
||||
CSIZE = $300; { character size mask }
|
||||
CS5 = $0; { 5 bits (pseudo) }
|
||||
CS6 = $100; { 6 bits }
|
||||
CS7 = $200; { 7 bits }
|
||||
CS8 = $300; { 8 bits }
|
||||
CSTOPB = $400; { send 2 stop bits }
|
||||
CREAD = $800; { enable receiver }
|
||||
PARENB = $1000; { parity enable }
|
||||
PARODD = $2000; { odd parity, else even }
|
||||
HUPCL = $4000; { hang up on last close }
|
||||
CLOCAL = $8000; { ignore modem status lines }
|
||||
CCTS_OFLOW = $10000; { CTS flow control of output }
|
||||
CRTS_IFLOW = $20000; { RTS flow control of input }
|
||||
CRTSCTS = (CCTS_OFLOW or CRTS_IFLOW);
|
||||
CDTR_IFLOW = $40000; { DTR flow control of input }
|
||||
CDSR_OFLOW = $80000; { DSR flow control of output }
|
||||
CCAR_OFLOW = $100000; { DCD flow control of output }
|
||||
MDMBUF = $100000; { old name for CCAR_OFLOW }
|
||||
|
||||
{
|
||||
* "Local" flags - dumping ground for other state
|
||||
*
|
||||
* Warning: some flags in this structure begin with
|
||||
* the letter "I" and look like they belong in the
|
||||
* input flag.
|
||||
}
|
||||
|
||||
ECHOKE = $1; { visual erase for line kill }
|
||||
ECHOE = $2; { visually erase chars }
|
||||
ECHOK = $4; { echo NL after line kill }
|
||||
ECHO = $8; { enable echoing }
|
||||
ECHONL = $10; { echo NL even if ECHO is off }
|
||||
ECHOPRT = $20; { visual erase mode for hardcopy }
|
||||
ECHOCTL = $40; { echo control chars as ^(Char) }
|
||||
ISIG = $80; { enable signals INTR, QUIT, [D]SUSP }
|
||||
ICANON = $100; { canonicalize input lines }
|
||||
ALTWERASE = $200; { use alternate WERASE algorithm }
|
||||
IEXTEN = $400; { enable DISCARD and LNEXT }
|
||||
EXTPROC = $800; { external processing }
|
||||
TOSTOP = $400000; { stop background jobs from output }
|
||||
FLUSHO = $800000; { output being flushed (state) }
|
||||
NOKERNINFO = $2000000; { no kernel output from VSTATUS }
|
||||
PENDIN =$20000000; { XXX retype pending input (state) }
|
||||
NOFLSH =$80000000; { don't flush after interrupt }
|
||||
|
||||
|
||||
|
||||
{
|
||||
* Commands passed to tcsetattr() for setting the termios structure.
|
||||
}
|
||||
|
||||
CONST
|
||||
|
||||
TCSANOW =0; { make change immediate }
|
||||
TCSADRAIN =1; { drain output, then change }
|
||||
TCSAFLUSH =2; { drain output, flush input }
|
||||
TCSASOFT =$10; { flag - don't alter h.w. state }
|
||||
|
||||
{
|
||||
* Standard speeds
|
||||
}
|
||||
B0 = 0;
|
||||
B50 = 50;
|
||||
B75 = 75;
|
||||
B110 = 110;
|
||||
B134 = 134;
|
||||
B150 = 150;
|
||||
B200 = 200;
|
||||
B300 = 300;
|
||||
B600 = 600;
|
||||
B1200 = 1200;
|
||||
B1800 = 1800;
|
||||
B2400 = 2400;
|
||||
B4800 = 4800;
|
||||
B9600 = 9600;
|
||||
B19200 = 19200;
|
||||
B38400 = 38400;
|
||||
B7200 = 7200;
|
||||
B14400 = 14400;
|
||||
B28800 = 28800;
|
||||
B57600 = 57600;
|
||||
B76800 = 76800;
|
||||
B115200 =115200;
|
||||
B230400 =230400;
|
||||
EXTA = 19200;
|
||||
EXTB = 38400;
|
||||
|
||||
TCIFLUSH =1;
|
||||
TCOFLUSH =2;
|
||||
TCIOFLUSH =3;
|
||||
TCOOFF =1;
|
||||
TCOON =2;
|
||||
TCIOFF =3;
|
||||
TCION =4;
|
||||
|
||||
(*
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
speed_t cfgetispeed __P((const struct termios * ));
|
||||
speed_t cfgetospeed __P((const struct termios * ));
|
||||
int cfsetispeed __P((struct termios *, speed_t));
|
||||
int cfsetospeed __P((struct termios *, speed_t));
|
||||
int tcgetattr __P((int, struct termios * ));
|
||||
int tcsetattr __P((int, int, const struct termios * ));
|
||||
int tcdrain __P((int));
|
||||
int tcflow __P((int, int));
|
||||
int tcflush __P((int, int));
|
||||
int tcsendbreak __P((int, int));
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
void cfmakeraw __P((struct termios * ));
|
||||
int cfsetspeed __P((struct termios *, speed_t));
|
||||
#endif { !_POSIX_SOURCE }
|
||||
__END_DECLS
|
||||
|
||||
#endif { !_KERNEL }
|
||||
|
||||
|
||||
|
||||
struct winsize {
|
||||
unsigned short ws_row; { rows, in characters }
|
||||
unsigned short ws_col; { columns, in characters }
|
||||
unsigned short ws_xpixel; { horizontal size, pixels }
|
||||
unsigned short ws_ypixel; { vertical size, pixels }
|
||||
};
|
||||
|
||||
*)
|
||||
IOCTLREAD = $40000000;
|
||||
IOCTLWRITE = $80000000;
|
||||
IOCTLVOID = $20000000;
|
||||
|
||||
TIOCMODG = IOCTLREAD+$47400+ 3; { get modem control state }
|
||||
TIOCMODS = IOCTLWRITE+$47400+ 4; { set modem control state }
|
||||
TIOCM_LE =$0001; { line enable }
|
||||
TIOCM_DTR =$0002; { data terminal ready }
|
||||
TIOCM_RTS =$0004; { request to send }
|
||||
TIOCM_ST =$0010; { secondary transmit }
|
||||
TIOCM_SR =$0020; { secondary receive }
|
||||
TIOCM_CTS =$0040; { clear to send }
|
||||
TIOCM_CAR =$0100; { carrier detect }
|
||||
TIOCM_CD =TIOCM_CAR;
|
||||
TIOCM_RNG =$0200; { ring }
|
||||
TIOCM_RI =TIOCM_RNG;
|
||||
TIOCM_DSR =$0400; { data set ready }
|
||||
{ 8-10 compat }
|
||||
TIOCEXCL =IOCTLVOID+$7400+ 13; { set exclusive use of tty }
|
||||
TIOCNXCL =IOCTLVOID+$7400+ 14; { reset exclusive use of tty }
|
||||
{ 15 unused }
|
||||
TIOCFLUSH =IOCTLWRITE+$47400+ 16; { flush buffers }
|
||||
{ 17-18 compat }
|
||||
TIOCGETA =IOCTLREAD+$2C7400+ 19; { get termios struct }
|
||||
TIOCSETA =IOCTLWRITE+$2C7400+ 20; { set termios struct }
|
||||
TIOCSETAW =IOCTLWRITE+$2C7400+ 21; { drain output, set }
|
||||
TIOCSETAF =IOCTLWRITE+$2C7400+ 22; { drn out, fls in, set }
|
||||
TIOCGETD =IOCTLREAD+$47400+ 26; { get line discipline }
|
||||
TIOCSETD =IOCTLWRITE+$47400+ 27; { set line discipline }
|
||||
{ 127-124 compat }
|
||||
TIOCSBRK =IOCTLVOID+$7400+ 123; { set break bit }
|
||||
TIOCCBRK =IOCTLVOID+$7400+ 122; { clear break bit }
|
||||
TIOCSDTR =IOCTLVOID+$7400+ 121; { set data terminal ready }
|
||||
TIOCCDTR =IOCTLVOID+$7400+ 120; { clear data terminal ready }
|
||||
TIOCGPGRP =IOCTLREAD+$47400+ 119; { get pgrp of tty }
|
||||
TIOCSPGRP =IOCTLWRITE+$47400+ 118; { set pgrp of tty }
|
||||
{ 117-116 compat }
|
||||
TIOCOUTQ =IOCTLREAD+$47400+ 115; { output queue size }
|
||||
TIOCSTI =IOCTLWRITE+$17400+ 114; { simulate terminal input }
|
||||
TIOCNOTTY =IOCTLVOID+$7400+ 113; { void tty association }
|
||||
TIOCPKT =IOCTLWRITE+$47400+ 112; { pty: set/clear packet mode }
|
||||
TIOCPKT_DATA =$00; { data packet }
|
||||
TIOCPKT_FLUSHREAD =$01; { flush packet }
|
||||
TIOCPKT_FLUSHWRITE =$02; { flush packet }
|
||||
TIOCPKT_STOP =$04; { stop output }
|
||||
TIOCPKT_START =$08; { start output }
|
||||
TIOCPKT_NOSTOP =$10; { no more ^S, ^Q }
|
||||
TIOCPKT_DOSTOP =$20; { now do ^S ^Q }
|
||||
TIOCPKT_IOCTL =$40; { state change of pty driver }
|
||||
TIOCSTOP =IOCTLVOID+$7400+ 111; { stop output, like ^S }
|
||||
TIOCSTART =IOCTLVOID+$7400+ 110; { start output, like ^Q }
|
||||
TIOCMSET =IOCTLWRITE+$47400+ 109; { set all modem bits }
|
||||
TIOCMBIS =IOCTLWRITE+$47400+ 108; { bis modem bits }
|
||||
TIOCMBIC =IOCTLWRITE+$47400+ 107; { bic modem bits }
|
||||
TIOCMGET =IOCTLREAD+$47400+ 106; { get all modem bits }
|
||||
TIOCREMOTE =IOCTLWRITE+$47400+ 105; { remote input editing }
|
||||
TIOCGWINSZ =IOCTLREAD+$87400+ 104; { get window size }
|
||||
TIOCSWINSZ =IOCTLWRITE+$87400+ 103; { set window size }
|
||||
TIOCUCNTL =IOCTLWRITE+$47400+ 102; { pty: set/clr usr cntl mode }
|
||||
TIOCSTAT =IOCTLVOID+$7400+ 101; { simulate ^T status message }
|
||||
// UIOCCMD(n) _IO('u', n) { usr cntl op "n" }
|
||||
TIOCCONS =IOCTLWRITE+$47400+ 98; { become virtual console }
|
||||
TIOCSCTTY =IOCTLVOID+$7400+ 97; { become controlling tty }
|
||||
TIOCEXT =IOCTLWRITE+$47400+ 96; { pty: external processing }
|
||||
TIOCSIG =IOCTLVOID+$7400+ 95; { pty: generate signal }
|
||||
TIOCDRAIN =IOCTLVOID+$7400+ 94; { wait till output drained }
|
||||
TIOCMSDTRWAIT =IOCTLWRITE+$47400+ 91; { modem: set wait on close }
|
||||
TIOCMGDTRWAIT =IOCTLREAD+$47400+ 90; { modem: get wait on close }
|
||||
TIOCTIMESTAMP =IOCTLREAD+$87400+ 89; { enable/get timestamp
|
||||
* of last input event }
|
||||
TIOCDCDTIMESTAMP =IOCTLREAD+$87400+ 88; { enable/get timestamp
|
||||
* of last DCd rise }
|
||||
TIOCSDRAINWAIT =IOCTLWRITE+$47400+ 87; { set ttywait timeout }
|
||||
TIOCGDRAINWAIT =IOCTLREAD+$47400+ 86; { get ttywait timeout }
|
||||
|
||||
TTYDISC =0; { termios tty line discipline }
|
||||
SLIPDISC =4; { serial IP discipline }
|
||||
PPPDISC =5; { PPP discipline }
|
||||
NETGRAPHDISC =6; { Netgraph tty node discipline }
|
||||
|
||||
|
||||
{
|
||||
* Defaults on "first" open.
|
||||
}
|
||||
TTYDEF_IFLAG =(BRKINT or ICRNL or IMAXBEL or IXON or IXANY);
|
||||
TTYDEF_OFLAG =(OPOST or ONLCR);
|
||||
TTYDEF_LFLAG =(ECHO or ICANON or ISIG or IEXTEN or ECHOE or ECHOKE or ECHOCTL);
|
||||
TTYDEF_CFLAG =(CREAD or CS8 or HUPCL);
|
||||
TTYDEF_SPEED =(B9600);
|
||||
|
||||
|
||||
|
||||
{
|
||||
* Control Character Defaults
|
||||
}
|
||||
CtrlMask = $1f; {\037}
|
||||
CEOF =chr( ORD('d') and CtrlMask);
|
||||
CEOL =chr( $ff and CtrlMask);{ XXX avoid _POSIX_VDISABLE }
|
||||
CERASE =chr( $7F and CtrlMask);
|
||||
CINTR =chr(ORD('c') and CtrlMask);
|
||||
CSTATUS =chr(ORD('t') and CtrlMask);
|
||||
CKILL =chr(ORD('u') and CtrlMask);
|
||||
CMIN =chr(1);
|
||||
CQUIT =chr(034 and CtrlMask); { FS, ^\ }
|
||||
CSUSP =chr(ORD('z') and CtrlMask);
|
||||
CTIME =chr(0);
|
||||
CDSUSP =chr(ORD('y') and CtrlMask);
|
||||
CSTART =chr(ORD('q') and CtrlMask);
|
||||
CSTOP =chr(ORD('s') and CtrlMask);
|
||||
CLNEXT =chr(ORD('v') and CtrlMask);
|
||||
CDISCARD =chr(ORD('o') and CtrlMask);
|
||||
CWERASE =chr(ORD('w') and CtrlMask);
|
||||
CREPRINT =chr(ORD('r') and CtrlMask);
|
||||
CEOT =CEOF;
|
||||
{ compat }
|
||||
CBRK =CEOL;
|
||||
CRPRNT =CREPRINT;
|
||||
CFLUSH =CDISCARD;
|
||||
|
||||
|
||||
{
|
||||
* TTYDEFCHARS to include an array of default control characters.
|
||||
}
|
||||
ttydefchars : array[0..NCCS-1] OF char =(
|
||||
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
|
||||
POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
|
||||
CDISCARD, CMIN, CTIME, CSTATUS, POSIX_VDISABLE);
|
||||
|
||||
|
206
rtl/netbsd/unixsock.inc
Normal file
206
rtl/netbsd/unixsock.inc
Normal file
@ -0,0 +1,206 @@
|
||||
{ $Id$ }
|
||||
|
||||
{******************************************************************************
|
||||
Basic Socket Functions
|
||||
******************************************************************************}
|
||||
|
||||
Function socket(Domain,SocketType,Protocol:Longint):Longint;
|
||||
begin
|
||||
Socket:=Do_Syscall(syscall_nr_socket,Domain,SocketType,Protocol);
|
||||
end;
|
||||
|
||||
Function Send(Sock:Longint;Const Buf;BufLen,Flags:Longint):Longint;
|
||||
begin
|
||||
Send:=do_syscall(syscall_nr_sendto,Sock,Longint(@Buf),BufLen,Flags,0,0);
|
||||
end;
|
||||
|
||||
Function SendTo(Sock:Longint;Const Buf;BufLen,Flags:Longint;Var Addr; AddrLen : Longint):Longint;
|
||||
begin
|
||||
Sendto:=do_syscall(syscall_nr_Sendto,Sock,Longint(@Buf),BufLen,Flags,Longint(@Addr),AddrLen);
|
||||
end;
|
||||
|
||||
Function Recv(Sock:Longint;Var Buf;BufLen,Flags:Longint):Longint;
|
||||
begin
|
||||
Recv:=do_syscall(syscall_nr_Recvfrom,Sock,Longint(@Buf),BufLen,Flags,0,0);
|
||||
end;
|
||||
|
||||
Function RecvFrom(Sock : Longint; Var Buf; Buflen,Flags : Longint; Var Addr ; AddrLen : Integer) : longint;
|
||||
|
||||
begin
|
||||
RecvFrom:=do_syscall(syscall_nr_Recvfrom,Sock,Longint(@buf),buflen,flags,Longint(@Addr),AddrLen);
|
||||
end;
|
||||
|
||||
Function Bind(Sock:Longint;Const Addr;AddrLen:Longint):Boolean;
|
||||
begin
|
||||
Bind:=(do_syscall(syscall_nr_Bind,Sock,Longint(@Addr),AddrLen)=0);
|
||||
end;
|
||||
|
||||
Function Listen(Sock,MaxConnect:Longint):Boolean;
|
||||
begin
|
||||
Listen:=(do_syscall(syscall_nr_Listen,Sock,MaxConnect,0)=0);
|
||||
end;
|
||||
|
||||
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
Accept:=do_syscall(syscall_nr_accept,Sock,longint(@Addr),longint(@AddrLen));
|
||||
If Accept<0 Then
|
||||
Accept:=-1;
|
||||
end;
|
||||
|
||||
Function Connect(Sock:Longint;Const Addr;Addrlen:Longint): boolean;
|
||||
|
||||
begin
|
||||
Connect:=do_syscall(syscall_nr_connect,Sock,longint(@Addr),AddrLen)=0;
|
||||
end;
|
||||
|
||||
|
||||
Function Shutdown(Sock:Longint;How:Longint):Longint;
|
||||
begin
|
||||
ShutDown:=do_syscall(syscall_nr_shutdown,Sock,How);
|
||||
end;
|
||||
|
||||
|
||||
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
GetSocketName:=do_syscall(syscall_nr_GetSockName,Sock,longint(@Addr),longint(@AddrLen));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function GetPeerName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
GetPeerName:=do_syscall(syscall_nr_GetPeerName,Sock,longint(@Addr),longint(@AddrLen));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function SetSocketOptions(Sock,Level,OptName:Longint;Const OptVal;optlen:longint):Longint;
|
||||
begin
|
||||
SetSocketOptions:=do_syscall(syscall_nr_SetSockOpt,Sock,Level,OptName,Longint(@OptVal),OptLen,0);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function GetSocketOptions(Sock,Level,OptName:Longint;Var OptVal;Var optlen:longint):Longint;
|
||||
begin
|
||||
GetSocketOptions:=do_syscall(syscall_nr_GetSockOpt,Sock,Level,OptName,Longint(@OptVal),OptLen,0);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;
|
||||
begin
|
||||
SocketPair:=do_syscall(syscall_nr_SocketPair,Domain,SocketType,Protocol,longint(@Pair),0,0);
|
||||
end;
|
||||
|
||||
{******************************************************************************
|
||||
UnixSock
|
||||
******************************************************************************}
|
||||
|
||||
Procedure Str2UnixSockAddr(const addr:string;var t:TUnixSockAddr;var len:longint);
|
||||
begin
|
||||
Move(Addr[1],t.Path,length(Addr));
|
||||
t.Family:=AF_UNIX;
|
||||
t.Path[length(Addr)]:=#0;
|
||||
Len:=Length(Addr)+3;
|
||||
end;
|
||||
|
||||
|
||||
Function Bind(Sock:longint;const addr:string):boolean;
|
||||
var
|
||||
UnixAddr : TUnixSockAddr;
|
||||
AddrLen : longint;
|
||||
begin
|
||||
Str2UnixSockAddr(addr,UnixAddr,AddrLen);
|
||||
Bind(Sock,UnixAddr,AddrLen);
|
||||
Bind:=(SocketError=0);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function DoAccept(Sock:longint;var addr:string):longint;
|
||||
var
|
||||
UnixAddr : TUnixSockAddr;
|
||||
AddrLen : longint;
|
||||
begin
|
||||
AddrLen:=length(addr)+3;
|
||||
DoAccept:=Accept(Sock,UnixAddr,AddrLen);
|
||||
Move(UnixAddr.Path,Addr[1],AddrLen);
|
||||
SetLength(Addr,AddrLen);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function DoConnect(Sock:longint;const addr:string):Boolean;
|
||||
var
|
||||
UnixAddr : TUnixSockAddr;
|
||||
AddrLen : longint;
|
||||
begin
|
||||
Str2UnixSockAddr(addr,UnixAddr,AddrLen);
|
||||
DoConnect:=Connect(Sock,UnixAddr,AddrLen);
|
||||
end;
|
||||
|
||||
Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:text):Boolean;
|
||||
var
|
||||
s : longint;
|
||||
begin
|
||||
S:=DoAccept(Sock,addr);
|
||||
if S>0 then
|
||||
begin
|
||||
Sock2Text(S,SockIn,SockOut);
|
||||
Accept:=true;
|
||||
end
|
||||
else
|
||||
Accept:=false;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:File):Boolean;
|
||||
var
|
||||
s : longint;
|
||||
begin
|
||||
S:=DoAccept(Sock,addr);
|
||||
if S>0 then
|
||||
begin
|
||||
Sock2File(S,SockIn,SockOut);
|
||||
Accept:=true;
|
||||
end
|
||||
else
|
||||
Accept:=false;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:text):Boolean;
|
||||
begin
|
||||
Connect:=DoConnect(Sock,addr);
|
||||
If Connect then
|
||||
Sock2Text(Sock,SockIn,SockOut);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean;
|
||||
begin
|
||||
Connect:=DoConnect(Sock,addr);
|
||||
if Connect then
|
||||
Sock2File(Sock,SockIn,SockOut);
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.1.2.3 2002/09/20 07:06:15 pierre
|
||||
*avoid $Id to be treated as a directive
|
||||
|
||||
Revision 1.1.2.2 2002/03/04 07:13:49 marco
|
||||
* Something that was forgotten.
|
||||
|
||||
Revision 1.1.2.4 2002/02/05 07:47:46 marco
|
||||
* Fixed typo
|
||||
|
||||
|
||||
}
|
776
rtl/netbsd/unixsysc.inc
Normal file
776
rtl/netbsd/unixsysc.inc
Normal file
@ -0,0 +1,776 @@
|
||||
{
|
||||
$Id$
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 2000 by Marco van de Voort
|
||||
member of the Free Pascal development team.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY;without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
Function Fork:longint;
|
||||
{
|
||||
This function issues the 'fork' System call. the program is duplicated in memory
|
||||
and Execution continues in parent and child process.
|
||||
In the parent process, fork returns the PID of the child. In the child process,
|
||||
zero is returned.
|
||||
A negative value indicates that an error has occurred, the error is returned in
|
||||
LinuxError.
|
||||
}
|
||||
|
||||
Begin
|
||||
fork:=Do_syscall(SysCall_nr_fork);
|
||||
LinuxError:=ErrNo;
|
||||
End;
|
||||
|
||||
(*
|
||||
function clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint;
|
||||
{NOT IMPLEMENTED YET UNDER BSD}
|
||||
begin // perhaps it is better to implement the hack from solaris then this msg
|
||||
HALT;
|
||||
END;
|
||||
|
||||
if (pointer(func)=nil) or (sp=nil) then
|
||||
begin
|
||||
LinuxError:=ESysEInval;
|
||||
exit(-1);
|
||||
end;
|
||||
asm
|
||||
{ Insert the argument onto the new stack. }
|
||||
movl sp,%ecx
|
||||
subl $8,%ecx
|
||||
movl args,%eax
|
||||
movl %eax,4(%ecx)
|
||||
|
||||
{ Save the function pointer as the zeroth argument.
|
||||
It will be popped off in the child in the ebx frobbing below. }
|
||||
movl func,%eax
|
||||
movl %eax,0(%ecx)
|
||||
|
||||
{ Do the system call }
|
||||
pushl %ebx
|
||||
pushl %ebx
|
||||
// movl flags,%ebx
|
||||
movl $251,%eax
|
||||
int $0x80
|
||||
popl %ebx
|
||||
popl %ebx
|
||||
test %eax,%eax
|
||||
jnz .Lclone_end
|
||||
|
||||
{ We're in the new thread }
|
||||
subl %ebp,%ebp { terminate the stack frame }
|
||||
call *%ebx
|
||||
{ exit process }
|
||||
movl %eax,%ebx
|
||||
movl $1,%eax
|
||||
int $0x80
|
||||
|
||||
.Lclone_end:
|
||||
movl %eax,__RESULT
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
|
||||
Procedure Execve(path:pathstr;args:ppchar;ep:ppchar);
|
||||
{
|
||||
Replaces the current program by the program specified in path,
|
||||
arguments in args are passed to Execve.
|
||||
environment specified in ep is passed on.
|
||||
}
|
||||
|
||||
Begin
|
||||
path:=path+#0;
|
||||
do_syscall(syscall_nr_Execve,longint(@path[1]),longint(Args),longint(ep));
|
||||
LinuxError:=ErrNo;
|
||||
End;
|
||||
|
||||
Function Umask(Mask:Integer):integer;
|
||||
{
|
||||
Sets file creation mask to (Mask and 0777 (octal) ), and returns the
|
||||
previous value.
|
||||
}
|
||||
begin
|
||||
UMask:=Do_syscall(syscall_nr_umask,mask);
|
||||
LinuxError:=0;
|
||||
end;
|
||||
|
||||
Procedure Nice(N:integer);
|
||||
{
|
||||
Set process priority. A positive N means a lower priority.
|
||||
A negative N decreases priority.
|
||||
|
||||
Doesn't exist in BSD. Linux emu uses setpriority in a construct as below:
|
||||
}
|
||||
|
||||
begin
|
||||
SetPriority(Prio_Process,0,N);
|
||||
end;
|
||||
|
||||
Procedure Execve(path:pchar;args:ppchar;ep:ppchar);
|
||||
{
|
||||
Replaces the current program by the program specified in path,
|
||||
arguments in args are passed to Execve.
|
||||
environment specified in ep is passed on.
|
||||
}
|
||||
|
||||
{
|
||||
Replaces the current program by the program specified in path,
|
||||
arguments in args are passed to Execve.
|
||||
environment specified in ep is passed on.
|
||||
}
|
||||
|
||||
Begin
|
||||
do_syscall(syscall_nr_Execve,longint(path),longint(Args),longint(ep));
|
||||
LinuxError:=ErrNo;
|
||||
End;
|
||||
|
||||
Procedure ExitProcess(val:longint);
|
||||
|
||||
begin
|
||||
do_syscall(Syscall_nr_exit,val);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
Function WaitPid(Pid:longint;Status:pointer;Options:longint):Longint;
|
||||
{
|
||||
Waits until a child with PID Pid exits, or returns if it is exited already.
|
||||
Any resources used by the child are freed.
|
||||
The exit status is reported in the adress referred to by Status. It should
|
||||
be a longint.
|
||||
}
|
||||
|
||||
begin
|
||||
WaitPID:=do_syscall(syscall_nr_WaitPID,PID,longint(Status),options,0);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
Function GetPriority(Which,Who:longint):longint;
|
||||
{
|
||||
Get Priority of process, process group, or user.
|
||||
Which : selects what kind of priority is used.
|
||||
can be one of the following predefined Constants :
|
||||
Prio_User.
|
||||
Prio_PGrp.
|
||||
Prio_Process.
|
||||
Who : depending on which, this is , respectively :
|
||||
Uid
|
||||
Pid
|
||||
Process Group id
|
||||
Errors are reported in linuxerror _only_. (priority can be negative)
|
||||
}
|
||||
begin
|
||||
errno:=0;
|
||||
if (which<prio_process) or (which>prio_user) then
|
||||
begin
|
||||
{ We can save an interrupt here }
|
||||
getpriority:=0;
|
||||
linuxerror:=ESyseinval;
|
||||
end
|
||||
else
|
||||
begin
|
||||
GetPriority:=do_syscall(syscall_nr_GetPriority,which,who);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
end;
|
||||
|
||||
Procedure SetPriority(Which,Who,What:longint);
|
||||
{
|
||||
Set Priority of process, process group, or user.
|
||||
Which : selects what kind of priority is used.
|
||||
can be one of the following predefined Constants :
|
||||
Prio_User.
|
||||
Prio_PGrp.
|
||||
Prio_Process.
|
||||
Who : depending on value of which, this is, respectively :
|
||||
Uid
|
||||
Pid
|
||||
Process Group id
|
||||
what : A number between -20 and 20. -20 is most favorable, 20 least.
|
||||
0 is the default.
|
||||
}
|
||||
begin
|
||||
errno:=0;
|
||||
if ((which<prio_process) or (which>prio_user)) or ((what<-20) or (what>20)) then
|
||||
linuxerror:=ESyseinval { We can save an interrupt here }
|
||||
else
|
||||
begin
|
||||
do_syscall(Syscall_nr_Setpriority,which,who,what);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Function GetPid:LongInt;
|
||||
{
|
||||
Get Process ID.
|
||||
}
|
||||
|
||||
begin
|
||||
GetPID:=do_syscall(Syscall_nr_GetPID);
|
||||
LinuxError:=errno;
|
||||
end;
|
||||
|
||||
Function GetPPid:LongInt;
|
||||
{
|
||||
Get Process ID of parent process.
|
||||
}
|
||||
|
||||
|
||||
begin
|
||||
GetPPid:=do_syscall(Syscall_nr_GetPPid);
|
||||
LinuxError:=errno;
|
||||
end;
|
||||
|
||||
Function GetUid:Longint;
|
||||
{
|
||||
Get User ID.
|
||||
}
|
||||
|
||||
begin
|
||||
GetUID:=do_syscall(Syscall_nr_GetUID);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
Function GetEUid:Longint;
|
||||
{
|
||||
Get _effective_ User ID.
|
||||
}
|
||||
|
||||
begin
|
||||
GetEUID:=do_syscall(Syscall_nr_GetEUID);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
|
||||
Function GetGid:Longint;
|
||||
{
|
||||
Get Group ID.
|
||||
}
|
||||
|
||||
begin
|
||||
GetGID:=do_syscall(Syscall_nr_getgid);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
|
||||
Function GetEGid:Longint;
|
||||
{
|
||||
Get _effective_ Group ID.
|
||||
}
|
||||
|
||||
begin
|
||||
GetEGID:=do_syscall(syscall_nr_getegid);
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
Procedure GetTimeOfDay(var tv:timeval);
|
||||
{
|
||||
Get the number of seconds since 00:00, January 1 1970, GMT
|
||||
the time NOT corrected any way
|
||||
}
|
||||
|
||||
var tz : timezone;
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_gettimeofday,longint(@tv),longint(@tz));
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function GetTimeOfDay: longint;
|
||||
{
|
||||
Get the number of seconds since 00:00, January 1 1970, GMT
|
||||
the time NOT corrected any way
|
||||
}
|
||||
begin
|
||||
GetTimeOfDay:=Sys_time;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function fdTruncate(fd,size:longint):boolean;
|
||||
|
||||
begin
|
||||
fdtruncate:=do_syscall(syscall_nr_ftruncate,fd,size,0)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function fdFlush (fd : Longint) : Boolean;
|
||||
|
||||
begin
|
||||
fdflush:=do_syscall(syscall_nr_fsync,fd)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
{$ifndef newreaddir}
|
||||
function sys_fcntl(Fd:longint;Cmd:longint;Arg:Longint):longint;
|
||||
|
||||
begin
|
||||
sys_fcntl:=do_syscall(syscall_nr_fcntl,fd,cmd,arg);
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
Function Chmod(path:pathstr;Newmode:longint):Boolean;
|
||||
{
|
||||
Changes the permissions of a file.
|
||||
}
|
||||
|
||||
begin
|
||||
path:=path+#0;
|
||||
chmod:=do_syscall(syscall_nr_chmod,longint(@path[1]),newmode)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Chown(path:pathstr;NewUid,NewGid:longint):boolean;
|
||||
{
|
||||
Change the owner and group of a file.
|
||||
A user can only change the group to a group of which he is a member.
|
||||
The super-user can change uid and gid of any file.
|
||||
}
|
||||
|
||||
begin
|
||||
path:=path+#0;
|
||||
ChOwn:=do_syscall(syscall_nr_chown,longint(@path[1]),newuid,newgid)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Utime(path:pathstr;utim:utimebuf):boolean;
|
||||
|
||||
begin
|
||||
UTime:=do_syscall(syscall_nr_utimes,longint(@path[1]),longint(@utim))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Flock (fd,mode : longint) : boolean;
|
||||
|
||||
begin
|
||||
Flock:=do_syscall(syscall_nr_flock,fd,mode)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Lstat(Filename: PathStr;var Info:stat):Boolean;
|
||||
{
|
||||
Get all information on a link (the link itself), and return it in info.
|
||||
}
|
||||
|
||||
begin
|
||||
FileName:=FileName+#0;
|
||||
LStat:=do_syscall(syscall_nr_lstat,longint(@filename[1]),longint(@info))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Fstat(Fd:Longint;var Info:stat):Boolean;
|
||||
{
|
||||
Get all information on a file descriptor, and return it in info.
|
||||
}
|
||||
|
||||
begin
|
||||
FStat:=do_syscall(syscall_nr_fstat,fd,longint(@info))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function StatFs(Path:Pathstr;Var Info:tstatfs):Boolean;
|
||||
|
||||
{
|
||||
Get all information on a fileSystem, and return it in Info.
|
||||
Path is the name of a file/directory on the fileSystem you wish to
|
||||
investigate.
|
||||
}
|
||||
|
||||
begin
|
||||
path:=path+#0;
|
||||
StatFS:=Do_Syscall(syscall_nr_statfs,longint(@path[1]),longint(@info))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function StatFS(Fd:Longint;Var Info:tstatfs):Boolean;
|
||||
{
|
||||
Get all information on a fileSystem, and return it in Info.
|
||||
Fd is the file descriptor of a file/directory on the fileSystem
|
||||
you wish to investigate.
|
||||
}
|
||||
|
||||
begin
|
||||
StatFS:=do_syscall(syscall_nr_fstatfs,fd,longint(@info))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Link(OldPath,NewPath:pathstr):boolean;
|
||||
{
|
||||
Proceduces a hard link from new to old.
|
||||
In effect, new will be the same file as old.
|
||||
}
|
||||
begin
|
||||
oldpath:=oldpath+#0;
|
||||
newpath:=newpath+#0;
|
||||
Link:=Do_Syscall(syscall_nr_link,longint(@oldpath[1]),longint(@newpath[1]))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
(*
|
||||
Function SymLink(OldPath,newPath:pathstr):boolean;
|
||||
{
|
||||
Proceduces a soft link from new to old.
|
||||
}
|
||||
|
||||
begin
|
||||
oldpath:=oldpath+#0;
|
||||
newpath:=newpath+#0;
|
||||
SymLink:=Do_Syscall(syscall_nr_symlink,longint(@oldpath[1]),longint(@newpath[1]))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
*)
|
||||
|
||||
Function Access(Path:Pathstr ;mode:longint):boolean;
|
||||
{
|
||||
Test users access rights on the specified file.
|
||||
Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
|
||||
R,W,X stand for read,write and Execute access, simultaneously.
|
||||
F_OK checks whether the test would be allowed on the file.
|
||||
i.e. It checks the search permissions in all directory components
|
||||
of the path.
|
||||
The test is done with the real user-ID, instead of the effective.
|
||||
If access is denied, or an error occurred, false is returned.
|
||||
If access is granted, true is returned.
|
||||
Errors other than no access,are reported in linuxerror.
|
||||
}
|
||||
|
||||
begin
|
||||
path:=path+#0;
|
||||
Access:=do_syscall(syscall_nr_access,longint(@path[1]),mode)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function Dup(oldfile:longint;var newfile:longint):Boolean;
|
||||
{
|
||||
Copies the filedescriptor oldfile to newfile
|
||||
}
|
||||
|
||||
begin
|
||||
newfile:=Do_syscall(syscall_nr_dup,oldfile);
|
||||
LinuxError:=Errno;
|
||||
Dup:=(LinuxError=0);
|
||||
end;
|
||||
|
||||
|
||||
Function Dup2(oldfile,newfile:longint):Boolean;
|
||||
{
|
||||
Copies the filedescriptor oldfile to newfile
|
||||
}
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_dup2,oldfile,newfile);
|
||||
LinuxError:=Errno;
|
||||
Dup2:=(LinuxError=0);
|
||||
end;
|
||||
|
||||
|
||||
Function Select(N:longint;readfds,writefds,exceptfds:PFDSet;TimeOut:PTimeVal):longint;
|
||||
{
|
||||
Select checks whether the file descriptor sets in readfs/writefs/exceptfs
|
||||
have changed.
|
||||
}
|
||||
|
||||
begin
|
||||
Select:=do_syscall(syscall_nr_select,n,longint(readfds),longint(writefds),longint(exceptfds),longint(timeout));
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
|
||||
Function AssignPipe(var pipe_in,pipe_out:longint):boolean;
|
||||
{
|
||||
Sets up a pair of file variables, which act as a pipe. The first one can
|
||||
be read from, the second one can be written to.
|
||||
If the operation was unsuccesful, linuxerror is set.
|
||||
}
|
||||
var
|
||||
pip : tpipe;
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_pipe,longint(@pip));
|
||||
LinuxError:=Errno;
|
||||
pipe_in:=pip[1];
|
||||
pipe_out:=pip[2];
|
||||
AssignPipe:=(LinuxError=0);
|
||||
end;
|
||||
|
||||
|
||||
Function PClose(Var F:text) :longint;
|
||||
var
|
||||
pl : ^longint;
|
||||
res : longint;
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_close,Textrec(F).Handle);
|
||||
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
||||
pl:=@(textrec(f).userdata[2]);
|
||||
waitpid(pl^,@res,0);
|
||||
pclose:=res shr 8;
|
||||
end;
|
||||
|
||||
Function PClose(Var F:file) : longint;
|
||||
var
|
||||
pl : ^longint;
|
||||
res : longint;
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_close,filerec(F).Handle);
|
||||
{ closed our side, Now wait for the other - this appears to be needed ?? }
|
||||
pl:=@(filerec(f).userdata[2]);
|
||||
waitpid(pl^,@res,0);
|
||||
pclose:=res shr 8;
|
||||
end;
|
||||
|
||||
|
||||
Function mkFifo(pathname:string;mode:longint):boolean;
|
||||
|
||||
begin
|
||||
pathname:=pathname+#0;
|
||||
mkfifo:=do_syscall(syscall_nr_mknod,longint(@pathname[1]),mode or STAT_IFIFO,0)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
|
||||
Function Kill(Pid:longint;Sig:longint):integer;
|
||||
{
|
||||
Send signal 'sig' to a process, or a group of processes.
|
||||
If Pid > 0 then the signal is sent to pid
|
||||
pid=-1 to all processes except process 1
|
||||
pid < -1 to process group -pid
|
||||
Return value is zero, except for case three, where the return value
|
||||
is the number of processes to which the signal was sent.
|
||||
}
|
||||
|
||||
begin
|
||||
kill:=do_syscall(syscall_nr_kill,pid,sig);
|
||||
if kill<0 THEN
|
||||
Kill:=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Procedure SigProcMask(How:longint;SSet,OldSSet:PSigSet);
|
||||
{
|
||||
Change the list of currently blocked signals.
|
||||
How determines which signals will be blocked :
|
||||
SigBlock : Add SSet to the current list of blocked signals
|
||||
SigUnBlock : Remove the signals in SSet from the list of blocked signals.
|
||||
SigSetMask : Set the list of blocked signals to SSet
|
||||
if OldSSet is non-null, the old set will be saved there.
|
||||
}
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_sigprocmask,longint(how),longint(sset),longint(oldsset));
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function SigPending:SigSet;
|
||||
{
|
||||
Allows examination of pending signals. The signal mask of pending
|
||||
signals is set in SSet
|
||||
}
|
||||
Var
|
||||
dummy : Sigset;
|
||||
begin
|
||||
do_syscall(syscall_nr_sigpending,longint(@dummy));
|
||||
LinuxError:=Errno;
|
||||
sigpending:=dummy;
|
||||
end;
|
||||
|
||||
Procedure SigSuspend(Mask:Sigset);
|
||||
{
|
||||
Set the signal mask with Mask, and suspend the program until a signal
|
||||
is received.
|
||||
}
|
||||
|
||||
begin
|
||||
do_syscall(syscall_nr_sigsuspend,longint(@mask));
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
Function NanoSleep(const req : timespec;var rem : timespec) : longint;
|
||||
begin
|
||||
NanoSleep:=Do_SysCall(syscall_nr_nanosleep,longint(@req),longint(@rem));
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Function IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean;
|
||||
{
|
||||
Interface to Unix ioctl call.
|
||||
Performs various operations on the filedescriptor Handle.
|
||||
Ndx describes the operation to perform.
|
||||
Data points to data needed for the Ndx function. The structure of this
|
||||
data is function-dependent.
|
||||
}
|
||||
|
||||
begin
|
||||
IOCtl:=Do_Syscall(syscall_nr_ioctl,handle,ndx,longint(data))=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
function MMap(const m:tmmapargs):longint;
|
||||
|
||||
begin
|
||||
{Last argument (offset) is actually 64-bit under BSD. Therefore extra 0}
|
||||
MMap:=do_syscall(syscall_nr_mmap,m.address,m.size,m.prot,m.flags,m.fd,m.offset,0);
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
function MUnMap (P : Pointer; Size : Longint) : Boolean;
|
||||
|
||||
begin
|
||||
MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size)=0;
|
||||
LinuxError:=Errno;
|
||||
end;
|
||||
|
||||
function signal(signum:longint;Handler:signalhandler):signalhandler;
|
||||
|
||||
var sa,osa : sigactionrec;
|
||||
|
||||
begin
|
||||
sa.sa_handler:=handler;
|
||||
FillChar(sa.sa_mask,sizeof(sigset),#0);
|
||||
sa.sa_flags := 0;
|
||||
(*
|
||||
if (sigintr and signum) =0 then
|
||||
{restart behaviour needs libc}
|
||||
sa.sa_flags :=sa.sa_flags or SA_RESTART;
|
||||
*)
|
||||
sigaction(signum,@sa,@osa);
|
||||
if ErrNo<>0 then
|
||||
signal:=NIL
|
||||
else
|
||||
signal:=osa.sa_handler;
|
||||
LinuxError:=Errno;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
function Clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint;
|
||||
{$ifndef FPC_HAS_NO_SYSCALL_NR_RFORK}
|
||||
assembler;
|
||||
asm
|
||||
pushl %esi
|
||||
movl 12(%ebp), %esi // get stack addr
|
||||
subl $4, %esi
|
||||
movl 20(%ebp), %eax // get __arg
|
||||
movl %eax, (%esi)
|
||||
subl $4, %esi
|
||||
movl 8(%ebp), %eax // get __fn
|
||||
movl %eax, (%esi)
|
||||
pushl 16(%ebp)
|
||||
pushl %esi
|
||||
mov syscall_nr_rfork, %eax
|
||||
int $0x80 // call actualsyscall
|
||||
jb .L2
|
||||
test %edx, %edx
|
||||
jz .L1
|
||||
movl %esi,%esp
|
||||
popl %eax
|
||||
call %eax
|
||||
addl $8, %esp
|
||||
call halt // Does not return
|
||||
.L2:
|
||||
mov %eax,ErrNo
|
||||
mov $-1,%eax
|
||||
jmp .L1
|
||||
// jmp PIC_PLT(HIDENAME(cerror))
|
||||
.L1:
|
||||
addl $8, %esp
|
||||
popl %esi
|
||||
end;
|
||||
{$else FPC_HAS_NO_SYSCALL_NR_RFORK}
|
||||
begin
|
||||
RunError(218);
|
||||
Clone:=-1;
|
||||
end;
|
||||
{$endif FPC_HAS_NO_SYSCALL_NR_RFORK}
|
||||
|
||||
{$packrecords C}
|
||||
|
||||
TYPE uint=CARDINAL;
|
||||
|
||||
CONST
|
||||
I386_GET_LDT =0;
|
||||
I386_SET_LDT =1;
|
||||
{ I386_IOPL }
|
||||
I386_GET_IOPERM =3;
|
||||
I386_SET_IOPERM =4;
|
||||
{ xxxxx }
|
||||
I386_VM86 =6;
|
||||
|
||||
{
|
||||
type i386_ldt_args = record
|
||||
int start : longint;
|
||||
union descriptor *descs;
|
||||
int num;
|
||||
end;
|
||||
}
|
||||
type
|
||||
i386_ioperm_args = record
|
||||
start : uint;
|
||||
length : uint;
|
||||
enable : longint;
|
||||
end;
|
||||
|
||||
|
||||
i386_vm86_args = record
|
||||
sub_op : longint; { sub-operation to perform }
|
||||
sub_args : pchar; { args }
|
||||
end;
|
||||
|
||||
sysarch_args = record
|
||||
op : longint;
|
||||
parms : pchar;
|
||||
end;
|
||||
|
||||
{
|
||||
int i386_get_ldt __P((int, union descriptor *, int));
|
||||
int i386_set_ldt __P((int, union descriptor *, int));
|
||||
int i386_get_ioperm __P((unsigned int, unsigned int *, int *));
|
||||
int i386_set_ioperm __P((unsigned int, unsigned int, int));
|
||||
int i386_vm86 __P((int, void *));
|
||||
int i386_set_watch __P((int watchnum, unsigned int watchaddr, int size,
|
||||
int access, struct dbreg * d));
|
||||
int i386_clr_watch __P((int watchnum, struct dbreg * d));
|
||||
}
|
||||
|
||||
Function IOPerm(From,Num:CARDINAL;Value:Longint):boolean;
|
||||
|
||||
var sg : i386_ioperm_args;
|
||||
sa : sysarch_args;
|
||||
|
||||
begin
|
||||
sg.start:=From;
|
||||
sg.length:=Num;
|
||||
sg.enable:=value;
|
||||
sa.op:=i386_SET_IOPERM;
|
||||
sa.parms:=@sg;
|
||||
IOPerm:=do_syscall(syscall_nr_sysarch,longint(@sa))=0;
|
||||
LinuxError:=ErrNo;
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2003-01-21 15:39:45 marco
|
||||
* NetBSD first rtl. Still not 100%, but close
|
||||
|
||||
Revision 1.1.2.3 2002/09/26 08:13:08 marco
|
||||
* Fix from Lazarus
|
||||
|
||||
Revision 1.1.2.2 2002/09/20 07:04:15 pierre
|
||||
* avoid compiler warning and comment level 2 warning
|
||||
|
||||
Revision 1.1.2.1 2001/08/10 11:07:17 pierre
|
||||
New NetBSD files taken and adapted from FreeBSD
|
||||
|
||||
Revision 1.1.2.3 2001/06/02 00:25:30 peter
|
||||
* moved some unix files to target dependent dirs
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user