[comp.lang.perl] Named pipes

fuchs@it.uka.de (Harald Fuchs) (12/12/90)

tchrist@convex.COM (Tom Christiansen) writes:
>For unrelated processes, you're going to have to use named pipes
>or sockets.
Named pipes? Hmm... how about adding the mknod system call to perl?
--

Harald Fuchs <fuchs@it.uka.de> <fuchs%it.uka.de@relay.cs.net> ...
<fuchs@telematik.informatik.uni-karlsruhe.dbp.de>   *gulp*

tchrist@convex.COM (Tom Christiansen) (12/13/90)

In article <fuchs.660976625@t500m0> fuchs@it.uka.de (Harald Fuchs) 
quotes me:
:>For unrelated processes, you're going to have to use named pipes
:>or sockets.
:Named pipes? Hmm... how about adding the mknod system call to perl?

Is there some reason why you can't use system("/etc/mknod ...")?
I recall that Larry doesn't like to add things that will only
be called once; it doesn't buy much time, and it really isn't
a bad thing to use other UNIX tools from within Perl.

"Ah," you say, "but I want to rewrite MAKEDEV in perl."  Ok, then use
syscall and SYS_mknod instead then.  It doesn't seem too hard to me.

    $SYS_mknod = 14;    # should really have gotten from the "right" place
    $S_FIFO = 010000;   # ditto

    syscall($SYS_mknod, "rendezvous", $S_FIFO|0666, 0)

--tom
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
"With a kernel dive, all things are possible, but it sure makes it hard
 to look at yourself in the mirror the next morning."  -me

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (12/14/90)

As quoted from <110864@convex.convex.com> by tchrist@convex.COM (Tom Christiansen):
+---------------
| In article <fuchs.660976625@t500m0> fuchs@it.uka.de (Harald Fuchs) 
| quotes me:
| :>For unrelated processes, you're going to have to use named pipes
| :>or sockets.
| :Named pipes? Hmm... how about adding the mknod system call to perl?
| 
| Is there some reason why you can't use system("/etc/mknod ...")?
+---------------

You've done it again, Tom.

System V Release 2 and earlier had a stupid /etc/mknod that assumed that only
root was permitted to run it, even though non-root is allowed to make FIFOs.
(SVR2 and earlier:  A/UX, AIX, 3B1 UNIX, etc.)  It did *not* let mknod() fail;
it did *not* have root-only modes; it complained if geteuid() was not 0.  Sigh.

+---------------
| "Ah," you say, "but I want to rewrite MAKEDEV in perl."  Ok, then use
| syscall and SYS_mknod instead then.  It doesn't seem too hard to me.
+---------------

Again --- show me syscall() for System V.

The original message was concerned with portability.  BSD-specific responses
aren't portable....

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery@NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY