| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- {
- $Id$
- This file is part of the Free Pascal run time library.
- Copyright (c) 2001 by Free Pascal development team
- This file implements all the base types and limits required
- for a minimal POSIX compliant subset required to port the compiler
- to a new OS.
- 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.
- **********************************************************************}
- {$ifdef FPC_USE_LIBC}
- const clib = 'c';
- type libcint=longint;
- plibcint=^libcint;
- function geterrnolocation: Plibcint; cdecl;external clib name'__errno_location';
- function geterrno:libcint; [public, alias: 'FPC_SYS_GETERRNO'];
- begin
- geterrno:=geterrnolocation^;
- end;
- procedure seterrno(err:libcint); [public, alias: 'FPC_SYS_SETERRNO'];
- begin
- geterrnolocation^:=err;
- end;
- {$else}
- {$ifdef ver1_0}
- Var
- {$else}
- ThreadVar
- {$endif}
- Errno : longint;
- function geterrno:longint; [public, alias: 'FPC_SYS_GETERRNO'];
- begin
- GetErrno:=Errno;
- end;
- procedure seterrno(err:longint); [public, alias: 'FPC_SYS_SETERRNO'];
- begin
- Errno:=err;
- end;
- {$endif}
- { OS dependant parts }
- {$I errno.inc} // error numbers
- {$I bunxtype.inc} // c-types, unix base types, unix
- // base structures
- {*****************************************************************************
- Extra cdecl declarations for FPC_USE_LIBC for this os
- *****************************************************************************}
- {$ifdef FPC_USE_LIBC}
- Function fpReadLink(name,linkname:pchar;maxlen:cint):cint; cdecl; external name 'readlink';
- function fpgetcwd(buf:pchar;_size:size_t):pchar; cdecl; external name 'getcwd';
- {$endif}
- {$I ossysc.inc} // base syscalls
- {$I osmain.inc} // base wrappers *nix RTL (derivatives)
- const
- { read/write permission for everyone }
- MODE_OPEN = S_IWUSR OR S_IRUSR OR
- S_IWGRP OR S_IRGRP OR
- S_IWOTH OR S_IROTH;
- { read/write search permission for everyone }
- MODE_MKDIR = MODE_OPEN OR
- S_IXUSR OR S_IXGRP OR S_IXOTH;
- {
- $Log$
- Revision 1.2 2005-02-06 13:06:20 peter
- * moved file and dir functions to sysfile/sysdir
- * win32 thread in systemunit
- Revision 1.1 2005/02/06 11:20:52 peter
- * threading in system unit
- * removed systhrds unit
- }
|