summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-06-23 03:01:02 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-06-23 05:57:58 +0000
commit6990d9917c06c8c6c480c9c385d7d2ed536c8d24 (patch)
treefe4033231f56c21fb89cf945475af81a2a074be2 /ext
parentc8950503db5121238084c28ced6940eeead0e14e (diff)
downloadperl-6990d9917c06c8c6c480c9c385d7d2ed536c8d24.tar.gz
applied patch, moved #define mkfifo ... from perl.h to POSIX.xs
Message-Id: <199806222101.AAA16456@alpha.hut.fi> Subject: [PATCH] _67: somebody said POSIX::mknod? p4raw-id: //depot/perl@1199
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.pm2
-rw-r--r--ext/POSIX/POSIX.pod6
-rw-r--r--ext/POSIX/POSIX.xs25
3 files changed, 30 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm
index 32010d62e0..b95249ce43 100644
--- a/ext/POSIX/POSIX.pm
+++ b/ext/POSIX/POSIX.pm
@@ -115,7 +115,7 @@ $VERSION = "1.02" ;
sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG
S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
- fstat mkfifo)],
+ fstat mkfifo mknod)],
sys_times_h => [qw()],
diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod
index 4726487b47..91ef781c12 100644
--- a/ext/POSIX/POSIX.pod
+++ b/ext/POSIX/POSIX.pod
@@ -660,6 +660,12 @@ This is similar to the C function C<mkfifo()>.
Returns C<undef> on failure.
+=item mknod
+
+This is similar to the C function C<mknod()>.
+
+Returns C<undef> on failure.
+
=item mktime
Convert date/time info to a calendar time.
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 41c6ba35de..568fbeee73 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -35,6 +35,7 @@
#ifdef I_STDDEF
#include <stddef.h>
#endif
+
/* XXX This comment is just to make I_TERMIO and I_SGTTY visible to
metaconfig for future extension writers. We don't use them in POSIX.
(This is really sneaky :-) --AD
@@ -62,8 +63,9 @@
# define pid_t int /* old versions of DECC miss this in types.h */
# endif
-# undef mkfifo /* #defined in perl.h */
+# undef mkfifo
# define mkfifo(a,b) (not_here("mkfifo"),-1)
+# define mknod(a,b,c) (not_here("mknod"),-1)
# define tzset() not_here("tzset")
#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000)
@@ -103,8 +105,9 @@
# define times(t) vms_times(t)
#else
#if defined (WIN32)
-# undef mkfifo /* #defined in perl.h */
+# undef mkfifo
# define mkfifo(a,b) not_here("mkfifo")
+# define mknod(a,b,c) not_here("mknod")
# define ttyname(a) (char*)not_here("ttyname")
# define sigset_t long
# define pid_t long
@@ -133,6 +136,13 @@
# define sigfillset(a) not_here("sigfillset")
# define sigismember(a,b) not_here("sigismember")
#else
+
+# ifndef HAS_MKFIFO
+# ifndef mkfifo
+# define mkfifo(path, mode) (mknod((path), (mode) | S_IFIFO, 0))
+# endif
+# endif /* !HAS_MKFIFO */
+
# include <grp.h>
# include <sys/times.h>
# ifdef HAS_UNAME
@@ -3473,6 +3483,17 @@ mkfifo(filename, mode)
RETVAL
SysRet
+mknod(filename, mode, device)
+ char * filename
+ Mode_t mode
+ Dev_t device
+ CODE:
+ TAINT_PROPER("mknod");
+ RETVAL = mknod(filename, mode, device);
+ OUTPUT:
+ RETVAL
+
+SysRet
tcdrain(fd)
int fd