{$else}\r
result := invalue;\r
{$endif}\r
- end; \r
+ end; \r
+ {$define need_v6constants}\r
{$else}\r
\r
{$define sigprocmask := fpsigprocmask}\r
var\r
p : ppchar;\r
begin\r
- p := unixutil.StringToPPChar(Todo,1);\r
+ p := unixutil.StringToPPChar(Todo,0);\r
if (p=nil) or (p^=nil) then exit;\r
fpexecv(p^,p);\r
end;\r
end;\r
function GetSocketName(Sock: LongInt; var Addr;var Addrlen: LongInt):LongInt;\r
begin\r
- result := fpgetpeername(sock,@addr,@addrlen);\r
+ result := fpgetsockname(sock,@addr,@addrlen);\r
end;\r
function Accept(Sock: LongInt; var Addr; var Addrlen: LongInt):LongInt;\r
begin\r
const\r
IPPROTO_UDP=17;\r
IPPROTO_ICMP=1;\r
+ {$define need_v6constants}\r
{$endif}\r
{$ifdef ver1_9}\r
const\r
result := invalue;\r
{$endif}\r
end;\r
+ {$define need_v6constants}\r
{$endif}\r
procedure gettimeofday(var tv:ttimeval);inline;\r
begin\r
sys_eintr=esyseintr;\r
\r
{$endif}\r
+ {$ifdef need_v6constants}\r
+ {$ifdef linux} \r
+ //the below values are only known correct on linux, I don't support \r
+ //1.0.x on any other unix platform atm anyway --plugwash\r
+ const \r
+ IPPROTO_IPV6 = 41;\r
+ IPV6_V6ONLY = 26;\r
+ {$endif}\r
+ {$endif}\r
+ {$ifdef freebsd}\r
+ //freepascal doesn't seem to define IPV6_V6ONLY on freebsd, the definition\r
+ //here is taken from the include files of a freebsd 8 system\r
+ const\r
+ IPV6_V6ONLY = 27;\r
+ {$endif}\r
+\r
{$endif}\r
+\r
+ \r