* more cleanups

This commit is contained in:
marco 2003-11-19 10:12:02 +00:00
parent dc50826f6a
commit 1ef3b8b988
5 changed files with 41 additions and 22 deletions

View File

@ -1,5 +1,5 @@
# #
# Don't edit, this file is generated by FPCMake Version 1.1 [2003/11/11] # Don't edit, this file is generated by FPCMake Version 1.1 [2003/11/18]
# #
default: all default: all
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
@ -215,13 +215,11 @@ UNIXINC=$(RTL)/unix
UNITPREFIX=rtl UNITPREFIX=rtl
ifeq ($(findstring 1.0.,$(FPC_VERSION)),) ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
SYSTEMUNIT=system SYSTEMUNIT=system
LINUXUNIT=
PRT0=prt0 PRT0=prt0
override FPCOPT+=-dNOMOUSE override FPCOPT+=-dNOMOUSE
loaders+=gprt0 loaders+=gprt0
else else
SYSTEMUNIT=sysbsd SYSTEMUNIT=sysbsd
LINUXUNIT=linux
override FPCOPT+=-dUNIX -dNOMOUSE override FPCOPT+=-dUNIX -dNOMOUSE
PRT0=prt0_10 PRT0=prt0_10
endif endif
@ -233,7 +231,7 @@ GRAPHDIR=$(INC)/graph
ifndef USELIBGGI ifndef USELIBGGI
USELIBGGI=NO USELIBGGI=NO
endif endif
override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings baseunix syscall unixutil $(LINUXUNIT) unix initc dos dl crt objects printer sysutils typinfo systhrds classes math varutils cpu mmx charset ucomplex getopts heaptrc lineinfo errors sockets gpm ipc terminfo video mouse keyboard console serial variants types sysctl override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings syscall baseunix unixutil unix initc dos dl crt objects printer sysutils typinfo systhrds classes math varutils cpu mmx charset ucomplex getopts heaptrc lineinfo errors sockets gpm ipc terminfo video mouse keyboard console serial variants types sysctl
override TARGET_LOADERS+=prt0 cprt0 gprt0 override TARGET_LOADERS+=prt0 cprt0 gprt0
override TARGET_RSTS+=math varutils typinfo classes variants override TARGET_RSTS+=math varutils typinfo classes variants
override INSTALL_FPCPACKAGE=y y override INSTALL_FPCPACKAGE=y y

View File

@ -10,8 +10,8 @@ fpcpackage=y
[target] [target]
loaders=prt0 cprt0 gprt0 loaders=prt0 cprt0 gprt0
units=$(SYSTEMUNIT) objpas strings baseunix syscall unixutil \ units=$(SYSTEMUNIT) objpas strings syscall baseunix unixutil \
$(LINUXUNIT) unix initc \ unix initc \
dos dl crt objects printer \ dos dl crt objects printer \
sysutils typinfo systhrds classes math varutils \ sysutils typinfo systhrds classes math varutils \
cpu mmx charset ucomplex getopts heaptrc lineinfo \ cpu mmx charset ucomplex getopts heaptrc lineinfo \
@ -55,13 +55,11 @@ UNITPREFIX=rtl
ifeq ($(findstring 1.0.,$(FPC_VERSION)),) ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
SYSTEMUNIT=system SYSTEMUNIT=system
LINUXUNIT=
PRT0=prt0 PRT0=prt0
override FPCOPT+=-dNOMOUSE override FPCOPT+=-dNOMOUSE
loaders+=gprt0 loaders+=gprt0
else else
SYSTEMUNIT=sysbsd SYSTEMUNIT=sysbsd
LINUXUNIT=linux
override FPCOPT+=-dUNIX -dNOMOUSE override FPCOPT+=-dUNIX -dNOMOUSE
PRT0=prt0_10 PRT0=prt0_10
endif endif

View File

