d_memset=''
d_mkdir=''
d_mkfifo=''
+d_mknod=''
d_mktime=''
d_msg=''
d_msgctl=''
xlibpth=''
libs=''
lns=''
+devtype=''
lseektype=''
make_set_make=''
d_mymalloc=''
set mkfifo d_mkfifo
eval $inlibc
+: see if mknod exists
+set mknod d_mknod
+eval $inlibc
+
: see if mktime exists
set mktime d_mktime
eval $inlibc
*) groupstype="$gidtype";;
esac
+: see what type is used for devices
+rp="What is the type used for device numbers on this system?"
+set dev_t devtype long stdio.h sys/types.h
+eval $typedef_ask
+
: see what type lseek is declared as in the kernel
rp="What is the type used for lseek's offset on this system?"
set off_t lseektype long stdio.h sys/types.h
d_memset='$d_memset'
d_mkdir='$d_mkdir'
d_mkfifo='$d_mkfifo'
+d_mknod='$d_mknod'
d_mktime='$d_mktime'
d_msg='$d_msg'
d_msgctl='$d_msgctl'
db_hashtype='$db_hashtype'
db_prefixtype='$db_prefixtype'
defvoidused='$defvoidused'
+devtype='$devtype'
direntrytype='$direntrytype'
dlext='$dlext'
dlsrc='$dlsrc'
*/
#$d_mkfifo HAS_MKFIFO /**/
+/* HAS_MKNOD:
+ * This symbol, if defined, indicates that the mknod routine is
+ * available to create character and block special files. Otherwise,
+ * mknod should be able to do it for you. However, if mknod is there,
+ * mknod might require super-user privileges which mknod will not.
+ */
+#$d_mknod HAS_MKNOD /**/
+
/* HAS_MKTIME:
* This symbol, if defined, indicates that the mktime routine is
* available.
*/
#define Gid_t $gidtype /* Type for getgid(), etc... */
+/* Dev_t:
+ * This symbol holds the type used to declare device numbers.
+ * It can be int, long, dev_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Dev_t $devtype /* <device> type */
+
/* Off_t:
* This symbol holds the type used to declare offsets in the kernel.
* It can be int, long, off_t, etc... It may be necessary to include
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()],
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.
#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
# 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)
# 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
# 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
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
# undef HAS_STRERROR
#endif
-#ifndef HAS_MKFIFO
-# ifndef mkfifo
-# define mkfifo(path, mode) (mknod((path), (mode) | S_IFIFO, 0))
-# endif
-#endif /* !HAS_MKFIFO */
-
#include <errno.h>
#ifdef HAS_SOCKET
# ifdef I_NET_ERRNO