[Linux-cluster] What can cause dlm_pthread_init to generate an errno 13?

Eric Johnson johnson.eric at gmail.com
Thu Nov 2 18:05:36 UTC 2006


It works as root.  I know that much.  I guess I thought it was
possible to hit the dlm as just a plain user.  No?

-Eric

On 11/2/06, Josef Whiter <jwhiter at redhat.com> wrote:
> Run it as root.
>
> Josef
>
> On Thu, Nov 02, 2006 at 12:51:34PM -0500, Eric Johnson wrote:
> > Hi -
> >
> > I must be very dumb.  I'm unable to do what I would consider to be the
> > "Hello World" of user mode dlm.
> >
> > [ejohnson at gfsa01:~/projects/dlm-simple] cat foo.cpp
> > #include <errno.h>
> > #include <stdio.h>
> > #include <sys/types.h>
> > #include <sys/stat.h>
> > #include <stdint.h>
> >
> > extern "C" {
> >  #include <libdlm.h>
> > }
> > #include <pthread.h>
> >
> > main(int argc, char **argv)
> > {
> >  printf("hello world\n");
> >  char lockName[] = "foobar" ;
> >
> >  int initStatus = dlm_pthread_init();
> >  printf("initStatus: %d, errno: %d\n",initStatus,errno);
> >
> >  int lockid =0 ;
> >  int status = lock_resource( lockName, LKM_EXMODE, 0, &lockid ) ;
> >  printf("status: %d, errno: %d\n",status,errno);
> > }
> > [ejohnson at gfsa01:~/projects/dlm-simple] touch foo.cpp
> >
> > [ejohnson at gfsa01:~/projects/dlm-simple] make
> > g++ -D_REENTRANT foo.cpp -o foo -ldlm -lpthread
> > ./foo/home/dev/util/linux64/bin/ld: skipping incompatible
> > /home/dev/util/linux64/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/libstdc++.a
> > when searching for -lstdc++
> >
> > [ejohnson at gfsa01:~/projects/dlm-simple] ./foo
> > hello world
> > initStatus: -1, errno: 13
> > status: -1, errno: 13
> >
> > I have googled around endlessly and been unable to find any insight as
> > to what it is that I'm missing.
> >
> > I'll gladly take a terse - "Hey knucklehead, go read this page in more
> > detail."
> >
> > -Eric
> >
> > --
> > Linux-cluster mailing list
> > Linux-cluster at redhat.com
> > https://www.redhat.com/mailman/listinfo/linux-cluster
>
> --
> Linux-cluster mailing list
> Linux-cluster at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-cluster
>




More information about the Linux-cluster mailing list