SPUG: h2xs and the easy life

Parr, Ryan Ryan.Parr at wwireless.com
Wed Mar 13 21:58:47 CST 2002


I'm trying to use h2xs for the first time on an HP-UX machine. I'm trying to
convert <sys/mount.h> into a perl mod. How nice would it be if I didn't have
to write that module, and better yet didn't have to shell out! At least,
that was the train of thought that got me here.

Command run:
h2xs -n FileSystem::Mount /usr/include/sys/mount.h

Everything is created, make runs just fine, make install no probs. I can't
use it though. When I load it (it loads fine) and call
mount('/dev/vg00/lvtest1','/test1') function I get:

Argument "/dev/vg00/lvtest1" isn't numeric in subroutine entry at
/opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/FileSystem/Mount.pm line 133,
<STDIN> line 2.
Can't locate auto/FileSystem/Mount/mount.al in @INC (@INC contains:
/opt/perl5/lib/5.6.1/PA-RISC1.1 /opt/perl5/lib/5.6.1
/opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1 /opt/perl5/lib/site_perl/5.6.1
/opt/perl5/lib/site_perl .) at ./mount_test.pl line 12

Obviously not what I'm looking for. Argument 1 to the mount() function isn't
supposed to be numeric:


>From mount(2) --
 SYNOPSIS
      #include <sys/mount.h>

      int mount(const char *fs, const char *path, int mflag);

      int mount(const char *fs,
                const char *path,
                      int   mflag,
                const char *fstype,
                const char *dataptr,
                      int   datalen);


New to XS, no real C background. Anyone see any blaring mistakes?

-- Ryan Parr


"Those who make peaceful revolution impossible will make violent revolution
inevitable." -- John F. Kennedy 



-----Original Message-----
From: Benjamin Franks [mailto:benjamin at dzhan.com] 
Sent: Tuesday, March 12, 2002 10:47 AM
To: spug-list at pm.org
Subject: SPUG: sysv shared memory and forking


Let's say I have a parent process that creates and attaches a pointer to a
shared memory segment and then forks off a number of children.  I understand
the children will inherit the parent's address space (copy on write and all
that) and thus the pointer attached to the shared memory segment.  However,
do they inherit the entire memory segment as well?  Or is the sysv memory
segment created outside the parent processes address space to begin with?

Thanks,
--Ben




 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list