From: "Brian F. Feldman" Date: 2000-11-13T04:51:41+09:00 Subject: [ruby-talk:6297] Re: lchown()/etc. and Unix syscall completeness matz@zetabits.com (Yukihiro Matsumoto) wrote: > Hi, > > In message "[ruby-talk:6288] lchown()/etc. and Unix syscall completeness" > on 00/11/12, "Brian F. Feldman" writes: > > |Ruby as it is now isn't very consistent with the system calls it provides. > > In fact, POSIX.1 is inconsistent. sigh. > > |Many system call wrappers are provided, indeed most of the ones that I need. > |For example, I need File.stat, and I also need File.lstat; they're both > |there. But other useful ones are missing. File.chmod and File.chown are > |there, but the l-prefixed syscalls like File.lchmod and File.lchown are > |missing. > > Because I'm not omniscient, of course, there should be the things like > this time to time. It tends to be slow to introduce non-POSIX system > calls, but I don't mean I say no to them. Even fchown is not among > POSIX.1. Anyway I ask you (and others) to provide enough information > for me to decide how should I (Ruby) handle each of these syscalls on > the platforms where they are not available. It is not to criticize you; rather, I would like to know where the limit is to be drawn about what should become supported. That is the hard part about it; how far away from support _just_ POSIX should we go? Or, for instance on Windows, even supporting just a small subset of POSIX. And then supporting the system-dependent calls, whether the default for a system which doesn't support them should be to return an error or leave them undefined. > And syscalls proposing are lchown and lchmod? In this case, that is what I'd like :) The reasoning for chown(2) following symbolic links is not clear to me, but it is the standard. The lchown(2) call seems to be widely prevalent as the way to get around this loss of functionality. It's a mess :) As far as the missing system calls other than those, I'd like Process.{group,gid}s (which I've added already), File.chflags, Process.setugid? (issetugid(2)), Process.killpg, File.mkfifo, File.lutime. There are other more esoteric ones, but these are pretty common. Ruby already supports most of the generally useful system calls. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------'