Bug 14642 - pfiles.stp doesn't compile anymore because of missing FD_ISSET
Summary: pfiles.stp doesn't compile anymore because of missing FD_ISSET
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 11:56 UTC by Mark Wielaard
Modified: 2012-09-29 08:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2012-09-28 11:56:51 UTC
pfiles.stp doesn't compile anymore with my current kernel 3.5.4-1.fc17.x86_64
It is complaining:

error: implicit declaration of function ‘FD_ISSET’ [-Werror=implicit-function-declaration]

I think this has something to do with this bug report:
"__NFDBITS conflict between sys/select.h and linux/posix_types.h"
https://bugzilla.redhat.com/show_bug.cgi?id=837641

But this is for a kernel space script, and that report is for user land code.

What should pfiles.stp include to get the correct FD_* definitions?
Comment 1 Josh Stone 2012-09-28 17:51:29 UTC
(In reply to comment #0)
> pfiles.stp doesn't compile anymore with my current kernel 3.5.4-1.fc17.x86_64
> It is complaining:
> 
> error: implicit declaration of function ‘FD_ISSET’
> [-Werror=implicit-function-declaration]
> 
> I think this has something to do with this bug report:
> "__NFDBITS conflict between sys/select.h and linux/posix_types.h"
> https://bugzilla.redhat.com/show_bug.cgi?id=837641
> 
> But this is for a kernel space script, and that report is for user land code.

It's true, that commit 8ded2bbc removed the FD_ISSET macro from the kernel.  Even before that though, it was simply a wrapper for __FD_ISSET, which was removed earlier in commit cf420048.

> What should pfiles.stp include to get the correct FD_* definitions?

The previous __FD_ISSET was very simple:

static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__fdsetp)
{
       return test_bit(__fd, __fdsetp->fds_bits);
}

It should be fine for pfiles.stp to use test_bit the same way.
Comment 2 Mark Wielaard 2012-09-29 08:58:14 UTC
commit 95b4f5c10dd5bdf63a32b62d1e8fd08f9cf80a2e
Author: Mark Wielaard <mjw@redhat.com>
Date:   Sat Sep 29 10:24:38 2012 +0200

    PR14642 pfiles.stp: Use test_bit directly instead of FD_ISSET.
    
    FD_ISSET might not be defined on all kernels.

Tested against 3.5.4-1.fc17.x86_64 and 2.6.18-308.1.1.el5 (i686).