I started to look into what it would take to implement a -h option to chmod(1), analagous to the -h option to chown(1). The problem got a lot harder than I thought it should be when I realized that Solaris doesn't have lchmod(2).
As I looked at the existing implementation of chmod (http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/syscall/chmod.c#61) it looked as though lchmod(2) should be as simple as copying chmod(2) and changing FOLLOW to NO_FOLLOW. Then adding the necessary bits to: uts/common/sys/syscall.h uts/common/os/sysent.c ... The part that discouraged me from that route was the fact that the last syscall number is 255. Surely that can't be coincidence. My questions: 1) Is there a reason that lchmod() doesn't already exist that is deeper than "no one has had time"? 2) Is there a limit of 255 system calls? 3) To implement this functionality, would it be more appropriate to extend the chmod system call to have another parameter (FOLLOW, NO_FOLLOW), and implement chmod and lchmod as macros pointing to the old chmod syscall number? I would expect that this would look something line the zone syscall (and several others) that have several different purposes to one syscall. 4) I see mentions of indirect system calls, but no good description of them. Is that where I should be focusing my attention? TIA, Mike -- Mike Gerdts http://mgerdts.blogspot.com/ _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
