2
$Id: sysos.inc,v 1.2 2005/02/14 17:13:30 peter Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 2001 by Free Pascal development team
6
This file implements all the base types and limits required
7
for a minimal POSIX compliant subset required to port the compiler
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
19
{*****************************************************************************
21
*****************************************************************************}
25
{$include doslibd.inc}
28
{*****************************************************************************
30
*****************************************************************************}
32
{ exec.library functions }
35
{$include doslibf.inc}
38
{*****************************************************************************
39
System Dependent Structures/Consts
40
*****************************************************************************}
43
CTRL_C = 20; { Error code on CTRL-C press }
45
{ Used for CTRL_C checking in I/O calls }
49
if (SetSignal(0,0) And SIGBREAKF_CTRL_C)<>0 then begin
50
{ Clear CTRL-C signal }
51
SetSignal(0,SIGBREAKF_CTRL_C);
58
{ Converts a MorphOS dos.library error code to a TP compatible error code }
59
{ Based on 1.0.x Amiga RTL }
60
procedure dosError2InOut(errno: LongInt);
64
ERROR_ACTION_NOT_KNOWN,
65
ERROR_NOT_IMPLEMENTED : InOutRes := 1;
67
ERROR_OBJECT_NOT_FOUND : InOutRes := 2;
68
ERROR_DIR_NOT_FOUND : InOutRes := 3;
69
ERROR_DISK_WRITE_PROTECTED : InOutRes := 150;
70
ERROR_OBJECT_WRONG_TYPE : InOutRes := 151;
73
ERROR_DELETE_PROTECTED,
74
ERROR_WRITE_PROTECTED,
77
ERROR_DIRECTORY_NOT_EMPTY : InOutRes := 5;
79
ERROR_NO_MORE_ENTRIES : InOutRes := 18;
80
ERROR_RENAME_ACROSS_DEVICES : InOutRes := 17;
81
ERROR_DISK_FULL : InOutRes := 101;
82
ERROR_INVALID_RESIDENT_LIBRARY : InoutRes := 153;
83
ERROR_BAD_HUNK : InOutRes := 153;
84
ERROR_NOT_A_DOS_DISK : InOutRes := 157;
87
ERROR_DISK_NOT_VALIDATED,
88
ERROR_DEVICE_NOT_MOUNTED : InOutRes := 152;
90
ERROR_SEEK_ERROR : InOutRes := 156;
96
ERROR_INVALID_COMPONENT_NAME,
97
ERROR_BAD_STREAM_NAME,
98
ERROR_FILE_NOT_OBJECT : InOutRes := 6;
105
{ Converts an Unix-like path to Amiga-like path }
106
function PathConv(path: string): string; alias: 'PATHCONV'; [public];
109
{ check for short paths }
110
if length(path)<=2 then begin
111
if (path='.') or (path='./') then path:='' else
112
if path='..' then path:='/' else
113
if path='*' then path:='#?';
115
{ convert parent directories }
116
tmppos:=pos('../',path);
117
while tmppos<>0 do begin
118
{ delete .. to have / as parent dir sign }
119
delete(path,tmppos,2);
120
tmppos:=pos('../',path);
122
{ convert current directories }
123
tmppos:=pos('./',path);
124
while tmppos<>0 do begin
125
{ delete ./ since we doesn't need to sign current directory }
126
delete(path,tmppos,2);
127
tmppos:=pos('./',path);
129
{ convert wildstart to #? }
130
tmppos:=pos('*',path);
131
while tmppos<>0 do begin
132
delete(path,tmppos,1);
133
insert('#?',path,tmppos);
134
tmppos:=pos('*',path);
144
Revision 1.2 2005/02/14 17:13:30 peter
147
Revision 1.1 2005/02/07 21:30:12 peter
148
* system unit updated
150
Revision 1.1 2005/02/06 16:57:18 peter
151
* threads for go32v2,os,emx,netware
153
Revision 1.1 2005/02/06 13:06:20 peter
154
* moved file and dir functions to sysfile/sysdir
155
* win32 thread in systemunit