Closed Bug 20420 Opened 25 years ago Closed 21 years ago

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

Categories

(NSPR :: NSPR, defect, P3)

All
Linux
defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

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.
Status: NEW → ASSIGNED
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.
Keywords: patch
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
Status: NEW → ASSIGNED
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
*** Bug 124175 has been marked as a duplicate of this bug. ***
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!
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
Closed: 21 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: