At 10:33 26/01/01 -0800, Matt Dillon wrote:
> I think it is worth doing. A quick google search shows that
> the linux folks discussed the AIX thingy in March 1999, but
> I don't think they actually implemented. From the discussion,
> it appears that the fcntl would be useful and (not having seen
> your patches), almost certainly trivial to implement.
you're right. (I can resend it as a tar file...)
*** kern_descrip.c Fri Jan 26 19:42:18 2001
--- kern_descrip.c.new Fri Jan 26 20:24:07 2001
***************
*** 364,369 ****
--- 364,387 ----
(caddr_t)(intptr_t)uap->arg, sizeof(fl));
}
return(error);
+
+ /* close all descriptors starting from a given value */
+ case F_CLOSEM:
+ {
+ i = uap->fd;
+
+ p->p_retval[0] = 0;
+ if ((unsigned)i >= fdp->fd_nfiles) {
+ return (EBADF);
+ }
+ for (; i<=fdp->fd_lastfile; i++) {
+ struct close_args uap; /* XXX. requires _SYS_SYSPROTO_H_ */
+ uap.fd = i;
+ close(p, &uap);
+ }
+ return 0;
+ }
+
default:
return (EINVAL);
}
The F_CLOSEM is added to <sys/fcntl.h>
fcntl.diff
*** fcntl.h Fri Jan 26 20:24:45 2001
--- fcntl.h.new Fri Jan 26 20:25:39 2001
***************
*** 156,161 ****
--- 156,162 ----
#define F_GETLK 7 /* get record locking
information */
#define F_SETLK 8 /* set record locking
information */
#define F_SETLKW 9 /* F_SETLK; wait if blocked */
+ #define F_CLOSEM 10 /* close open fd's larger >= arg
*/
/* file descriptor flags (F_GETFD, F_SETFD) */
#define FD_CLOEXEC 1 /* close-on-exec flag */
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message