[#7955] Failing tests in ruby since 1.8.2 — "Caleb Tennis" <caleb@...>
The following tests have been failing in Ruby for a long time, including
[#7978] Patch for Unix socket peer credentials — "James F. Hranicky" <jfh@...>
This patch adds support for getting the uid and gid of the peer
In article <200606091528.30171.jfh@cise.ufl.edu>,
On Friday 16 June 2006 11:51, Tanaka Akira wrote:
In article <200606161327.35948.jfh@cise.ufl.edu>,
On Saturday 17 June 2006 06:27, Tanaka Akira wrote:
In article <200607101352.16804.jfh@cise.ufl.edu>,
On Tuesday 11 July 2006 00:10, Tanaka Akira wrote:
Hi,
On Thursday 13 July 2006 22:48, nobu@ruby-lang.org wrote:
On Jul 18, 2006, at 12:27 PM, James F. Hranicky wrote:
On Tuesday 18 July 2006 15:52, Eric Hodel wrote:
[#7994] Ruby Kaigi date confusion — "Charles O Nutter" <headius@...>
I'm quite confused by the dates I have seen reported on various Ruby Kaigi
[#8013] Download page on ruby-lang has numeric URL — Hugh Sasse <hgs@...>
This is off-topic to ruby-core, but possibly core to ruby's uptake:
On Jun 19, 2006, at 3:32 AM, Hugh Sasse wrote:
[#8038] bug in $. ? — Wybo Dekker <wybo@...>
wybo>cat t
Wybo Dekker schrieb:
Pit Capitain wrote:
[#8050] Thank-you to the Rails Core Team — Dave Teare <devlists-ruby-core@...>
While we were listening to Dave Thomas' Keynote address today at
[#8061] Win32 Extension Issues Wanted! — "Austin Ziegler" <halostatue@...>
Everyone. I had a conversation with folks from Microsoft today about
[#8065] Core documentation patches — Alex Young <alex@...>
Hi there,
Hi,
Yukihiro Matsumoto wrote:
[#8073] 1.8.5p1 build failure on Solaris 10 — "Daniel Berger" <Daniel.Berger@...>
Solaris 10
Hi,
Yukihiro Matsumoto wrote:
>>>>> "D" == Daniel Berger <Daniel.Berger@qwest.com> writes:
ts <decoux@moulon.inra.fr> wrote on 28.06.2006 17:37:00:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:02:11:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:53:20:
ville.mattila@stonesoft.com wrote:
[#8087] optparse.rb to RDoc documentation patch — <noreply@...>
Patches item #4879, was opened at 2006-06-28 20:50
On Jun 28, 2006, at 11:50 AM, <noreply@rubyforge.org>
[#8102] Reorganizing configure.in by platform? — "Daniel Berger" <Daniel.Berger@...>
Hi,
[PATCH] File.mkfifo File.mknod
hi list, i've seen an old patch on ruby-talk (http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/91735) who add support for mkfifo() and mknod() in ruby. It doesn't seems to have been included in ruby. Here is a updated version of this patch against the latest CVS. regards
Attachments (1)
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.301
diff -u -r1.301 configure.in
--- configure.in 9 Jun 2006 21:20:13 -0000 1.301
+++ configure.in 21 Jun 2006 12:54:40 -0000
@@ -510,7 +510,7 @@
getpriority getrlimit setrlimit\
dlopen sigprocmask sigaction _setjmp vsnprintf snprintf\
setsid telldir seekdir fchmod mktime timegm cosh sinh tanh log2\
- setuid setgid daemon select_large_fdset setenv unsetenv)
+ setuid setgid daemon select_large_fdset setenv unsetenv mkfifo mknod)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
[use_setreuid=$enableval])
Index: file.c
===================================================================
RCS file: /src/ruby/file.c,v
retrieving revision 1.240
diff -u -r1.240 file.c
--- file.c 20 Jun 2006 18:02:16 -0000 1.240
+++ file.c 21 Jun 2006 12:54:42 -0000
@@ -3368,6 +3368,103 @@
return Qnil; /* not reached */
}
+/*
+ * call-seq:
+ * File.mknod(file_name, [type, [mode, [dev]]]) => 0
+ *
+ * Create a filesystem node (file, device special file or named pipe)
+ * named _file_name_, specified by _mode_ and _dev_.
+ *
+ * _type_ and _mode_ specifies the type and the permissions of node to
+ * be created respectively.
+ *
+ * The permissions are modified by the process's umask in the usual
+ * way: the permissions of the created node are (mode & ~umask).
+ *
+ * _type_ should be one of +?f+, +?c+, +?b+ and +?p+ to specify a
+ * normal file (which will be created empty), character special file,
+ * block special file or FIFO (named pipe), respectively, or +nil+,
+ * which will create a normal file.
+ */
+
+static VALUE
+rb_file_s_mknod(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+#ifdef HAVE_MKNOD
+ VALUE path, type, vmode, vdev;
+ int mode = 0666, dev = 0, t;
+
+ rb_secure(4);
+ switch (rb_scan_args(argc, argv, "13", &path, &type, &vmode, &vdev)) {
+ case 4:
+ dev = NUM2INT(vdev);
+ case 3:
+ mode = NUM2INT(vmode) & ~S_IFMT;
+ }
+ SafeStringValue(path);
+ if (!NIL_P(type)) {
+ rb_check_safe_obj(type);
+ switch (t = NUM2CHR(type)) {
+ case 'f': mode |= S_IFREG; break;
+ case 'c': mode |= S_IFCHR; break;
+#ifdef S_IFBLK
+ case 'b': mode |= S_IFBLK; break;
+#endif
+#ifdef S_IFIFO
+ case 'p': mode |= S_IFIFO; break;
+#endif
+ default:
+ rb_raise(rb_eArgError, "unknown node type - %c", t);
+ }
+ }
+ if (mknod(RSTRING(path)->ptr, mode, dev)) {
+ rb_sys_fail(0);
+ }
+#else
+ rb_notimplement();
+#endif
+ return INT2FIX(0);
+}
+
+/*
+ * call-seq:
+ * File.mkfifo(file_name, mode) => 0
+ *
+ * Creates a FIFO special file with name _file_name_. _mode_
+ * specifies the FIFO's permissions. It is modified by the process's
+ * umask in the usual way: the permissions of the created file are
+ * (mode & ~umask).
+ */
+
+static VALUE
+rb_file_s_mkfifo(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+#if !defined HAVE_MKFIFO && defined HAVE_MKNOD && defined S_IFIFO
+#define mkfifo(path, mode) mknod(path, (mode)&~S_IFMT|S_IFIFO, 0)
+#define HAVE_MKFIFO
+#endif
+#ifdef HAVE_MKFIFO
+ VALUE path, vmode;
+ int mode = 0666;
+
+ rb_secure(4);
+ if (rb_scan_args(argc, argv, "11", &path, &vmode) > 1) {
+ mode = NUM2INT(vmode);
+ }
+ SafeStringValue(path);
+ if (mkfifo(RSTRING(path)->ptr, mode)) {
+ rb_sys_fail(0);
+ }
+#else
+ rb_notimplement();
+#endif
+ return INT2FIX(0);
+}
+
/*
@@ -4341,6 +4438,8 @@
rb_define_singleton_method(rb_cFile, "rename", rb_file_s_rename, 2);
rb_define_singleton_method(rb_cFile, "umask", rb_file_s_umask, -1);
rb_define_singleton_method(rb_cFile, "truncate", rb_file_s_truncate, 2);
+ rb_define_singleton_method(rb_cFile, "mknod", rb_file_s_mknod, -1);
+ rb_define_singleton_method(rb_cFile, "mkfifo", rb_file_s_mkfifo, -1);
rb_define_singleton_method(rb_cFile, "expand_path", rb_file_s_expand_path, -1);
rb_define_singleton_method(rb_cFile, "basename", rb_file_s_basename, -1);
rb_define_singleton_method(rb_cFile, "dirname", rb_file_s_dirname, 1);