Преглед изворни кода

+ Fixed some differences with Kylix libc

git-svn-id: trunk@834 -
michael пре 20 година
родитељ
комит
216d27705d

+ 1 - 0
.gitattributes

@@ -1390,6 +1390,7 @@ packages/base/libc/timeh.inc svneol=native#text/plain
 packages/base/libc/timesh.inc svneol=native#text/plain
 packages/base/libc/timexh.inc svneol=native#text/plain
 packages/base/libc/ttyenth.inc svneol=native#text/plain
+packages/base/libc/types.inc svneol=native#text/plain
 packages/base/libc/typesh.inc svneol=native#text/plain
 packages/base/libc/ucontexth.inc svneol=native#text/plain
 packages/base/libc/ulimith.inc svneol=native#text/plain

+ 2 - 1
packages/base/libc/libc.pp

@@ -225,7 +225,8 @@ Implementation
 
 uses kernelioctl;
 
-{$i cerrno.inc}        // errno.h asm/errno.h bits/errno.h macros.
+{$i types.inc}         // types.h macros.
+{$i cerrno.inc}       // errno.h asm/errno.h bits/errno.h macros.
 {$i time.inc}         // bits/time.h macros.
 {$i stime.inc}        // sys/time.h macros.
 {$i dirent.inc}       // dirent.h macros.

+ 6 - 0
packages/base/libc/semaphoreh.inc

@@ -6,6 +6,7 @@ type
         __sem_value : longint;
         __sem_waiting : _pthread_descr;
      end;
+              
 
 Const
   SEM_FAILED    = Psem_t(nil);
@@ -31,6 +32,11 @@ Type
   TSemaphore = sem_t;
   PSemaphore = ^TSemaphore;
 
+   __sem_lock_t = record { Not in header file - anonymous , should equal _pthread_fastlock} 
+     status: Longint;
+     spinlock: Integer;
+   end;
+
 function sem_init(var __sem: sem_t; __pshared:longint; __value:dword):longint;cdecl;external threadslib name 'sem_init';
 function sem_destroy(var __sem: sem_t):longint;cdecl;external threadslib name 'sem_destroy';
 function sem_close(var __sem: sem_t):longint;cdecl;external threadslib name 'sem_close';

+ 1 - 3
packages/base/libc/sigactionh.inc

@@ -8,7 +8,6 @@ type
      sa_restorer : procedure ;cdecl;
    end;
 
-
 const
    SA_NOCLDSTOP = 1;
    SA_NOCLDWAIT = 2;
@@ -37,8 +36,7 @@ const
 Type
   TSigAction = _sigaction;
   PSigAction = ^TSigAction;
-
   TRestoreHandler = procedure; cdecl;
-
+   __sigaction = _sigaction;
 
 

+ 23 - 2
packages/base/libc/siginfoh.inc

@@ -155,5 +155,26 @@ Type
   TSigInfo = siginfo;
 
   TSigEvent = sigevent;
-
-
+  _si_kill =  record
+    si_pid: __pid_t;
+    si_uid: __uid_t;
+  end;
+  _si_pad = packed array[0..__SI_PAD_SIZE-1] of Integer;
+  _si_sigfault = record
+    si_addr: Pointer; 
+  end;
+  _si_sigpoll = record
+    si_band: Longint; 
+    si_fd: Integer;
+  end;
+  _si_timer = record
+    _timer1: Cardinal;
+    _timer2: Cardinal;
+  end;
+  _si_rt =  record
+    si_pid: __pid_t;
+    si_uid: __uid_t;
+    si_sigval: sigval_t;
+  end;
+                  
+            

+ 0 - 13
packages/base/libc/sselect.inc

@@ -1,17 +1,4 @@
 
-Function __FDELT(d: longint): Integer;inline;
-
-begin
-  Result:=d div __NFDBITS;
-end;
-
-
-Function __FDMASK(d: longint): __fd_mask;inline;
-begin
-  Result:=1 shl (d mod __NFDBITS);
-end;
-
-
 Function FD_ISSET(fd: longint; const fdset: _fd_set): Boolean;
 
 begin

+ 0 - 2
packages/base/libc/sselecth.inc

@@ -13,8 +13,6 @@ Type
 const
   NFDBITS = __NFDBITS;
   
-Function __FDELT(d: longint): Integer;inline;
-Function __FDMASK(d: longint): __fd_mask;inline;
 procedure FD_ZERO(var fdset: _fd_set);
 procedure FD_SET(fd: longint; var fdset: _fd_Set);
 procedure FD_CLR(fd: longint; var fdset: _fd_set);

+ 11 - 0
packages/base/libc/types.inc

@@ -0,0 +1,11 @@
+Function __FDELT(d: longint): Integer;
+
+begin
+  Result:=d div __NFDBITS;
+end;
+
+
+Function __FDMASK(d: longint): __fd_mask;
+begin
+  Result:=1 shl (d mod __NFDBITS);
+end;

+ 12 - 3
packages/base/libc/typesh.inc

@@ -58,7 +58,7 @@ type
   TFdSet = __fd_set;
   PFdSet = ^TFdSet;
 
-
+ 
 type
   __key_t = longint;
   __ipc_pid_t = word;
@@ -75,7 +75,8 @@ type
   __t_uscalar_t = dword;
   __intptr_t = longint;
   __socklen_t = dword;
-
+  TFileDescriptor = integer;
+  
 { ---------------------------------------------------------------------
     'h2pas -S -c -D -l libc -i' from sys/types.h
   ---------------------------------------------------------------------}
@@ -210,5 +211,13 @@ Type
   P__timer_t = ^__timer_t;
 
 
-{ fd_set for select and pselect.  }
+{ Macros }
+Function __FDELT(d: longint): Integer;
+Function __FDMASK(d: longint): __fd_mask;
+ 
+{ Borland compatibility }
+Type
 
+  TFsID = __fsid_t;
+  PFsID = ^TFsID;
+