Re: close_range?

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
> Linux and FreeBSD have adopted a syscall close_range(min, max, flags)
> that, depending on flags, either closes, marks cloexec, or `unshares'
> every file descriptor d with min <= d <= max.

> [...] (I'll ignore `unshare' for now which does not really have
> first-class semantics in NetBSD anyway.) [...]

What _are_ its semantics?  Based on the name, my reaction would be to
expect that either (a) it's got something to do with threading and/or
Linuxish clone(CLONE_FILES), decoupling one thread/process's fd from
another's, or (b) something akin to dup but happening at the open file
table level instead of the file descriptor level.

I don't like the close_range() name, because it sometimes has nothing
to do with closing (the unshare option).  I also see no need for
burning another syscall number; I'd prefer to make those fcntl()
operations, either with more than three arguments or with the third arg
being a pointer to a struct.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.