[2] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Bug Report

daemon@ATHENA.MIT.EDU (Tie Liao)
Fri Jun 9 10:57:01 1995

Date: Fri, 9 Jun 1995 15:58:22 +0200
From: Tie Liao <Tie.Liao@inria.fr>
To: pthreads@MIT.EDU
Reply-To: Tie.Liao@inria.fr

Hi,

I am trying to use your pthread package in a C++ software 
environment (multimedia project - MADE). I encountered some 
problems that I'd like to report to you. The following is 
my working environment:

    Platform: Sun Sparc
    OS: SunOS 4.1.3
    Compiler: GCC 2.5.8

The problems are:

  o in the file include/sys/stat.h, near the end,
    __BEGIN_DECLS and __END_DECLS need to be added
    for the function declarations. Without them, we may have
    compilation problem for C++ programs.

  o trouble with "extern inline" (in cdefs.h). try
      #include <stdio.h>
      main() { (void)getchar(); }

    save it in g.c and g.cc, and compile them with pgcc
    or pg++.

    The result is that it's OK for g.c. But for g.cc, the
    following error message is printed:
      ld: Undefined symbol 
         ___getc__FP7__sFILE 
      collect2: ld returned 2 exit status

    I replaced "extern inline" with "inline" in cdefs.h, 
    both are OK. I am not sure this is the correct way.

  o most syscalls are implemented by machine-dependent
    instruction set using a template. An exception should
    be the syscall "int pipe(fd[])". It is implemented
    not correctly.

    The difference is that the returned value of pipe syscall
    is to be filled in fd[]. I patched the code to make
    the pipe syscall work and put it in
      machdep/syscall-sparc-sunos-4.1.3.S

    It looks like

    /* ==========================================================================
     * machdep_sys_pipe()
     */
        .globl _machdep_sys_pipe

    _machdep_sys_pipe:
        mov  %o0, %o2
        mov  SYS_pipe, %g1
        ta  0
        bcs 1b
        nop
        st  %o0, [ %o2 ]
        st  %o1, [ %o2 + 4 ]
        retl 
        mov  %g0, %o0

The big inconveniency is the recomplation of related libraries.
We can't safely use the X lib (X11R5) without recompilation. 
For example, when I use X bitmaps in my test program, the 
program crashes due to access to a (FILE *) in XRdBitF.c
through a macro getc(FILE *fp).

Besides the above probelms, the package works correctly. I'll
continue to use it.

Tie Liao
____________________________________________________________
Tie Liao                          email : Tie.Liao@inria.fr          
INRIA, Domaine de Voluceau        phone : (33-1) 39 63 59 76
Rocquencourt - BP 105             fax   : (33-1) 39 63 51 14
78153 Le Chesnay Cedex, France

home help back first fref pref prev next nref lref last post