@ -4,6 +4,8 @@
Copyright (c) 1999-2000 by Michael Van Canneyt, Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team. member of the Free Pascal development team.
Constants for Unix unit.
See the file COPYING.FPC, included in this distribution, See the file COPYING.FPC, included in this distribution,
for details about the copyright. for details about the copyright.
@ -13,14 +15,19 @@
**********************************************************************} **********************************************************************}
{BSD version, only the blocks with BSD in the comment are updated}
Const const
{ Things for LSEEK call, same in linux and BSD } { For getting/setting priority }
Prio_Process = 0;
Prio_PGrp = 1;
Prio_User = 2;
{ Things for LSEEK call}
Seek_set = 0; Seek_set = 0;
Seek_Cur = 1; Seek_Cur = 1;
Seek_End = 2; Seek_End = 2;
{ Things for OPEN call - after include/sys/fcntl.h, BSD updated.
{ Things for OPEN call - after include/sys/fcntl.h,
BSD specifies these constants in hex } BSD specifies these constants in hex }
Open_Accmode = 3; Open_Accmode = 3;
Open_RdOnly = 0; Open_RdOnly = 0;
@ -44,6 +51,8 @@ Const
Wait_UnTraced = 2; Wait_UnTraced = 2;
Wait_Any = -1; Wait_Any = -1;
Wait_MyPGRP = 0; Wait_MyPGRP = 0;
{ Constants to check stat.mode - checked all STAT constants with BSD} { Constants to check stat.mode - checked all STAT constants with BSD}
STAT_IFMT = $f000; {00170000 } STAT_IFMT = $f000; {00170000 }
STAT_IFSOCK = $c000; {0140000 } STAT_IFSOCK = $c000; {0140000 }
@ -92,6 +101,11 @@ Const
{Constansts Termios/Ioctl (used in Do_IsDevice) } {Constansts Termios/Ioctl (used in Do_IsDevice) }
IOCtl_TCGETS= $40000000+$2C7400+ 19; // TCGETS is also in termios.inc, but the sysunix needs only this IOCtl_TCGETS= $40000000+$2C7400+ 19; // TCGETS is also in termios.inc, but the sysunix needs only this
ITimer_Real =0;
ITimer_Virtual =1;
ITimer_Prof =2;
{
{Checked for BSD using Linuxthreads port} {Checked for BSD using Linuxthreads port}
{ cloning flags } { cloning flags }
CSIGNAL = $000000ff; // signal mask to be sent at exit CSIGNAL = $000000ff; // signal mask to be sent at exit
@ -101,17 +115,16 @@ Const
CLONE_SIGHAND = $00000800; // set if signal handlers shared CLONE_SIGHAND = $00000800; // set if signal handlers shared
CLONE_PID = $00001000; // set if pid shared CLONE_PID = $00001000; // set if pid shared
ITimer_Real =0;
ITimer_Virtual =1;
ITimer_Prof =2;
type type
TCloneFunc=function(args:pointer):longint;cdecl; TCloneFunc=function(args:pointer):longint;cdecl;
}
{ {
$Log$ $Log$
Revision 1.8 2003-11-17 16:56:20 marco Revision 1.9 2003-11-19 10:12:02 marco
* more cleanups
Revision 1.8 2003/11/17 16:56:20 marco
* tiocgeta fixed * tiocgeta fixed
Revision 1.7 2002/09/07 16:01:17 peter Revision 1.7 2002/09/07 16:01:17 peter

View File

@ -54,6 +54,7 @@ end;
//function SIGCHLDHandler(Sig: longint): longint; cdecl;//this is std linux C declaration as function //function SIGCHLDHandler(Sig: longint): longint; cdecl;//this is std linux C declaration as function
procedure SIGCHLDHandler(Sig: longint); cdecl; procedure SIGCHLDHandler(Sig: longint); cdecl;
begin begin
fpwaitpid(-1, nil, WNOHANG); fpwaitpid(-1, nil, WNOHANG);
end; end;
@ -73,7 +74,7 @@ begin
GetMem(Act, SizeOf(SigActionRec)); GetMem(Act, SizeOf(SigActionRec));
GetMem(OldAct, SizeOf(SigActionRec)); GetMem(OldAct, SizeOf(SigActionRec));
Act^.sa_handler := @SIGCHLDHandler; Act^.sa_handler := TSigAction(@SIGCHLDHandler);
Act^.sa_flags := SA_NOCLDSTOP {or SA_NOMASK or SA_RESTART}; Act^.sa_flags := SA_NOCLDSTOP {or SA_NOMASK or SA_RESTART};
Fillchar(Act^.sa_mask,sizeof(Act^.sa_mask),0); //Do not block all signals ??. Don't need if SA_NOMASK in flags Fillchar(Act^.sa_mask,sizeof(Act^.sa_mask),0); //Do not block all signals ??. Don't need if SA_NOMASK in flags
FpSigAction(SIGCHLD, Act, OldAct); FpSigAction(SIGCHLD, Act, OldAct);
@ -605,7 +606,10 @@ end;
{ {
$Log$ $Log$
Revision 1.5 2003-11-17 10:05:51 marco Revision 1.6 2003-11-19 10:12:02 marco
* more cleanups
Revision 1.5 2003/11/17 10:05:51 marco
* threads for FreeBSD. Not working tho * threads for FreeBSD. Not working tho
Revision 1.4 2003/11/17 08:27:49 marco Revision 1.4 2003/11/17 08:27:49 marco

View File

@ -189,6 +189,7 @@ begin
MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size)=0; MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size)=0;
end; end;
{
function intClone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint; {$ifndef ver1_0} oldfpccall; {$endif} function intClone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint; {$ifndef ver1_0} oldfpccall; {$endif}
@ -240,10 +241,15 @@ begin
Clone:= Clone:=
intclone(tclonefunc(func),sp,flags,args); intclone(tclonefunc(func),sp,flags,args);
end; end;
}
{ {
$Log$ $Log$
Revision 1.14 2003-11-17 10:05:51 marco Revision 1.15 2003-11-19 10:12:02 marco
* more cleanups
Revision 1.14 2003/11/17 10:05:51 marco
* threads for FreeBSD. Not working tho * threads for FreeBSD. Not working tho
Revision 1.13 2003/11/14 16:21:59 marco Revision 1.13 2003/11/14 16:21:59 marco