Build failures on Ubuntu - gettid related

Message ID 1155892549.2784.9.camel@localhost.localdomain
State New
Headers

Commit Message

Ville Skyttä Aug. 18, 2006, 9:15 a.m. UTC
  On Tue, 2006-08-15 at 14:52 +0200, Jens Auer wrote:

> The gettid function is not defined in any header, if it interpret the
> source correctly. The _syscall0-macro expands to a function definition
> pid_t gettid(void).

_syscallX are not available for userspace in recent kernel headers
(since April), this causes VDR compilation failures also with the
current Fedora Core 6 test versions.  More info:
http://tinyurl.com/qaydh , http://lkml.org/lkml/2006/6/4/128

The attached patch appears to work for me, and from a bit of Googling I
get the impression that it should probably work with all kernel header
sets since 2.4.20.
  

Comments

Chris Elsworth Aug. 20, 2006, 6:27 p.m. UTC | #1
On Fri, Aug 18, 2006 at 12:15:49PM +0300, Ville Skytt? wrote:
> On Tue, 2006-08-15 at 14:52 +0200, Jens Auer wrote:
> 
> _syscallX are not available for userspace in recent kernel headers
> (since April), this causes VDR compilation failures also with the
> current Fedora Core 6 test versions.  More info:
> http://tinyurl.com/qaydh , http://lkml.org/lkml/2006/6/4/128
> 
> The attached patch appears to work for me, and from a bit of Googling I
> get the impression that it should probably work with all kernel header
> sets since 2.4.20.

> --- thread.c~	2006-06-02 16:51:39.000000000 +0300
> +++ thread.c	2006-08-18 01:26:24.000000000 +0300
> @@ -318,7 +318,5 @@
>  
> -_syscall0(pid_t, gettid)
> -
>  tThreadId cThread::ThreadId(void)
>  {
> -  return gettid();
> +  return syscall(__NR_gettid);
>  }

This works for me on Ubuntu, and is pretty much what I'd tried except
I used 224 instead of __NR_gettid. Can this be merged into vdr, Klaus?
  
Klaus Schmidinger Aug. 20, 2006, 9:23 p.m. UTC | #2
Chris Elsworth wrote:
> On Fri, Aug 18, 2006 at 12:15:49PM +0300, Ville Skytt? wrote:
>> On Tue, 2006-08-15 at 14:52 +0200, Jens Auer wrote:
>>
>> _syscallX are not available for userspace in recent kernel headers
>> (since April), this causes VDR compilation failures also with the
>> current Fedora Core 6 test versions.  More info:
>> http://tinyurl.com/qaydh , http://lkml.org/lkml/2006/6/4/128
>>
>> The attached patch appears to work for me, and from a bit of Googling I
>> get the impression that it should probably work with all kernel header
>> sets since 2.4.20.
> 
>> --- thread.c~	2006-06-02 16:51:39.000000000 +0300
>> +++ thread.c	2006-08-18 01:26:24.000000000 +0300
>> @@ -318,7 +318,5 @@
>>  
>> -_syscall0(pid_t, gettid)
>> -
>>  tThreadId cThread::ThreadId(void)
>>  {
>> -  return gettid();
>> +  return syscall(__NR_gettid);
>>  }
> 
> This works for me on Ubuntu, and is pretty much what I'd tried except
> I used 224 instead of __NR_gettid. Can this be merged into vdr, Klaus?

It already is in maintenance patch 1.4.1-5.

Klaus
  

Patch

--- thread.c~	2006-06-02 16:51:39.000000000 +0300
+++ thread.c	2006-08-18 01:26:24.000000000 +0300
@@ -318,7 +318,5 @@ 
 
-_syscall0(pid_t, gettid)
-
 tThreadId cThread::ThreadId(void)
 {
-  return gettid();
+  return syscall(__NR_gettid);
 }