/[lcore]/trunk/httpserver_20080306/unixstuff.inc
ViewVC logotype

Contents of /trunk/httpserver_20080306/unixstuff.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Fri Mar 28 02:26:58 2008 UTC (13 years, 2 months ago) by plugwash
File size: 1753 byte(s)
initial import

1 {$ifdef UNIX}
2 {$macro on}
3 {$ifdef VER1_0}
4 {$define tv_sec := sec}
5 {$define tv_usec := usec}
6 function dup(const original:integer):integer;inline;
7 begin
8 linux.dup(original,result);
9 end;
10 {$define gettimeofdaysec := gettimeofday}
11 {$else}
12
13 {$define sigprocmask := fpsigprocmask}
14 {$define sigaction := fpsigaction}
15 {$define fdclose := fpclose}
16 {$define fcntl := fpfcntl}
17 {$define fdwrite := fpwrite}
18 {$define fdread := fpread}
19 {$define fdopen := fpopen}
20 {$define select := fpselect}
21 {$define linuxerror := fpgeterrno}
22 {$define fork := fpfork}
23 {$define getpid := fpgetpid}
24 {$define getenv := fpgetenv}
25 {$define chmod := fpchmod}
26 {$define dup2 := fpdup2}
27 {$ifndef ver1_9_2}
28 {$define flock := fpflock}
29 {$endif}
30 procedure gettimeofday(var tv:ttimeval);inline;
31 begin
32 fpgettimeofday(@tv,nil);
33 end;
34 function gettimeofdaysec : longint;
35 var
36 tv:ttimeval;
37 begin
38 gettimeofday(tv);
39 result := tv.tv_sec;
40 end;
41
42 //a function is used here rather than a define to prevent issues with tlasio.dup
43 function dup(const original:integer):integer;inline;
44 begin
45 result := fpdup(original);
46 end;
47 function octal(invalue:longint):longint;
48 var
49 a : integer;
50 i : integer;
51 begin
52 i := 0;
53 result := 0;
54 while invalue <> 0 do begin
55 a := invalue mod 10;
56 result := result + (a shl (i*3));
57
58 invalue := invalue div 10;
59 inc(i);
60 end;
61 end;
62 const
63 sys_eintr=esyseintr;
64
65 {$endif}
66 {$endif}

Properties

Name Value
svn:executable

No admin address has been configured">No admin address has been configured
ViewVC Help
Powered by ViewVC 1.1.26