removed getcallerpc dependency, we have no threads, thus no locking needed - 9base - revived minimalist port of Plan 9 userland to Unix
 (HTM) git clone git://git.suckless.org/9base
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit bebc443496e27d1eebfdbabc7bed4257b23dbcea
 (DIR) parent a106699167c3750d8d61f5200b923b62de6906c9
 (HTM) Author: Anselm R. Garbe <garbeam@wmii.de>
       Date:   Mon, 23 Jan 2006 17:36:21 +0200
       
       removed getcallerpc dependency, we have no threads, thus no locking needed
       
       Diffstat:
         M lib9/Makefile                       |      11 ++++++-----
         M lib9/libc.h                         |       2 +-
         M lib9/qlock.c                        |      34 +++++++++++++++++++++++++++++++
       
       3 files changed, 41 insertions(+), 6 deletions(-)
       ---
 (DIR) diff --git a/lib9/Makefile b/lib9/Makefile
       @@ -19,6 +19,12 @@ TARG=lib9
        # following objects are not compiled for several reasons
        #        crypt.o
        #        netcrypt.o
       +#        getcallerpc-$(OBJTYPE).o
       +#        convD2M.o
       +#        convM2D.o
       +#        convM2S.o
       +#        convS2M.o
       +
        OFILES=\
                fmt/dofmt.o\
                fmt/fltfmt.o\
       @@ -112,10 +118,6 @@ OFILES=\
                cistrncmp.o\
                cistrstr.o\
                cleanname.o\
       -        convD2M.o\
       -        convM2D.o\
       -        convM2S.o\
       -        convS2M.o\
                create.o\
                ctime.o\
                date.o\
       @@ -133,7 +135,6 @@ OFILES=\
                execl.o\
                fcallfmt.o\
                get9root.o\
       -        getcallerpc-$(OBJTYPE).o\
                getenv.o\
                getfields.o\
                getnetconn.o\
 (DIR) diff --git a/lib9/libc.h b/lib9/libc.h
       @@ -375,7 +375,7 @@ extern        int        encodefmt(Fmt*);
        extern        int        dirmodefmt(Fmt*);
        extern        void        exits(char*);
        extern        double        frexp(double, int*);
       -extern        ulong        getcallerpc(void*);
       +/*extern        ulong        getcallerpc(void*);*/
        extern        char*        p9getenv(char*);
        extern        int        p9putenv(char*, char*);
        extern        int        getfields(char*, char**, int, int, char*);
 (DIR) diff --git a/lib9/qlock.c b/lib9/qlock.c
       @@ -21,15 +21,18 @@ void        (*_wunlock)(RWLock*, ulong);
        void
        lock(Lock *l)
        {
       +        /*
                if(_lock)
                        (*_lock)(l, 1, getcallerpc(&l));
                else
                        l->held = 1;
       +                */
        }
        
        int
        canlock(Lock *l)
        {
       +        /*
                if(_lock)
                        return (*_lock)(l, 0, getcallerpc(&l));
                else{
       @@ -38,29 +41,36 @@ canlock(Lock *l)
                        l->held = 1;
                        return 1;
                }
       +        */
       +        return 1;
        }
        
        void
        unlock(Lock *l)
        {
       +        /*
                if(_unlock)
                        (*_unlock)(l, getcallerpc(&l));
                else
                        l->held = 0;
       +                */
        }
        
        void
        qlock(QLock *l)
        {
       +        /*
                if(_qlock)
                        (*_qlock)(l, 1, getcallerpc(&l));
                else
                        l->l.held = 1;
       +                */
        }
        
        int
        canqlock(QLock *l)
        {
       +        /*
                if(_qlock)
                        return (*_qlock)(l, 0, getcallerpc(&l));
                else{
       @@ -69,29 +79,36 @@ canqlock(QLock *l)
                        l->l.held = 1;
                        return 1;
                }
       +        */
       +        return 1;
        }
        
        void
        qunlock(QLock *l)
        {
       +        /*
                if(_qunlock)
                        (*_qunlock)(l, getcallerpc(&l));
                else
                        l->l.held = 0;
       +                */
        }
        
        void
        rlock(RWLock *l)
        {
       +        /*
                if(_rlock)
                        (*_rlock)(l, 1, getcallerpc(&l));
                else
                        l->readers++;
       +                */
        }
        
        int
        canrlock(RWLock *l)
        {
       +        /*
                if(_rlock)
                        return (*_rlock)(l, 0, getcallerpc(&l));
                else{
       @@ -100,29 +117,36 @@ canrlock(RWLock *l)
                        l->readers++;
                        return 1;
                }
       +        */
       +        return 1;
        }
        
        void
        runlock(RWLock *l)
        {
       +        /*
                if(_runlock)
                        (*_runlock)(l, getcallerpc(&l));
                else
                        l->readers--;
       +                */
        }
        
        void
        wlock(RWLock *l)
        {
       +        /*
                if(_wlock)
                        (*_wlock)(l, 1, getcallerpc(&l));
                else
                        l->writer = (void*)1;
       +                */
        }
        
        int
        canwlock(RWLock *l)
        {
       +        /*
                if(_wlock)
                        return (*_wlock)(l, 0, getcallerpc(&l));
                else{
       @@ -131,36 +155,46 @@ canwlock(RWLock *l)
                        l->writer = (void*)1;
                        return 1;
                }
       +        */
       +        return 1;
        }
        
        void
        wunlock(RWLock *l)
        {
       +        /*
                if(_wunlock)
                        (*_wunlock)(l, getcallerpc(&l));
                else
                        l->writer = nil;
       +                */
        }
        
        void
        rsleep(Rendez *r)
        {
       +        /*
                if(_rsleep)
                        (*_rsleep)(r, getcallerpc(&r));
       +                */
        }
        
        int
        rwakeup(Rendez *r)
        {
       +        /*
                if(_rwakeup)
                        return (*_rwakeup)(r, 0, getcallerpc(&r));
       +                */
                return 0;
        }
        
        int
        rwakeupall(Rendez *r)
        {
       +        /*
                if(_rwakeup)
                        return (*_rwakeup)(r, 1, getcallerpc(&r));
       +                */
                return 0;
        }