1{
2    This file is part of the Free Pascal run time library.
3    This unit implements cygwin initialization
4    Copyright (c) 1999-2006 by the Free Pascal development team.
5
6    See the file COPYING.FPC, included in this distribution,
7    for details about the copyright.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 **********************************************************************}
14unit initc;
15
16interface
17uses
18  ctypes;
19
20function fpgetCerrno:cint;
21procedure fpsetCerrno(err:cint);
22
23property cerrno:cint read fpgetCerrno write fpsetcerrno;
24
25
26implementation
27
28function geterrnolocation: pcint; cdecl;external 'cygwin1.dll' name '__errno';
29
30function fpgetCerrno:cint;
31begin
32  fpgetCerrno:=geterrnolocation^;
33end;
34
35procedure fpsetCerrno(err:cint);
36begin
37  geterrnolocation^:=err;
38end;
39
40end.
41