Use the --wrap symbol linker option to wrap poll and select

RESOLVED WONTFIX

Status

P3
normal
RESOLVED WONTFIX
19 years ago
16 years ago

People

(Reporter: wtc, Assigned: wtc)

Tracking

Future
All
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

19 years ago
In classic NSPR (user-level threads only), we need to wrap
the select() and poll() functions.  To do this our wrapper
functions must have a way to invoke the real (original) select()
or poll() function.  Usually there is an internal symbol such
as _select that we can use.  However, on Linux there is no
internal symbol for poll() that is universally available.
Moreover, it is not a good idea to use these _xxx internal
symbols.

Mike Shaver pointed out that the GNU linker has a --wrap symbol
option for wrapping symbols:
       --wrap symbol
              Use  a  wrapper function for symbol.  Any undefined
              reference to symbol will be resolved to __wrap_sym-
              bol.  Any undefined reference to __real_symbol will
              be resolved to symbol.

We can use the --wrap symbol linker option to wrap poll() and select().
However, this means any program or library using classic NSPR will
need to be linked with --wrap poll --wrap select.  I am not sure
if that is possible.  For example, if a library (.so) that comes with the
Linux OS calls poll() or select(), we will need to relink that library
with --wrap poll --wrap select.
(Assignee)

Comment 1

19 years ago
Created attachment 3141 [details] [diff] [review]
A patch for mozilla/nsprpub to use --wrap symbol.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED

Comment 2

19 years ago
http://www.lh.com/~oleg/ftp/syscall-interpose.html
has some examples of doing this for open, with GNU ld, and with HP-UX and
Solaris ld's.

Updated

19 years ago
Keywords: patch
(Assignee)

Updated

19 years ago
Target Milestone: --- → Future
This bug, and it's patch, seems to have fallen through the cracks, because it's 
not assigned to the default module owner. Reassigning.

Please note - this bug has a patch attached, so should be evaluated ASAP.

Gerv
Assignee: wtc → larryh
Status: ASSIGNED → NEW
QA Contact: srinivas → larryh

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 4

17 years ago
Reassigned the bug to me.

I probably will not bother to fix this as pthreads
are preferred over NSPR user-level threads.
Assignee: larryh → wtc
Status: ASSIGNED → NEW

Comment 5

16 years ago
*** Bug 124175 has been marked as a duplicate of this bug. ***

Comment 6

16 years ago
Please don't let this "fall through the cracks" again,
now that 124175 has been united with it.
It is most awkward when using "Paste as quotation" to have big
paragraphs disappear miles to the right!
(Assignee)

Comment 7

16 years ago
Bug 124175 was incorrectly marked as a duplicate of this
bug.

Marked the bug WONTFIX for the reason stated in comment 4.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.