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

Contents of /trunk/unixstuff.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Fri Mar 28 02:26:58 2008 UTC (13 years, 4 months ago) by plugwash
File size: 1965 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 {$ifndef ver1_9_4}
30 procedure Execl(Todo:string);inline;
31 var
32 p : ppchar;
33 begin
34 p := unixutil.StringToPPChar(Todo,1);
35 if (p=nil) or (p^=nil) then exit;
36 fpexecv(p^,p);
37 end;
38 {$endif}
39 {$endif}
40 procedure gettimeofday(var tv:ttimeval);inline;
41 begin
42 fpgettimeofday(@tv,nil);
43 end;
44 function gettimeofdaysec : longint;
45 var
46 tv:ttimeval;
47 begin
48 gettimeofday(tv);
49 result := tv.tv_sec;
50 end;
51
52 //a function is used here rather than a define to prevent issues with tlasio.dup
53 function dup(const original:integer):integer;inline;
54 begin
55 result := fpdup(original);
56 end;
57 function octal(invalue:longint):longint;
58 var
59 a : integer;
60 i : integer;
61 begin
62 i := 0;
63 result := 0;
64 while invalue <> 0 do begin
65 a := invalue mod 10;
66 result := result + (a shl (i*3));
67
68 invalue := invalue div 10;
69 inc(i);
70 end;
71 end;
72 const
73 sys_eintr=esyseintr;
74
75 {$endif}
76 {$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